This commit removes "avatar_url", "bot_type", "email",
"full_name", "is_active" and "owner_id" fields from bot
objects passed in "realm_bots" as user objects in
"realm_users" already has those fields and clients can
get the data needed from it.
Also removes the code to send realm_bot/update events
when changing these fields.
Previously callers needed to manually keep is_admin, is_owner,
is_guest, and is_moderator in sync with the role field. Derive
them automatically from role, matching the production logic in
people._add_user() and user_events.ts. Also export the Role
and Bot constant objects for use by test files.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This refactor replaces manual user/bot objects with standardized
factories to ensure type coherence with production data.
Updated web/tests/lib/example_user.cjs to include `is_moderator`
as a default property, as verified via production JS console.