@webex/plugin-meetings 2.59.8 → 2.60.0

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.
@@ -1 +1 @@
1
- {"version":3,"names":["_uuid","_interopRequireDefault","require","_constants","MembersUtil","generateAddMemberOptions","invitee","locusUrl","alertIfActive","generateAdmitMemberOptions","memberIds","getAddMemberBody","options","invitees","address","emailAddress","email","phoneNumber","getAdmitMemberRequestBody","admit","participantIds","getAdmitMemberRequestParams","format","body","uri","concat","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","_ref","device","dtmf","correlationId","uuid","v4","direction","SEND_DTMF_ENDPOINT","POST","cancelPhoneInviteOptions","generateCancelInviteRequestParams","actionType","_REMOVE_","_default","exports","default"],"sources":["util.ts"],"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: any = {};\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 = (\n invitee: object,\n locusUrl: string,\n alertIfActive: boolean\n) => ({\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: Array<any>, locusUrl: string) => ({\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: any) => ({\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: any) => ({\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: any) => {\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: any) => {\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 = ({url, tones, memberId, locusUrl}) => {\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,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,UAAA,GAAAD,OAAA;AAYA,IAAME,WAAgB,GAAG,CAAC,CAAC;;AAE3B;AACA;AACA;AACA;AACA;AACA;AACAA,WAAW,CAACC,wBAAwB,GAAG,UACrCC,OAAe,EACfC,QAAgB,EAChBC,aAAsB;EAAA,OAClB;IACJF,OAAO,EAAPA,OAAO;IACPC,QAAQ,EAARA,QAAQ;IACRC,aAAa,EAAbA;EACF,CAAC;AAAA,CAAC;;AAEF;AACA;AACA;AACA;AACA;AACAJ,WAAW,CAACK,0BAA0B,GAAG,UAACC,SAAqB,EAAEH,QAAgB;EAAA,OAAM;IACrFA,QAAQ,EAARA,QAAQ;IACRG,SAAS,EAATA;EACF,CAAC;AAAA,CAAC;;AAEF;AACA;AACA;AACA;AACAN,WAAW,CAACO,gBAAgB,GAAG,UAACC,OAAY;EAAA,OAAM;IAChDC,QAAQ,EAAE,CACR;MACEC,OAAO,EAAEF,OAAO,CAACN,OAAO,CAACS,YAAY,IAAIH,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,GAAG,EAAHA;IACF,CAAC;IACDxB,QAAQ,EAARA,QAAQ;IACR6B,IAAI,EAAE;MACJC,aAAa,EAAEC,aAAI,CAACC,EAAE,EAAE;MACxBP,KAAK,EAALA,KAAK;MACLQ,SAAS,EAAE;IACb;EACF,CAAC;EACD,IAAMjD,GAAG,MAAAC,MAAA,CAAMlB,QAAQ,OAAAkB,MAAA,CAAIc,sBAAW,OAAAd,MAAA,CAAIe,QAAQ,OAAAf,MAAA,CAAIiD,6BAAkB,CAAE;EAE1E,OAAO;IACL/C,MAAM,EAAEC,qBAAU,CAAC+C,IAAI;IACvBnD,GAAG,EAAHA,GAAG;IACHD,IAAI,EAAJA;EACF,CAAC;AACH,CAAC;AAEDnB,WAAW,CAACwE,wBAAwB,GAAG,UAACtE,OAAO,EAAEC,QAAQ;EAAA,OAAM;IAC7DD,OAAO,EAAPA,OAAO;IACPC,QAAQ,EAARA;EACF,CAAC;AAAA,CAAC;AAEFH,WAAW,CAACyE,iCAAiC,GAAG,UAACjE,OAAO,EAAK;EAC3D,IAAMW,IAAI,GAAG;IACXuD,UAAU,EAAEC,mBAAQ;IACpBlE,QAAQ,EAAE,CACR;MACEC,OAAO,EAAEF,OAAO,CAACN,OAAO,CAACW;IAC3B,CAAC;EAEL,CAAC;EACD,IAAMc,aAAa,GAAG;IACpBJ,MAAM,EAAEC,qBAAU,CAACC,GAAG;IACtBL,GAAG,EAAEZ,OAAO,CAACL,QAAQ;IACrBgB,IAAI,EAAJA;EACF,CAAC;EAED,OAAOQ,aAAa;AACtB,CAAC;AAAC,IAAAiD,QAAA,GAEa5E,WAAW;AAAA6E,OAAA,CAAAC,OAAA,GAAAF,QAAA"}
1
+ {"version":3,"names":["_uuid","_interopRequireDefault","require","_constants","MembersUtil","generateAddMemberOptions","invitee","locusUrl","alertIfActive","generateAdmitMemberOptions","memberIds","getAddMemberBody","options","invitees","address","emailAddress","email","phoneNumber","getAdmitMemberRequestBody","admit","participantIds","getAdmitMemberRequestParams","format","body","uri","concat","CONTROLS","method","HTTP_VERBS","PUT","getAddMemberRequestParams","requestParams","getAddedRoleShape","role","roleShape","type","hasRole","hostKey","isInvalidInvitee","DIALER_REGEX","E164_FORMAT","test","VALID_EMAIL_ADDRESS","getRemoveMemberRequestParams","reason","PARTICIPANT","memberId","LEAVE","generateRoleAssignmentMemberOptions","roles","getRoleAssignmentMemberRequestParams","forEach","push","PATCH","generateTransferHostMemberOptions","transfer","moderator","generateRemoveMemberOptions","removal","_FORCED_","generateMuteMemberOptions","status","muted","generateRaiseHandMemberOptions","raised","generateLowerAllHandsMemberOptions","requestingParticipantId","getMuteMemberRequestParams","audio","getRaiseHandMemberRequestParams","hand","getLowerAllHandsMemberRequestParams","getTransferHostToMemberRequestParams","genderateSendDTMFOptions","url","tones","generateSendDTMFRequestParams","_ref","device","dtmf","correlationId","uuid","v4","direction","SEND_DTMF_ENDPOINT","POST","cancelPhoneInviteOptions","generateCancelInviteRequestParams","actionType","_REMOVE_","_default","exports","default"],"sources":["util.ts"],"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';\nimport {RoleAssignmentOptions, RoleAssignmentRequest, ServerRoleShape} from './types';\n\nconst MembersUtil: any = {};\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 = (\n invitee: object,\n locusUrl: string,\n alertIfActive: boolean\n) => ({\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: Array<any>, locusUrl: string) => ({\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: any) => ({\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: any) => ({\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: any) => {\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: any) => {\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\n/**\n * @param {ServerRoleShape} role\n * @returns {ServerRoleShape} the role shape to be added to the body\n */\nMembersUtil.getAddedRoleShape = (role: ServerRoleShape) => {\n const roleShape: ServerRoleShape = {type: role.type, hasRole: role.hasRole};\n\n if (role.hostKey) {\n roleShape.hostKey = role.hostKey;\n }\n\n return roleShape;\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\n/**\n * @param {String} memberId\n * @param {[ServerRoleShape]} roles\n * @param {String} locusUrl\n * @returns {RoleAssignmentOptions}\n */\nMembersUtil.generateRoleAssignmentMemberOptions = (\n memberId: string,\n roles: Array<ServerRoleShape>,\n locusUrl: string\n): RoleAssignmentOptions => ({\n memberId,\n roles,\n locusUrl,\n});\n\n/**\n * @param {RoleAssignmentOptions} options\n * @returns {RoleAssignmentRequest} the request parameters (method, uri, body) needed to make a addMember request\n */\nMembersUtil.getRoleAssignmentMemberRequestParams = (\n options: RoleAssignmentOptions\n): RoleAssignmentRequest => {\n const body = {role: {roles: []}};\n options.roles.forEach((role) => {\n body.role.roles.push(MembersUtil.getAddedRoleShape(role));\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.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 = ({url, tones, memberId, locusUrl}) => {\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,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,UAAA,GAAAD,OAAA;AAaA,IAAME,WAAg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AAEF,OAAO,CAACN,OAAO,CAACW;IAC3B,CAAC;EAEL,CAAC;EACD,IAAMc,aAAa,GAAG;IACpBJ,MAAM,EAAEC,qBAAU,CAACC,GAAG;IACtBL,GAAG,EAAEZ,OAAO,CAACL,QAAQ;IACrBgB,IAAI,EAAJA;EACF,CAAC;EAED,OAAOQ,aAAa;AACtB,CAAC;AAAC,IAAA2D,QAAA,GAEatF,WAAW;AAAAuF,OAAA,CAAAC,OAAA,GAAAF,QAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webex/plugin-meetings",
3
- "version": "2.59.8",
3
+ "version": "2.60.0",
4
4
  "description": "",
5
5
  "license": "Cisco EULA (https://www.cisco.com/c/en/us/products/end-user-license-agreement.html)",
6
6
  "contributors": [
@@ -39,17 +39,17 @@
39
39
  "devDependencies": {
40
40
  "@babel/core": "^7.17.10",
41
41
  "@types/jsdom": "^21",
42
- "@webex/babel-config-legacy": "2.59.8",
43
- "@webex/eslint-config-legacy": "2.59.8",
44
- "@webex/jest-config-legacy": "2.59.8",
45
- "@webex/legacy-tools": "2.59.8",
46
- "@webex/plugin-meetings": "2.59.8",
47
- "@webex/plugin-rooms": "2.59.8",
48
- "@webex/test-helper-chai": "2.59.8",
49
- "@webex/test-helper-mocha": "2.59.8",
50
- "@webex/test-helper-mock-webex": "2.59.8",
51
- "@webex/test-helper-retry": "2.59.8",
52
- "@webex/test-helper-test-users": "2.59.8",
42
+ "@webex/babel-config-legacy": "2.60.0",
43
+ "@webex/eslint-config-legacy": "2.60.0",
44
+ "@webex/jest-config-legacy": "2.60.0",
45
+ "@webex/legacy-tools": "2.60.0",
46
+ "@webex/plugin-meetings": "2.60.0",
47
+ "@webex/plugin-rooms": "2.60.0",
48
+ "@webex/test-helper-chai": "2.60.0",
49
+ "@webex/test-helper-mocha": "2.60.0",
50
+ "@webex/test-helper-mock-webex": "2.60.0",
51
+ "@webex/test-helper-retry": "2.60.0",
52
+ "@webex/test-helper-test-users": "2.60.0",
53
53
  "chai": "^4.3.4",
54
54
  "chai-as-promised": "^7.1.1",
55
55
  "eslint": "^8.24.0",
@@ -60,15 +60,15 @@
60
60
  "typescript": "^4.7.4"
61
61
  },
62
62
  "dependencies": {
63
- "@webex/common": "2.59.8",
63
+ "@webex/common": "2.60.0",
64
64
  "@webex/internal-media-core": "0.0.7-beta",
65
- "@webex/internal-plugin-device": "2.59.8",
66
- "@webex/internal-plugin-metrics": "2.59.8",
67
- "@webex/internal-plugin-support": "2.59.8",
68
- "@webex/internal-plugin-user": "2.59.8",
69
- "@webex/plugin-people": "2.59.8",
65
+ "@webex/internal-plugin-device": "2.60.0",
66
+ "@webex/internal-plugin-metrics": "2.60.0",
67
+ "@webex/internal-plugin-support": "2.60.0",
68
+ "@webex/internal-plugin-user": "2.60.0",
69
+ "@webex/plugin-people": "2.60.0",
70
70
  "@webex/ts-sdp": "1.0.1",
71
- "@webex/webex-core": "2.59.8",
71
+ "@webex/webex-core": "2.60.0",
72
72
  "bowser": "^2.11.0",
73
73
  "btoa": "^1.2.1",
74
74
  "dotenv": "^4.0.0",
@@ -0,0 +1,134 @@
1
+ import * as MEETINGCONSTANTS from '../../constants';
2
+
3
+ /**
4
+ * Extended Error object for reclaim host role empty or wrong key
5
+ */
6
+ export class ReclaimHostEmptyWrongKeyError extends Error {
7
+ sdkMessage: string;
8
+ error: null;
9
+ code: number;
10
+
11
+ /**
12
+ *
13
+ * @constructor
14
+ * @param {String} [message]
15
+ * @param {Object} [error]
16
+ */
17
+ constructor(
18
+ message: string = MEETINGCONSTANTS.ERROR_DICTIONARY.RECLAIM_HOST_ROLE_EMPTY_OR_WRONG_KEY
19
+ .MESSAGE,
20
+ error: any = null
21
+ ) {
22
+ super(message);
23
+
24
+ if (Error.captureStackTrace) {
25
+ Error.captureStackTrace(this, ReclaimHostEmptyWrongKeyError);
26
+ }
27
+
28
+ this.name = MEETINGCONSTANTS.ERROR_DICTIONARY.RECLAIM_HOST_ROLE_EMPTY_OR_WRONG_KEY.NAME;
29
+ this.sdkMessage =
30
+ message || MEETINGCONSTANTS.ERROR_DICTIONARY.RECLAIM_HOST_ROLE_EMPTY_OR_WRONG_KEY.MESSAGE;
31
+ this.error = error;
32
+
33
+ this.code = MEETINGCONSTANTS.ERROR_DICTIONARY.RECLAIM_HOST_ROLE_EMPTY_OR_WRONG_KEY.CODE;
34
+ }
35
+ }
36
+
37
+ /**
38
+ * Extended Error object for reclaim host role not supported
39
+ */
40
+ export class ReclaimHostNotSupportedError extends Error {
41
+ sdkMessage: string;
42
+ error: null;
43
+ code: number;
44
+
45
+ /**
46
+ *
47
+ * @constructor
48
+ * @param {String} [message]
49
+ * @param {Object} [error]
50
+ */
51
+ constructor(
52
+ message: string = MEETINGCONSTANTS.ERROR_DICTIONARY.RECLAIM_HOST_ROLE_NOT_SUPPORTED.MESSAGE,
53
+ error: any = null
54
+ ) {
55
+ super(message);
56
+
57
+ if (Error.captureStackTrace) {
58
+ Error.captureStackTrace(this, ReclaimHostNotSupportedError);
59
+ }
60
+
61
+ this.name = MEETINGCONSTANTS.ERROR_DICTIONARY.RECLAIM_HOST_ROLE_NOT_SUPPORTED.NAME;
62
+ this.sdkMessage =
63
+ message || MEETINGCONSTANTS.ERROR_DICTIONARY.RECLAIM_HOST_ROLE_NOT_SUPPORTED.MESSAGE;
64
+ this.error = error;
65
+
66
+ this.code = MEETINGCONSTANTS.ERROR_DICTIONARY.RECLAIM_HOST_ROLE_NOT_SUPPORTED.CODE;
67
+ }
68
+ }
69
+
70
+ /**
71
+ * Extended Error object for reclaim host role not allowed for other participants
72
+ */
73
+ export class ReclaimHostNotAllowedError extends Error {
74
+ sdkMessage: string;
75
+ error: null;
76
+ code: number;
77
+
78
+ /**
79
+ *
80
+ * @constructor
81
+ * @param {String} [message]
82
+ * @param {Object} [error]
83
+ */
84
+ constructor(
85
+ message: string = MEETINGCONSTANTS.ERROR_DICTIONARY.RECLAIM_HOST_ROLE_NOT_ALLOWED.MESSAGE,
86
+ error: any = null
87
+ ) {
88
+ super(message);
89
+
90
+ if (Error.captureStackTrace) {
91
+ Error.captureStackTrace(this, ReclaimHostNotAllowedError);
92
+ }
93
+
94
+ this.name = MEETINGCONSTANTS.ERROR_DICTIONARY.RECLAIM_HOST_ROLE_NOT_ALLOWED.NAME;
95
+ this.sdkMessage =
96
+ message || MEETINGCONSTANTS.ERROR_DICTIONARY.RECLAIM_HOST_ROLE_NOT_ALLOWED.MESSAGE;
97
+ this.error = error;
98
+
99
+ this.code = MEETINGCONSTANTS.ERROR_DICTIONARY.RECLAIM_HOST_ROLE_NOT_ALLOWED.CODE;
100
+ }
101
+ }
102
+
103
+ /**
104
+ * Extended Error object for reclaim host role when user is host already
105
+ */
106
+ export class ReclaimHostIsHostAlreadyError extends Error {
107
+ sdkMessage: string;
108
+ error: null;
109
+ code: number;
110
+
111
+ /**
112
+ *
113
+ * @constructor
114
+ * @param {String} [message]
115
+ * @param {Object} [error]
116
+ */
117
+ constructor(
118
+ message: string = MEETINGCONSTANTS.ERROR_DICTIONARY.RECLAIM_HOST_ROLE_IS_ALREADY_HOST.MESSAGE,
119
+ error: any = null
120
+ ) {
121
+ super(message);
122
+
123
+ if (Error.captureStackTrace) {
124
+ Error.captureStackTrace(this, ReclaimHostIsHostAlreadyError);
125
+ }
126
+
127
+ this.name = MEETINGCONSTANTS.ERROR_DICTIONARY.RECLAIM_HOST_ROLE_IS_ALREADY_HOST.NAME;
128
+ this.sdkMessage =
129
+ message || MEETINGCONSTANTS.ERROR_DICTIONARY.RECLAIM_HOST_ROLE_IS_ALREADY_HOST.MESSAGE;
130
+ this.error = error;
131
+
132
+ this.code = MEETINGCONSTANTS.ERROR_DICTIONARY.RECLAIM_HOST_ROLE_IS_ALREADY_HOST.CODE;
133
+ }
134
+ }
package/src/constants.ts CHANGED
@@ -239,6 +239,13 @@ export const CALENDAR_EVENTS = {
239
239
  DELETE: 'event:calendar.meeting.delete',
240
240
  };
241
241
 
242
+ export const ASSIGN_ROLES_ERROR_CODES = {
243
+ ReclaimHostNotSupportedErrorCode: 2400127,
244
+ ReclaimHostNotAllowedErrorCode: 2403135,
245
+ ReclaimHostEmptyWrongKeyErrorCode: 2403136,
246
+ ReclaimHostIsHostAlreadyErrorCode: 2409150,
247
+ };
248
+
242
249
  export const DEFAULT_GET_STATS_FILTER = {
243
250
  types: [
244
251
  'track',
@@ -449,6 +456,30 @@ export const ERROR_DICTIONARY = {
449
456
  MESSAGE: 'Captcha is required.',
450
457
  CODE: 8,
451
458
  },
459
+ RECLAIM_HOST_ROLE_NOT_SUPPORTED: {
460
+ NAME: 'ReclaimHostRoleNotSupported',
461
+ MESSAGE:
462
+ 'Non converged meetings, PSTN or SIP users in converged meetings are not supported currently.',
463
+ CODE: 9,
464
+ },
465
+ RECLAIM_HOST_ROLE_NOT_ALLOWED: {
466
+ NAME: 'ReclaimHostRoleNotAllowed',
467
+ MESSAGE:
468
+ 'Reclaim Host Role Not Allowed For Other Participants. Participants cannot claim host role in PMR meeting, space instant meeting or escalated instant meeting. However, the original host still can reclaim host role when it manually makes another participant to be the host.',
469
+ CODE: 10,
470
+ },
471
+ RECLAIM_HOST_ROLE_EMPTY_OR_WRONG_KEY: {
472
+ NAME: 'ReclaimHostRoleEmptyOrWrongKey',
473
+ MESSAGE:
474
+ 'Host Key Not Specified Or Matched. The original host can reclaim the host role without entering the host key. However, any other person who claims the host role must enter the host key to get it.',
475
+ CODE: 11,
476
+ },
477
+ RECLAIM_HOST_ROLE_IS_ALREADY_HOST: {
478
+ NAME: 'ReclaimHostRoleIsAlreadyHost',
479
+ MESSAGE:
480
+ 'Participant Having Host Role Already. Participant who sends request to reclaim host role has already a host role.',
481
+ CODE: 12,
482
+ },
452
483
  };
453
484
 
454
485
  export const FLOOR_ACTION = {
@@ -11,6 +11,7 @@ import MemberUtil from './util';
11
11
  */
12
12
  export default class Member {
13
13
  associatedUser: any;
14
+ canReclaimHost: boolean;
14
15
  id: any;
15
16
  isAudioMuted: any;
16
17
  isContentSharing: any;
@@ -57,6 +58,13 @@ export default class Member {
57
58
  }
58
59
  | any = {}
59
60
  ) {
61
+ /**
62
+ * @instance
63
+ * @type {Boolean}
64
+ * @public
65
+ * @memberof Member
66
+ */
67
+ this.canReclaimHost = false;
60
68
  /**
61
69
  * The server participant object
62
70
  * @instance
@@ -250,6 +258,7 @@ export default class Member {
250
258
  private processParticipant(participant: object) {
251
259
  this.participant = participant;
252
260
  if (participant) {
261
+ this.canReclaimHost = MemberUtil.canReclaimHost(participant);
253
262
  this.id = MemberUtil.extractId(participant);
254
263
  this.name = MemberUtil.extractName(participant);
255
264
  this.isAudioMuted = MemberUtil.isAudioMuted(participant);
@@ -20,6 +20,20 @@ import {IMediaStatus} from './member.types';
20
20
 
21
21
  const MemberUtil: any = {};
22
22
 
23
+ /**
24
+ * @param {Object} participant the locus participant
25
+ * @returns {Boolean}
26
+ */
27
+ MemberUtil.canReclaimHost = (participant) => {
28
+ if (!participant) {
29
+ throw new ParameterError(
30
+ 'canReclaimHostRole could not be processed, participant is undefined.'
31
+ );
32
+ }
33
+
34
+ return participant.canReclaimHostRole || false;
35
+ };
36
+
23
37
  /**
24
38
  * @param {Object} participant the locus participant
25
39
  * @returns {Boolean}
@@ -5,7 +5,14 @@ import {isEmpty} from 'lodash';
5
5
  // @ts-ignore
6
6
  import {StatelessWebexPlugin} from '@webex/webex-core';
7
7
 
8
- import {MEETINGS, EVENT_TRIGGERS, FLOOR_ACTION, CONTENT, WHITEBOARD} from '../constants';
8
+ import {
9
+ MEETINGS,
10
+ EVENT_TRIGGERS,
11
+ FLOOR_ACTION,
12
+ CONTENT,
13
+ WHITEBOARD,
14
+ ASSIGN_ROLES_ERROR_CODES,
15
+ } from '../constants';
9
16
  import Trigger from '../common/events/trigger-proxy';
10
17
  import Member from '../member';
11
18
  import LoggerProxy from '../common/logs/logger-proxy';
@@ -14,6 +21,13 @@ import ParameterError from '../common/errors/parameter';
14
21
  import MembersCollection from './collection';
15
22
  import MembersRequest from './request';
16
23
  import MembersUtil from './util';
24
+ import {ServerRoleShape} from './types';
25
+ import {
26
+ ReclaimHostEmptyWrongKeyError,
27
+ ReclaimHostIsHostAlreadyError,
28
+ ReclaimHostNotAllowedError,
29
+ ReclaimHostNotSupportedError,
30
+ } from '../common/errors/reclaim-host-role-error';
17
31
 
18
32
  /**
19
33
  * Members Update Event
@@ -686,6 +700,46 @@ export default class Members extends StatelessWebexPlugin {
686
700
  return this.membersRequest.addMembers(options);
687
701
  }
688
702
 
703
+ /**
704
+ * Assign role(s) to a member in the meeting
705
+ * @param {String} memberId
706
+ * @param {[ServerRoleShape]} roles - to assign an array of roles
707
+ * @returns {Promise}
708
+ * @public
709
+ * @memberof Members
710
+ */
711
+ public assignRoles(memberId: string, roles: Array<ServerRoleShape>) {
712
+ if (!this.locusUrl) {
713
+ return Promise.reject(
714
+ new ParameterError(
715
+ 'The associated locus url for this meetings members object must be defined.'
716
+ )
717
+ );
718
+ }
719
+ if (!memberId) {
720
+ return Promise.reject(
721
+ new ParameterError('The member id must be defined to assign the roles to a member.')
722
+ );
723
+ }
724
+ const options = MembersUtil.generateRoleAssignmentMemberOptions(memberId, roles, this.locusUrl);
725
+
726
+ return this.membersRequest.assignRolesMember(options).catch((error: any) => {
727
+ const errorCode = error.body?.errorCode;
728
+ switch (errorCode) {
729
+ case ASSIGN_ROLES_ERROR_CODES.ReclaimHostNotSupportedErrorCode:
730
+ return Promise.reject(new ReclaimHostNotSupportedError());
731
+ case ASSIGN_ROLES_ERROR_CODES.ReclaimHostNotAllowedErrorCode:
732
+ return Promise.reject(new ReclaimHostNotAllowedError());
733
+ case ASSIGN_ROLES_ERROR_CODES.ReclaimHostEmptyWrongKeyErrorCode:
734
+ return Promise.reject(new ReclaimHostEmptyWrongKeyError());
735
+ case ASSIGN_ROLES_ERROR_CODES.ReclaimHostIsHostAlreadyErrorCode:
736
+ return Promise.reject(new ReclaimHostIsHostAlreadyError());
737
+ default:
738
+ return Promise.reject(error);
739
+ }
740
+ });
741
+ }
742
+
689
743
  /**
690
744
  * Cancels an outgoing PSTN call to the associated meeting
691
745
  * @param {String} invitee
@@ -59,6 +59,26 @@ export default class MembersRequest extends StatelessWebexPlugin {
59
59
  return this.request(requestParams);
60
60
  }
61
61
 
62
+ /**
63
+ * Sends a request to assign roles to a member
64
+ * @param {Object} options
65
+ * @param {String} options.locusUrl
66
+ * @param {String} options.memberId ID of PSTN user
67
+ * @returns {Promise}
68
+ */
69
+ assignRolesMember(options: any) {
70
+ if (!options || !options.locusUrl || !options.memberId) {
71
+ throw new ParameterError(
72
+ 'memberId must be defined, and the associated locus url for this meeting object must be defined.'
73
+ );
74
+ }
75
+
76
+ const requestParams = MembersUtil.getRoleAssignmentMemberRequestParams(options);
77
+
78
+ // @ts-ignore
79
+ return this.request(requestParams);
80
+ }
81
+
62
82
  removeMember(options) {
63
83
  if (!options || !options.locusUrl || !options.memberId) {
64
84
  throw new ParameterError(
@@ -0,0 +1,29 @@
1
+ export enum ServerRoles {
2
+ Cohost = 'COHOST',
3
+ Moderator = 'MODERATOR',
4
+ Presenter = 'PRESENTER',
5
+ }
6
+
7
+ export type ServerRoleShape = {
8
+ type: ServerRoles;
9
+ hasRole: boolean;
10
+ hostKey?: string;
11
+ };
12
+
13
+ export type RoleAssignmentOptions = {
14
+ roles: Array<ServerRoleShape>;
15
+ locusUrl: string;
16
+ memberId: string;
17
+ };
18
+
19
+ export type RoleAssignmentBody = {
20
+ role: {
21
+ roles: Array<ServerRoleShape>;
22
+ };
23
+ };
24
+
25
+ export type RoleAssignmentRequest = {
26
+ method: string;
27
+ uri: string;
28
+ body: RoleAssignmentBody;
29
+ };
@@ -11,6 +11,7 @@ import {
11
11
  SEND_DTMF_ENDPOINT,
12
12
  _REMOVE_,
13
13
  } from '../constants';
14
+ import {RoleAssignmentOptions, RoleAssignmentRequest, ServerRoleShape} from './types';
14
15
 
15
16
  const MembersUtil: any = {};
16
17
 
@@ -91,6 +92,20 @@ MembersUtil.getAddMemberRequestParams = (format: any) => {
91
92
  return requestParams;
92
93
  };
93
94
 
95
+ /**
96
+ * @param {ServerRoleShape} role
97
+ * @returns {ServerRoleShape} the role shape to be added to the body
98
+ */
99
+ MembersUtil.getAddedRoleShape = (role: ServerRoleShape) => {
100
+ const roleShape: ServerRoleShape = {type: role.type, hasRole: role.hasRole};
101
+
102
+ if (role.hostKey) {
103
+ roleShape.hostKey = role.hostKey;
104
+ }
105
+
106
+ return roleShape;
107
+ };
108
+
94
109
  MembersUtil.isInvalidInvitee = (invitee) => {
95
110
  if (!(invitee && (invitee.email || invitee.emailAddress || invitee.phoneNumber))) {
96
111
  return true;
@@ -116,6 +131,43 @@ MembersUtil.getRemoveMemberRequestParams = (options) => {
116
131
  };
117
132
  };
118
133
 
134
+ /**
135
+ * @param {String} memberId
136
+ * @param {[ServerRoleShape]} roles
137
+ * @param {String} locusUrl
138
+ * @returns {RoleAssignmentOptions}
139
+ */
140
+ MembersUtil.generateRoleAssignmentMemberOptions = (
141
+ memberId: string,
142
+ roles: Array<ServerRoleShape>,
143
+ locusUrl: string
144
+ ): RoleAssignmentOptions => ({
145
+ memberId,
146
+ roles,
147
+ locusUrl,
148
+ });
149
+
150
+ /**
151
+ * @param {RoleAssignmentOptions} options
152
+ * @returns {RoleAssignmentRequest} the request parameters (method, uri, body) needed to make a addMember request
153
+ */
154
+ MembersUtil.getRoleAssignmentMemberRequestParams = (
155
+ options: RoleAssignmentOptions
156
+ ): RoleAssignmentRequest => {
157
+ const body = {role: {roles: []}};
158
+ options.roles.forEach((role) => {
159
+ body.role.roles.push(MembersUtil.getAddedRoleShape(role));
160
+ });
161
+
162
+ const uri = `${options.locusUrl}/${PARTICIPANT}/${options.memberId}/${CONTROLS}`;
163
+
164
+ return {
165
+ method: HTTP_VERBS.PATCH,
166
+ uri,
167
+ body,
168
+ };
169
+ };
170
+
119
171
  MembersUtil.generateTransferHostMemberOptions = (transfer, moderator, locusUrl) => ({
120
172
  moderator,
121
173
  locusUrl,
@@ -20,6 +20,13 @@ describe('member', () => {
20
20
 
21
21
  assert.calledOnceWithExactly(MemberUtil.isHandRaised, participant);
22
22
  });
23
+
24
+ it('checks that processParticipant calls canReclaimHost', () => {
25
+ sinon.spy(MemberUtil, 'canReclaimHost');
26
+ member.processParticipant(participant);
27
+
28
+ assert.calledOnceWithExactly(MemberUtil.canReclaimHost, participant);
29
+ });
23
30
  })
24
31
 
25
32
  describe('#processMember', ()=>{
@@ -78,3 +78,35 @@ describe('extractMediaStatus', () => {
78
78
  assert.deepEqual(mediaStatus, {audio: 'RECVONLY', video: 'SENDRECV'});
79
79
  });
80
80
  });
81
+
82
+ describe('MemberUtil.canReclaimHost', () => {
83
+ it('throws error when there is no participant', () => {
84
+ assert.throws(() => {
85
+ MemberUtil.canReclaimHost();
86
+ }, 'canReclaimHostRole could not be processed, participant is undefined.');
87
+ });
88
+
89
+ it('returns true when canReclaimHostRole is true', () => {
90
+ const participant = {
91
+ canReclaimHostRole: true,
92
+ };
93
+
94
+ assert.isTrue(MemberUtil.canReclaimHost(participant));
95
+ });
96
+
97
+ it('returns false when canReclaimHostRole is false', () => {
98
+ const participant = {
99
+ canReclaimHostRole: false,
100
+ };
101
+
102
+ assert.isFalse(MemberUtil.canReclaimHost(participant));
103
+ });
104
+
105
+ it('returns false when canReclaimHostRole is falsy', () => {
106
+ const participant = {
107
+ canReclaimHostRole: undefined,
108
+ };
109
+
110
+ assert.isFalse(MemberUtil.canReclaimHost(participant));
111
+ });
112
+ });