@pageproof/sdk-pr 567.0.1731458118024 → 568.0.1731465535064

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.
@@ -184,6 +184,12 @@ declare class Comment {
184
184
  * @type {boolean}
185
185
  */
186
186
  isPrivate: boolean;
187
+ /**
188
+ * User ids of user who have been mentioned in this comment.
189
+ *
190
+ * @type {Array<String>}
191
+ */
192
+ mentionedIds: Array<String>;
187
193
  /**
188
194
  * @private
189
195
  * @param {object} commentData The comment object from the server
@@ -1 +1 @@
1
- "use strict";exports.__esModule=true;var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key]}}}return target};var _transform=require("./transform");var _transform2=_interopRequireDefault(_transform);var _User=require("./User");var _User2=_interopRequireDefault(_User);var _File=require("./File");var _File2=_interopRequireDefault(_File);var _parseComment=require("../util/comments/parseComment");var _parseComment2=_interopRequireDefault(_parseComment);var _getCommentState=require("../util/comments/getCommentState");var _getCommentState2=_interopRequireDefault(_getCommentState);var _parsePins=require("../util/pins/parsePins");function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}var commentSchema={id:"CommentId",proofId:"ProofId",pins:function pins(data){return(0,_parsePins.parsePins)(data.XY).map(function(pin,index){if(index===0&&data.BoxFillType){return _extends({},pin,{fill:data.BoxFillType&&{type:data.BoxFillType,image:data.BoxFillImage}})}return pin})},pin:function pin(){return this.pins[0]},user:function user(data){return(new _User2.default).fromUser(data)},comment$:"EncryptedComment",envelope:"Envelope",attachments:function attachments(data){if(data.Attachments){return data.Attachments.map(function(attachment){return(new _File2.default).fromCommentAttachment(_extends({CommentId:data.CommentId},attachment))})}return[]},agreeCount:function agreeCount(data){return data.Agrees.length},pageNumber:(0,_transform.number)("Page"),mediaTime:function mediaTime(){return this.pin&&this.pin.time},mediaDuration:function mediaDuration(){return this.pin&&this.pin.duration},createdDate:(0,_transform.date)("Timestamp"),updatedDate:(0,_transform.date)("Updated"),parentCommentId:(0,_transform.optional)("Parent"),metadata:(0,_transform.json)("Metadata",{}),sourceMetadata:"SourceMetadata",state:function state(data){return(0,_getCommentState2.default)(data)},isPrivate:"Private"};var Comment=function(){function Comment(){_classCallCheck(this,Comment)}Comment.prototype.fromComment=function fromComment(commentData){(0,_transform2.default)(this,commentSchema,commentData);return this};Comment.prototype.fromRawComment=function fromRawComment(rawComment){var parsed=(0,_parseComment2.default)(rawComment);this.raw=rawComment;this.tokens=parsed;return this};return Comment}();exports.default=Comment;
1
+ "use strict";exports.__esModule=true;var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key]}}}return target};var _transform=require("./transform");var _transform2=_interopRequireDefault(_transform);var _User=require("./User");var _User2=_interopRequireDefault(_User);var _File=require("./File");var _File2=_interopRequireDefault(_File);var _parseComment=require("../util/comments/parseComment");var _parseComment2=_interopRequireDefault(_parseComment);var _getCommentState=require("../util/comments/getCommentState");var _getCommentState2=_interopRequireDefault(_getCommentState);var _parsePins=require("../util/pins/parsePins");function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}var commentSchema={id:"CommentId",proofId:"ProofId",pins:function pins(data){return(0,_parsePins.parsePins)(data.XY).map(function(pin,index){if(index===0&&data.BoxFillType){return _extends({},pin,{fill:data.BoxFillType&&{type:data.BoxFillType,image:data.BoxFillImage}})}return pin})},pin:function pin(){return this.pins[0]},user:function user(data){return(new _User2.default).fromUser(data)},comment$:"EncryptedComment",envelope:"Envelope",attachments:function attachments(data){if(data.Attachments){return data.Attachments.map(function(attachment){return(new _File2.default).fromCommentAttachment(_extends({CommentId:data.CommentId},attachment))})}return[]},agreeCount:function agreeCount(data){return data.Agrees.length},pageNumber:(0,_transform.number)("Page"),mediaTime:function mediaTime(){return this.pin&&this.pin.time},mediaDuration:function mediaDuration(){return this.pin&&this.pin.duration},createdDate:(0,_transform.date)("Timestamp"),updatedDate:(0,_transform.date)("Updated"),parentCommentId:(0,_transform.optional)("Parent"),metadata:(0,_transform.json)("Metadata",{}),sourceMetadata:"SourceMetadata",state:function state(data){return(0,_getCommentState2.default)(data)},isPrivate:"Private",mentionedIds:"MentionedIds"};var Comment=function(){function Comment(){_classCallCheck(this,Comment)}Comment.prototype.fromComment=function fromComment(commentData){(0,_transform2.default)(this,commentSchema,commentData);return this};Comment.prototype.fromRawComment=function fromRawComment(rawComment){var parsed=(0,_parseComment2.default)(rawComment);this.raw=rawComment;this.tokens=parsed;return this};return Comment}();exports.default=Comment;