Files
sim/packages
Waleed 068422b3ff refactor(audit): derive updatedFields through one shared helper (#6604)
* refactor(audit): derive updatedFields through one shared helper

Six copies of Object.keys(updateData).filter(k => k !== 'updatedAt') across
four files decided, independently, which columns an audit row reports. The
exclusion set is an audit convention, not a local detail, so it moves to
@sim/audit as auditUpdatedFields and the exclusion becomes a single edit.

The admin organizations route evaluated the expression twice in one handler
and filed it under the metadata key `fields` while every other site uses
`updatedFields`, so any consumer filtering on updatedFields silently missed
org updates. It now computes once and uses the shared key; nothing reads
metadata.fields.

auditMock carries the real implementation rather than a stub, since callers
under test derive their audit metadata through it. The two suites that
hand-roll an @sim/audit factory source it from there.

* test(audit): pin the testing mock's copy of auditUpdatedFields

@sim/audit devDepends on @sim/testing, so the mock cannot import the real
helper without closing a package cycle. Assert parity from the audit side
instead, where the dependency already runs the safe direction, so a change to
the exclusion convention cannot leave mocked callers validating behavior the
deployed helper no longer has.
2026-08-11 22:11:57 -07:00
..
2026-08-11 18:06:40 -07:00

Packages

Internal

Package Description
@sim/tsconfig Shared TypeScript configs (base, nextjs, library, library-build)
@sim/db Database schema and Drizzle ORM utilities
@sim/logger Structured logging with colored output
@sim/testing Test factories, builders, and assertions

Published

Package npm Description
cli simstudio Run Sim locally via Docker
ts-sdk simstudio-ts-sdk TypeScript SDK for workflow execution
python-sdk simstudio-sdk Python SDK for workflow execution