Ghost/ghost/member-events/lib/MemberEntryViewEvent.js
Fabien O'Carroll 3f9af4f554 Added @tryghost/member-events
refs https://github.com/TryGhost/Team/issues/1054

This will hold all of the event definitions used in members so that they
can be used across packages.
2021-09-17 15:22:08 +02:00

27 lines
620 B
JavaScript

/**
* @typedef {object} MemberEntryViewEventData
* @prop {string} memberId
* @prop {string} memberStatus
* @prop {string} entryId
* @prop {string} entryUrl
*/
module.exports = class MemberEntryViewEvent {
/**
* @param {MemberEntryViewEventData} data
* @param {Date} timestamp
*/
constructor(data, timestamp) {
this.data = data;
this.timestamp = timestamp;
}
/**
* @param {MemberEntryViewEventData} data
* @param {Date} [timestamp]
*/
static create(data, timestamp) {
return new MemberEntryViewEvent(data, timestamp || new Date);
}
};