Each entity tracks which of its fields has changed within the current unit of work/
const a1 = em.load(Author, "1");
// Nothing has changed at first
// Now perform some business logic
a1.firstName = "a2";
// And the field shows up has changed
changes API has three methods:
firstNamehas been set, either on a new entity or an existing entity
firstNamehas been changed on an existing entity
changes.firstName.originalValue- is the original value, only for an existing entity
changes API is only for the current in-memory changes being made to an entity, it's not an audit trail.
That said, Joist entities can be used with 3rd-party audit trail solutions like CyanAudit.