How do I persiste the action sequence when I persiste the update

I persiste update through y-websocket by db, and I want to persiste the action, such as: insert a text, insert a picture, paste with formatting, delete a text…

How can I pass these parameters together with ‘update’, thanks.