Ghost/ghost/member-events/lib/MemberSubscribeEvent.js
Naz 8892a60948 Renamed verification threshold parameter
refs https://github.com/TryGhost/Toolbox/issues/387

- There will three distinct verification limits soon. To keep the naming clear "configThreshold" would be too generic/confusing to use.
- Introduced jsdoc descriptions for the "source" parameter, which will be corelating with each new config parameter ("apiTriggerThreshold", "importTriggerThreshold", "adminTriggerThreshold", etc.). This should give a better visibility into parameters we are dealing in this area.
2022-08-25 14:26:44 +08:00

25 lines
603 B
JavaScript

/**
* @typedef {object} MemberSubscribeEventData
* @prop {string} memberId
* @prop {'import' | 'system' | 'api' | 'admin' | 'member'} source
*/
module.exports = class MemberSubscribeEvent {
/**
* @param {MemberSubscribeEventData} data
* @param {Date} timestamp
*/
constructor(data, timestamp) {
this.data = data;
this.timestamp = timestamp;
}
/**
* @param {MemberSubscribeEventData} data
* @param {Date} [timestamp]
*/
static create(data, timestamp) {
return new MemberSubscribeEvent(data, timestamp || new Date);
}
};