Ghost/ghost/member-events
Simon Backx 076e3c02b2
Added linking between member and subscription created events (#15693)
fixes https://github.com/TryGhost/Team/issues/2160

- Adds a `batch_id` to both events that contain the same ID if they were created at the same time.
- Removes duplicate signup/conversion events using the batch_id
- Requires an update in mongo-knex to work (refs https://ghost.slack.com/archives/C02G9E68C/p1666773313272409?thread_ts=1666767872.375009&cid=C02G9E68C)
- Some dependencies needed an update to load the latest mongo-knex
- Added tiers to membersUtils, loaded on startup (we can start to use this instead of fetching it every time)
2022-10-27 11:44:19 +02:00
..
lib Added linking between member and subscription created events (#15693) 2022-10-27 11:44:19 +02:00
test Added @tryghost/member-events 2021-09-17 15:22:08 +02:00
.eslintrc.js Added @tryghost/member-events 2021-09-17 15:22:08 +02:00
index.js Added member last seen update on link click (#15459) 2022-09-23 10:34:33 +02:00
package.json Update dependency mocha to v10.1.0 2022-10-17 08:41:28 +00:00
README.md Tidied up package READMEs 2022-07-25 15:17:12 +02:00

Member Events

Usage

const {MemberEntryViewEvent} = require('@tryghost/member-events');

const event = MemberEntryViewEvent.create({
    memberId: member.id,
    memberStatus: member.status,
    entryId: post.id,
    entryUrl: post.url
});

const DomainEvents = require('@tryghost/domain-events');

DomainEvents.dispatch(event);