sanity
sanity copied to clipboard
feat: implementation for events in history
[!WARNING]
Not to be merged yet, this requires approval from the CLDX team on how the events are generated.
Description
Publish is | Draft is created | Draft is deleted | Draft is unedited | Draft is upsert |
---|---|---|---|---|
unedited | document.createVersion (draft) | document.deleteVersion (draft) | no-effect (none) | document.editVersion (draft) |
deleted | document.unpublish (published) | document.deleteGroup (published) | maybeUnpublishMaybeDelete (published) | document.unpublish (published) |
upsert | document.updateLive (published) | document.publishVersion (published) | document.updateLive (published) | document.updateLive (published) |
created | document.createVersion (published) | document.publishVersion (published) | document.createLive (published) | document.createVersion (published) |
What to review
This Pr updates how the chunks are defined, using event based actions. This events in a close future will include also the versions. Eventually, we will have an events API to get them from, so all the mapping won't need to happen in the client. To create the necessary events we are using the transactions.
Are this changes correct? Are there any missing pieces?
Testing
Open any document and see the history, it should work as always, no visual or functional changes introduced, this is preparing to use the events api. Tests have been added for the get events functions.
Also, a story has been created showing how the transactions -> events -> chunks logic work.
Notes for release
feat: introduces event based history.