Ghost/ghost/member-events/lib/MemberCreatedEvent.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

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);
}
};