@webex/plugin-meetings 2.11.0 → 2.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/dist/meeting-info/meeting-info-v2.js +3 -1
- package/dist/meeting-info/meeting-info-v2.js.map +1 -1
- package/dist/members/index.js +24 -1
- package/dist/members/index.js.map +1 -1
- package/dist/members/request.js +11 -0
- package/dist/members/request.js.map +1 -1
- package/dist/members/util.js +22 -0
- package/dist/members/util.js.map +1 -1
- package/package.json +6 -6
- package/src/meeting-info/meeting-info-v2.js +3 -1
- package/src/members/index.js +21 -1
- package/src/members/request.js +10 -0
- package/src/members/util.js +21 -0
- package/test/unit/spec/meeting-info/meetinginfov2.js +21 -5
- package/test/unit/spec/members/index.js +112 -13
- package/test/unit/spec/members/request.js +70 -1
- package/test/unit/spec/members/utils.js +39 -0
package/README.md
CHANGED
|
@@ -1029,6 +1029,10 @@ meeting.members.muteMember(memberId)
|
|
|
1029
1029
|
// use a memberId string and a "raise" boolean to raise or lower, default to true ("raise the hand")
|
|
1030
1030
|
meeting.members.raiseOrLowerHand(memberId)
|
|
1031
1031
|
|
|
1032
|
+
// You can lower all hands in a meeting
|
|
1033
|
+
// use a memberId string to indicate who is requesting lowering all hands
|
|
1034
|
+
meeting.members.lowerAllHands(requestingMemberId)
|
|
1035
|
+
|
|
1032
1036
|
// You can transfer the host role to another member in the meeting, this is proxied by meeting.transfer
|
|
1033
1037
|
// use a memberId string and a moderator boolean to transfer or not, default to true
|
|
1034
1038
|
meeting.members.transferHostToMember(memberId)
|
|
@@ -363,8 +363,10 @@ var MeetingInfoV2 = /*#__PURE__*/function () {
|
|
|
363
363
|
case 14:
|
|
364
364
|
directURI = _context2.sent;
|
|
365
365
|
if (directURI) options.directURI = directURI;
|
|
366
|
-
return _context2.abrupt("return", this.webex.request(options).then(function () {
|
|
366
|
+
return _context2.abrupt("return", this.webex.request(options).then(function (response) {
|
|
367
367
|
_metrics.default.sendBehavioralMetric(_constants2.default.FETCH_MEETING_INFO_V1_SUCCESS);
|
|
368
|
+
|
|
369
|
+
return response;
|
|
368
370
|
}).catch(function (err) {
|
|
369
371
|
if ((err === null || err === void 0 ? void 0 : err.statusCode) === 403) {
|
|
370
372
|
var _err$body5, _err$body6, _err$body6$data;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["PASSWORD_ERROR_DEFAULT_MESSAGE","CAPTCHA_ERROR_DEFAULT_MESSAGE","ADHOC_MEETING_DEFAULT_ERROR","CAPTCHA_ERROR_REQUIRES_PASSWORD_CODES","MeetingInfoV2PasswordError","wbxAppApiErrorCode","meetingInfo","message","name","sdkMessage","stack","Error","wbxAppApiCode","MeetingInfoV2AdhocMeetingError","MeetingInfoV2CaptchaError","captchaInfo","isPasswordRequired","includes","MeetingInfoV2","webex","destination","type","MeetingInfoUtil","getDestinationType","conversationUrl","meetings","preferredWebexSite","getInvitees","particpants","invitees","forEach","participant","push","email","emailAddress","ciUserUuid","entryUUID","internal","conversation","get","url","includeParticipants","disableTransform","then","body","title","displayName","spaceUrl","keyUrl","encryptionKeyUrl","kroUrl","kmsResourceObjectUrl","participants","items","uri","Metrics","sendBehavioralMetric","BEHAVIORAL_METRICS","ADHOC_MEETING_SUCCESS","request","method","HTTP_VERBS","POST","catch","err","code","ADHOC_MEETING_FAILURE","reason","password","destinationType","_CONVERSATION_URL_","config","experimental","enableAdhocMeetings","createAdhocSpaceMeeting","getRequestBody","options","service","resource","getDirectMeetingInfoURI","directURI","FETCH_MEETING_INFO_V1_SUCCESS","statusCode","VERIFY_PASSWORD_ERROR","data","VERIFY_CAPTCHA_ERROR","captchaId","captchaID","verificationImageURL","verificationAudioURL","refreshURL","FETCH_MEETING_INFO_V1_FAILURE"],"sources":["meeting-info-v2.js"],"sourcesContent":["\nimport {HTTP_VERBS, _CONVERSATION_URL_} from '../constants';\nimport Metrics from '../metrics';\nimport BEHAVIORAL_METRICS from '../metrics/constants';\n\nimport MeetingInfoUtil from './utilv2';\n\nconst PASSWORD_ERROR_DEFAULT_MESSAGE = 'Password required. Call fetchMeetingInfo() with password argument';\nconst CAPTCHA_ERROR_DEFAULT_MESSAGE = 'Captcha required. Call fetchMeetingInfo() with captchaInfo argument';\nconst ADHOC_MEETING_DEFAULT_ERROR = 'Failed starting the adhoc meeting, Please contact support team ';\nconst CAPTCHA_ERROR_REQUIRES_PASSWORD_CODES = [423005, 423006];\n\n/**\n * Error to indicate that wbxappapi requires a password\n */\nexport class MeetingInfoV2PasswordError extends Error {\n /**\n *\n * @constructor\n * @param {Number} [wbxAppApiErrorCode]\n * @param {Object} [meetingInfo]\n * @param {String} [message]\n */\n constructor(wbxAppApiErrorCode, meetingInfo, message = PASSWORD_ERROR_DEFAULT_MESSAGE) {\n super(`${message}, code=${wbxAppApiErrorCode}`);\n this.name = 'MeetingInfoV2PasswordError';\n this.sdkMessage = message;\n this.stack = (new Error()).stack;\n this.wbxAppApiCode = wbxAppApiErrorCode;\n this.meetingInfo = meetingInfo;\n }\n}\n\n/**\n * Error generating a adhoc space meeting\n */\nexport class MeetingInfoV2AdhocMeetingError extends Error {\n /**\n *\n * @constructor\n * @param {Number} [wbxAppApiErrorCode]\n * @param {String} [message]\n */\n constructor(wbxAppApiErrorCode, message = ADHOC_MEETING_DEFAULT_ERROR) {\n super(`${message}, code=${wbxAppApiErrorCode}`);\n this.name = 'MeetingInfoV2AdhocMeetingError';\n this.sdkMessage = message;\n this.stack = (new Error()).stack;\n this.wbxAppApiCode = wbxAppApiErrorCode;\n }\n}\n\n\n/**\n * Error to indicate that preferred webex site not present to start adhoc meeting\n */\nexport class MeetingInfoV2CaptchaError extends Error {\n /**\n *\n * @constructor\n * @param {Number} [wbxAppApiErrorCode]\n * @param {Object} [captchaInfo]\n * @param {String} [message]\n */\n constructor(wbxAppApiErrorCode, captchaInfo, message = CAPTCHA_ERROR_DEFAULT_MESSAGE) {\n super(`${message}, code=${wbxAppApiErrorCode}`);\n this.name = 'MeetingInfoV2PasswordError';\n this.sdkMessage = message;\n this.stack = (new Error()).stack;\n this.wbxAppApiCode = wbxAppApiErrorCode;\n this.isPasswordRequired = CAPTCHA_ERROR_REQUIRES_PASSWORD_CODES.includes(wbxAppApiErrorCode);\n this.captchaInfo = captchaInfo;\n }\n}\n\n/**\n * @class MeetingInfo\n */\nexport default class MeetingInfoV2 {\n /**\n *\n * @param {WebexSDK} webex\n */\n constructor(webex) {\n this.webex = webex;\n }\n\n /**\n * converts hydra id into conversation url and persons Id\n * @param {String} destination one of many different types of destinations to look up info for\n * @param {String} [type] to match up with the destination value\n * @returns {Promise} destination and type\n * @public\n * @memberof MeetingInfo\n */\n fetchInfoOptions(destination, type = null) {\n return MeetingInfoUtil.getDestinationType({\n destination,\n type,\n webex: this.webex\n });\n }\n\n /**\n * Creates adhoc space meetings for a space by fetching the conversation infomation\n * @param {String} conversationUrl conversationUrl to start adhoc meeting on\n * @returns {Promise} returns a meeting info object\n * @public\n * @memberof MeetingInfo\n */\n async createAdhocSpaceMeeting(conversationUrl) {\n if (!this.webex.meetings.preferredWebexSite) {\n throw Error('No preferred webex site found');\n }\n const getInvitees = (particpants = []) => {\n const invitees = [];\n\n if (particpants) {\n particpants.forEach((participant) => {\n invitees.push({\n email: participant.emailAddress,\n ciUserUuid: participant.entryUUID\n });\n });\n }\n\n return invitees;\n };\n\n return this.webex.internal.conversation.get(\n {url: conversationUrl},\n {includeParticipants: true, disableTransform: true}\n )\n .then((conversation) => {\n const body = {\n title: conversation.displayName,\n spaceUrl: conversation.url,\n keyUrl: conversation.encryptionKeyUrl,\n kroUrl: conversation.kmsResourceObjectUrl,\n invitees: getInvitees(conversation.participants?.items)\n };\n\n const uri = this.webex.meetings.preferredWebexSite ?\n `https://${this.webex.meetings.preferredWebexSite}/wbxappapi/v2/meetings/spaceInstant` : '';\n\n Metrics.sendBehavioralMetric(\n BEHAVIORAL_METRICS.ADHOC_MEETING_SUCCESS\n );\n\n return this.webex.request({\n method: HTTP_VERBS.POST,\n uri,\n body\n })\n .catch((err) => {\n throw new MeetingInfoV2AdhocMeetingError(err.body?.code, err.body?.message);\n });\n })\n .catch((err) => {\n Metrics.sendBehavioralMetric(\n BEHAVIORAL_METRICS.ADHOC_MEETING_FAILURE,\n {\n reason: err.message,\n stack: err.stack\n }\n );\n throw new MeetingInfoV2AdhocMeetingError(err.body?.code, err.body?.message);\n });\n }\n\n /**\n * Fetches meeting info from the server\n * @param {String} destination one of many different types of destinations to look up info for\n * @param {String} [type] to match up with the destination value\n * @param {String} password\n * @param {Object} captchaInfo\n * @param {String} captchaInfo.code\n * @param {String} captchaInfo.id\n * @returns {Promise} returns a meeting info object\n * @public\n * @memberof MeetingInfo\n */\n async fetchMeetingInfo(destination, type = null, password = null, captchaInfo = null) {\n const destinationType = await MeetingInfoUtil.getDestinationType({\n destination,\n type,\n webex: this.webex\n });\n\n if (destinationType.type === _CONVERSATION_URL_ && this.webex.config.meetings.experimental.enableAdhocMeetings) {\n return this.createAdhocSpaceMeeting(destinationType.destination);\n }\n\n const body = await MeetingInfoUtil.getRequestBody({...destinationType, password, captchaInfo});\n\n const options = {\n method: HTTP_VERBS.POST,\n service: 'webex-appapi-service',\n resource: 'meetingInfo',\n body\n };\n\n const directURI = await MeetingInfoUtil.getDirectMeetingInfoURI(destinationType);\n\n if (directURI) options.directURI = directURI;\n\n return this.webex.request(options)\n .then(() => {\n Metrics.sendBehavioralMetric(\n BEHAVIORAL_METRICS.FETCH_MEETING_INFO_V1_SUCCESS\n );\n })\n .catch((err) => {\n if (err?.statusCode === 403) {\n Metrics.sendBehavioralMetric(\n BEHAVIORAL_METRICS.VERIFY_PASSWORD_ERROR,\n {\n reason: err.message,\n stack: err.stack\n }\n );\n\n throw new MeetingInfoV2PasswordError(err.body?.code, err.body?.data?.meetingInfo);\n }\n if (err?.statusCode === 423) {\n Metrics.sendBehavioralMetric(\n BEHAVIORAL_METRICS.VERIFY_CAPTCHA_ERROR,\n {\n reason: err.message,\n stack: err.stack\n }\n );\n\n throw new MeetingInfoV2CaptchaError(err.body?.code, {\n captchaId: err.body.captchaID,\n verificationImageURL: err.body.verificationImageURL,\n verificationAudioURL: err.body.verificationAudioURL,\n refreshURL: err.body.refreshURL\n });\n }\n\n Metrics.sendBehavioralMetric(\n BEHAVIORAL_METRICS.FETCH_MEETING_INFO_V1_FAILURE,\n {\n reason: err.message,\n stack: err.stack\n }\n );\n throw err;\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA;;AACA;;AACA;;AAEA;;;;;;;;;;AAEA,IAAMA,8BAA8B,GAAG,mEAAvC;AACA,IAAMC,6BAA6B,GAAG,qEAAtC;AACA,IAAMC,2BAA2B,GAAG,iEAApC;AACA,IAAMC,qCAAqC,GAAG,CAAC,MAAD,EAAS,MAAT,CAA9C;AAEA;AACA;AACA;;IACaC,0B;;;;;EACX;AACF;AACA;AACA;AACA;AACA;AACA;EACE,oCAAYC,kBAAZ,EAAgCC,WAAhC,EAAuF;IAAA;;IAAA,IAA1CC,OAA0C,uEAAhCP,8BAAgC;IAAA;IACrF,oCAASO,OAAT,oBAA0BF,kBAA1B;IACA,MAAKG,IAAL,GAAY,4BAAZ;IACA,MAAKC,UAAL,GAAkBF,OAAlB;IACA,MAAKG,KAAL,GAAc,IAAIC,KAAJ,EAAD,CAAcD,KAA3B;IACA,MAAKE,aAAL,GAAqBP,kBAArB;IACA,MAAKC,WAAL,GAAmBA,WAAnB;IANqF;EAOtF;;;+CAf6CK,K;AAkBhD;AACA;AACA;;;;;IACaE,8B;;;;;EACX;AACF;AACA;AACA;AACA;AACA;EACE,wCAAYR,kBAAZ,EAAuE;IAAA;;IAAA,IAAvCE,OAAuC,uEAA7BL,2BAA6B;IAAA;IACrE,sCAASK,OAAT,oBAA0BF,kBAA1B;IACA,OAAKG,IAAL,GAAY,gCAAZ;IACA,OAAKC,UAAL,GAAkBF,OAAlB;IACA,OAAKG,KAAL,GAAc,IAAIC,KAAJ,EAA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BADrB,EAEE;sBACElB,MAAM,EAAEH,GAAG,CAACzD,OADd;sBAEEG,KAAK,EAAEsD,GAAG,CAACtD;oBAFb,CAFF;;oBAQA,MAAM,IAAII,yBAAJ,eAA8BkD,GAAG,CAACpB,IAAlC,+CAA8B,WAAUqB,IAAxC,EAA8C;sBAClDqB,SAAS,EAAEtB,GAAG,CAACpB,IAAJ,CAAS2C,SAD8B;sBAElDC,oBAAoB,EAAExB,GAAG,CAACpB,IAAJ,CAAS4C,oBAFmB;sBAGlDC,oBAAoB,EAAEzB,GAAG,CAACpB,IAAJ,CAAS6C,oBAHmB;sBAIlDC,UAAU,EAAE1B,GAAG,CAACpB,IAAJ,CAAS8C;oBAJ6B,CAA9C,CAAN;kBAMD;;kBAEDnC,iBAAQC,oBAAR,CACEC,oBAAmBkC,6BADrB,EAEE;oBACExB,MAAM,EAAEH,GAAG,CAACzD,OADd;oBAEEG,KAAK,EAAEsD,GAAG,CAACtD;kBAFb,CAFF;;kBAOA,MAAMsD,GAAN;gBACD,CA3CI,CAxBT;;cAAA;cAAA;gBAAA;YAAA;UAAA;QAAA;MAAA,C"}
|
|
1
|
+
{"version":3,"names":["PASSWORD_ERROR_DEFAULT_MESSAGE","CAPTCHA_ERROR_DEFAULT_MESSAGE","ADHOC_MEETING_DEFAULT_ERROR","CAPTCHA_ERROR_REQUIRES_PASSWORD_CODES","MeetingInfoV2PasswordError","wbxAppApiErrorCode","meetingInfo","message","name","sdkMessage","stack","Error","wbxAppApiCode","MeetingInfoV2AdhocMeetingError","MeetingInfoV2CaptchaError","captchaInfo","isPasswordRequired","includes","MeetingInfoV2","webex","destination","type","MeetingInfoUtil","getDestinationType","conversationUrl","meetings","preferredWebexSite","getInvitees","particpants","invitees","forEach","participant","push","email","emailAddress","ciUserUuid","entryUUID","internal","conversation","get","url","includeParticipants","disableTransform","then","body","title","displayName","spaceUrl","keyUrl","encryptionKeyUrl","kroUrl","kmsResourceObjectUrl","participants","items","uri","Metrics","sendBehavioralMetric","BEHAVIORAL_METRICS","ADHOC_MEETING_SUCCESS","request","method","HTTP_VERBS","POST","catch","err","code","ADHOC_MEETING_FAILURE","reason","password","destinationType","_CONVERSATION_URL_","config","experimental","enableAdhocMeetings","createAdhocSpaceMeeting","getRequestBody","options","service","resource","getDirectMeetingInfoURI","directURI","response","FETCH_MEETING_INFO_V1_SUCCESS","statusCode","VERIFY_PASSWORD_ERROR","data","VERIFY_CAPTCHA_ERROR","captchaId","captchaID","verificationImageURL","verificationAudioURL","refreshURL","FETCH_MEETING_INFO_V1_FAILURE"],"sources":["meeting-info-v2.js"],"sourcesContent":["\nimport {HTTP_VERBS, _CONVERSATION_URL_} from '../constants';\nimport Metrics from '../metrics';\nimport BEHAVIORAL_METRICS from '../metrics/constants';\n\nimport MeetingInfoUtil from './utilv2';\n\nconst PASSWORD_ERROR_DEFAULT_MESSAGE = 'Password required. Call fetchMeetingInfo() with password argument';\nconst CAPTCHA_ERROR_DEFAULT_MESSAGE = 'Captcha required. Call fetchMeetingInfo() with captchaInfo argument';\nconst ADHOC_MEETING_DEFAULT_ERROR = 'Failed starting the adhoc meeting, Please contact support team ';\nconst CAPTCHA_ERROR_REQUIRES_PASSWORD_CODES = [423005, 423006];\n\n/**\n * Error to indicate that wbxappapi requires a password\n */\nexport class MeetingInfoV2PasswordError extends Error {\n /**\n *\n * @constructor\n * @param {Number} [wbxAppApiErrorCode]\n * @param {Object} [meetingInfo]\n * @param {String} [message]\n */\n constructor(wbxAppApiErrorCode, meetingInfo, message = PASSWORD_ERROR_DEFAULT_MESSAGE) {\n super(`${message}, code=${wbxAppApiErrorCode}`);\n this.name = 'MeetingInfoV2PasswordError';\n this.sdkMessage = message;\n this.stack = (new Error()).stack;\n this.wbxAppApiCode = wbxAppApiErrorCode;\n this.meetingInfo = meetingInfo;\n }\n}\n\n/**\n * Error generating a adhoc space meeting\n */\nexport class MeetingInfoV2AdhocMeetingError extends Error {\n /**\n *\n * @constructor\n * @param {Number} [wbxAppApiErrorCode]\n * @param {String} [message]\n */\n constructor(wbxAppApiErrorCode, message = ADHOC_MEETING_DEFAULT_ERROR) {\n super(`${message}, code=${wbxAppApiErrorCode}`);\n this.name = 'MeetingInfoV2AdhocMeetingError';\n this.sdkMessage = message;\n this.stack = (new Error()).stack;\n this.wbxAppApiCode = wbxAppApiErrorCode;\n }\n}\n\n\n/**\n * Error to indicate that preferred webex site not present to start adhoc meeting\n */\nexport class MeetingInfoV2CaptchaError extends Error {\n /**\n *\n * @constructor\n * @param {Number} [wbxAppApiErrorCode]\n * @param {Object} [captchaInfo]\n * @param {String} [message]\n */\n constructor(wbxAppApiErrorCode, captchaInfo, message = CAPTCHA_ERROR_DEFAULT_MESSAGE) {\n super(`${message}, code=${wbxAppApiErrorCode}`);\n this.name = 'MeetingInfoV2PasswordError';\n this.sdkMessage = message;\n this.stack = (new Error()).stack;\n this.wbxAppApiCode = wbxAppApiErrorCode;\n this.isPasswordRequired = CAPTCHA_ERROR_REQUIRES_PASSWORD_CODES.includes(wbxAppApiErrorCode);\n this.captchaInfo = captchaInfo;\n }\n}\n\n/**\n * @class MeetingInfo\n */\nexport default class MeetingInfoV2 {\n /**\n *\n * @param {WebexSDK} webex\n */\n constructor(webex) {\n this.webex = webex;\n }\n\n /**\n * converts hydra id into conversation url and persons Id\n * @param {String} destination one of many different types of destinations to look up info for\n * @param {String} [type] to match up with the destination value\n * @returns {Promise} destination and type\n * @public\n * @memberof MeetingInfo\n */\n fetchInfoOptions(destination, type = null) {\n return MeetingInfoUtil.getDestinationType({\n destination,\n type,\n webex: this.webex\n });\n }\n\n /**\n * Creates adhoc space meetings for a space by fetching the conversation infomation\n * @param {String} conversationUrl conversationUrl to start adhoc meeting on\n * @returns {Promise} returns a meeting info object\n * @public\n * @memberof MeetingInfo\n */\n async createAdhocSpaceMeeting(conversationUrl) {\n if (!this.webex.meetings.preferredWebexSite) {\n throw Error('No preferred webex site found');\n }\n const getInvitees = (particpants = []) => {\n const invitees = [];\n\n if (particpants) {\n particpants.forEach((participant) => {\n invitees.push({\n email: participant.emailAddress,\n ciUserUuid: participant.entryUUID\n });\n });\n }\n\n return invitees;\n };\n\n return this.webex.internal.conversation.get(\n {url: conversationUrl},\n {includeParticipants: true, disableTransform: true}\n )\n .then((conversation) => {\n const body = {\n title: conversation.displayName,\n spaceUrl: conversation.url,\n keyUrl: conversation.encryptionKeyUrl,\n kroUrl: conversation.kmsResourceObjectUrl,\n invitees: getInvitees(conversation.participants?.items)\n };\n\n const uri = this.webex.meetings.preferredWebexSite ?\n `https://${this.webex.meetings.preferredWebexSite}/wbxappapi/v2/meetings/spaceInstant` : '';\n\n Metrics.sendBehavioralMetric(\n BEHAVIORAL_METRICS.ADHOC_MEETING_SUCCESS\n );\n\n return this.webex.request({\n method: HTTP_VERBS.POST,\n uri,\n body\n })\n .catch((err) => {\n throw new MeetingInfoV2AdhocMeetingError(err.body?.code, err.body?.message);\n });\n })\n .catch((err) => {\n Metrics.sendBehavioralMetric(\n BEHAVIORAL_METRICS.ADHOC_MEETING_FAILURE,\n {\n reason: err.message,\n stack: err.stack\n }\n );\n throw new MeetingInfoV2AdhocMeetingError(err.body?.code, err.body?.message);\n });\n }\n\n /**\n * Fetches meeting info from the server\n * @param {String} destination one of many different types of destinations to look up info for\n * @param {String} [type] to match up with the destination value\n * @param {String} password\n * @param {Object} captchaInfo\n * @param {String} captchaInfo.code\n * @param {String} captchaInfo.id\n * @returns {Promise} returns a meeting info object\n * @public\n * @memberof MeetingInfo\n */\n async fetchMeetingInfo(destination, type = null, password = null, captchaInfo = null) {\n const destinationType = await MeetingInfoUtil.getDestinationType({\n destination,\n type,\n webex: this.webex\n });\n\n if (destinationType.type === _CONVERSATION_URL_ && this.webex.config.meetings.experimental.enableAdhocMeetings) {\n return this.createAdhocSpaceMeeting(destinationType.destination);\n }\n\n const body = await MeetingInfoUtil.getRequestBody({...destinationType, password, captchaInfo});\n\n const options = {\n method: HTTP_VERBS.POST,\n service: 'webex-appapi-service',\n resource: 'meetingInfo',\n body\n };\n\n const directURI = await MeetingInfoUtil.getDirectMeetingInfoURI(destinationType);\n\n if (directURI) options.directURI = directURI;\n\n return this.webex.request(options)\n .then((response) => {\n Metrics.sendBehavioralMetric(\n BEHAVIORAL_METRICS.FETCH_MEETING_INFO_V1_SUCCESS\n );\n\n return response;\n })\n .catch((err) => {\n if (err?.statusCode === 403) {\n Metrics.sendBehavioralMetric(\n BEHAVIORAL_METRICS.VERIFY_PASSWORD_ERROR,\n {\n reason: err.message,\n stack: err.stack\n }\n );\n\n throw new MeetingInfoV2PasswordError(err.body?.code, err.body?.data?.meetingInfo);\n }\n if (err?.statusCode === 423) {\n Metrics.sendBehavioralMetric(\n BEHAVIORAL_METRICS.VERIFY_CAPTCHA_ERROR,\n {\n reason: err.message,\n stack: err.stack\n }\n );\n\n throw new MeetingInfoV2CaptchaError(err.body?.code, {\n captchaId: err.body.captchaID,\n verificationImageURL: err.body.verificationImageURL,\n verificationAudioURL: err.body.verificationAudioURL,\n refreshURL: err.body.refreshURL\n });\n }\n\n Metrics.sendBehavioralMetric(\n BEHAVIORAL_METRICS.FETCH_MEETING_INFO_V1_FAILURE,\n {\n reason: err.message,\n stack: err.stack\n }\n );\n throw err;\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA;;AACA;;AACA;;AAEA;;;;;;;;;;AAEA,IAAMA,8BAA8B,GAAG,mEAAvC;AACA,IAAMC,6BAA6B,GAAG,qEAAtC;AACA,IAAMC,2BAA2B,GAAG,iEAApC;AACA,IAAMC,qCAAqC,GAAG,CAAC,MAAD,EAAS,MAAT,CAA9C;AAEA;AACA;AACA;;IACaC,0B;;;;;EACX;AACF;AACA;AACA;AACA;AACA;AACA;EACE,oCAAYC,kBAAZ,EAAgCC,WAAhC,EAAuF;IAAA;;IAAA,IAA1CC,OAA0C,uEAAhCP,8BAAgC;IAAA;IACrF,oCAASO,OAAT,oBAA0BF,kBAA1B;IACA,MAAKG,IAAL,GAAY,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ist/members/index.js
CHANGED
|
@@ -842,7 +842,30 @@ var Members = /*#__PURE__*/function (_StatelessWebexPlugin) {
|
|
|
842
842
|
|
|
843
843
|
var options = _util.default.generateRaiseHandMemberOptions(memberId, raise, this.locusUrl);
|
|
844
844
|
|
|
845
|
-
return this.membersRequest.
|
|
845
|
+
return this.membersRequest.raiseOrLowerHandMember(options);
|
|
846
|
+
}
|
|
847
|
+
/**
|
|
848
|
+
* Lower all hands of members in a meeting
|
|
849
|
+
* @param {String} requestingMemberId - id of the participant which requested the lower all hands
|
|
850
|
+
* @returns {Promise}
|
|
851
|
+
* @public
|
|
852
|
+
* @memberof Members
|
|
853
|
+
*/
|
|
854
|
+
|
|
855
|
+
}, {
|
|
856
|
+
key: "lowerAllHands",
|
|
857
|
+
value: function lowerAllHands(requestingMemberId) {
|
|
858
|
+
if (!this.locusUrl) {
|
|
859
|
+
return _promise.default.reject(new _parameter.default('The associated locus url for this meetings members object must be defined.'));
|
|
860
|
+
}
|
|
861
|
+
|
|
862
|
+
if (!requestingMemberId) {
|
|
863
|
+
return _promise.default.reject(new _parameter.default('The requestingMemberId must be defined to lower all hands in a meeting.'));
|
|
864
|
+
}
|
|
865
|
+
|
|
866
|
+
var options = _util.default.generateLowerAllHandsMemberOptions(requestingMemberId, this.locusUrl);
|
|
867
|
+
|
|
868
|
+
return this.membersRequest.lowerAllHandsMember(options);
|
|
846
869
|
}
|
|
847
870
|
/**
|
|
848
871
|
* Transfers the host to another member
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Members","attrs","options","MEETINGS","membersRequest","MembersRequest","membersCollection","MembersCollection","locusUrl","hostId","type","selfId","mediaShareContentId","mediaShareWhiteboardId","recordingId","payload","newSelfId","oldSelfId","newSelf","id","oldSelf","theSelf","get","setIsSelf","notSelf","Trigger","trigger","file","function","EVENT_TRIGGERS","MEMBERS_SELF_UPDATE","activeSelfId","endedSelfId","newHostId","oldHostId","newHost","oldHost","theHost","setIsHost","notHost","MEMBERS_HOST_UPDATE","activeHostId","endedHostId","delta","handleLocusInfoUpdatedParticipants","full","handleMembersUpdate","MEMBERS_UPDATE","currentContent","current","content","previousContent","previous","currentWhiteboard","whiteboard","previousWhiteboard","whoSharing","whoStopped","beneficiaryId","disposition","FLOOR_ACTION","GRANTED","RELEASED","shareMember","setIsContentSharing","stopMember","MEMBERS_CONTENT_UPDATE","activeSharingId","endedSharingId","setLocusUrl","setType","membersUpdate","updated","constructMembers","added","getAll","list","forEach","member","set","participants","LoggerProxy","logger","warn","memberUpdate","update","locus","url","ParameterError","owner","info","fullState","self","person","contentId","contentMediaShare","mediaShares","length","find","mediaShare","name","CONTENT","floor","beneficiary","whiteboardId","whiteboardMediaShare","WHITEBOARD","participant","hideInRoster","existing","push","Member","contentSharingId","whiteboardSharingId","invitee","alertIfActive","reject","MembersUtil","isInvalidInvitee","generateAddMemberOptions","addMembers","cancelPhoneInviteOptions","cancelPhoneInvite","memberIds","generateAdmitMemberOptions","admitMember","memberId","generateRemoveMemberOptions","removeMember","mute","generateMuteMemberOptions","muteMember","raise","generateRaiseHandMemberOptions","raiseLowerHandMember","moderator","generateTransferHostMemberOptions","transferHostToMember","tones","deviceArray","devices","device","deviceType","genderateSendDTMFOptions","sendDialPadKey","Error","StatelessWebexPlugin"],"sources":["index.js"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\nimport {isEmpty} from 'lodash';\nimport {StatelessWebexPlugin} from '@webex/webex-core';\n\nimport {MEETINGS, EVENT_TRIGGERS, FLOOR_ACTION, CONTENT, WHITEBOARD} from '../constants';\nimport Trigger from '../common/events/trigger-proxy';\nimport Member from '../member';\nimport LoggerProxy from '../common/logs/logger-proxy';\nimport ParameterError from '../common/errors/parameter';\n\nimport MembersCollection from './collection';\nimport MembersRequest from './request';\nimport MembersUtil from './util';\n\n/**\n * Members Update Event\n * Emitted when something in the roster list needs to be updated\n * @event members:update\n * @instance\n * @property {Object} delta the changes to the members list\n * @property {Array} delta.updated array only the updates, includes removals, as they will have updated status and member properties\n * @property {Array} delta.added array added members to the meeting\n * @property {Array} full array the full members collection\n * @memberof Members\n */\n\n/**\n * Members Content Update Event\n * Emitted when who is sharing changes\n * @event members:content:update\n * @instance\n * @property {String} activeContentSharingId\n * @property {String} endedContentSharingId\n * @memberof Members\n */\n\n/**\n * Members Host Update Event\n * Emitted when who is the host changes\n * @event members:host:update\n * @instance\n * @property {String} activeHostId\n * @property {String} endedHostId\n * @memberof Members\n */\n\n/**\n * Members Self Update Event\n * Emitted when who is the self changes\n * @event members:self:update\n * @instance\n * @property {String} activeSelfId\n * @property {String} endedSelfId\n * @memberof Members\n */\n\n/**\n * @class Members\n */\nexport default class Members extends StatelessWebexPlugin {\n namespace = MEETINGS;\n\n /**\n *\n * @param {Object} attrs\n * @param {Object} options\n * @memberof Members\n */\n constructor(attrs, options) {\n super({}, options);\n /**\n * The Members Request object to interact with server\n * @instance\n * @type {MembersRequest}\n * @private\n * @memberof Members\n */\n this.membersRequest = new MembersRequest({}, options);\n /**\n * The Members Collection cache\n * @instance\n * @type {MembersCollection}\n * @private\n * @memberof Members\n */\n this.membersCollection = new MembersCollection();\n /**\n * The current locus url for the active meeting\n * @instance\n * @type {String}\n * @private\n * @memberof Members\n */\n this.locusUrl = attrs.locusUrl || null;\n /**\n * The current hostId for the meeting\n * @instance\n * @type {String}\n * @private\n * @memberof Members\n */\n this.hostId = null;\n /**\n * The current type for the meeting, could be MEETING or CALL\n * @instance\n * @type {String}\n * @private\n * @memberof Members\n */\n this.type = null;\n /**\n * Locus has a self object, sent individually to the client\n * i.e., each person in the call gets their own self object from locus.\n * We need to maintain that self object, because we also get information about all the participants\n * and differentiate those participants from self.\n * The self id shouldnt ever change, but it does have properties that will change\n * and we use values in locus-info, such as to determine if i am admitted to the meeting or not as guest.\n * The current selfId for the meeting\n * @instance\n * @type {String}\n * @private\n * @memberof Members\n */\n this.selfId = null;\n /**\n * The current mediaShareContentId for the meeting\n * @instance\n * @type {String}\n * @private\n * @memberof Members\n */\n this.mediaShareContentId = null;\n /**\n * The current mediaShareWhiteboardId for the meeting\n * @instance\n * @type {String}\n * @private\n * @memberof Members\n */\n this.mediaShareWhiteboardId = null;\n /**\n * The current recordingId for the meeting, if it exists\n * @instance\n * @type {String}\n * @private\n * @memberof Members\n */\n this.recordingId = null;\n }\n\n /**\n * Internal update the self Id value\n * @param {Object} payload\n * @param {Object} payload.newSelf\n * @param {Object} payload.oldSelf\n * @returns {undefined}\n * @private\n * @memberof Members\n */\n locusSelfUpdate(payload) {\n let newSelfId = null;\n let oldSelfId = null;\n\n if (payload) {\n if (payload.newSelf) {\n newSelfId = payload.newSelf.id;\n }\n if (payload.oldSelf) {\n oldSelfId = payload.oldSelf.id;\n }\n }\n if (newSelfId) {\n const theSelf = this.membersCollection.get(newSelfId);\n\n if (theSelf) {\n theSelf.setIsSelf(true);\n }\n }\n if (oldSelfId) {\n const notSelf = this.membersCollection.get(oldSelfId);\n\n if (notSelf) {\n notSelf.setIsSelf(false);\n }\n }\n this.selfId = newSelfId;\n Trigger.trigger(\n this,\n {\n file: 'members',\n function: 'locusSelfUpdate'\n },\n EVENT_TRIGGERS.MEMBERS_SELF_UPDATE,\n {\n activeSelfId: newSelfId,\n endedSelfId: oldSelfId\n }\n );\n }\n\n /**\n * Internal update the hostId value\n * @param {Object} payload\n * @param {Object} payload.newHost\n * @param {Object} payload.oldHost\n * @returns {undefined}\n * @private\n * @memberof Members\n */\n locusHostUpdate(payload) {\n let newHostId = null;\n let oldHostId = null;\n\n if (payload) {\n if (payload.newHost) {\n newHostId = payload.newHost.id;\n }\n if (payload.oldHost) {\n oldHostId = payload.oldHost.id;\n }\n }\n if (newHostId) {\n const theHost = this.membersCollection.get(newHostId);\n\n if (theHost) {\n theHost.setIsHost(true);\n }\n }\n if (oldHostId) {\n const notHost = this.membersCollection.get(oldHostId);\n\n if (notHost) {\n notHost.setIsHost(false);\n }\n }\n this.hostId = newHostId;\n Trigger.trigger(\n this,\n {\n file: 'members',\n function: 'locusHostUpdate'\n },\n EVENT_TRIGGERS.MEMBERS_HOST_UPDATE,\n {\n activeHostId: newHostId,\n endedHostId: oldHostId\n }\n );\n }\n\n /**\n * when new participant updates come in, both delta and full participants, update them in members collection\n * delta object in the event will have {updated, added} and full will be the full membersCollection\n * @param {Object} payload\n * @param {Object} payload.participants\n * @returns {undefined}\n * @private\n * @memberof Members\n */\n locusParticipantsUpdate(payload) {\n if (payload) {\n const delta = this.handleLocusInfoUpdatedParticipants(payload);\n const full = this.handleMembersUpdate(delta); // SDK should propagate the full list for both delta and non delta updates\n\n Trigger.trigger(\n this,\n {\n file: 'members',\n function: 'locusParticipantsUpdate'\n },\n EVENT_TRIGGERS.MEMBERS_UPDATE,\n {\n delta,\n full\n }\n );\n }\n }\n\n /**\n * Internal update the content id\n * @param {Object} payload\n * @param {Object} payload.current\n * @param {Object} payload.previous\n * @returns {undefined}\n * @private\n * @memberof Members\n */\n locusMediaSharesUpdate(payload) {\n const currentContent = payload.current?.content;\n const previousContent = payload.previous?.content;\n const currentWhiteboard = payload.current?.whiteboard;\n const previousWhiteboard = payload.previous?.whiteboard;\n let whoSharing = null;\n let whoStopped = null;\n\n if (currentContent?.beneficiaryId) {\n if (currentContent.disposition === FLOOR_ACTION.GRANTED) {\n whoSharing = currentContent.beneficiaryId;\n this.mediaShareWhiteboardId = null;\n this.mediaShareContentId = whoSharing;\n }\n\n if (previousContent?.disposition === FLOOR_ACTION.GRANTED) {\n if (currentContent.disposition === FLOOR_ACTION.RELEASED) {\n whoStopped = currentContent.beneficiaryId;\n this.mediaShareContentId = null;\n }\n else if (currentContent.disposition === FLOOR_ACTION.GRANTED && currentContent.beneficiaryId !== previousContent.beneficiaryId) {\n whoStopped = previousContent.beneficiaryId;\n }\n }\n }\n\n if (currentWhiteboard?.beneficiaryId) {\n if (currentWhiteboard.disposition === FLOOR_ACTION.GRANTED) {\n whoSharing = currentWhiteboard.beneficiaryId;\n this.mediaShareContentId = null;\n this.mediaShareWhiteboardId = whoSharing;\n }\n\n if (previousWhiteboard?.disposition === FLOOR_ACTION.GRANTED) {\n if (currentWhiteboard.disposition === FLOOR_ACTION.RELEASED) {\n whoStopped = currentWhiteboard.beneficiaryId;\n this.mediaShareWhiteboardId = null;\n }\n else if (currentWhiteboard.disposition === FLOOR_ACTION.GRANTED && currentWhiteboard.beneficiaryId !== previousWhiteboard.beneficiaryId) {\n whoStopped = previousWhiteboard.beneficiaryId;\n }\n }\n }\n\n if (whoSharing) {\n const shareMember = this.membersCollection.get(whoSharing);\n\n if (shareMember) {\n shareMember.setIsContentSharing(true);\n }\n }\n if (whoStopped) {\n const stopMember = this.membersCollection.get(whoStopped);\n\n if (stopMember) {\n stopMember.setIsContentSharing(false);\n }\n }\n\n Trigger.trigger(\n this,\n {\n file: 'members',\n function: 'locusMediaSharesUpdate'\n },\n EVENT_TRIGGERS.MEMBERS_CONTENT_UPDATE,\n {\n activeSharingId: whoSharing,\n endedSharingId: whoStopped\n }\n );\n }\n\n\n /**\n * Internal update the locus url value\n * @param {Object} payload\n * @param {String} payload.locusUrl\n * @returns {undefined}\n * @private\n * @memberof Members\n */\n locusUrlUpdate(payload) {\n if (payload) {\n this.setLocusUrl(null, payload);\n }\n }\n\n /**\n * Internal update the type of meeting\n * @param {Object} payload\n * @param {String} payload.type\n * @returns {undefined}\n * @private\n * @memberof Members\n */\n locusFullStateTypeUpdate(payload) {\n // TODO: at some point there could be a timing issue here, for updating each member\n // ie., if the type changes AND there is no locus update, then each member will not know the type of call\n // which means they cannot determine isMutable && isRemovable\n // for now this scenario is impossible to occur since we always get a locus update when the type changes\n // except for in delta locus meetings, but in that case, the type will always have been set differently\n // from the outset anyway\n if (payload) {\n this.setType(payload);\n }\n }\n\n /**\n * sets values in the members collection for updated and added properties from delta\n * @param {Object} membersUpdate {updated: [], added: []}\n * @returns {Object} membersCollection\n * @private\n * @memberof Members\n */\n handleMembersUpdate(membersUpdate) {\n if (membersUpdate) {\n if (membersUpdate.updated) {\n this.constructMembers(membersUpdate.updated);\n }\n if (membersUpdate.added) {\n this.constructMembers(membersUpdate.added);\n }\n }\n\n return this.membersCollection.getAll();\n }\n\n /**\n * set members to the member collection from each updated/added lists as passed in\n * @param {Array} list\n * @returns {undefined}\n * @private\n * @memberof Members\n */\n constructMembers(list) {\n list.forEach((member) => {\n this.membersCollection.set(member.id, member);\n });\n }\n\n /**\n * Internal update the participants value\n * @param {Object} payload\n * @returns {Object}\n * @private\n * @memberof Members\n */\n handleLocusInfoUpdatedParticipants(payload) {\n this.hostId = payload.hostId || this.hostId;\n this.selfId = payload.selfId || this.selfId;\n this.recordingId = payload.recordingId;\n if (!payload.participants) {\n LoggerProxy.logger.warn('Members:index#handleLocusInfoUpdatedParticipants --> participants payload is missing.');\n }\n const memberUpdate = this.update(payload.participants);\n\n return memberUpdate;\n }\n\n /**\n * Update the locus Url\n * @param {Object} locus\n * @param {String} [locusUrl] optional, takes precedence\n * @throws {ParameterError}\n * @returns {undefined}\n * @public\n * @memberof Members\n */\n setLocusUrl(locus, locusUrl = null) {\n if (locusUrl) {\n this.locusUrl = locusUrl;\n }\n else if (locus && (locus.locusUrl || locus.url)) {\n this.locusUrl = locus.locusUrl || locus.url;\n }\n else {\n throw new ParameterError('Setting locusUrl for the Members module should be done with a locus object or locusUrl');\n }\n }\n\n /**\n * Update the host id\n * @param {Object} locus\n * @param {String} [hostId] optional, takes precedence\n * @throws {ParameterError}\n * @returns {undefined}\n * @public\n * @memberof Members\n */\n setHostId(locus, hostId = null) {\n if (hostId) {\n this.hostId = hostId;\n }\n else if (locus) {\n this.hostId = locus && locus.owner && locus.owner.info ? locus.owner.info : null;\n }\n else {\n throw new ParameterError('Setting hostid for the Members module should be done with a locus object or hostId');\n }\n }\n\n /**\n * Update the type\n * @param {Object} fullState\n * @param {String} [type] optional, takes precedence\n * @throws {ParameterError}\n * @returns {undefined}\n * @public\n * @memberof Members\n */\n setType(fullState, type = null) {\n if (type) {\n this.type = type;\n }\n else if (fullState) {\n this.type = (fullState && fullState.type) || null;\n }\n else {\n throw new ParameterError('Setting type for the Members module should be done with a fullstate object or type string');\n }\n }\n\n /**\n * Update the self Id\n * @param {Object} locus\n * @param {String} [selfId] optional, takes precedence\n * @throws {Error}\n * @returns {undefined}\n * @memberof Members\n */\n setSelfId(locus, selfId = null) {\n if (selfId) {\n this.selfId = selfId;\n }\n else if (locus) {\n this.selfId = locus && locus.self && locus.self.person && locus.self.person.id ? locus.self.person.id : null;\n }\n else {\n throw new ParameterError('Setting selfid for the Members module should be done with a locus object or selfId');\n }\n }\n\n /**\n * Update the media share content id\n * @param {Object} locus\n * @param {String} [contentId] optional, takes precedence\n * @throws {Error}\n * @returns {undefined}\n * @memberof Members\n */\n setMediaShareContentId(locus, contentId) {\n if (contentId) {\n this.mediaShareContentId = contentId;\n }\n else if (locus) {\n const contentMediaShare =\n locus.mediaShares &&\n locus.mediaShares.length &&\n locus.mediaShares.find((mediaShare) => mediaShare.name === CONTENT);\n\n this.mediaShareContentId =\n (contentMediaShare &&\n contentMediaShare.floor &&\n contentMediaShare.floor.beneficiary &&\n contentMediaShare.floor.beneficiary.id) ||\n null;\n }\n else {\n throw new ParameterError('Setting hostid for the Members module should be done with a locus object or hostId');\n }\n }\n\n /**\n * Update the media share whiteboard id\n * @param {Object} locus\n * @param {String} [whiteboardId] optional, takes precedence\n * @throws {Error}\n * @returns {undefined}\n * @memberof Members\n */\n setMediaShareWhiteboardId(locus, whiteboardId) {\n if (whiteboardId) {\n this.mediaShareWhiteboardId = whiteboardId;\n }\n else if (locus) {\n const whiteboardMediaShare =\n locus.mediaShares &&\n locus.mediaShares.length &&\n locus.mediaShares.find((mediaShare) => mediaShare.name === WHITEBOARD);\n\n this.mediaShareWhiteboardId =\n (whiteboardMediaShare &&\n whiteboardMediaShare.floor &&\n whiteboardMediaShare.floor.beneficiary &&\n whiteboardMediaShare.floor.beneficiary.id) ||\n null;\n }\n else {\n throw new ParameterError('Setting hostid for the Members module should be done with a locus object or hostId');\n }\n }\n\n /**\n * Find all the updates, and added members\n * Removed/left members will end up in updates\n * Each array contains only members\n * @param {Array} participants the locus participants\n * @returns {Object} {added: {Array}, updated: {Array}}\n * @private\n * @memberof Members\n */\n update(participants) {\n const membersUpdate = {added: [], updated: []};\n\n if (participants) {\n participants.forEach((participant) => {\n if (participant.hideInRoster) {\n return;\n }\n const existing = this.membersCollection.get(participant.id);\n\n if (existing) {\n // TODO: compare existing member to new participant coming in properties and determine if updated (this helps for non delta events)\n // on client re renders, but we will have to determine what values to compare to determine difference, premature optimization\n membersUpdate.updated.push(\n new Member(participant, {\n recordingId: this.recordingId,\n selfId: this.selfId,\n hostId: this.hostId,\n contentSharingId: this.mediaShareContentId,\n whiteboardSharingId: this.mediaShareWhiteboardId,\n type: this.type\n })\n );\n }\n else {\n membersUpdate.added.push(\n new Member(participant, {\n recordingId: this.recordingId,\n selfId: this.selfId,\n hostId: this.hostId,\n contentSharingId: this.mediaShareContentId,\n whiteboardSharingId: this.mediaShareWhiteboardId,\n type: this.type\n })\n );\n }\n });\n }\n\n return membersUpdate;\n }\n\n /**\n * Adds a guest Member to the associated meeting\n * @param {String} invitee\n * @param {Boolean} [alertIfActive]\n * @returns {Promise}\n * @memberof Members\n */\n addMember(invitee, alertIfActive) {\n if (!this.locusUrl) {\n return Promise.reject(new ParameterError('The associated locus url for this meeting object must be defined.'));\n }\n if (MembersUtil.isInvalidInvitee(invitee)) {\n return Promise.reject(\n new ParameterError('The invitee must be defined with either a valid email, emailAddress or phoneNumber property.')\n );\n }\n const options = MembersUtil.generateAddMemberOptions(invitee, this.locusUrl, alertIfActive);\n\n return this.membersRequest.addMembers(options);\n }\n\n /**\n * Cancels an outgoing PSTN call to the associated meeting\n * @param {String} invitee\n * @returns {Promise}\n * @memberof Members\n */\n cancelPhoneInvite(invitee) {\n if (!this.locusUrl) {\n return Promise.reject(new ParameterError('The associated locus url for this meeting object must be defined.'));\n }\n if (MembersUtil.isInvalidInvitee(invitee)) {\n return Promise.reject(\n new ParameterError('The invitee must be defined with a valid phoneNumber property.')\n );\n }\n const options = MembersUtil.cancelPhoneInviteOptions(invitee, this.locusUrl);\n\n\n return this.membersRequest.cancelPhoneInvite(options);\n }\n\n /**\n * Admits waiting members (invited guests to meeting)\n * @param {Array} memberIds\n * @returns {Promise}\n * @public\n * @memberof Members\n */\n admitMembers(memberIds) {\n if (isEmpty(memberIds)) {\n return Promise.reject(new ParameterError('No member ids provided to admit.'));\n }\n const options = MembersUtil.generateAdmitMemberOptions(memberIds, this.locusUrl);\n\n return this.membersRequest.admitMember(options);\n }\n\n /**\n * Removes a member from the meeting\n * @param {String} memberId\n * @returns {Promise}\n * @public\n * @memberof Members\n */\n removeMember(memberId) {\n if (!this.locusUrl) {\n return Promise.reject(new ParameterError('The associated locus url for this meeting object must be defined.'));\n }\n if (!memberId) {\n return Promise.reject(new ParameterError('The member id must be defined to remove the member.'));\n }\n const options = MembersUtil.generateRemoveMemberOptions(memberId, this.locusUrl);\n\n return this.membersRequest.removeMember(options);\n }\n\n /**\n * Audio mutes another member in a meeting\n * @param {String} memberId\n * @param {boolean} [mute] default true\n * @returns {Promise}\n * @public\n * @memberof Members\n */\n muteMember(memberId, mute = true) {\n if (!this.locusUrl) {\n return Promise.reject(new ParameterError('The associated locus url for this meetings members object must be defined.'));\n }\n if (!memberId) {\n return Promise.reject(new ParameterError('The member id must be defined to mute the member.'));\n }\n const options = MembersUtil.generateMuteMemberOptions(memberId, mute, this.locusUrl);\n\n return this.membersRequest.muteMember(options);\n }\n\n /**\n * Raise or lower the hand of a member in a meeting\n * @param {String} memberId\n * @param {boolean} [raise] - to raise hand (=true) or lower (=false), default: true\n * @returns {Promise}\n * @public\n * @memberof Members\n */\n raiseOrLowerHand(memberId, raise = true) {\n if (!this.locusUrl) {\n return Promise.reject(new ParameterError('The associated locus url for this meetings members object must be defined.'));\n }\n if (!memberId) {\n return Promise.reject(new ParameterError('The member id must be defined to raise/lower the hand of the member.'));\n }\n const options = MembersUtil.generateRaiseHandMemberOptions(memberId, raise, this.locusUrl);\n\n return this.membersRequest.raiseLowerHandMember(options);\n }\n\n /**\n * Transfers the host to another member\n * @param {String} memberId\n * @param {boolean} [moderator] default true\n * @returns {Promise}\n * @public\n * @memberof Members\n */\n transferHostToMember(memberId, moderator = true) {\n if (!this.locusUrl) {\n return Promise.reject(new ParameterError('The associated locus url for this meetings members object must be defined.'));\n }\n if (!memberId) {\n return Promise.reject(new ParameterError('The member id must be defined to transfer host to the member.'));\n }\n const options = MembersUtil.generateTransferHostMemberOptions(memberId, moderator, this.locusUrl);\n\n return this.membersRequest.transferHostToMember(options);\n }\n\n\n /**\n * Sends DTMF tones for the PSTN member of a meeting\n * @param {String} tones a string of one or more DTMF tones to send\n * @param {String} memberId member id\n * @returns {Promise}\n * @public\n * @memberof Members\n */\n sendDialPadKey(tones = '', memberId = '') {\n if (!tones && tones !== 0) {\n return Promise.reject(new ParameterError('DMTF tones must be passed in'));\n }\n\n const member = this.membersCollection.get(memberId);\n\n if (!member) {\n return Promise.reject(new ParameterError('there is no member associated with that Id'));\n }\n\n const {locusUrl} = this;\n\n const deviceArray = member.participant.devices;\n const device = deviceArray.find(({deviceType}) => deviceType === 'SIP');\n const url = device?.url;\n\n if (locusUrl && url) {\n const options = MembersUtil.genderateSendDTMFOptions(url, tones, memberId, locusUrl);\n\n return this.membersRequest.sendDialPadKey(options);\n }\n\n return Promise.reject(new Error('Members:index#sendDialPadKey --> cannot send DTMF, meeting does not have a connection to the \"locus\" call control service.'));\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AACA;;AACA;;;;;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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UA,KAAK,KAAK,CAAxB,EAA2B;QACzB,OAAO,iBAAQtB,MAAR,CAAe,IAAI5B,kBAAJ,CAAmB,8BAAnB,CAAf,CAAP;MACD;;MAED,IAAMV,MAAM,GAAG,KAAKxE,iBAAL,CAAuBgB,GAAvB,CAA2BwG,QAA3B,CAAf;;MAEA,IAAI,CAAChD,MAAL,EAAa;QACX,OAAO,iBAAQsC,MAAR,CAAe,IAAI5B,kBAAJ,CAAmB,4CAAnB,CAAf,CAAP;MACD;;MAED,IAAOhF,QAAP,GAAmB,IAAnB,CAAOA,QAAP;MAEA,IAAMmI,WAAW,GAAG7D,MAAM,CAAC6B,WAAP,CAAmBiC,OAAvC;MACA,IAAMC,MAAM,GAAGF,WAAW,CAACzC,IAAZ,CAAiB;QAAA,IAAE4C,UAAF,QAAEA,UAAF;QAAA,OAAkBA,UAAU,KAAK,KAAjC;MAAA,CAAjB,CAAf;MACA,IAAMvD,GAAG,GAAGsD,MAAH,aAAGA,MAAH,uBAAGA,MAAM,CAAEtD,GAApB;;MAEA,IAAI/E,QAAQ,IAAI+E,GAAhB,EAAqB;QACnB,IAAMrF,OAAO,GAAGmH,cAAY0B,wBAAZ,CAAqCxD,GAArC,EAA0CmD,KAA1C,EAAiDZ,QAAjD,EAA2DtH,QAA3D,CAAhB;;QAEA,OAAO,KAAKJ,cAAL,CAAoB4I,cAApB,CAAmC9I,OAAnC,CAAP;MACD;;MAED,OAAO,iBAAQkH,MAAR,CAAe,IAAI6B,KAAJ,CAAU,4HAAV,CAAf,CAAP;IACD;;;EAjvBkCC,+B"}
|
|
1
|
+
{"version":3,"names":["Members","attrs","options","MEETINGS","membersRequest","MembersRequest","membersCollection","MembersCollection","locusUrl","hostId","type","selfId","mediaShareContentId","mediaShareWhiteboardId","recordingId","payload","newSelfId","oldSelfId","newSelf","id","oldSelf","theSelf","get","setIsSelf","notSelf","Trigger","trigger","file","function","EVENT_TRIGGERS","MEMBERS_SELF_UPDATE","activeSelfId","endedSelfId","newHostId","oldHostId","newHost","oldHost","theHost","setIsHost","notHost","MEMBERS_HOST_UPDATE","activeHostId","endedHostId","delta","handleLocusInfoUpdatedParticipants","full","handleMembersUpdate","MEMBERS_UPDATE","currentContent","current","content","previousContent","previous","currentWhiteboard","whiteboard","previousWhiteboard","whoSharing","whoStopped","beneficiaryId","disposition","FLOOR_ACTION","GRANTED","RELEASED","shareMember","setIsContentSharing","stopMember","MEMBERS_CONTENT_UPDATE","activeSharingId","endedSharingId","setLocusUrl","setType","membersUpdate","updated","constructMembers","added","getAll","list","forEach","member","set","participants","LoggerProxy","logger","warn","memberUpdate","update","locus","url","ParameterError","owner","info","fullState","self","person","contentId","contentMediaShare","mediaShares","length","find","mediaShare","name","CONTENT","floor","beneficiary","whiteboardId","whiteboardMediaShare","WHITEBOARD","participant","hideInRoster","existing","push","Member","contentSharingId","whiteboardSharingId","invitee","alertIfActive","reject","MembersUtil","isInvalidInvitee","generateAddMemberOptions","addMembers","cancelPhoneInviteOptions","cancelPhoneInvite","memberIds","generateAdmitMemberOptions","admitMember","memberId","generateRemoveMemberOptions","removeMember","mute","generateMuteMemberOptions","muteMember","raise","generateRaiseHandMemberOptions","raiseOrLowerHandMember","requestingMemberId","generateLowerAllHandsMemberOptions","lowerAllHandsMember","moderator","generateTransferHostMemberOptions","transferHostToMember","tones","deviceArray","devices","device","deviceType","genderateSendDTMFOptions","sendDialPadKey","Error","StatelessWebexPlugin"],"sources":["index.js"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\nimport {isEmpty} from 'lodash';\nimport {StatelessWebexPlugin} from '@webex/webex-core';\n\nimport {MEETINGS, EVENT_TRIGGERS, FLOOR_ACTION, CONTENT, WHITEBOARD} from '../constants';\nimport Trigger from '../common/events/trigger-proxy';\nimport Member from '../member';\nimport LoggerProxy from '../common/logs/logger-proxy';\nimport ParameterError from '../common/errors/parameter';\n\nimport MembersCollection from './collection';\nimport MembersRequest from './request';\nimport MembersUtil from './util';\n\n/**\n * Members Update Event\n * Emitted when something in the roster list needs to be updated\n * @event members:update\n * @instance\n * @property {Object} delta the changes to the members list\n * @property {Array} delta.updated array only the updates, includes removals, as they will have updated status and member properties\n * @property {Array} delta.added array added members to the meeting\n * @property {Array} full array the full members collection\n * @memberof Members\n */\n\n/**\n * Members Content Update Event\n * Emitted when who is sharing changes\n * @event members:content:update\n * @instance\n * @property {String} activeContentSharingId\n * @property {String} endedContentSharingId\n * @memberof Members\n */\n\n/**\n * Members Host Update Event\n * Emitted when who is the host changes\n * @event members:host:update\n * @instance\n * @property {String} activeHostId\n * @property {String} endedHostId\n * @memberof Members\n */\n\n/**\n * Members Self Update Event\n * Emitted when who is the self changes\n * @event members:self:update\n * @instance\n * @property {String} activeSelfId\n * @property {String} endedSelfId\n * @memberof Members\n */\n\n/**\n * @class Members\n */\nexport default class Members extends StatelessWebexPlugin {\n namespace = MEETINGS;\n\n /**\n *\n * @param {Object} attrs\n * @param {Object} options\n * @memberof Members\n */\n constructor(attrs, options) {\n super({}, options);\n /**\n * The Members Request object to interact with server\n * @instance\n * @type {MembersRequest}\n * @private\n * @memberof Members\n */\n this.membersRequest = new MembersRequest({}, options);\n /**\n * The Members Collection cache\n * @instance\n * @type {MembersCollection}\n * @private\n * @memberof Members\n */\n this.membersCollection = new MembersCollection();\n /**\n * The current locus url for the active meeting\n * @instance\n * @type {String}\n * @private\n * @memberof Members\n */\n this.locusUrl = attrs.locusUrl || null;\n /**\n * The current hostId for the meeting\n * @instance\n * @type {String}\n * @private\n * @memberof Members\n */\n this.hostId = null;\n /**\n * The current type for the meeting, could be MEETING or CALL\n * @instance\n * @type {String}\n * @private\n * @memberof Members\n */\n this.type = null;\n /**\n * Locus has a self object, sent individually to the client\n * i.e., each person in the call gets their own self object from locus.\n * We need to maintain that self object, because we also get information about all the participants\n * and differentiate those participants from self.\n * The self id shouldnt ever change, but it does have properties that will change\n * and we use values in locus-info, such as to determine if i am admitted to the meeting or not as guest.\n * The current selfId for the meeting\n * @instance\n * @type {String}\n * @private\n * @memberof Members\n */\n this.selfId = null;\n /**\n * The current mediaShareContentId for the meeting\n * @instance\n * @type {String}\n * @private\n * @memberof Members\n */\n this.mediaShareContentId = null;\n /**\n * The current mediaShareWhiteboardId for the meeting\n * @instance\n * @type {String}\n * @private\n * @memberof Members\n */\n this.mediaShareWhiteboardId = null;\n /**\n * The current recordingId for the meeting, if it exists\n * @instance\n * @type {String}\n * @private\n * @memberof Members\n */\n this.recordingId = null;\n }\n\n /**\n * Internal update the self Id value\n * @param {Object} payload\n * @param {Object} payload.newSelf\n * @param {Object} payload.oldSelf\n * @returns {undefined}\n * @private\n * @memberof Members\n */\n locusSelfUpdate(payload) {\n let newSelfId = null;\n let oldSelfId = null;\n\n if (payload) {\n if (payload.newSelf) {\n newSelfId = payload.newSelf.id;\n }\n if (payload.oldSelf) {\n oldSelfId = payload.oldSelf.id;\n }\n }\n if (newSelfId) {\n const theSelf = this.membersCollection.get(newSelfId);\n\n if (theSelf) {\n theSelf.setIsSelf(true);\n }\n }\n if (oldSelfId) {\n const notSelf = this.membersCollection.get(oldSelfId);\n\n if (notSelf) {\n notSelf.setIsSelf(false);\n }\n }\n this.selfId = newSelfId;\n Trigger.trigger(\n this,\n {\n file: 'members',\n function: 'locusSelfUpdate'\n },\n EVENT_TRIGGERS.MEMBERS_SELF_UPDATE,\n {\n activeSelfId: newSelfId,\n endedSelfId: oldSelfId\n }\n );\n }\n\n /**\n * Internal update the hostId value\n * @param {Object} payload\n * @param {Object} payload.newHost\n * @param {Object} payload.oldHost\n * @returns {undefined}\n * @private\n * @memberof Members\n */\n locusHostUpdate(payload) {\n let newHostId = null;\n let oldHostId = null;\n\n if (payload) {\n if (payload.newHost) {\n newHostId = payload.newHost.id;\n }\n if (payload.oldHost) {\n oldHostId = payload.oldHost.id;\n }\n }\n if (newHostId) {\n const theHost = this.membersCollection.get(newHostId);\n\n if (theHost) {\n theHost.setIsHost(true);\n }\n }\n if (oldHostId) {\n const notHost = this.membersCollection.get(oldHostId);\n\n if (notHost) {\n notHost.setIsHost(false);\n }\n }\n this.hostId = newHostId;\n Trigger.trigger(\n this,\n {\n file: 'members',\n function: 'locusHostUpdate'\n },\n EVENT_TRIGGERS.MEMBERS_HOST_UPDATE,\n {\n activeHostId: newHostId,\n endedHostId: oldHostId\n }\n );\n }\n\n /**\n * when new participant updates come in, both delta and full participants, update them in members collection\n * delta object in the event will have {updated, added} and full will be the full membersCollection\n * @param {Object} payload\n * @param {Object} payload.participants\n * @returns {undefined}\n * @private\n * @memberof Members\n */\n locusParticipantsUpdate(payload) {\n if (payload) {\n const delta = this.handleLocusInfoUpdatedParticipants(payload);\n const full = this.handleMembersUpdate(delta); // SDK should propagate the full list for both delta and non delta updates\n\n Trigger.trigger(\n this,\n {\n file: 'members',\n function: 'locusParticipantsUpdate'\n },\n EVENT_TRIGGERS.MEMBERS_UPDATE,\n {\n delta,\n full\n }\n );\n }\n }\n\n /**\n * Internal update the content id\n * @param {Object} payload\n * @param {Object} payload.current\n * @param {Object} payload.previous\n * @returns {undefined}\n * @private\n * @memberof Members\n */\n locusMediaSharesUpdate(payload) {\n const currentContent = payload.current?.content;\n const previousContent = payload.previous?.content;\n const currentWhiteboard = payload.current?.whiteboard;\n const previousWhiteboard = payload.previous?.whiteboard;\n let whoSharing = null;\n let whoStopped = null;\n\n if (currentContent?.beneficiaryId) {\n if (currentContent.disposition === FLOOR_ACTION.GRANTED) {\n whoSharing = currentContent.beneficiaryId;\n this.mediaShareWhiteboardId = null;\n this.mediaShareContentId = whoSharing;\n }\n\n if (previousContent?.disposition === FLOOR_ACTION.GRANTED) {\n if (currentContent.disposition === FLOOR_ACTION.RELEASED) {\n whoStopped = currentContent.beneficiaryId;\n this.mediaShareContentId = null;\n }\n else if (currentContent.disposition === FLOOR_ACTION.GRANTED && currentContent.beneficiaryId !== previousContent.beneficiaryId) {\n whoStopped = previousContent.beneficiaryId;\n }\n }\n }\n\n if (currentWhiteboard?.beneficiaryId) {\n if (currentWhiteboard.disposition === FLOOR_ACTION.GRANTED) {\n whoSharing = currentWhiteboard.beneficiaryId;\n this.mediaShareContentId = null;\n this.mediaShareWhiteboardId = whoSharing;\n }\n\n if (previousWhiteboard?.disposition === FLOOR_ACTION.GRANTED) {\n if (currentWhiteboard.disposition === FLOOR_ACTION.RELEASED) {\n whoStopped = currentWhiteboard.beneficiaryId;\n this.mediaShareWhiteboardId = null;\n }\n else if (currentWhiteboard.disposition === FLOOR_ACTION.GRANTED && currentWhiteboard.beneficiaryId !== previousWhiteboard.beneficiaryId) {\n whoStopped = previousWhiteboard.beneficiaryId;\n }\n }\n }\n\n if (whoSharing) {\n const shareMember = this.membersCollection.get(whoSharing);\n\n if (shareMember) {\n shareMember.setIsContentSharing(true);\n }\n }\n if (whoStopped) {\n const stopMember = this.membersCollection.get(whoStopped);\n\n if (stopMember) {\n stopMember.setIsContentSharing(false);\n }\n }\n\n Trigger.trigger(\n this,\n {\n file: 'members',\n function: 'locusMediaSharesUpdate'\n },\n EVENT_TRIGGERS.MEMBERS_CONTENT_UPDATE,\n {\n activeSharingId: whoSharing,\n endedSharingId: whoStopped\n }\n );\n }\n\n\n /**\n * Internal update the locus url value\n * @param {Object} payload\n * @param {String} payload.locusUrl\n * @returns {undefined}\n * @private\n * @memberof Members\n */\n locusUrlUpdate(payload) {\n if (payload) {\n this.setLocusUrl(null, payload);\n }\n }\n\n /**\n * Internal update the type of meeting\n * @param {Object} payload\n * @param {String} payload.type\n * @returns {undefined}\n * @private\n * @memberof Members\n */\n locusFullStateTypeUpdate(payload) {\n // TODO: at some point there could be a timing issue here, for updating each member\n // ie., if the type changes AND there is no locus update, then each member will not know the type of call\n // which means they cannot determine isMutable && isRemovable\n // for now this scenario is impossible to occur since we always get a locus update when the type changes\n // except for in delta locus meetings, but in that case, the type will always have been set differently\n // from the outset anyway\n if (payload) {\n this.setType(payload);\n }\n }\n\n /**\n * sets values in the members collection for updated and added properties from delta\n * @param {Object} membersUpdate {updated: [], added: []}\n * @returns {Object} membersCollection\n * @private\n * @memberof Members\n */\n handleMembersUpdate(membersUpdate) {\n if (membersUpdate) {\n if (membersUpdate.updated) {\n this.constructMembers(membersUpdate.updated);\n }\n if (membersUpdate.added) {\n this.constructMembers(membersUpdate.added);\n }\n }\n\n return this.membersCollection.getAll();\n }\n\n /**\n * set members to the member collection from each updated/added lists as passed in\n * @param {Array} list\n * @returns {undefined}\n * @private\n * @memberof Members\n */\n constructMembers(list) {\n list.forEach((member) => {\n this.membersCollection.set(member.id, member);\n });\n }\n\n /**\n * Internal update the participants value\n * @param {Object} payload\n * @returns {Object}\n * @private\n * @memberof Members\n */\n handleLocusInfoUpdatedParticipants(payload) {\n this.hostId = payload.hostId || this.hostId;\n this.selfId = payload.selfId || this.selfId;\n this.recordingId = payload.recordingId;\n if (!payload.participants) {\n LoggerProxy.logger.warn('Members:index#handleLocusInfoUpdatedParticipants --> participants payload is missing.');\n }\n const memberUpdate = this.update(payload.participants);\n\n return memberUpdate;\n }\n\n /**\n * Update the locus Url\n * @param {Object} locus\n * @param {String} [locusUrl] optional, takes precedence\n * @throws {ParameterError}\n * @returns {undefined}\n * @public\n * @memberof Members\n */\n setLocusUrl(locus, locusUrl = null) {\n if (locusUrl) {\n this.locusUrl = locusUrl;\n }\n else if (locus && (locus.locusUrl || locus.url)) {\n this.locusUrl = locus.locusUrl || locus.url;\n }\n else {\n throw new ParameterError('Setting locusUrl for the Members module should be done with a locus object or locusUrl');\n }\n }\n\n /**\n * Update the host id\n * @param {Object} locus\n * @param {String} [hostId] optional, takes precedence\n * @throws {ParameterError}\n * @returns {undefined}\n * @public\n * @memberof Members\n */\n setHostId(locus, hostId = null) {\n if (hostId) {\n this.hostId = hostId;\n }\n else if (locus) {\n this.hostId = locus && locus.owner && locus.owner.info ? locus.owner.info : null;\n }\n else {\n throw new ParameterError('Setting hostid for the Members module should be done with a locus object or hostId');\n }\n }\n\n /**\n * Update the type\n * @param {Object} fullState\n * @param {String} [type] optional, takes precedence\n * @throws {ParameterError}\n * @returns {undefined}\n * @public\n * @memberof Members\n */\n setType(fullState, type = null) {\n if (type) {\n this.type = type;\n }\n else if (fullState) {\n this.type = (fullState && fullState.type) || null;\n }\n else {\n throw new ParameterError('Setting type for the Members module should be done with a fullstate object or type string');\n }\n }\n\n /**\n * Update the self Id\n * @param {Object} locus\n * @param {String} [selfId] optional, takes precedence\n * @throws {Error}\n * @returns {undefined}\n * @memberof Members\n */\n setSelfId(locus, selfId = null) {\n if (selfId) {\n this.selfId = selfId;\n }\n else if (locus) {\n this.selfId = locus && locus.self && locus.self.person && locus.self.person.id ? locus.self.person.id : null;\n }\n else {\n throw new ParameterError('Setting selfid for the Members module should be done with a locus object or selfId');\n }\n }\n\n /**\n * Update the media share content id\n * @param {Object} locus\n * @param {String} [contentId] optional, takes precedence\n * @throws {Error}\n * @returns {undefined}\n * @memberof Members\n */\n setMediaShareContentId(locus, contentId) {\n if (contentId) {\n this.mediaShareContentId = contentId;\n }\n else if (locus) {\n const contentMediaShare =\n locus.mediaShares &&\n locus.mediaShares.length &&\n locus.mediaShares.find((mediaShare) => mediaShare.name === CONTENT);\n\n this.mediaShareContentId =\n (contentMediaShare &&\n contentMediaShare.floor &&\n contentMediaShare.floor.beneficiary &&\n contentMediaShare.floor.beneficiary.id) ||\n null;\n }\n else {\n throw new ParameterError('Setting hostid for the Members module should be done with a locus object or hostId');\n }\n }\n\n /**\n * Update the media share whiteboard id\n * @param {Object} locus\n * @param {String} [whiteboardId] optional, takes precedence\n * @throws {Error}\n * @returns {undefined}\n * @memberof Members\n */\n setMediaShareWhiteboardId(locus, whiteboardId) {\n if (whiteboardId) {\n this.mediaShareWhiteboardId = whiteboardId;\n }\n else if (locus) {\n const whiteboardMediaShare =\n locus.mediaShares &&\n locus.mediaShares.length &&\n locus.mediaShares.find((mediaShare) => mediaShare.name === WHITEBOARD);\n\n this.mediaShareWhiteboardId =\n (whiteboardMediaShare &&\n whiteboardMediaShare.floor &&\n whiteboardMediaShare.floor.beneficiary &&\n whiteboardMediaShare.floor.beneficiary.id) ||\n null;\n }\n else {\n throw new ParameterError('Setting hostid for the Members module should be done with a locus object or hostId');\n }\n }\n\n /**\n * Find all the updates, and added members\n * Removed/left members will end up in updates\n * Each array contains only members\n * @param {Array} participants the locus participants\n * @returns {Object} {added: {Array}, updated: {Array}}\n * @private\n * @memberof Members\n */\n update(participants) {\n const membersUpdate = {added: [], updated: []};\n\n if (participants) {\n participants.forEach((participant) => {\n if (participant.hideInRoster) {\n return;\n }\n const existing = this.membersCollection.get(participant.id);\n\n if (existing) {\n // TODO: compare existing member to new participant coming in properties and determine if updated (this helps for non delta events)\n // on client re renders, but we will have to determine what values to compare to determine difference, premature optimization\n membersUpdate.updated.push(\n new Member(participant, {\n recordingId: this.recordingId,\n selfId: this.selfId,\n hostId: this.hostId,\n contentSharingId: this.mediaShareContentId,\n whiteboardSharingId: this.mediaShareWhiteboardId,\n type: this.type\n })\n );\n }\n else {\n membersUpdate.added.push(\n new Member(participant, {\n recordingId: this.recordingId,\n selfId: this.selfId,\n hostId: this.hostId,\n contentSharingId: this.mediaShareContentId,\n whiteboardSharingId: this.mediaShareWhiteboardId,\n type: this.type\n })\n );\n }\n });\n }\n\n return membersUpdate;\n }\n\n /**\n * Adds a guest Member to the associated meeting\n * @param {String} invitee\n * @param {Boolean} [alertIfActive]\n * @returns {Promise}\n * @memberof Members\n */\n addMember(invitee, alertIfActive) {\n if (!this.locusUrl) {\n return Promise.reject(new ParameterError('The associated locus url for this meeting object must be defined.'));\n }\n if (MembersUtil.isInvalidInvitee(invitee)) {\n return Promise.reject(\n new ParameterError('The invitee must be defined with either a valid email, emailAddress or phoneNumber property.')\n );\n }\n const options = MembersUtil.generateAddMemberOptions(invitee, this.locusUrl, alertIfActive);\n\n return this.membersRequest.addMembers(options);\n }\n\n /**\n * Cancels an outgoing PSTN call to the associated meeting\n * @param {String} invitee\n * @returns {Promise}\n * @memberof Members\n */\n cancelPhoneInvite(invitee) {\n if (!this.locusUrl) {\n return Promise.reject(new ParameterError('The associated locus url for this meeting object must be defined.'));\n }\n if (MembersUtil.isInvalidInvitee(invitee)) {\n return Promise.reject(\n new ParameterError('The invitee must be defined with a valid phoneNumber property.')\n );\n }\n const options = MembersUtil.cancelPhoneInviteOptions(invitee, this.locusUrl);\n\n\n return this.membersRequest.cancelPhoneInvite(options);\n }\n\n /**\n * Admits waiting members (invited guests to meeting)\n * @param {Array} memberIds\n * @returns {Promise}\n * @public\n * @memberof Members\n */\n admitMembers(memberIds) {\n if (isEmpty(memberIds)) {\n return Promise.reject(new ParameterError('No member ids provided to admit.'));\n }\n const options = MembersUtil.generateAdmitMemberOptions(memberIds, this.locusUrl);\n\n return this.membersRequest.admitMember(options);\n }\n\n /**\n * Removes a member from the meeting\n * @param {String} memberId\n * @returns {Promise}\n * @public\n * @memberof Members\n */\n removeMember(memberId) {\n if (!this.locusUrl) {\n return Promise.reject(new ParameterError('The associated locus url for this meeting object must be defined.'));\n }\n if (!memberId) {\n return Promise.reject(new ParameterError('The member id must be defined to remove the member.'));\n }\n const options = MembersUtil.generateRemoveMemberOptions(memberId, this.locusUrl);\n\n return this.membersRequest.removeMember(options);\n }\n\n /**\n * Audio mutes another member in a meeting\n * @param {String} memberId\n * @param {boolean} [mute] default true\n * @returns {Promise}\n * @public\n * @memberof Members\n */\n muteMember(memberId, mute = true) {\n if (!this.locusUrl) {\n return Promise.reject(new ParameterError('The associated locus url for this meetings members object must be defined.'));\n }\n if (!memberId) {\n return Promise.reject(new ParameterError('The member id must be defined to mute the member.'));\n }\n const options = MembersUtil.generateMuteMemberOptions(memberId, mute, this.locusUrl);\n\n return this.membersRequest.muteMember(options);\n }\n\n /**\n * Raise or lower the hand of a member in a meeting\n * @param {String} memberId\n * @param {boolean} [raise] - to raise hand (=true) or lower (=false), default: true\n * @returns {Promise}\n * @public\n * @memberof Members\n */\n raiseOrLowerHand(memberId, raise = true) {\n if (!this.locusUrl) {\n return Promise.reject(new ParameterError('The associated locus url for this meetings members object must be defined.'));\n }\n if (!memberId) {\n return Promise.reject(new ParameterError('The member id must be defined to raise/lower the hand of the member.'));\n }\n const options = MembersUtil.generateRaiseHandMemberOptions(memberId, raise, this.locusUrl);\n\n return this.membersRequest.raiseOrLowerHandMember(options);\n }\n\n /**\n * Lower all hands of members in a meeting\n * @param {String} requestingMemberId - id of the participant which requested the lower all hands\n * @returns {Promise}\n * @public\n * @memberof Members\n */\n lowerAllHands(requestingMemberId) {\n if (!this.locusUrl) {\n return Promise.reject(new ParameterError('The associated locus url for this meetings members object must be defined.'));\n }\n if (!requestingMemberId) {\n return Promise.reject(new ParameterError('The requestingMemberId must be defined to lower all hands in a meeting.'));\n }\n const options = MembersUtil.generateLowerAllHandsMemberOptions(requestingMemberId, this.locusUrl);\n\n return this.membersRequest.lowerAllHandsMember(options);\n }\n\n\n /**\n * Transfers the host to another member\n * @param {String} memberId\n * @param {boolean} [moderator] default true\n * @returns {Promise}\n * @public\n * @memberof Members\n */\n transferHostToMember(memberId, moderator = true) {\n if (!this.locusUrl) {\n return Promise.reject(new ParameterError('The associated locus url for this meetings members object must be defined.'));\n }\n if (!memberId) {\n return Promise.reject(new ParameterError('The member id must be defined to transfer host to the member.'));\n }\n const options = MembersUtil.generateTransferHostMemberOptions(memberId, moderator, this.locusUrl);\n\n return this.membersRequest.transferHostToMember(options);\n }\n\n\n /**\n * Sends DTMF tones for the PSTN member of a meeting\n * @param {String} tones a string of one or more DTMF tones to send\n * @param {String} memberId member id\n * @returns {Promise}\n * @public\n * @memberof Members\n */\n sendDialPadKey(tones = '', memberId = '') {\n if (!tones && tones !== 0) {\n return Promise.reject(new ParameterError('DMTF tones must be passed in'));\n }\n\n const member = this.membersCollection.get(memberId);\n\n if (!member) {\n return Promise.reject(new ParameterError('there is no member associated with that Id'));\n }\n\n const {locusUrl} = this;\n\n const deviceArray = member.participant.devices;\n const device = deviceArray.find(({deviceType}) => deviceType === 'SIP');\n const url = device?.url;\n\n if (locusUrl && url) {\n const options = MembersUtil.genderateSendDTMFOptions(url, tones, memberId, locusUrl);\n\n return this.membersRequest.sendDialPadKey(options);\n }\n\n return Promise.reject(new Error('Members:index#sendDialPadKey --> cannot send DTMF, meeting does not have a connection to the \"locus\" call control service.'));\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AACA;;AACA;;;;;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;IACqBA,O;;;;;EAGnB;AACF;AACA;AACA;AACA;AACA;EACE,iBAAYC,KAAZ,EAAmBC,OAAnB,EAA4B;IAAA;;IAAA;IAC1B,0BAAM,EAAN,EAAUA,OAAV;IACA;AACJ;AACA;AACA;AACA;AACA;AACA;;IAR8B,wFARhBC,mBAQgB;IAS1B,MAAKC,cAAL,GAAsB,IAAIC,gBAAJ,CAAmB,EAAnB,EAAuBH,OAAvB,CAAtB;IACA;AACJ;AACA;AACA;AACA;AACA;AACA;;IACI,MAAKI,iBAAL,GAAyB,IAAIC,mBAAJ,EAAzB;IACA;AACJ;AACA;AACA;AACA;AACA;AACA;;IACI,MAAKC,QAAL,GAAgBP,KAAK,CAACO,QAAN,IAAkB,IAAlC;IACA;AACJ;AACA;AACA;AACA;AACA;AACA;;IACI,MAAKC,MAAL,GAAc,IAAd;IACA;AACJ;AACA;AACA;AACA;AACA;AACA;;IACI,MAAKC,IAAL,GAAY,IAAZ;IACA;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;IACI,MAAKC,MAAL,GAAc,IAAd;IACA;AACJ;AACA;AACA;AACA;AACA;AACA;;IACI,MAAKC,mBAAL,GAA2B,IAA3B;IACA;AACJ;AACA;A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,QAAP,GAAmB,IAAnB,CAAOA,QAAP;MAEA,IAAMsI,WAAW,GAAGhE,MAAM,CAAC6B,WAAP,CAAmBoC,OAAvC;MACA,IAAMC,MAAM,GAAGF,WAAW,CAAC5C,IAAZ,CAAiB;QAAA,IAAE+C,UAAF,QAAEA,UAAF;QAAA,OAAkBA,UAAU,KAAK,KAAjC;MAAA,CAAjB,CAAf;MACA,IAAM1D,GAAG,GAAGyD,MAAH,aAAGA,MAAH,uBAAGA,MAAM,CAAEzD,GAApB;;MAEA,IAAI/E,QAAQ,IAAI+E,GAAhB,EAAqB;QACnB,IAAMrF,OAAO,GAAGmH,cAAY6B,wBAAZ,CAAqC3D,GAArC,EAA0CsD,KAA1C,EAAiDf,QAAjD,EAA2DtH,QAA3D,CAAhB;;QAEA,OAAO,KAAKJ,cAAL,CAAoB+I,cAApB,CAAmCjJ,OAAnC,CAAP;MACD;;MAED,OAAO,iBAAQkH,MAAR,CAAe,IAAIgC,KAAJ,CAAU,4HAAV,CAAf,CAAP;IACD;;;EArwBkCC,+B"}
|
package/dist/members/request.js
CHANGED
|
@@ -132,6 +132,17 @@ var MembersRequest = /*#__PURE__*/function (_StatelessWebexPlugin) {
|
|
|
132
132
|
return this.request(requestParams);
|
|
133
133
|
}
|
|
134
134
|
}, {
|
|
135
|
+
key: "lowerAllHandsMember",
|
|
136
|
+
value: function lowerAllHandsMember(options) {
|
|
137
|
+
if (!options || !options.locusUrl || !options.requestingParticipantId) {
|
|
138
|
+
throw new _parameter.default('requestingParticipantId must be defined, and the associated locus url for this meeting object must be defined.');
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
var requestParams = _util.default.getLowerAllHandsMemberRequestParams(options);
|
|
142
|
+
|
|
143
|
+
return this.request(requestParams);
|
|
144
|
+
}
|
|
145
|
+
}, {
|
|
135
146
|
key: "transferHostToMember",
|
|
136
147
|
value: function transferHostToMember(options) {
|
|
137
148
|
if (!options || !options.locusUrl || !options.memberId || !options.moderator) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["MembersRequest","MEETINGS","options","invitee","emailAddress","email","phoneNumber","locusUrl","ParameterError","requestParams","MembersUtil","getAddMemberRequestParams","request","memberIds","getAdmitMemberRequestParams","memberId","getRemoveMemberRequestParams","getMuteMemberRequestParams","getRaiseHandMemberRequestParams","moderator","getTransferHostToMemberRequestParams","url","tones","generateSendDTMFRequestParams","generateCancelInviteRequestParams","StatelessWebexPlugin"],"sources":["request.js"],"sourcesContent":["import {StatelessWebexPlugin} from '@webex/webex-core';\n\nimport {MEETINGS} from '../constants';\nimport ParameterError from '../common/errors/parameter';\n\nimport MembersUtil from './util';\n\n\n/**\n * @class MembersRequest\n */\nexport default class MembersRequest extends StatelessWebexPlugin {\n namespace = MEETINGS;\n\n /**\n *\n * @param {Object} options with format of {invitee: string, locusUrl: string}\n * @returns {Promise}\n * @throws {Error} if the options are not valid and complete, must have invitee with emailAddress OR email AND locusUrl\n * @memberof MembersRequest\n */\n addMembers(options) {\n if (!(!options || !options.invitee || (!options.invitee.emailAddress || !options.invitee.email || !options.invitee.phoneNumber) || !options.locusUrl)) {\n throw new ParameterError('invitee must be passed and the associated locus url for this meeting object must be defined.');\n }\n const requestParams = MembersUtil.getAddMemberRequestParams(options);\n\n return this.request(requestParams);\n }\n\n /**\n *\n * @param {Object} options\n * @returns {Promise}\n * @throws {Error} if the options are not valid and complete, must have memberIds AND locusUrl\n * @memberof MembersRequest\n */\n admitMember(options) {\n if (!options || !options.locusUrl || !options.memberIds) {\n throw new ParameterError('memberIds must be an array passed and the associated locus url for this meeting object must be defined.');\n }\n const requestParams = MembersUtil.getAdmitMemberRequestParams(options);\n\n return this.request(requestParams);\n }\n\n removeMember(options) {\n if (!options || !options.locusUrl || !options.memberId) {\n throw new ParameterError('memberId must be defined, and the associated locus url for this meeting object must be defined.');\n }\n\n const requestParams = MembersUtil.getRemoveMemberRequestParams(options);\n\n return this.request(requestParams);\n }\n\n muteMember(options) {\n if (!options || !options.locusUrl || !options.memberId) {\n throw new ParameterError('memberId must be defined, and the associated locus url for this meeting object must be defined.');\n }\n\n const requestParams = MembersUtil.getMuteMemberRequestParams(options);\n\n return this.request(requestParams);\n }\n\n raiseOrLowerHandMember(options) {\n if (!options || !options.locusUrl || !options.memberId) {\n throw new ParameterError('memberId must be defined, and the associated locus url for this meeting object must be defined.');\n }\n\n const requestParams = MembersUtil.getRaiseHandMemberRequestParams(options);\n\n return this.request(requestParams);\n }\n\n transferHostToMember(options) {\n if (!options || !options.locusUrl || !options.memberId || !options.moderator) {\n throw new ParameterError('memberId must be defined, the associated locus url, and the moderator for this meeting object must be defined.');\n }\n\n const requestParams = MembersUtil.getTransferHostToMemberRequestParams(options);\n\n return this.request(requestParams);\n }\n\n /**\n * Sends a request to the DTMF endpoint to send tones\n * @param {Object} options\n * @param {String} options.locusUrl\n * @param {String} options.url device url SIP user\n * @param {String} options.tones a string of one or more DTMF tones to send\n * @param {String} options.memberId ID of PSTN user\n * @returns {Promise}\n */\n sendDialPadKey(options) {\n if (!options || !options.locusUrl || !options.memberId || !options.url || !options.tones && options.tones !== 0) {\n throw new ParameterError('memberId must be defined, the associated locus url, the device url and DTMF tones for this meeting object must be defined.');\n }\n\n const requestParams = MembersUtil.generateSendDTMFRequestParams(options);\n\n return this.request(requestParams);\n }\n\n /**\n * @param {Object} options with format of {invitee: string, locusUrl: string}\n * @returns {Promise}\n * @throws {Error} if the options are not valid and complete, must have invitee with emailAddress OR email AND locusUrl\n * @memberof MembersRequest\n */\n cancelPhoneInvite(options) {\n if (!(options?.invitee?.phoneNumber || options?.locusUrl)) {\n throw new ParameterError('invitee must be passed and the associated locus url for this meeting object must be defined.');\n }\n\n const requestParams = MembersUtil.generateCancelInviteRequestParams(options);\n\n return this.request(requestParams);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AAEA;;AACA;;AAEA;;;;;;AAGA;AACA;AACA;IACqBA,c;;;;;;;;;;;;;;;4FACPC,mB;;;;;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ACtD,MAAM,IAAIP,kBAAJ,CAAmB,iGAAnB,CAAN;MACD;;MAED,IAAMC,aAAa,GAAGC,cAAYO,0BAAZ,CAAuCf,OAAvC,CAAtB;;MAEA,OAAO,KAAKU,OAAL,CAAaH,aAAb,CAAP;IACD;;;WAED,gCAAuBP,OAAvB,EAAgC;MAC9B,IAAI,CAACA,OAAD,IAAY,CAACA,OAAO,CAACK,QAArB,IAAiC,CAACL,OAAO,CAACa,QAA9C,EAAwD;QACtD,MAAM,IAAIP,kBAAJ,CAAmB,iGAAnB,CAAN;MACD;;MAED,IAAMC,aAAa,GAAGC,cAAYQ,+BAAZ,CAA4ChB,OAA5C,CAAtB;;MAEA,OAAO,KAAKU,OAAL,CAAaH,aAAb,CAAP;IACD;;;WAED,8BAAqBP,OAArB,EAA8B;MAC5B,IAAI,CAACA,OAAD,IAAY,CAACA,OAAO,CAACK,QAArB,IAAiC,CAACL,OAAO,CAACa,QAA1C,IAAsD,CAACb,OAAO,
|
|
1
|
+
{"version":3,"names":["MembersRequest","MEETINGS","options","invitee","emailAddress","email","phoneNumber","locusUrl","ParameterError","requestParams","MembersUtil","getAddMemberRequestParams","request","memberIds","getAdmitMemberRequestParams","memberId","getRemoveMemberRequestParams","getMuteMemberRequestParams","getRaiseHandMemberRequestParams","requestingParticipantId","getLowerAllHandsMemberRequestParams","moderator","getTransferHostToMemberRequestParams","url","tones","generateSendDTMFRequestParams","generateCancelInviteRequestParams","StatelessWebexPlugin"],"sources":["request.js"],"sourcesContent":["import {StatelessWebexPlugin} from '@webex/webex-core';\n\nimport {MEETINGS} from '../constants';\nimport ParameterError from '../common/errors/parameter';\n\nimport MembersUtil from './util';\n\n\n/**\n * @class MembersRequest\n */\nexport default class MembersRequest extends StatelessWebexPlugin {\n namespace = MEETINGS;\n\n /**\n *\n * @param {Object} options with format of {invitee: string, locusUrl: string}\n * @returns {Promise}\n * @throws {Error} if the options are not valid and complete, must have invitee with emailAddress OR email AND locusUrl\n * @memberof MembersRequest\n */\n addMembers(options) {\n if (!(!options || !options.invitee || (!options.invitee.emailAddress || !options.invitee.email || !options.invitee.phoneNumber) || !options.locusUrl)) {\n throw new ParameterError('invitee must be passed and the associated locus url for this meeting object must be defined.');\n }\n const requestParams = MembersUtil.getAddMemberRequestParams(options);\n\n return this.request(requestParams);\n }\n\n /**\n *\n * @param {Object} options\n * @returns {Promise}\n * @throws {Error} if the options are not valid and complete, must have memberIds AND locusUrl\n * @memberof MembersRequest\n */\n admitMember(options) {\n if (!options || !options.locusUrl || !options.memberIds) {\n throw new ParameterError('memberIds must be an array passed and the associated locus url for this meeting object must be defined.');\n }\n const requestParams = MembersUtil.getAdmitMemberRequestParams(options);\n\n return this.request(requestParams);\n }\n\n removeMember(options) {\n if (!options || !options.locusUrl || !options.memberId) {\n throw new ParameterError('memberId must be defined, and the associated locus url for this meeting object must be defined.');\n }\n\n const requestParams = MembersUtil.getRemoveMemberRequestParams(options);\n\n return this.request(requestParams);\n }\n\n muteMember(options) {\n if (!options || !options.locusUrl || !options.memberId) {\n throw new ParameterError('memberId must be defined, and the associated locus url for this meeting object must be defined.');\n }\n\n const requestParams = MembersUtil.getMuteMemberRequestParams(options);\n\n return this.request(requestParams);\n }\n\n raiseOrLowerHandMember(options) {\n if (!options || !options.locusUrl || !options.memberId) {\n throw new ParameterError('memberId must be defined, and the associated locus url for this meeting object must be defined.');\n }\n\n const requestParams = MembersUtil.getRaiseHandMemberRequestParams(options);\n\n return this.request(requestParams);\n }\n\n lowerAllHandsMember(options) {\n if (!options || !options.locusUrl || !options.requestingParticipantId) {\n throw new ParameterError('requestingParticipantId must be defined, and the associated locus url for this meeting object must be defined.');\n }\n\n const requestParams = MembersUtil.getLowerAllHandsMemberRequestParams(options);\n\n return this.request(requestParams);\n }\n\n transferHostToMember(options) {\n if (!options || !options.locusUrl || !options.memberId || !options.moderator) {\n throw new ParameterError('memberId must be defined, the associated locus url, and the moderator for this meeting object must be defined.');\n }\n\n const requestParams = MembersUtil.getTransferHostToMemberRequestParams(options);\n\n return this.request(requestParams);\n }\n\n /**\n * Sends a request to the DTMF endpoint to send tones\n * @param {Object} options\n * @param {String} options.locusUrl\n * @param {String} options.url device url SIP user\n * @param {String} options.tones a string of one or more DTMF tones to send\n * @param {String} options.memberId ID of PSTN user\n * @returns {Promise}\n */\n sendDialPadKey(options) {\n if (!options || !options.locusUrl || !options.memberId || !options.url || !options.tones && options.tones !== 0) {\n throw new ParameterError('memberId must be defined, the associated locus url, the device url and DTMF tones for this meeting object must be defined.');\n }\n\n const requestParams = MembersUtil.generateSendDTMFRequestParams(options);\n\n return this.request(requestParams);\n }\n\n /**\n * @param {Object} options with format of {invitee: string, locusUrl: string}\n * @returns {Promise}\n * @throws {Error} if the options are not valid and complete, must have invitee with emailAddress OR email AND locusUrl\n * @memberof MembersRequest\n */\n cancelPhoneInvite(options) {\n if (!(options?.invitee?.phoneNumber || options?.locusUrl)) {\n throw new ParameterError('invitee must be passed and the associated locus url for this meeting object must be defined.');\n }\n\n const requestParams = MembersUtil.generateCancelInviteRequestParams(options);\n\n return this.request(requestParams);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AAEA;;AACA;;AAEA;;;;;;AAGA;AACA;AACA;IACqBA,c;;;;;;;;;;;;;;;4FACPC,mB;;;;;;;IAEZ;AACF;AACA;AACA;AACA;AACA;AACA;IACE,oBAAWC,OAAX,EAAoB;MAClB,IAAI,EAAE,CAACA,OAAD,IAAY,CAACA,OAAO,CAACC,OAArB,IAAiC,CAACD,OAAO,CAACC,OAAR,CAAgBC,YAAjB,IAAiC,CAACF,OAAO,CAACC,OAAR,CAAgBE,KAAlD,IAA2D,CAACH,OAAO,CAACC,OAAR,CAAgBG,WAA7G,IAA6H,CAACJ,OAAO,CAACK,QAAxI,CAAJ,EAAuJ;QACrJ,MAAM,IAAIC,kBAAJ,CAAmB,8FAAnB,CAAN;MACD;;MACD,IAAMC,aAAa,GAAGC,cAAYC,yBAAZ,CAAsCT,OAAtC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,WAAP,wBAAAA,OAAO,CAAEC,OAAT,8DAAkBG,WAAlB,IAAiCJ,OAAjC,aAAiCA,OAAjC,eAAiCA,OAAO,CAAEK,QAA5C,CAAJ,EAA2D;QACzD,MAAM,IAAIC,kBAAJ,CAAmB,8FAAnB,CAAN;MACD;;MAED,IAAMC,aAAa,GAAGC,cAAYgB,iCAAZ,CAA8CxB,OAA9C,CAAtB;;MAEA,OAAO,KAAKU,OAAL,CAAaH,aAAb,CAAP;IACD;;;EAtHyCkB,+B"}
|
package/dist/members/util.js
CHANGED
|
@@ -156,6 +156,13 @@ MembersUtil.generateRaiseHandMemberOptions = function (memberId, status, locusUr
|
|
|
156
156
|
};
|
|
157
157
|
};
|
|
158
158
|
|
|
159
|
+
MembersUtil.generateLowerAllHandsMemberOptions = function (requestingParticipantId, locusUrl) {
|
|
160
|
+
return {
|
|
161
|
+
requestingParticipantId: requestingParticipantId,
|
|
162
|
+
locusUrl: locusUrl
|
|
163
|
+
};
|
|
164
|
+
};
|
|
165
|
+
|
|
159
166
|
MembersUtil.getMuteMemberRequestParams = function (options) {
|
|
160
167
|
var body = {
|
|
161
168
|
audio: {
|
|
@@ -184,6 +191,21 @@ MembersUtil.getRaiseHandMemberRequestParams = function (options) {
|
|
|
184
191
|
};
|
|
185
192
|
};
|
|
186
193
|
|
|
194
|
+
MembersUtil.getLowerAllHandsMemberRequestParams = function (options) {
|
|
195
|
+
var body = {
|
|
196
|
+
hand: {
|
|
197
|
+
raised: false
|
|
198
|
+
},
|
|
199
|
+
requestingParticipantId: options.requestingParticipantId
|
|
200
|
+
};
|
|
201
|
+
var uri = "".concat(options.locusUrl, "/").concat(_constants.CONTROLS);
|
|
202
|
+
return {
|
|
203
|
+
method: _constants.HTTP_VERBS.PATCH,
|
|
204
|
+
uri: uri,
|
|
205
|
+
body: body
|
|
206
|
+
};
|
|
207
|
+
};
|
|
208
|
+
|
|
187
209
|
MembersUtil.getTransferHostToMemberRequestParams = function (options) {
|
|
188
210
|
var body = {
|
|
189
211
|
role: {
|
package/dist/members/util.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["MembersUtil","generateAddMemberOptions","invitee","locusUrl","alertIfActive","generateAdmitMemberOptions","memberIds","getAddMemberBody","options","invitees","address","emailAddress","email","phoneNumber","getAdmitMemberRequestBody","admit","participantIds","getAdmitMemberRequestParams","format","body","uri","CONTROLS","method","HTTP_VERBS","PUT","getAddMemberRequestParams","requestParams","isInvalidInvitee","DIALER_REGEX","E164_FORMAT","test","VALID_EMAIL_ADDRESS","getRemoveMemberRequestParams","reason","PARTICIPANT","memberId","LEAVE","generateTransferHostMemberOptions","transfer","moderator","generateRemoveMemberOptions","removal","_FORCED_","generateMuteMemberOptions","status","muted","generateRaiseHandMemberOptions","raised","getMuteMemberRequestParams","audio","PATCH","getRaiseHandMemberRequestParams","hand","getTransferHostToMemberRequestParams","role","genderateSendDTMFOptions","url","tones","generateSendDTMFRequestParams","device","dtmf","correlationId","uuid","v4","direction","SEND_DTMF_ENDPOINT","POST","cancelPhoneInviteOptions","generateCancelInviteRequestParams","actionType","_REMOVE_"],"sources":["util.js"],"sourcesContent":["import uuid from 'uuid';\n\nimport {\n HTTP_VERBS,\n CONTROLS,\n _FORCED_,\n LEAVE,\n PARTICIPANT,\n VALID_EMAIL_ADDRESS,\n DIALER_REGEX,\n SEND_DTMF_ENDPOINT,\n _REMOVE_\n} from '../constants';\n\nconst MembersUtil = {};\n\n/**\n * @param {Object} invitee with emailAddress, email or phoneNumber\n * @param {String} locusUrl\n * @param {Boolean} alertIfActive\n * @returns {Object} the format object\n */\nMembersUtil.generateAddMemberOptions = (invitee, locusUrl, alertIfActive) => ({\n invitee,\n locusUrl,\n alertIfActive\n});\n\n/**\n * @param {Array} memberIds\n * @param {String} locusUrl\n * @returns {Object} the format object\n */\nMembersUtil.generateAdmitMemberOptions = (memberIds, locusUrl) => ({\n locusUrl,\n memberIds\n});\n\n/**\n * @param {Object} options with {invitee: {emailAddress, email, phoneNumber}, alertIfActive}\n * @returns {Object} with {invitees: [{address}], alertIfActive}\n */\nMembersUtil.getAddMemberBody = (options) => ({\n invitees: [\n {\n address: options.invitee.emailAddress || options.invitee.email || options.invitee.phoneNumber\n }\n ],\n alertIfActive: options.alertIfActive\n});\n\n/**\n * @param {Object} options with {memberIds}\n * @returns {Object} admit with {memberIds}\n */\nMembersUtil.getAdmitMemberRequestBody = (options) => ({\n admit: {participantIds: options.memberIds}\n});\n\n/**\n * @param {Object} format with {memberIds, locusUrl}\n * @returns {Object} the request parameters (method, uri, body) needed to make a admitMember request\n */\nMembersUtil.getAdmitMemberRequestParams = (format) => {\n const body = MembersUtil.getAdmitMemberRequestBody(format);\n const uri = `${format.locusUrl}/${CONTROLS}`;\n\n return {\n method: HTTP_VERBS.PUT,\n uri,\n body\n };\n};\n\n/**\n * @param {Object} format with {invitee {emailAddress, email, phoneNumber}, locusUrl, alertIfActive}\n * @returns {Object} the request parameters (method, uri, body) needed to make a addMember request\n */\nMembersUtil.getAddMemberRequestParams = (format) => {\n const body = MembersUtil.getAddMemberBody(format);\n const requestParams = {\n method: HTTP_VERBS.PUT,\n uri: format.locusUrl,\n body\n };\n\n return requestParams;\n};\n\nMembersUtil.isInvalidInvitee = (invitee) => {\n if (!(invitee && (invitee.email || invitee.emailAddress || invitee.phoneNumber))) {\n return true;\n }\n\n if (invitee.phoneNumber) {\n return !DIALER_REGEX.E164_FORMAT.test(invitee.phoneNumber);\n }\n\n return !VALID_EMAIL_ADDRESS.test(invitee.email || invitee.emailAddress);\n};\n\nMembersUtil.getRemoveMemberRequestParams = (options) => {\n const body = {\n reason: options.reason\n };\n const uri = `${options.locusUrl}/${PARTICIPANT}/${options.memberId}/${LEAVE}`;\n\n return {\n method: HTTP_VERBS.PUT,\n uri,\n body\n };\n};\n\nMembersUtil.generateTransferHostMemberOptions = (transfer, moderator, locusUrl) => ({\n moderator,\n locusUrl,\n memberId: transfer\n});\n\nMembersUtil.generateRemoveMemberOptions = (removal, locusUrl) => ({\n reason: _FORCED_,\n memberId: removal,\n locusUrl\n});\n\nMembersUtil.generateMuteMemberOptions = (memberId, status, locusUrl) => ({\n memberId,\n muted: status,\n locusUrl\n});\n\nMembersUtil.generateRaiseHandMemberOptions = (memberId, status, locusUrl) => ({\n memberId,\n raised: status,\n locusUrl\n});\n\nMembersUtil.getMuteMemberRequestParams = (options) => {\n const body = {\n audio: {\n muted: options.muted\n }\n };\n const uri = `${options.locusUrl}/${PARTICIPANT}/${options.memberId}/${CONTROLS}`;\n\n return {\n method: HTTP_VERBS.PATCH,\n uri,\n body\n };\n};\n\nMembersUtil.getRaiseHandMemberRequestParams = (options) => {\n const body = {\n hand: {\n raised: options.raised\n }\n };\n const uri = `${options.locusUrl}/${PARTICIPANT}/${options.memberId}/${CONTROLS}`;\n\n return {\n method: HTTP_VERBS.PATCH,\n uri,\n body\n };\n};\n\nMembersUtil.getTransferHostToMemberRequestParams = (options) => {\n const body = {\n role: {\n moderator: options.moderator\n }\n };\n const uri = `${options.locusUrl}/${PARTICIPANT}/${options.memberId}/${CONTROLS}`;\n\n return {\n method: HTTP_VERBS.PATCH,\n uri,\n body\n };\n};\n\nMembersUtil.genderateSendDTMFOptions = (url, tones, memberId, locusUrl) => ({\n url,\n tones,\n memberId,\n locusUrl\n});\n\nMembersUtil.generateSendDTMFRequestParams = ({\n url, tones, memberId, locusUrl\n}) => {\n const body = {\n device: {\n url\n },\n memberId,\n dtmf: {\n correlationId: uuid.v4(),\n tones,\n direction: 'transmit'\n }\n };\n const uri = `${locusUrl}/${PARTICIPANT}/${memberId}/${SEND_DTMF_ENDPOINT}`;\n\n return {\n method: HTTP_VERBS.POST,\n uri,\n body\n };\n};\n\nMembersUtil.cancelPhoneInviteOptions = (invitee, locusUrl) => ({\n invitee,\n locusUrl\n});\n\nMembersUtil.generateCancelInviteRequestParams = (options) => {\n const body = {\n actionType: _REMOVE_,\n invitees: [\n {\n address: options.invitee.phoneNumber\n }\n ]\n };\n const requestParams = {\n method: HTTP_VERBS.PUT,\n uri: options.locusUrl,\n body\n };\n\n return requestParams;\n};\n\nexport default MembersUtil;\n"],"mappings":";;;;;;;;;;;;AAAA;;AAEA;;AAYA,IAAMA,WAAW,GAAG,EAApB;AAEA;AACA;AACA;AACA;AACA;AACA;;AACAA,WAAW,CAACC,wBAAZ,GAAuC,UAACC,OAAD,EAAUC,QAAV,EAAoBC,aAApB;EAAA,OAAuC;IAC5EF,OAAO,EAAPA,OAD4E;IAE5EC,QAAQ,EAARA,QAF4E;IAG5EC,aAAa,EAAbA;EAH4E,CAAvC;AAAA,CAAvC;AAMA;AACA;AACA;AACA;AACA;;;AACAJ,WAAW,CAACK,0BAAZ,GAAyC,UAACC,SAAD,EAAYH,QAAZ;EAAA,OAA0B;IACjEA,QAAQ,EAARA,QADiE;IAEjEG,SAAS,EAATA;EAFiE,CAA1B;AAAA,CAAzC;AAKA;AACA;AACA;AACA;;;AACAN,WAAW,CAACO,gBAAZ,GAA+B,UAACC,OAAD;EAAA,OAAc;IAC3CC,QAAQ,EAAE,CACR;MACEC,OAAO,EAAEF,OAAO,CAACN,OAAR,CAAgBS,YAAhB,IAAgCH,OAAO,CAACN,OAAR,CAAgBU,KAAhD,IAAyDJ,OAAO,CAACN,OAAR,CAAgBW;IADpF,CADQ,CADiC;IAM3CT,aAAa,EAAEI,OAAO,CAACJ;EANoB,CAAd;AAAA,CAA/B;AASA;AACA;AACA;AACA;;;AACAJ,WAAW,CAACc,yBAAZ,GAAwC,UAACN,OAAD;EAAA,OAAc;IACpDO,KAAK,EAAE;MAACC,cAAc,EAAER,OAAO,CAACF;IAAzB;EAD6C,CAAd;AAAA,CAAxC;AAIA;AACA;AACA;AACA;;;AACAN,WAAW,CAACiB,2BAAZ,GAA0C,UAACC,MAAD,EAAY;EACpD,IAAMC,IAAI,GAAGnB,WAAW,CAACc,yBAAZ,CAAsCI,MAAtC,CAAb;EACA,IAAME,GAAG,aAAMF,MAAM,CAACf,QAAb,cAAyBkB,mBAAzB,CA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AQ,EAARA,QAJW;IAKXyB,IAAI,EAAE;MACJC,aAAa,EAAEC,cAAKC,EAAL,EADX;MAEJN,KAAK,EAALA,KAFI;MAGJO,SAAS,EAAE;IAHP;EALK,CAAb;EAWA,IAAM5C,GAAG,aAAMjB,QAAN,cAAkB+B,sBAAlB,cAAiCC,QAAjC,cAA6C8B,6BAA7C,CAAT;EAEA,OAAO;IACL3C,MAAM,EAAEC,sBAAW2C,IADd;IAEL9C,GAAG,EAAHA,GAFK;IAGLD,IAAI,EAAJA;EAHK,CAAP;AAKD,CArBD;;AAuBAnB,WAAW,CAACmE,wBAAZ,GAAuC,UAACjE,OAAD,EAAUC,QAAV;EAAA,OAAwB;IAC7DD,OAAO,EAAPA,OAD6D;IAE7DC,QAAQ,EAARA;EAF6D,CAAxB;AAAA,CAAvC;;AAKAH,WAAW,CAACoE,iCAAZ,GAAgD,UAAC5D,OAAD,EAAa;EAC3D,IAAMW,IAAI,GAAG;IACXkD,UAAU,EAAEC,mBADD;IAEX7D,QAAQ,EAAE,CACR;MACEC,OAAO,EAAEF,OAAO,CAACN,OAAR,CAAgBW;IAD3B,CADQ;EAFC,CAAb;EAQA,IAAMa,aAAa,GAAG;IACpBJ,MAAM,EAAEC,sBAAWC,GADC;IAEpBJ,GAAG,EAAEZ,OAAO,CAACL,QAFO;IAGpBgB,IAAI,EAAJA;EAHoB,CAAtB;EAMA,OAAOO,aAAP;AACD,CAhBD;;eAkBe1B,W"}
|
|
1
|
+
{"version":3,"names":["MembersUtil","generateAddMemberOptions","invitee","locusUrl","alertIfActive","generateAdmitMemberOptions","memberIds","getAddMemberBody","options","invitees","address","emailAddress","email","phoneNumber","getAdmitMemberRequestBody","admit","participantIds","getAdmitMemberRequestParams","format","body","uri","CONTROLS","method","HTTP_VERBS","PUT","getAddMemberRequestParams","requestParams","isInvalidInvitee","DIALER_REGEX","E164_FORMAT","test","VALID_EMAIL_ADDRESS","getRemoveMemberRequestParams","reason","PARTICIPANT","memberId","LEAVE","generateTransferHostMemberOptions","transfer","moderator","generateRemoveMemberOptions","removal","_FORCED_","generateMuteMemberOptions","status","muted","generateRaiseHandMemberOptions","raised","generateLowerAllHandsMemberOptions","requestingParticipantId","getMuteMemberRequestParams","audio","PATCH","getRaiseHandMemberRequestParams","hand","getLowerAllHandsMemberRequestParams","getTransferHostToMemberRequestParams","role","genderateSendDTMFOptions","url","tones","generateSendDTMFRequestParams","device","dtmf","correlationId","uuid","v4","direction","SEND_DTMF_ENDPOINT","POST","cancelPhoneInviteOptions","generateCancelInviteRequestParams","actionType","_REMOVE_"],"sources":["util.js"],"sourcesContent":["import uuid from 'uuid';\n\nimport {\n HTTP_VERBS,\n CONTROLS,\n _FORCED_,\n LEAVE,\n PARTICIPANT,\n VALID_EMAIL_ADDRESS,\n DIALER_REGEX,\n SEND_DTMF_ENDPOINT,\n _REMOVE_\n} from '../constants';\n\nconst MembersUtil = {};\n\n/**\n * @param {Object} invitee with emailAddress, email or phoneNumber\n * @param {String} locusUrl\n * @param {Boolean} alertIfActive\n * @returns {Object} the format object\n */\nMembersUtil.generateAddMemberOptions = (invitee, locusUrl, alertIfActive) => ({\n invitee,\n locusUrl,\n alertIfActive\n});\n\n/**\n * @param {Array} memberIds\n * @param {String} locusUrl\n * @returns {Object} the format object\n */\nMembersUtil.generateAdmitMemberOptions = (memberIds, locusUrl) => ({\n locusUrl,\n memberIds\n});\n\n/**\n * @param {Object} options with {invitee: {emailAddress, email, phoneNumber}, alertIfActive}\n * @returns {Object} with {invitees: [{address}], alertIfActive}\n */\nMembersUtil.getAddMemberBody = (options) => ({\n invitees: [\n {\n address: options.invitee.emailAddress || options.invitee.email || options.invitee.phoneNumber\n }\n ],\n alertIfActive: options.alertIfActive\n});\n\n/**\n * @param {Object} options with {memberIds}\n * @returns {Object} admit with {memberIds}\n */\nMembersUtil.getAdmitMemberRequestBody = (options) => ({\n admit: {participantIds: options.memberIds}\n});\n\n/**\n * @param {Object} format with {memberIds, locusUrl}\n * @returns {Object} the request parameters (method, uri, body) needed to make a admitMember request\n */\nMembersUtil.getAdmitMemberRequestParams = (format) => {\n const body = MembersUtil.getAdmitMemberRequestBody(format);\n const uri = `${format.locusUrl}/${CONTROLS}`;\n\n return {\n method: HTTP_VERBS.PUT,\n uri,\n body\n };\n};\n\n/**\n * @param {Object} format with {invitee {emailAddress, email, phoneNumber}, locusUrl, alertIfActive}\n * @returns {Object} the request parameters (method, uri, body) needed to make a addMember request\n */\nMembersUtil.getAddMemberRequestParams = (format) => {\n const body = MembersUtil.getAddMemberBody(format);\n const requestParams = {\n method: HTTP_VERBS.PUT,\n uri: format.locusUrl,\n body\n };\n\n return requestParams;\n};\n\nMembersUtil.isInvalidInvitee = (invitee) => {\n if (!(invitee && (invitee.email || invitee.emailAddress || invitee.phoneNumber))) {\n return true;\n }\n\n if (invitee.phoneNumber) {\n return !DIALER_REGEX.E164_FORMAT.test(invitee.phoneNumber);\n }\n\n return !VALID_EMAIL_ADDRESS.test(invitee.email || invitee.emailAddress);\n};\n\nMembersUtil.getRemoveMemberRequestParams = (options) => {\n const body = {\n reason: options.reason\n };\n const uri = `${options.locusUrl}/${PARTICIPANT}/${options.memberId}/${LEAVE}`;\n\n return {\n method: HTTP_VERBS.PUT,\n uri,\n body\n };\n};\n\nMembersUtil.generateTransferHostMemberOptions = (transfer, moderator, locusUrl) => ({\n moderator,\n locusUrl,\n memberId: transfer\n});\n\nMembersUtil.generateRemoveMemberOptions = (removal, locusUrl) => ({\n reason: _FORCED_,\n memberId: removal,\n locusUrl\n});\n\nMembersUtil.generateMuteMemberOptions = (memberId, status, locusUrl) => ({\n memberId,\n muted: status,\n locusUrl\n});\n\nMembersUtil.generateRaiseHandMemberOptions = (memberId, status, locusUrl) => ({\n memberId,\n raised: status,\n locusUrl\n});\n\nMembersUtil.generateLowerAllHandsMemberOptions = (requestingParticipantId, locusUrl) => ({\n requestingParticipantId,\n locusUrl\n});\n\nMembersUtil.getMuteMemberRequestParams = (options) => {\n const body = {\n audio: {\n muted: options.muted\n }\n };\n const uri = `${options.locusUrl}/${PARTICIPANT}/${options.memberId}/${CONTROLS}`;\n\n return {\n method: HTTP_VERBS.PATCH,\n uri,\n body\n };\n};\n\nMembersUtil.getRaiseHandMemberRequestParams = (options) => {\n const body = {\n hand: {\n raised: options.raised\n }\n };\n const uri = `${options.locusUrl}/${PARTICIPANT}/${options.memberId}/${CONTROLS}`;\n\n return {\n method: HTTP_VERBS.PATCH,\n uri,\n body\n };\n};\n\nMembersUtil.getLowerAllHandsMemberRequestParams = (options) => {\n const body = {\n hand: {\n raised: false\n },\n requestingParticipantId: options.requestingParticipantId\n };\n const uri = `${options.locusUrl}/${CONTROLS}`;\n\n return {\n method: HTTP_VERBS.PATCH,\n uri,\n body\n };\n};\n\nMembersUtil.getTransferHostToMemberRequestParams = (options) => {\n const body = {\n role: {\n moderator: options.moderator\n }\n };\n const uri = `${options.locusUrl}/${PARTICIPANT}/${options.memberId}/${CONTROLS}`;\n\n return {\n method: HTTP_VERBS.PATCH,\n uri,\n body\n };\n};\n\nMembersUtil.genderateSendDTMFOptions = (url, tones, memberId, locusUrl) => ({\n url,\n tones,\n memberId,\n locusUrl\n});\n\nMembersUtil.generateSendDTMFRequestParams = ({\n url, tones, memberId, locusUrl\n}) => {\n const body = {\n device: {\n url\n },\n memberId,\n dtmf: {\n correlationId: uuid.v4(),\n tones,\n direction: 'transmit'\n }\n };\n const uri = `${locusUrl}/${PARTICIPANT}/${memberId}/${SEND_DTMF_ENDPOINT}`;\n\n return {\n method: HTTP_VERBS.POST,\n uri,\n body\n };\n};\n\nMembersUtil.cancelPhoneInviteOptions = (invitee, locusUrl) => ({\n invitee,\n locusUrl\n});\n\nMembersUtil.generateCancelInviteRequestParams = (options) => {\n const body = {\n actionType: _REMOVE_,\n invitees: [\n {\n address: options.invitee.phoneNumber\n }\n ]\n };\n const requestParams = {\n method: HTTP_VERBS.PUT,\n uri: options.locusUrl,\n body\n };\n\n return requestParams;\n};\n\nexport default MembersUtil;\n"],"mappings":";;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GAAG,EAAEZ,OAAO,CAACL,QAFO;IAGpBgB,IAAI,EAAJA;EAHoB,CAAtB;EAMA,OAAOO,aAAP;AACD,CAhBD;;eAkBe1B,W"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webex/plugin-meetings",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.12.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"contributors": [
|
|
@@ -24,19 +24,19 @@
|
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@babel/runtime-corejs2": "^7.14.8",
|
|
27
|
-
"@webex/webex-core": "2.
|
|
28
|
-
"@webex/internal-plugin-mercury": "2.
|
|
29
|
-
"@webex/internal-plugin-conversation": "2.
|
|
27
|
+
"@webex/webex-core": "2.12.1",
|
|
28
|
+
"@webex/internal-plugin-mercury": "2.12.1",
|
|
29
|
+
"@webex/internal-plugin-conversation": "2.12.1",
|
|
30
30
|
"webrtc-adapter": "^7.7.0",
|
|
31
31
|
"lodash": "^4.17.21",
|
|
32
32
|
"uuid": "^3.3.2",
|
|
33
33
|
"global": "^4.4.0",
|
|
34
34
|
"ip-anonymize": "^0.1.0",
|
|
35
|
-
"@webex/common": "2.
|
|
35
|
+
"@webex/common": "2.12.1",
|
|
36
36
|
"bowser": "^2.11.0",
|
|
37
37
|
"sdp-transform": "^2.12.0",
|
|
38
38
|
"readable-stream": "^3.6.0",
|
|
39
|
-
"@webex/common-timers": "2.
|
|
39
|
+
"@webex/common-timers": "2.12.1",
|
|
40
40
|
"btoa": "^1.2.1",
|
|
41
41
|
"@webex/internal-media-core": "^0.0.4-beta",
|
|
42
42
|
"javascript-state-machine": "^3.1.0",
|
|
@@ -205,10 +205,12 @@ export default class MeetingInfoV2 {
|
|
|
205
205
|
if (directURI) options.directURI = directURI;
|
|
206
206
|
|
|
207
207
|
return this.webex.request(options)
|
|
208
|
-
.then(() => {
|
|
208
|
+
.then((response) => {
|
|
209
209
|
Metrics.sendBehavioralMetric(
|
|
210
210
|
BEHAVIORAL_METRICS.FETCH_MEETING_INFO_V1_SUCCESS
|
|
211
211
|
);
|
|
212
|
+
|
|
213
|
+
return response;
|
|
212
214
|
})
|
|
213
215
|
.catch((err) => {
|
|
214
216
|
if (err?.statusCode === 403) {
|
package/src/members/index.js
CHANGED
|
@@ -756,9 +756,29 @@ export default class Members extends StatelessWebexPlugin {
|
|
|
756
756
|
}
|
|
757
757
|
const options = MembersUtil.generateRaiseHandMemberOptions(memberId, raise, this.locusUrl);
|
|
758
758
|
|
|
759
|
-
return this.membersRequest.
|
|
759
|
+
return this.membersRequest.raiseOrLowerHandMember(options);
|
|
760
760
|
}
|
|
761
761
|
|
|
762
|
+
/**
|
|
763
|
+
* Lower all hands of members in a meeting
|
|
764
|
+
* @param {String} requestingMemberId - id of the participant which requested the lower all hands
|
|
765
|
+
* @returns {Promise}
|
|
766
|
+
* @public
|
|
767
|
+
* @memberof Members
|
|
768
|
+
*/
|
|
769
|
+
lowerAllHands(requestingMemberId) {
|
|
770
|
+
if (!this.locusUrl) {
|
|
771
|
+
return Promise.reject(new ParameterError('The associated locus url for this meetings members object must be defined.'));
|
|
772
|
+
}
|
|
773
|
+
if (!requestingMemberId) {
|
|
774
|
+
return Promise.reject(new ParameterError('The requestingMemberId must be defined to lower all hands in a meeting.'));
|
|
775
|
+
}
|
|
776
|
+
const options = MembersUtil.generateLowerAllHandsMemberOptions(requestingMemberId, this.locusUrl);
|
|
777
|
+
|
|
778
|
+
return this.membersRequest.lowerAllHandsMember(options);
|
|
779
|
+
}
|
|
780
|
+
|
|
781
|
+
|
|
762
782
|
/**
|
|
763
783
|
* Transfers the host to another member
|
|
764
784
|
* @param {String} memberId
|
package/src/members/request.js
CHANGED
|
@@ -74,6 +74,16 @@ export default class MembersRequest extends StatelessWebexPlugin {
|
|
|
74
74
|
return this.request(requestParams);
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
+
lowerAllHandsMember(options) {
|
|
78
|
+
if (!options || !options.locusUrl || !options.requestingParticipantId) {
|
|
79
|
+
throw new ParameterError('requestingParticipantId must be defined, and the associated locus url for this meeting object must be defined.');
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
const requestParams = MembersUtil.getLowerAllHandsMemberRequestParams(options);
|
|
83
|
+
|
|
84
|
+
return this.request(requestParams);
|
|
85
|
+
}
|
|
86
|
+
|
|
77
87
|
transferHostToMember(options) {
|
|
78
88
|
if (!options || !options.locusUrl || !options.memberId || !options.moderator) {
|
|
79
89
|
throw new ParameterError('memberId must be defined, the associated locus url, and the moderator for this meeting object must be defined.');
|
package/src/members/util.js
CHANGED
|
@@ -136,6 +136,11 @@ MembersUtil.generateRaiseHandMemberOptions = (memberId, status, locusUrl) => ({
|
|
|
136
136
|
locusUrl
|
|
137
137
|
});
|
|
138
138
|
|
|
139
|
+
MembersUtil.generateLowerAllHandsMemberOptions = (requestingParticipantId, locusUrl) => ({
|
|
140
|
+
requestingParticipantId,
|
|
141
|
+
locusUrl
|
|
142
|
+
});
|
|
143
|
+
|
|
139
144
|
MembersUtil.getMuteMemberRequestParams = (options) => {
|
|
140
145
|
const body = {
|
|
141
146
|
audio: {
|
|
@@ -166,6 +171,22 @@ MembersUtil.getRaiseHandMemberRequestParams = (options) => {
|
|
|
166
171
|
};
|
|
167
172
|
};
|
|
168
173
|
|
|
174
|
+
MembersUtil.getLowerAllHandsMemberRequestParams = (options) => {
|
|
175
|
+
const body = {
|
|
176
|
+
hand: {
|
|
177
|
+
raised: false
|
|
178
|
+
},
|
|
179
|
+
requestingParticipantId: options.requestingParticipantId
|
|
180
|
+
};
|
|
181
|
+
const uri = `${options.locusUrl}/${CONTROLS}`;
|
|
182
|
+
|
|
183
|
+
return {
|
|
184
|
+
method: HTTP_VERBS.PATCH,
|
|
185
|
+
uri,
|
|
186
|
+
body
|
|
187
|
+
};
|
|
188
|
+
};
|
|
189
|
+
|
|
169
190
|
MembersUtil.getTransferHostToMemberRequestParams = (options) => {
|
|
170
191
|
const body = {
|
|
171
192
|
role: {
|
|
@@ -88,10 +88,14 @@ describe('plugin-meetings', () => {
|
|
|
88
88
|
|
|
89
89
|
describe('#fetchMeetingInfo', () => {
|
|
90
90
|
it('should fetch meeting info for the destination type', async () => {
|
|
91
|
+
const body = {meetingKey: '1234323'};
|
|
92
|
+
const requestResponse = {statusCode: 200, body};
|
|
93
|
+
|
|
91
94
|
sinon.stub(MeetingInfoUtil, 'getDestinationType').returns(Promise.resolve({type: 'MEETING_ID', destination: '123456'}));
|
|
92
|
-
sinon.stub(MeetingInfoUtil, 'getRequestBody').returns(Promise.resolve(
|
|
95
|
+
sinon.stub(MeetingInfoUtil, 'getRequestBody').returns(Promise.resolve(body));
|
|
96
|
+
webex.request.resolves(requestResponse);
|
|
93
97
|
|
|
94
|
-
await meetingInfo.fetchMeetingInfo({
|
|
98
|
+
const result = await meetingInfo.fetchMeetingInfo({
|
|
95
99
|
type: _MEETING_ID_,
|
|
96
100
|
destination: '1234323'
|
|
97
101
|
});
|
|
@@ -99,28 +103,39 @@ describe('plugin-meetings', () => {
|
|
|
99
103
|
assert.calledWith(webex.request, {
|
|
100
104
|
method: 'POST', service: 'webex-appapi-service', resource: 'meetingInfo', body: {meetingKey: '1234323'}
|
|
101
105
|
});
|
|
106
|
+
assert.deepEqual(result, requestResponse);
|
|
102
107
|
|
|
103
108
|
MeetingInfoUtil.getDestinationType.restore();
|
|
104
109
|
MeetingInfoUtil.getRequestBody.restore();
|
|
105
110
|
});
|
|
111
|
+
|
|
106
112
|
it('should fetch meeting info for the personal meeting room type', async () => {
|
|
113
|
+
const body = {meetingKey: '1234323'};
|
|
114
|
+
const requestResponse = {statusCode: 200, body};
|
|
115
|
+
|
|
107
116
|
sinon.stub(MeetingInfoUtil, 'getDestinationType').returns(Promise.resolve({type: 'MEETING_ID', destination: '123456'}));
|
|
108
|
-
sinon.stub(MeetingInfoUtil, 'getRequestBody').returns(Promise.resolve(
|
|
117
|
+
sinon.stub(MeetingInfoUtil, 'getRequestBody').returns(Promise.resolve(body));
|
|
118
|
+
webex.request.resolves(requestResponse);
|
|
109
119
|
|
|
110
|
-
await meetingInfo.fetchMeetingInfo({
|
|
120
|
+
const result = await meetingInfo.fetchMeetingInfo({
|
|
111
121
|
type: _PERSONAL_ROOM_
|
|
112
122
|
});
|
|
113
123
|
|
|
114
124
|
assert.calledWith(webex.request, {
|
|
115
125
|
method: 'POST', service: 'webex-appapi-service', resource: 'meetingInfo', body: {meetingKey: '1234323'}
|
|
116
126
|
});
|
|
127
|
+
assert.deepEqual(result, requestResponse);
|
|
117
128
|
|
|
118
129
|
MeetingInfoUtil.getDestinationType.restore();
|
|
119
130
|
MeetingInfoUtil.getRequestBody.restore();
|
|
120
131
|
});
|
|
121
132
|
|
|
122
133
|
it('should fetch meeting info with provided password and captcha code', async () => {
|
|
123
|
-
|
|
134
|
+
const requestResponse = {statusCode: 200, body: {meetingKey: '1234323'}};
|
|
135
|
+
|
|
136
|
+
webex.request.resolves(requestResponse);
|
|
137
|
+
|
|
138
|
+
const result = await meetingInfo.fetchMeetingInfo('1234323', _MEETING_ID_, 'abc', {id: '999', code: 'aabbcc11'});
|
|
124
139
|
|
|
125
140
|
assert.calledWith(webex.request, {
|
|
126
141
|
method: 'POST',
|
|
@@ -134,6 +149,7 @@ describe('plugin-meetings', () => {
|
|
|
134
149
|
captchaVerifyCode: 'aabbcc11'
|
|
135
150
|
}
|
|
136
151
|
});
|
|
152
|
+
assert.deepEqual(result, requestResponse);
|
|
137
153
|
assert(Metrics.sendBehavioralMetric.calledOnce);
|
|
138
154
|
assert.calledWith(
|
|
139
155
|
Metrics.sendBehavioralMetric,
|
|
@@ -10,8 +10,9 @@ import chaiAsPromised from 'chai-as-promised';
|
|
|
10
10
|
import {Credentials} from '@webex/webex-core';
|
|
11
11
|
import Support from '@webex/internal-plugin-support';
|
|
12
12
|
import MockWebex from '@webex/test-helper-mock-webex';
|
|
13
|
-
import Meetings from '@webex/plugin-meetings';
|
|
14
13
|
|
|
14
|
+
import Meetings from '@webex/plugin-meetings';
|
|
15
|
+
import ParameterError from '@webex/plugin-meetings/src/common/errors/parameter';
|
|
15
16
|
import Members from '@webex/plugin-meetings/src/members';
|
|
16
17
|
import MembersUtil from '@webex/plugin-meetings/src/members/util';
|
|
17
18
|
|
|
@@ -191,25 +192,123 @@ describe('plugin-meetings', () => {
|
|
|
191
192
|
});
|
|
192
193
|
});
|
|
193
194
|
|
|
194
|
-
describe('#
|
|
195
|
-
|
|
196
|
-
const members = createMembers({url:
|
|
195
|
+
describe('#raiseOrLowerHand', () => {
|
|
196
|
+
const setup = (locusUrl) => {
|
|
197
|
+
const members = createMembers({url: locusUrl});
|
|
197
198
|
|
|
198
|
-
const
|
|
199
|
+
const spies = {
|
|
200
|
+
generateRaiseHandMemberOptions: sandbox.spy(MembersUtil, 'generateRaiseHandMemberOptions'),
|
|
201
|
+
raiseOrLowerHandMember: sandbox.spy(members.membersRequest, 'raiseOrLowerHandMember'),
|
|
202
|
+
};
|
|
203
|
+
|
|
204
|
+
return {members, spies};
|
|
205
|
+
};
|
|
199
206
|
|
|
200
|
-
|
|
201
|
-
|
|
207
|
+
const checkInvalid = async (resultPromise, expectedMessage, spies) => {
|
|
208
|
+
await assert.isRejected(resultPromise, ParameterError, expectedMessage);
|
|
209
|
+
assert.notCalled(spies.generateRaiseHandMemberOptions);
|
|
210
|
+
assert.notCalled(spies.raiseOrLowerHandMember);
|
|
211
|
+
};
|
|
202
212
|
|
|
203
|
-
|
|
213
|
+
const checkValid = async (resultPromise, spies, expectedMemberId, expectedRaise, expectedLocusUrl) => {
|
|
214
|
+
await assert.isFulfilled(resultPromise);
|
|
215
|
+
assert.calledOnceWithExactly(spies.generateRaiseHandMemberOptions, expectedMemberId, expectedRaise, expectedLocusUrl);
|
|
216
|
+
assert.calledOnceWithExactly(spies.raiseOrLowerHandMember, {memberId: expectedMemberId, raised: expectedRaise, locusUrl: expectedLocusUrl});
|
|
217
|
+
assert.strictEqual(resultPromise, spies.raiseOrLowerHandMember.getCall(0).returnValue);
|
|
218
|
+
};
|
|
204
219
|
|
|
205
|
-
|
|
206
|
-
|
|
220
|
+
it('should not make a request if there is no member id', async () => {
|
|
221
|
+
const {members, spies} = setup(url1);
|
|
222
|
+
|
|
223
|
+
const resultPromise = members.raiseOrLowerHand();
|
|
224
|
+
|
|
225
|
+
await checkInvalid(resultPromise, 'The member id must be defined to raise/lower the hand of the member.', spies);
|
|
207
226
|
});
|
|
208
227
|
|
|
209
|
-
it('should
|
|
210
|
-
const members =
|
|
228
|
+
it('should not make a request if there is no locus url', async () => {
|
|
229
|
+
const {members, spies} = setup();
|
|
230
|
+
|
|
231
|
+
const resultPromise = members.raiseOrLowerHand(uuid.v4());
|
|
232
|
+
|
|
233
|
+
await checkInvalid(resultPromise, 'The associated locus url for this meetings members object must be defined.', spies);
|
|
234
|
+
});
|
|
235
|
+
|
|
236
|
+
it('should make the correct request when called with raise as true', async () => {
|
|
237
|
+
const memberId = uuid.v4();
|
|
238
|
+
const {members, spies} = setup(url1);
|
|
239
|
+
|
|
240
|
+
const resultPromise = members.raiseOrLowerHand(memberId, true);
|
|
241
|
+
|
|
242
|
+
await checkValid(resultPromise, spies, memberId, true, url1);
|
|
243
|
+
});
|
|
244
|
+
|
|
245
|
+
it('should make the correct request when called with raise as false', async () => {
|
|
246
|
+
const memberId = uuid.v4();
|
|
247
|
+
const {members, spies} = setup(url1);
|
|
248
|
+
|
|
249
|
+
const resultPromise = members.raiseOrLowerHand(memberId, false);
|
|
250
|
+
|
|
251
|
+
await checkValid(resultPromise, spies, memberId, false, url1);
|
|
252
|
+
});
|
|
253
|
+
|
|
254
|
+
it('should make the correct request when called with raise as default', async () => {
|
|
255
|
+
const memberId = uuid.v4();
|
|
256
|
+
const {members, spies} = setup(url1);
|
|
257
|
+
|
|
258
|
+
const resultPromise = members.raiseOrLowerHand(memberId);
|
|
259
|
+
|
|
260
|
+
await checkValid(resultPromise, spies, memberId, true, url1);
|
|
261
|
+
});
|
|
262
|
+
});
|
|
263
|
+
|
|
264
|
+
describe('#lowerAllHands', () => {
|
|
265
|
+
const setup = (locusUrl) => {
|
|
266
|
+
const members = createMembers({url: locusUrl});
|
|
267
|
+
|
|
268
|
+
const spies = {
|
|
269
|
+
generateLowerAllHandsMemberOptions: sandbox.spy(MembersUtil, 'generateLowerAllHandsMemberOptions'),
|
|
270
|
+
lowerAllHandsMember: sandbox.spy(members.membersRequest, 'lowerAllHandsMember'),
|
|
271
|
+
};
|
|
272
|
+
|
|
273
|
+
return {members, spies};
|
|
274
|
+
};
|
|
275
|
+
|
|
276
|
+
const checkInvalid = async (resultPromise, expectedMessage, spies) => {
|
|
277
|
+
await assert.isRejected(resultPromise, ParameterError, expectedMessage);
|
|
278
|
+
assert.notCalled(spies.generateLowerAllHandsMemberOptions);
|
|
279
|
+
assert.notCalled(spies.lowerAllHandsMember);
|
|
280
|
+
};
|
|
281
|
+
|
|
282
|
+
const checkValid = async (resultPromise, spies, expectedRequestingMemberId, expectedLocusUrl) => {
|
|
283
|
+
await assert.isFulfilled(resultPromise);
|
|
284
|
+
assert.calledOnceWithExactly(spies.generateLowerAllHandsMemberOptions, expectedRequestingMemberId, expectedLocusUrl);
|
|
285
|
+
assert.calledOnceWithExactly(spies.lowerAllHandsMember, {requestingParticipantId: expectedRequestingMemberId, locusUrl: expectedLocusUrl});
|
|
286
|
+
assert.strictEqual(resultPromise, spies.lowerAllHandsMember.getCall(0).returnValue);
|
|
287
|
+
};
|
|
288
|
+
|
|
289
|
+
it('should not make a request if there is no requestingMemberId', async () => {
|
|
290
|
+
const {members, spies} = setup(url1);
|
|
291
|
+
|
|
292
|
+
const resultPromise = members.lowerAllHands();
|
|
293
|
+
|
|
294
|
+
await checkInvalid(resultPromise, 'The requestingMemberId must be defined to lower all hands in a meeting.', spies);
|
|
295
|
+
});
|
|
296
|
+
|
|
297
|
+
it('should not make a request if there is no locus url', async () => {
|
|
298
|
+
const {members, spies} = setup();
|
|
299
|
+
|
|
300
|
+
const resultPromise = members.lowerAllHands(uuid.v4());
|
|
301
|
+
|
|
302
|
+
await checkInvalid(resultPromise, 'The associated locus url for this meetings members object must be defined.', spies);
|
|
303
|
+
});
|
|
304
|
+
|
|
305
|
+
it('should make the correct request when called with requestingMemberId', async () => {
|
|
306
|
+
const requestingMemberId = uuid.v4();
|
|
307
|
+
const {members, spies} = setup(url1);
|
|
308
|
+
|
|
309
|
+
const resultPromise = members.lowerAllHands(requestingMemberId);
|
|
211
310
|
|
|
212
|
-
|
|
311
|
+
await checkValid(resultPromise, spies, requestingMemberId, url1);
|
|
213
312
|
});
|
|
214
313
|
});
|
|
215
314
|
});
|
|
@@ -3,9 +3,11 @@ import chai from 'chai';
|
|
|
3
3
|
import uuid from 'uuid';
|
|
4
4
|
import chaiAsPromised from 'chai-as-promised';
|
|
5
5
|
import MockWebex from '@webex/test-helper-mock-webex';
|
|
6
|
-
import Meetings from '@webex/plugin-meetings';
|
|
7
6
|
|
|
7
|
+
import Meetings from '@webex/plugin-meetings';
|
|
8
8
|
import MembersRequest from '@webex/plugin-meetings/src/members/request';
|
|
9
|
+
import membersUtil from '@webex/plugin-meetings/src/members/util';
|
|
10
|
+
import ParameterError from '@webex/plugin-meetings/src/common/errors/parameter';
|
|
9
11
|
|
|
10
12
|
const {assert} = chai;
|
|
11
13
|
|
|
@@ -118,5 +120,72 @@ describe('plugin-meetings', () => {
|
|
|
118
120
|
assert.equal(requestParams.body.hand.raised, true);
|
|
119
121
|
});
|
|
120
122
|
});
|
|
123
|
+
|
|
124
|
+
describe('#lowerAllHands', () => {
|
|
125
|
+
const parameterErrorMessage = 'requestingParticipantId must be defined, and the associated locus url for this meeting object must be defined.';
|
|
126
|
+
|
|
127
|
+
const checkInvalid = async (functionParams) => {
|
|
128
|
+
assert.throws(() => membersRequest.lowerAllHandsMember(functionParams), ParameterError, parameterErrorMessage);
|
|
129
|
+
assert(membersRequest.request.notCalled);
|
|
130
|
+
assert(membersUtil.getLowerAllHandsMemberRequestParams.notCalled);
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
it('rejects if no options are passed in', async () => {
|
|
134
|
+
checkInvalid();
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
it('rejects if no locusUrl are passed in', async () => {
|
|
138
|
+
checkInvalid({requestingParticipantId: 'test'});
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
it('rejects if no requestingParticipantId are passed in', async () => {
|
|
142
|
+
checkInvalid({locusUrl: 'test'});
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
it('returns a promise', async () => {
|
|
146
|
+
const locusUrl = url1;
|
|
147
|
+
const memberId = 'test1';
|
|
148
|
+
|
|
149
|
+
const options = {
|
|
150
|
+
requestingParticipantId: memberId,
|
|
151
|
+
locusUrl,
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
assert.strictEqual(membersRequest.lowerAllHandsMember(options), membersRequest.request.getCall(0).returnValue);
|
|
155
|
+
});
|
|
156
|
+
|
|
157
|
+
it('sends a PATCH to the locus endpoint', async () => {
|
|
158
|
+
const locusUrl = url1;
|
|
159
|
+
const memberId = 'test1';
|
|
160
|
+
|
|
161
|
+
const options = {
|
|
162
|
+
requestingParticipantId: memberId,
|
|
163
|
+
locusUrl,
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
const getRequestParamsSpy = sandbox.spy(membersUtil, 'getLowerAllHandsMemberRequestParams');
|
|
168
|
+
|
|
169
|
+
await membersRequest.lowerAllHandsMember(options);
|
|
170
|
+
|
|
171
|
+
assert.calledOnceWithExactly(getRequestParamsSpy, {
|
|
172
|
+
requestingParticipantId: memberId,
|
|
173
|
+
locusUrl: url1
|
|
174
|
+
});
|
|
175
|
+
|
|
176
|
+
const requestParams = membersRequest.request.getCall(0).args[0];
|
|
177
|
+
|
|
178
|
+
assert.deepEqual(requestParams, {
|
|
179
|
+
method: 'PATCH',
|
|
180
|
+
uri: `${locusUrl}/controls`,
|
|
181
|
+
body: {
|
|
182
|
+
hand: {
|
|
183
|
+
raised: false
|
|
184
|
+
},
|
|
185
|
+
requestingParticipantId: memberId
|
|
186
|
+
}
|
|
187
|
+
});
|
|
188
|
+
});
|
|
189
|
+
});
|
|
121
190
|
});
|
|
122
191
|
});
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import sinon from 'sinon';
|
|
2
|
+
import chai from 'chai';
|
|
3
|
+
import chaiAsPromised from 'chai-as-promised';
|
|
4
|
+
|
|
5
|
+
import MembersUtil from '@webex/plugin-meetings/src/members/util';
|
|
6
|
+
|
|
7
|
+
const {assert} = chai;
|
|
8
|
+
|
|
9
|
+
chai.use(chaiAsPromised);
|
|
10
|
+
sinon.assert.expose(chai.assert, {prefix: ''});
|
|
11
|
+
|
|
12
|
+
describe('plugin-meetings', () => {
|
|
13
|
+
describe('members utils library', () => {
|
|
14
|
+
describe('#generateRaiseHandMemberOptions', () => {
|
|
15
|
+
it('returns the correct options', () => {
|
|
16
|
+
const memberId = 'test';
|
|
17
|
+
const status = true;
|
|
18
|
+
const locusUrl = 'urlTest1';
|
|
19
|
+
|
|
20
|
+
assert.deepEqual(MembersUtil.generateRaiseHandMemberOptions(memberId, status, locusUrl), {
|
|
21
|
+
memberId,
|
|
22
|
+
raised: status,
|
|
23
|
+
locusUrl
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
describe('#generateLowerAllHandsMemberOptions', () => {
|
|
28
|
+
it('returns the correct options', () => {
|
|
29
|
+
const requestingParticipantId = 'test';
|
|
30
|
+
const locusUrl = 'urlTest1';
|
|
31
|
+
|
|
32
|
+
assert.deepEqual(MembersUtil.generateLowerAllHandsMemberOptions(requestingParticipantId, locusUrl), {
|
|
33
|
+
requestingParticipantId,
|
|
34
|
+
locusUrl
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
});
|