🖼️ Avatar Blocks
Avatar blocks provide reusable building blocks for working with avatar objects across domains (e.g., user profiles, organizations). They focus on normalizing avatar objects for API responses and maintaining files in cloud storage via signed URLs.
🎯 Overview
Avatar blocks are designed to:
- Normalize avatar objects by converting storage
objectId
to a signed download URL - Integrate with file storage drivers for secure URL generation
- Handle cleanup when avatars are replaced to prevent orphaned files
📦 Block Types
🔍 Schemas
JSON Schema definitions for avatar data validation:
- avatarSchema: Base avatar object validation (objectId, type)
⚙️ Blocks
Pure business logic functions for avatar operations:
- normalizeAvatarOfOwner: Normalize a single owner’s avatar to signed URL
- normalizeAvatarsOfOwners: Normalize a list of owners’ avatars
- deleteAvatarIfReplaced: Delete old avatar file when a new one replaces it
🔗 Related Documentation
- File Storage Blocks - Signed URL generation and file operations
- User Blocks - User profiles using avatars
- Organization Blocks - Organizations with logo/avatar-like media