mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-30 21:40:39 +03:00
8892a60948
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.
26 lines
697 B
JavaScript
26 lines
697 B
JavaScript
/**
|
|
* @typedef {object} MemberCreatedEventData
|
|
* @prop {string} memberId
|
|
* @prop {'import' | 'system' | 'api' | 'admin' | 'member'} source
|
|
* @prop {import('@tryghost/member-attribution/lib/attribution').Attribution} [attribution] Attribution
|
|
*/
|
|
|
|
module.exports = class MemberCreatedEvent {
|
|
/**
|
|
* @param {MemberCreatedEventData} data
|
|
* @param {Date} timestamp
|
|
*/
|
|
constructor(data, timestamp) {
|
|
this.data = data;
|
|
this.timestamp = timestamp;
|
|
}
|
|
|
|
/**
|
|
* @param {MemberCreatedEventData} data
|
|
* @param {Date} [timestamp]
|
|
*/
|
|
static create(data, timestamp) {
|
|
return new MemberCreatedEvent(data, timestamp ?? new Date);
|
|
}
|
|
};
|