@webex/plugin-meetings 3.0.0-beta.142 → 3.0.0-beta.143

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":[],"sources":["annotation.types.ts"],"sourcesContent":["/**\n * Type for an StrokeData Object\n */\ntype StrokeData = {\n deviceId: string;\n toUserId: string;\n requesterId: string;\n content: string;\n shareInstanceId: string;\n encryptionKeyUrl: string;\n version: string;\n};\n\ntype RequestData = {\n toUserId: string;\n toDeviceUrl: string;\n shareInstanceId: string;\n};\n\ntype CommandRequestBody = {\n actionType: string;\n resourceType: string;\n shareInstanceId: string;\n receivers?: any[];\n};\n\ninterface IAnnotationChannel {\n // === below is for presenter\n acceptRequest: (approval) => undefined | Promise<void>;\n declineRequest: (approval) => undefined | Promise<void>;\n closeAnnotation: (requestData: RequestData) => undefined | Promise<void>;\n changeAnnotationOptions: (options, meeting) => undefined | Promise<void>;\n // === below is for attendee\n approveAnnotation: (requestData: RequestData) => undefined | Promise<void>;\n cancelApproveAnnotation: (requestData: RequestData, approval) => undefined | Promise<void>;\n sendStrokeData: (strokeData: StrokeData) => void;\n // =====\n approvalUrlUpdate: (approvalUrl: string) => void;\n locusUrlUpdate: (locusUrl: string) => void;\n}\n\nexport type {StrokeData, RequestData, CommandRequestBody, IAnnotationChannel};\n"],"mappings":""}
1
+ {"version":3,"names":[],"sources":["annotation.types.ts"],"sourcesContent":["/**\n * Type for an StrokeData Object\n */\ntype StrokeData = {\n deviceId: string;\n toUserId: string;\n requesterId: string;\n content: string;\n shareInstanceId: string;\n encryptionKeyUrl: string;\n version: string;\n};\n\ntype RequestData = {\n toUserId: string;\n toDeviceUrl: string;\n shareInstanceId: string;\n};\n\ntype CommandRequestBody = {\n actionType: string;\n resourceType: string;\n shareInstanceId: string;\n receivers?: any[];\n};\n\ninterface IAnnotationChannel {\n // === below is for presenter\n acceptRequest: (approval) => undefined | Promise<void>;\n declineRequest: (approval) => undefined | Promise<void>;\n closeAnnotation: (requestData: RequestData) => undefined | Promise<void>;\n // change annotation privilege\n changeAnnotationOptions: (remoteShareUrl, annotationInfo) => undefined | Promise<void>;\n // === below is for attendee\n approveAnnotation: (requestData: RequestData) => undefined | Promise<void>;\n cancelApproveAnnotation: (requestData: RequestData, approval) => undefined | Promise<void>;\n sendStrokeData: (strokeData: StrokeData) => void;\n // =====\n approvalUrlUpdate: (approvalUrl: string) => void;\n locusUrlUpdate: (locusUrl: string) => void;\n}\n\nexport type {StrokeData, RequestData, CommandRequestBody, IAnnotationChannel};\n"],"mappings":""}
@@ -105,20 +105,21 @@ var AnnotationChannel = /*#__PURE__*/function (_WebexPlugin) {
105
105
 
106
106
  /**
107
107
  * Process Stroke Data
108
- * @param {request} request stroke data
108
+ * @param {object} data
109
109
  * @returns {void}
110
110
  */
111
111
  (0, _createClass2.default)(AnnotationChannel, [{
112
112
  key: "processStrokeMessage",
113
- value: function processStrokeMessage(request) {
113
+ value: function processStrokeMessage(data) {
114
114
  var _this2 = this;
115
+ var request = data.request;
115
116
  this.decryptContent(request.value.encryptionKeyUrl, request.value.content).then(function (decryptedContent) {
116
117
  request.value.content = decryptedContent;
117
118
  _triggerProxy.default.trigger(_this2, {
118
119
  file: 'annotation',
119
120
  function: 'processStrokeMessage'
120
121
  }, _constants.EVENT_TRIGGERS.ANNOTATION_STROKE_DATA, {
121
- payload: request.value
122
+ payload: data
122
123
  });
123
124
  });
124
125
  }
@@ -154,7 +155,7 @@ var AnnotationChannel = /*#__PURE__*/function (_WebexPlugin) {
154
155
  switch (e === null || e === void 0 ? void 0 : (_e$data4 = e.data) === null || _e$data4 === void 0 ? void 0 : _e$data4.relayType) {
155
156
  case _constants.ANNOTATION_RELAY_TYPES.ANNOTATION_CLIENT:
156
157
  this.seqNum = ((e === null || e === void 0 ? void 0 : e.sequenceNumber) || 0) + 1;
157
- this.processStrokeMessage(e.data.request);
158
+ this.processStrokeMessage(e.data);
158
159
  break;
159
160
  default:
160
161
  break;
@@ -294,12 +295,17 @@ var AnnotationChannel = /*#__PURE__*/function (_WebexPlugin) {
294
295
  value:
295
296
  /**
296
297
  * Change annotation options
297
- * @param {object} options
298
- * @param {object} meeting
298
+ * @param {remoteShareUrl} remoteShareUrl
299
+ * @param {annotationInfo} annotationInfo
299
300
  * @returns {Promise}
300
301
  */
301
- function changeAnnotationOptions(options, meeting) {
302
- return meeting === null || meeting === void 0 ? void 0 : meeting.meetingRequest.changeMeetingFloor(options);
302
+ function changeAnnotationOptions(remoteShareUrl, annotationInfo) {
303
+ // @ts-ignore
304
+ return this.request({
305
+ method: _constants2.HTTP_VERBS.PATCH,
306
+ url: remoteShareUrl,
307
+ body: annotationInfo
308
+ });
303
309
  }
304
310
 
305
311
  /**
@@ -1 +1 @@
1
- {"version":3,"names":["AnnotationChannel","args","ANNOTATION","actionType","requestData","body","resourceType","shareInstanceId","toUserId","receivers","participantId","deviceUrl","toDeviceUrl","request","method","HTTP_VERBS","POST","url","approvalUrl","encryptionKeyUrl","content","webex","internal","encryption","decryptText","then","res","encryptText","strokeData","llm","isConnected","encryptContent","encryptedContent","publishEncrypted","seqNum","decryptContent","value","decryptedContent","TriggerProxy","trigger","file","function","EVENT_TRIGGERS","ANNOTATION_STROKE_DATA","payload","e","data","eventType","approval","ANNOTATION_RESOURCE_TYPE","ANNOTATION_COMMAND","type","sequenceNumber","relayType","ANNOTATION_RELAY_TYPES","ANNOTATION_CLIENT","processStrokeMessage","hasSubscribedToEvents","mercury","on","eventCommandProcessor","eventDataProcessor","locusUrl","listenToEvents","PUT","ANNOTATION_ACTION_TYPE","ACCEPTED","DECLINED","sendAnnotationAction","REQUESTED","CANCELED","CLOSED","options","meeting","meetingRequest","changeMeetingFloor","id","recipients","route","getBinding","headers","to","ANNOTATION_REQUEST_TYPE","ANNOTATION_MESSAGE","deviceId","seq","requesterId","version","trackingId","config","trackingIdPrefix","uuid","v4","toString","timestamp","Date","getTime","filterMessage","socket","send","WebexPlugin"],"sources":["index.ts"],"sourcesContent":["import uuid from 'uuid';\n// eslint-disable-next-line import/no-extraneous-dependencies\nimport {WebexPlugin, config} from '@webex/webex-core';\nimport TriggerProxy from '../common/events/trigger-proxy';\n\nimport {\n EVENT_TRIGGERS,\n ANNOTATION_RELAY_TYPES,\n ANNOTATION,\n ANNOTATION_REQUEST_TYPE,\n ANNOTATION_ACTION_TYPE,\n ANNOTATION_RESOURCE_TYPE,\n} from './constants';\n\nimport {StrokeData, RequestData, IAnnotationChannel, CommandRequestBody} from './annotation.types';\nimport {HTTP_VERBS} from '../constants';\n\n/**\n * @description Annotation to handle LLM and Mercury message and locus API\n * @class\n */\nclass AnnotationChannel extends WebexPlugin implements IAnnotationChannel {\n namespace = ANNOTATION;\n\n private seqNum: number;\n\n hasSubscribedToEvents: boolean;\n\n approvalUrl: string;\n locusUrl: string;\n deviceUrl: string;\n\n /**\n * Initializes annotation module\n */\n constructor(...args) {\n super(...args);\n this.seqNum = 1;\n }\n\n /**\n * Process Stroke Data\n * @param {request} request stroke data\n * @returns {void}\n */\n private processStrokeMessage(request) {\n this.decryptContent(request.value.encryptionKeyUrl, request.value.content).then(\n (decryptedContent) => {\n request.value.content = decryptedContent;\n TriggerProxy.trigger(\n this,\n {\n file: 'annotation',\n function: 'processStrokeMessage',\n },\n EVENT_TRIGGERS.ANNOTATION_STROKE_DATA,\n {\n payload: request.value,\n }\n );\n }\n );\n }\n\n /** bind all events from mercury\n * @param {Object} e\n * @returns {undefined}\n */\n private eventCommandProcessor(e) {\n if (\n e?.data?.eventType === 'locus.approval_request' &&\n e?.data?.approval?.resourceType === ANNOTATION_RESOURCE_TYPE &&\n e?.data?.approval?.actionType\n ) {\n TriggerProxy.trigger(\n this,\n {\n file: 'annotation',\n function: 'approval_request',\n },\n EVENT_TRIGGERS.ANNOTATION_COMMAND,\n {\n type: e.data.approval.actionType,\n payload: e.data.approval,\n }\n );\n this.seqNum = (e?.sequenceNumber || 0) + 1;\n }\n }\n\n /** bind all events from llm\n * @param {Object} e\n * @returns {undefined}\n */\n private eventDataProcessor(e) {\n switch (e?.data?.relayType) {\n case ANNOTATION_RELAY_TYPES.ANNOTATION_CLIENT:\n this.seqNum = (e?.sequenceNumber || 0) + 1;\n this.processStrokeMessage(e.data.request);\n break;\n default:\n break;\n }\n }\n\n /**\n * Listen to websocket messages\n * @returns {undefined}\n */\n private listenToEvents() {\n if (!this.hasSubscribedToEvents) {\n // @ts-ignore\n this.webex.internal.mercury.on(\n 'event:locus.approval_request',\n this.eventCommandProcessor,\n this\n );\n // @ts-ignore\n this.webex.internal.llm.on('event:relay.event', this.eventDataProcessor, this);\n this.hasSubscribedToEvents = true;\n }\n }\n\n /**\n * set locusUrl\n * @param {string} locusUrl\n * @returns {void}\n */\n public locusUrlUpdate(locusUrl: string) {\n this.locusUrl = locusUrl;\n this.listenToEvents();\n }\n\n /**\n * set approved url\n * @param {string} approvalUrl\n * @returns {void}\n */\n public approvalUrlUpdate(approvalUrl: string) {\n this.approvalUrl = approvalUrl;\n }\n\n /**\n * accept request\n * @param {object} approval\n * @returns {Promise}\n */\n public acceptRequest(approval) {\n // @ts-ignore\n return this.request({\n method: HTTP_VERBS.PUT,\n url: approval.url,\n body: {\n resourceType: ANNOTATION_RESOURCE_TYPE,\n actionType: ANNOTATION_ACTION_TYPE.ACCEPTED,\n },\n });\n }\n\n /**\n * presenter declined request annotation\n * @param {approval} approval\n * @returns {Promise}\n */\n public declineRequest(approval) {\n // @ts-ignore\n return this.request({\n method: HTTP_VERBS.PUT,\n url: approval.url,\n body: {\n resourceType: ANNOTATION_RESOURCE_TYPE,\n actionType: ANNOTATION_ACTION_TYPE.DECLINED,\n },\n });\n }\n\n /**\n * request approved annotation\n * @param {RequestData} requestData\n * @returns {Promise}\n */\n public approveAnnotation(requestData: RequestData) {\n return this.sendAnnotationAction(ANNOTATION_ACTION_TYPE.REQUESTED, requestData);\n }\n\n /**\n * cancel approved annotation\n * @param {object} requestData\n * @param {object} approval\n * @returns {Promise}\n */\n public cancelApproveAnnotation(requestData: RequestData, approval) {\n const body: CommandRequestBody = {\n actionType: ANNOTATION_ACTION_TYPE.CANCELED,\n resourceType: 'AnnotationOnShare',\n shareInstanceId: requestData.shareInstanceId,\n };\n\n // @ts-ignore\n return this.request({\n method: HTTP_VERBS.PUT,\n url: `${approval.url}`,\n body,\n });\n }\n\n /**\n * close annotation\n * @param {object} requestData\n * @returns {Promise}\n */\n public closeAnnotation(requestData: RequestData) {\n return this.sendAnnotationAction(ANNOTATION_ACTION_TYPE.CLOSED, requestData);\n }\n\n /**\n * send annotation command\n * @param {ANNOTATION_ACTION_TYPE} actionType\n * @param {RequestData} requestData\n * @returns {Promise}\n */\n private sendAnnotationAction = async (\n actionType: ANNOTATION_ACTION_TYPE,\n requestData: RequestData\n ): Promise<void> => {\n const body: CommandRequestBody = {\n actionType,\n resourceType: 'AnnotationOnShare',\n shareInstanceId: requestData.shareInstanceId,\n };\n if (requestData?.toUserId) {\n body.receivers = [{participantId: requestData.toUserId, deviceUrl: requestData.toDeviceUrl}];\n }\n\n // @ts-ignore\n return this.request({\n method: HTTP_VERBS.POST,\n url: `${this.approvalUrl}`,\n body,\n });\n };\n\n /**\n * decrypt data\n * @param {string} encryptionKeyUrl\n * @param {string} content encrypted content\n * @returns {string} decrypted content\n */\n private decryptContent = (encryptionKeyUrl: string, content: string): Promise<any> => {\n // @ts-ignore\n return this.webex.internal.encryption.decryptText(encryptionKeyUrl, content).then((res) => {\n return res;\n });\n };\n\n /**\n * encrypt data\n * @param {string} encryptionKeyUrl\n * @param {string} content original content\n * @returns {string} encrypted content\n */\n private encryptContent = (encryptionKeyUrl: string, content: string): Promise<any> => {\n // @ts-ignore\n return this.webex.internal.encryption.encryptText(encryptionKeyUrl, content).then((res) => {\n return res;\n });\n };\n\n /**\n * Sends stroke data to presenter\n * @param {StrokeData} strokeData\n * @returns {void}\n */\n public sendStrokeData = (strokeData: StrokeData): void => {\n // @ts-ignore\n if (!this.webex.internal.llm.isConnected()) return;\n this.encryptContent(strokeData.encryptionKeyUrl, strokeData.content).then(\n (encryptedContent) => {\n this.publishEncrypted(encryptedContent, strokeData);\n }\n );\n };\n\n /**\n * Change annotation options\n * @param {object} options\n * @param {object} meeting\n * @returns {Promise}\n */\n public changeAnnotationOptions(options, meeting) {\n return meeting?.meetingRequest.changeMeetingFloor(options);\n }\n\n /**\n * private encrypted the strokes data\n * @param {string} encryptedContent\n * @param {StrokeData} strokeData\n * @returns {void}\n */\n private publishEncrypted(encryptedContent: string, strokeData: StrokeData) {\n const data = {\n id: `${this.seqNum}`,\n type: 'publishRequest',\n recipients: {\n // @ts-ignore\n route: this.webex.internal.llm.getBinding(),\n },\n headers: {\n to: strokeData.toUserId,\n },\n data: {\n eventType: 'relay.event',\n relayType: ANNOTATION_RELAY_TYPES.ANNOTATION_CLIENT,\n request: {\n value: {\n type: ANNOTATION_REQUEST_TYPE.ANNOTATION_MESSAGE,\n content: encryptedContent,\n deviceId: strokeData.deviceId,\n seq: this.seqNum,\n requesterId: strokeData.requesterId,\n version: strokeData.version,\n shareInstanceId: strokeData.shareInstanceId,\n encryptionKeyUrl: strokeData.encryptionKeyUrl,\n },\n },\n },\n trackingId: `${config.trackingIdPrefix}_${uuid.v4().toString()}`,\n timestamp: new Date().getTime(),\n sequenceNumber: this.seqNum,\n filterMessage: false,\n };\n\n // @ts-ignore\n this.webex.internal.llm.socket.send(data);\n this.seqNum += 1;\n }\n}\n\nexport default AnnotationChannel;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAEA;AACA;AAEA;AAUA;AAAwC;AAAA;AAExC;AACA;AACA;AACA;AAHA,IAIMA,iBAAiB;EAAA;EAAA;EAWrB;AACF;AACA;EACE,6BAAqB;IAAA;IAAA;IAAA,kCAANC,IAAI;MAAJA,IAAI;IAAA;IACjB,gDAASA,IAAI;IAAE,wFAdLC,qBAAU;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;MAAA,mFAuMS,iBAC7BC,UAAkC,EAClCC,WAAwB;QAAA;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,gBAAgB,EAAES,UAAU,CAACT;YAC/B;UACF;QACF,CAAC;QACDqE,UAAU,YAAKC,iBAAM,CAACC,gBAAgB,cAAIC,aAAI,CAACC,EAAE,EAAE,CAACC,QAAQ,EAAE,CAAE;QAChEC,SAAS,EAAE,IAAIC,IAAI,EAAE,CAACC,OAAO,EAAE;QAC/B5C,cAAc,EAAE,IAAI,CAAClB,MAAM;QAC3B+D,aAAa,EAAE;MACjB,CAAC;;MAED;MACA,IAAI,CAAC5E,KAAK,CAACC,QAAQ,CAACO,GAAG,CAACqE,MAAM,CAACC,IAAI,CAACrD,IAAI,CAAC;MACzC,IAAI,CAACZ,MAAM,IAAI,CAAC;IAClB;EAAC;EAAA;AAAA,EA1T6BkE,sBAAW;AAAA,eA6T5BpG,iBAAiB;AAAA"}
1
+ {"version":3,"names":["AnnotationChannel","args","ANNOTATION","actionType","requestData","body","resourceType","shareInstanceId","toUserId","receivers","participantId","deviceUrl","toDeviceUrl","request","method","HTTP_VERBS","POST","url","approvalUrl","encryptionKeyUrl","content","webex","internal","encryption","decryptText","then","res","encryptText","strokeData","llm","isConnected","encryptContent","encryptedContent","publishEncrypted","seqNum","data","decryptContent","value","decryptedContent","TriggerProxy","trigger","file","function","EVENT_TRIGGERS","ANNOTATION_STROKE_DATA","payload","e","eventType","approval","ANNOTATION_RESOURCE_TYPE","ANNOTATION_COMMAND","type","sequenceNumber","relayType","ANNOTATION_RELAY_TYPES","ANNOTATION_CLIENT","processStrokeMessage","hasSubscribedToEvents","mercury","on","eventCommandProcessor","eventDataProcessor","locusUrl","listenToEvents","PUT","ANNOTATION_ACTION_TYPE","ACCEPTED","DECLINED","sendAnnotationAction","REQUESTED","CANCELED","CLOSED","remoteShareUrl","annotationInfo","PATCH","id","recipients","route","getBinding","headers","to","ANNOTATION_REQUEST_TYPE","ANNOTATION_MESSAGE","deviceId","seq","requesterId","version","trackingId","config","trackingIdPrefix","uuid","v4","toString","timestamp","Date","getTime","filterMessage","socket","send","WebexPlugin"],"sources":["index.ts"],"sourcesContent":["import uuid from 'uuid';\n// eslint-disable-next-line import/no-extraneous-dependencies\nimport {WebexPlugin, config} from '@webex/webex-core';\nimport TriggerProxy from '../common/events/trigger-proxy';\n\nimport {\n EVENT_TRIGGERS,\n ANNOTATION_RELAY_TYPES,\n ANNOTATION,\n ANNOTATION_REQUEST_TYPE,\n ANNOTATION_ACTION_TYPE,\n ANNOTATION_RESOURCE_TYPE,\n} from './constants';\n\nimport {StrokeData, RequestData, IAnnotationChannel, CommandRequestBody} from './annotation.types';\nimport {HTTP_VERBS} from '../constants';\n\n/**\n * @description Annotation to handle LLM and Mercury message and locus API\n * @class\n */\nclass AnnotationChannel extends WebexPlugin implements IAnnotationChannel {\n namespace = ANNOTATION;\n\n private seqNum: number;\n\n hasSubscribedToEvents: boolean;\n\n approvalUrl: string;\n locusUrl: string;\n deviceUrl: string;\n\n /**\n * Initializes annotation module\n */\n constructor(...args) {\n super(...args);\n this.seqNum = 1;\n }\n\n /**\n * Process Stroke Data\n * @param {object} data\n * @returns {void}\n */\n private processStrokeMessage(data) {\n const {request} = data;\n this.decryptContent(request.value.encryptionKeyUrl, request.value.content).then(\n (decryptedContent) => {\n request.value.content = decryptedContent;\n TriggerProxy.trigger(\n this,\n {\n file: 'annotation',\n function: 'processStrokeMessage',\n },\n EVENT_TRIGGERS.ANNOTATION_STROKE_DATA,\n {\n payload: data,\n }\n );\n }\n );\n }\n\n /** bind all events from mercury\n * @param {Object} e\n * @returns {undefined}\n */\n private eventCommandProcessor(e) {\n if (\n e?.data?.eventType === 'locus.approval_request' &&\n e?.data?.approval?.resourceType === ANNOTATION_RESOURCE_TYPE &&\n e?.data?.approval?.actionType\n ) {\n TriggerProxy.trigger(\n this,\n {\n file: 'annotation',\n function: 'approval_request',\n },\n EVENT_TRIGGERS.ANNOTATION_COMMAND,\n {\n type: e.data.approval.actionType,\n payload: e.data.approval,\n }\n );\n this.seqNum = (e?.sequenceNumber || 0) + 1;\n }\n }\n\n /** bind all events from llm\n * @param {Object} e\n * @returns {undefined}\n */\n private eventDataProcessor(e) {\n switch (e?.data?.relayType) {\n case ANNOTATION_RELAY_TYPES.ANNOTATION_CLIENT:\n this.seqNum = (e?.sequenceNumber || 0) + 1;\n this.processStrokeMessage(e.data);\n break;\n default:\n break;\n }\n }\n\n /**\n * Listen to websocket messages\n * @returns {undefined}\n */\n private listenToEvents() {\n if (!this.hasSubscribedToEvents) {\n // @ts-ignore\n this.webex.internal.mercury.on(\n 'event:locus.approval_request',\n this.eventCommandProcessor,\n this\n );\n // @ts-ignore\n this.webex.internal.llm.on('event:relay.event', this.eventDataProcessor, this);\n this.hasSubscribedToEvents = true;\n }\n }\n\n /**\n * set locusUrl\n * @param {string} locusUrl\n * @returns {void}\n */\n public locusUrlUpdate(locusUrl: string) {\n this.locusUrl = locusUrl;\n this.listenToEvents();\n }\n\n /**\n * set approved url\n * @param {string} approvalUrl\n * @returns {void}\n */\n public approvalUrlUpdate(approvalUrl: string) {\n this.approvalUrl = approvalUrl;\n }\n\n /**\n * accept request\n * @param {object} approval\n * @returns {Promise}\n */\n public acceptRequest(approval) {\n // @ts-ignore\n return this.request({\n method: HTTP_VERBS.PUT,\n url: approval.url,\n body: {\n resourceType: ANNOTATION_RESOURCE_TYPE,\n actionType: ANNOTATION_ACTION_TYPE.ACCEPTED,\n },\n });\n }\n\n /**\n * presenter declined request annotation\n * @param {approval} approval\n * @returns {Promise}\n */\n public declineRequest(approval) {\n // @ts-ignore\n return this.request({\n method: HTTP_VERBS.PUT,\n url: approval.url,\n body: {\n resourceType: ANNOTATION_RESOURCE_TYPE,\n actionType: ANNOTATION_ACTION_TYPE.DECLINED,\n },\n });\n }\n\n /**\n * request approved annotation\n * @param {RequestData} requestData\n * @returns {Promise}\n */\n public approveAnnotation(requestData: RequestData) {\n return this.sendAnnotationAction(ANNOTATION_ACTION_TYPE.REQUESTED, requestData);\n }\n\n /**\n * cancel approved annotation\n * @param {object} requestData\n * @param {object} approval\n * @returns {Promise}\n */\n public cancelApproveAnnotation(requestData: RequestData, approval) {\n const body: CommandRequestBody = {\n actionType: ANNOTATION_ACTION_TYPE.CANCELED,\n resourceType: 'AnnotationOnShare',\n shareInstanceId: requestData.shareInstanceId,\n };\n\n // @ts-ignore\n return this.request({\n method: HTTP_VERBS.PUT,\n url: `${approval.url}`,\n body,\n });\n }\n\n /**\n * close annotation\n * @param {object} requestData\n * @returns {Promise}\n */\n public closeAnnotation(requestData: RequestData) {\n return this.sendAnnotationAction(ANNOTATION_ACTION_TYPE.CLOSED, requestData);\n }\n\n /**\n * send annotation command\n * @param {ANNOTATION_ACTION_TYPE} actionType\n * @param {RequestData} requestData\n * @returns {Promise}\n */\n private sendAnnotationAction = async (\n actionType: ANNOTATION_ACTION_TYPE,\n requestData: RequestData\n ): Promise<void> => {\n const body: CommandRequestBody = {\n actionType,\n resourceType: 'AnnotationOnShare',\n shareInstanceId: requestData.shareInstanceId,\n };\n if (requestData?.toUserId) {\n body.receivers = [{participantId: requestData.toUserId, deviceUrl: requestData.toDeviceUrl}];\n }\n\n // @ts-ignore\n return this.request({\n method: HTTP_VERBS.POST,\n url: `${this.approvalUrl}`,\n body,\n });\n };\n\n /**\n * decrypt data\n * @param {string} encryptionKeyUrl\n * @param {string} content encrypted content\n * @returns {string} decrypted content\n */\n private decryptContent = (encryptionKeyUrl: string, content: string): Promise<any> => {\n // @ts-ignore\n return this.webex.internal.encryption.decryptText(encryptionKeyUrl, content).then((res) => {\n return res;\n });\n };\n\n /**\n * encrypt data\n * @param {string} encryptionKeyUrl\n * @param {string} content original content\n * @returns {string} encrypted content\n */\n private encryptContent = (encryptionKeyUrl: string, content: string): Promise<any> => {\n // @ts-ignore\n return this.webex.internal.encryption.encryptText(encryptionKeyUrl, content).then((res) => {\n return res;\n });\n };\n\n /**\n * Sends stroke data to presenter\n * @param {StrokeData} strokeData\n * @returns {void}\n */\n public sendStrokeData = (strokeData: StrokeData): void => {\n // @ts-ignore\n if (!this.webex.internal.llm.isConnected()) return;\n this.encryptContent(strokeData.encryptionKeyUrl, strokeData.content).then(\n (encryptedContent) => {\n this.publishEncrypted(encryptedContent, strokeData);\n }\n );\n };\n\n /**\n * Change annotation options\n * @param {remoteShareUrl} remoteShareUrl\n * @param {annotationInfo} annotationInfo\n * @returns {Promise}\n */\n public changeAnnotationOptions(remoteShareUrl, annotationInfo) {\n // @ts-ignore\n return this.request({\n method: HTTP_VERBS.PATCH,\n url: remoteShareUrl,\n body: annotationInfo,\n });\n }\n\n /**\n * private encrypted the strokes data\n * @param {string} encryptedContent\n * @param {StrokeData} strokeData\n * @returns {void}\n */\n private publishEncrypted(encryptedContent: string, strokeData: StrokeData) {\n const data = {\n id: `${this.seqNum}`,\n type: 'publishRequest',\n recipients: {\n // @ts-ignore\n route: this.webex.internal.llm.getBinding(),\n },\n headers: {\n to: strokeData.toUserId,\n },\n data: {\n eventType: 'relay.event',\n relayType: ANNOTATION_RELAY_TYPES.ANNOTATION_CLIENT,\n request: {\n value: {\n type: ANNOTATION_REQUEST_TYPE.ANNOTATION_MESSAGE,\n content: encryptedContent,\n deviceId: strokeData.deviceId,\n seq: this.seqNum,\n requesterId: strokeData.requesterId,\n version: strokeData.version,\n shareInstanceId: strokeData.shareInstanceId,\n encryptionKeyUrl: strokeData.encryptionKeyUrl,\n },\n },\n },\n trackingId: `${config.trackingIdPrefix}_${uuid.v4().toString()}`,\n timestamp: new Date().getTime(),\n sequenceNumber: this.seqNum,\n filterMessage: false,\n };\n\n // @ts-ignore\n this.webex.internal.llm.socket.send(data);\n this.seqNum += 1;\n }\n}\n\nexport default AnnotationChannel;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAEA;AACA;AAEA;AAUA;AAAwC;AAAA;AAExC;AACA;AACA;AACA;AAHA,IAIMA,iBAAiB;EAAA;EAAA;EAWrB;AACF;AACA;EACE,6BAAqB;IAAA;IAAA;IAAA,kCAANC,IAAI;MAAJA,IAAI;IAAA;IACjB,gDAASA,IAAI;IAAE,wFAdLC,qBA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AG,EAAE,IAAI,CAAClD,MAAM;cAChBmD,WAAW,EAAEzD,UAAU,CAACyD,WAAW;cACnCC,OAAO,EAAE1D,UAAU,CAAC0D,OAAO;cAC3B/E,eAAe,EAAEqB,UAAU,CAACrB,eAAe;cAC3CY,gBAAgB,EAAES,UAAU,CAACT;YAC/B;UACF;QACF,CAAC;QACDoE,UAAU,YAAKC,iBAAM,CAACC,gBAAgB,cAAIC,aAAI,CAACC,EAAE,EAAE,CAACC,QAAQ,EAAE,CAAE;QAChEC,SAAS,EAAE,IAAIC,IAAI,EAAE,CAACC,OAAO,EAAE;QAC/B3C,cAAc,EAAE,IAAI,CAAClB,MAAM;QAC3B8D,aAAa,EAAE;MACjB,CAAC;;MAED;MACA,IAAI,CAAC3E,KAAK,CAACC,QAAQ,CAACO,GAAG,CAACoE,MAAM,CAACC,IAAI,CAAC/D,IAAI,CAAC;MACzC,IAAI,CAACD,MAAM,IAAI,CAAC;IAClB;EAAC;EAAA;AAAA,EAhU6BiE,sBAAW;AAAA,eAmU5BnG,iBAAiB;AAAA"}
@@ -186,7 +186,7 @@ var Breakout = _webexCore.WebexPlugin.extend({
186
186
  sessionId: this.sessionId
187
187
  });
188
188
  },
189
- version: "3.0.0-beta.142"
189
+ version: "3.0.0-beta.143"
190
190
  });
191
191
  var _default = Breakout;
192
192
  exports.default = _default;
@@ -1005,7 +1005,7 @@ var Breakouts = _webexCore.WebexPlugin.extend({
1005
1005
  this.trigger(_constants.BREAKOUTS.EVENTS.ASK_RETURN_TO_MAIN);
1006
1006
  }
1007
1007
  },
1008
- version: "3.0.0-beta.142"
1008
+ version: "3.0.0-beta.143"
1009
1009
  });
1010
1010
  var _default = Breakouts;
1011
1011
  exports.default = _default;
@@ -25,7 +25,7 @@ interface IAnnotationChannel {
25
25
  acceptRequest: (approval: any) => undefined | Promise<void>;
26
26
  declineRequest: (approval: any) => undefined | Promise<void>;
27
27
  closeAnnotation: (requestData: RequestData) => undefined | Promise<void>;
28
- changeAnnotationOptions: (options: any, meeting: any) => undefined | Promise<void>;
28
+ changeAnnotationOptions: (remoteShareUrl: any, annotationInfo: any) => undefined | Promise<void>;
29
29
  approveAnnotation: (requestData: RequestData) => undefined | Promise<void>;
30
30
  cancelApproveAnnotation: (requestData: RequestData, approval: any) => undefined | Promise<void>;
31
31
  sendStrokeData: (strokeData: StrokeData) => void;
@@ -17,7 +17,7 @@ declare class AnnotationChannel extends WebexPlugin implements IAnnotationChanne
17
17
  constructor(...args: any[]);
18
18
  /**
19
19
  * Process Stroke Data
20
- * @param {request} request stroke data
20
+ * @param {object} data
21
21
  * @returns {void}
22
22
  */
23
23
  private processStrokeMessage;
@@ -108,11 +108,11 @@ declare class AnnotationChannel extends WebexPlugin implements IAnnotationChanne
108
108
  sendStrokeData: (strokeData: StrokeData) => void;
109
109
  /**
110
110
  * Change annotation options
111
- * @param {object} options
112
- * @param {object} meeting
111
+ * @param {remoteShareUrl} remoteShareUrl
112
+ * @param {annotationInfo} annotationInfo
113
113
  * @returns {Promise}
114
114
  */
115
- changeAnnotationOptions(options: any, meeting: any): any;
115
+ changeAnnotationOptions(remoteShareUrl: any, annotationInfo: any): any;
116
116
  /**
117
117
  * private encrypted the strokes data
118
118
  * @param {string} encryptedContent
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webex/plugin-meetings",
3
- "version": "3.0.0-beta.142",
3
+ "version": "3.0.0-beta.143",
4
4
  "description": "",
5
5
  "license": "Cisco EULA (https://www.cisco.com/c/en/us/products/end-user-license-agreement.html)",
6
6
  "contributors": [
@@ -32,12 +32,12 @@
32
32
  "build": "yarn run -T tsc --declaration true --declarationDir ./dist/types"
33
33
  },
34
34
  "devDependencies": {
35
- "@webex/plugin-meetings": "3.0.0-beta.142",
36
- "@webex/test-helper-chai": "3.0.0-beta.142",
37
- "@webex/test-helper-mocha": "3.0.0-beta.142",
38
- "@webex/test-helper-mock-webex": "3.0.0-beta.142",
39
- "@webex/test-helper-retry": "3.0.0-beta.142",
40
- "@webex/test-helper-test-users": "3.0.0-beta.142",
35
+ "@webex/plugin-meetings": "3.0.0-beta.143",
36
+ "@webex/test-helper-chai": "3.0.0-beta.143",
37
+ "@webex/test-helper-mocha": "3.0.0-beta.143",
38
+ "@webex/test-helper-mock-webex": "3.0.0-beta.143",
39
+ "@webex/test-helper-retry": "3.0.0-beta.143",
40
+ "@webex/test-helper-test-users": "3.0.0-beta.143",
41
41
  "chai": "^4.3.4",
42
42
  "chai-as-promised": "^7.1.1",
43
43
  "jsdom-global": "3.0.2",
@@ -46,19 +46,19 @@
46
46
  "typescript": "^4.7.4"
47
47
  },
48
48
  "dependencies": {
49
- "@webex/common": "3.0.0-beta.142",
49
+ "@webex/common": "3.0.0-beta.143",
50
50
  "@webex/internal-media-core": "1.38.3",
51
- "@webex/internal-plugin-conversation": "3.0.0-beta.142",
52
- "@webex/internal-plugin-device": "3.0.0-beta.142",
53
- "@webex/internal-plugin-llm": "3.0.0-beta.142",
54
- "@webex/internal-plugin-mercury": "3.0.0-beta.142",
55
- "@webex/internal-plugin-metrics": "3.0.0-beta.142",
56
- "@webex/internal-plugin-support": "3.0.0-beta.142",
57
- "@webex/internal-plugin-user": "3.0.0-beta.142",
58
- "@webex/media-helpers": "3.0.0-beta.142",
59
- "@webex/plugin-people": "3.0.0-beta.142",
60
- "@webex/plugin-rooms": "3.0.0-beta.142",
61
- "@webex/webex-core": "3.0.0-beta.142",
51
+ "@webex/internal-plugin-conversation": "3.0.0-beta.143",
52
+ "@webex/internal-plugin-device": "3.0.0-beta.143",
53
+ "@webex/internal-plugin-llm": "3.0.0-beta.143",
54
+ "@webex/internal-plugin-mercury": "3.0.0-beta.143",
55
+ "@webex/internal-plugin-metrics": "3.0.0-beta.143",
56
+ "@webex/internal-plugin-support": "3.0.0-beta.143",
57
+ "@webex/internal-plugin-user": "3.0.0-beta.143",
58
+ "@webex/media-helpers": "3.0.0-beta.143",
59
+ "@webex/plugin-people": "3.0.0-beta.143",
60
+ "@webex/plugin-rooms": "3.0.0-beta.143",
61
+ "@webex/webex-core": "3.0.0-beta.143",
62
62
  "ampersand-collection": "^2.0.2",
63
63
  "bowser": "^2.11.0",
64
64
  "btoa": "^1.2.1",
@@ -29,7 +29,8 @@ interface IAnnotationChannel {
29
29
  acceptRequest: (approval) => undefined | Promise<void>;
30
30
  declineRequest: (approval) => undefined | Promise<void>;
31
31
  closeAnnotation: (requestData: RequestData) => undefined | Promise<void>;
32
- changeAnnotationOptions: (options, meeting) => undefined | Promise<void>;
32
+ // change annotation privilege
33
+ changeAnnotationOptions: (remoteShareUrl, annotationInfo) => undefined | Promise<void>;
33
34
  // === below is for attendee
34
35
  approveAnnotation: (requestData: RequestData) => undefined | Promise<void>;
35
36
  cancelApproveAnnotation: (requestData: RequestData, approval) => undefined | Promise<void>;
@@ -40,10 +40,11 @@ class AnnotationChannel extends WebexPlugin implements IAnnotationChannel {
40
40
 
41
41
  /**
42
42
  * Process Stroke Data
43
- * @param {request} request stroke data
43
+ * @param {object} data
44
44
  * @returns {void}
45
45
  */
46
- private processStrokeMessage(request) {
46
+ private processStrokeMessage(data) {
47
+ const {request} = data;
47
48
  this.decryptContent(request.value.encryptionKeyUrl, request.value.content).then(
48
49
  (decryptedContent) => {
49
50
  request.value.content = decryptedContent;
@@ -55,7 +56,7 @@ class AnnotationChannel extends WebexPlugin implements IAnnotationChannel {
55
56
  },
56
57
  EVENT_TRIGGERS.ANNOTATION_STROKE_DATA,
57
58
  {
58
- payload: request.value,
59
+ payload: data,
59
60
  }
60
61
  );
61
62
  }
@@ -96,7 +97,7 @@ class AnnotationChannel extends WebexPlugin implements IAnnotationChannel {
96
97
  switch (e?.data?.relayType) {
97
98
  case ANNOTATION_RELAY_TYPES.ANNOTATION_CLIENT:
98
99
  this.seqNum = (e?.sequenceNumber || 0) + 1;
99
- this.processStrokeMessage(e.data.request);
100
+ this.processStrokeMessage(e.data);
100
101
  break;
101
102
  default:
102
103
  break;
@@ -283,12 +284,17 @@ class AnnotationChannel extends WebexPlugin implements IAnnotationChannel {
283
284
 
284
285
  /**
285
286
  * Change annotation options
286
- * @param {object} options
287
- * @param {object} meeting
287
+ * @param {remoteShareUrl} remoteShareUrl
288
+ * @param {annotationInfo} annotationInfo
288
289
  * @returns {Promise}
289
290
  */
290
- public changeAnnotationOptions(options, meeting) {
291
- return meeting?.meetingRequest.changeMeetingFloor(options);
291
+ public changeAnnotationOptions(remoteShareUrl, annotationInfo) {
292
+ // @ts-ignore
293
+ return this.request({
294
+ method: HTTP_VERBS.PATCH,
295
+ url: remoteShareUrl,
296
+ body: annotationInfo,
297
+ });
292
298
  }
293
299
 
294
300
  /**
@@ -144,7 +144,10 @@ describe('live-annotation', () => {
144
144
 
145
145
  annotationService.eventDataProcessor({data: {relayType: 'annotation.client', request:{value:{encryptionKeyUrl:"encryptionKeyUrl"}}}});
146
146
 
147
- assert.calledOnceWithExactly(spy, {value:{encryptionKeyUrl:"encryptionKeyUrl"}});
147
+ assert.calledOnceWithExactly(spy, {
148
+ relayType: 'annotation.client',
149
+ request: { value: { encryptionKeyUrl: 'encryptionKeyUrl' } }
150
+ } );
148
151
 
149
152
  });
150
153
 
@@ -153,10 +156,10 @@ describe('live-annotation', () => {
153
156
  const spy = sinon.spy();
154
157
  annotationService.on(EVENT_TRIGGERS.ANNOTATION_STROKE_DATA, spy);
155
158
 
156
- await annotationService.processStrokeMessage({value:{encryptionKeyUrl: 'encryptionKeyUrl', content: 'content'}});
159
+ await annotationService.processStrokeMessage({request:{value:{encryptionKeyUrl: 'encryptionKeyUrl', content: 'content'}}});
157
160
 
158
161
  assert.calledOnceWithExactly(spy, {
159
- payload: {encryptionKeyUrl: 'encryptionKeyUrl', content: 'decryptedContent'},
162
+ payload:{request:{value:{encryptionKeyUrl: 'encryptionKeyUrl', content: 'decryptedContent'}}} ,
160
163
  });
161
164
 
162
165
  });
@@ -341,20 +344,20 @@ describe('live-annotation', () => {
341
344
  });
342
345
 
343
346
  describe('change annotation options', () => {
344
- it('makes change annotation options as expected', () => {
345
- const options = {
347
+ it('makes change annotation options as expected', async() => {
348
+ const options = { annotationInfo:{
346
349
  version: '1',
347
350
  policy: 'AnnotationNotAllowed',
348
- };
349
- const meeting = {
350
- meetingRequest : {
351
- changeMeetingFloor: () => {
352
- }
353
- }
354
- }
355
- sinon.spy(meeting.meetingRequest, 'changeMeetingFloor');
356
- annotationService.changeAnnotationOptions(options,meeting);
357
- assert.calledOnceWithExactly(meeting.meetingRequest.changeMeetingFloor, options);
351
+ }};
352
+
353
+ const remoteShareUrl = 'remoteShareUrl';
354
+ const result = await annotationService.changeAnnotationOptions(remoteShareUrl,options);
355
+ assert.calledOnceWithExactly(webex.request, {
356
+ method: 'PATCH',
357
+ url: 'remoteShareUrl',
358
+ body: {annotationInfo: { version: '1', policy: 'AnnotationNotAllowed' }}
359
+ });
360
+ assert.equal(result, 'REQUEST_RETURN_VALUE')
358
361
  });
359
362
  });
360
363