UNPKG

grafo-client

Version:

Grafo Client API Library

1 lines 922 B
function Comment_old(t,e,o){"add"==t&&(this.msgType="new_comment",this.msg="adding new comment"),this.text=e,this.isResolved=void 0!==o&&o}module.exports=Comment_old,Comment_old.prototype.getText=function(){return this.text},Comment_old.prototype.setText=function(t){this.text=t},Comment_old.prototype.setOwningDocument=function(t){this.owningDoc=t},Comment_old.prototype.setParent=function(t){if(void 0===t||null==t)throw new Error("Parent cannot be empty");this.parent=t},Comment_old.prototype.getCommunicationFormat=function(t){if("add"==t){var e={documentId:this.owningDoc,commentText:this.text};if("concept"==this.parent.nodeType)e.nodeId=this.parent.id;else{if("attribute"!=this.parent.nodeType)throw new Error("Hey Shruthi !!! you havent defined how to handle comment for anything other than concept");e.nodeId=this.parent.groupId,e.subId=this.parent.id}}return{messageType:this.msgType,message:this.msg,params:e}};