mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-28 13:22:39 +03:00
29 lines
651 B
JavaScript
29 lines
651 B
JavaScript
|
/**
|
||
|
* @typedef {object} MemberCommentEventData
|
||
|
* @prop {string} memberId
|
||
|
* @prop {string} commentId
|
||
|
* @prop {string} postId
|
||
|
*/
|
||
|
|
||
|
/**
|
||
|
* Server-side event firing on page views (page, post, tags...)
|
||
|
*/
|
||
|
module.exports = class MemberCommentEvent {
|
||
|
/**
|
||
|
* @param {MemberCommentEventData} data
|
||
|
* @param {Date} timestamp
|
||
|
*/
|
||
|
constructor(data, timestamp) {
|
||
|
this.data = data;
|
||
|
this.timestamp = timestamp;
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* @param {MemberCommentEventData} data
|
||
|
* @param {Date} [timestamp]
|
||
|
*/
|
||
|
static create(data, timestamp) {
|
||
|
return new MemberCommentEvent(data, timestamp || new Date);
|
||
|
}
|
||
|
};
|