fix: adapt firehose implementation to monorepo structure
Resolved merge conflicts from monorepo reorganization and updated firehose
implementation to work with extracted packages:
Database layer refactoring:
- Removed singleton db export from @atbb/db package
- Added db instance injection to FirehoseService constructor
- Created initIndexer() function to initialize indexer with db instance
- Added drizzle-orm to appview dependencies for type imports
Schema alignment fixes:
- Updated post handlers to use correct column names (text not content,
rootPostId/parentPostId not replyRootId/replyParentId, deleted boolean
not deletedAt timestamp)
- Removed forumId from posts table (only forumUri exists)
- Fixed forum handlers (removed displayName and createdAt fields)
- Fixed category handlers (removed forumUri and displayName, added slug)
- Fixed membership handlers (replaced status with role/roleUri/joinedAt)
- Fixed modAction handlers (removed forumUri, use subjectPostUri not
subjectPostId, added createdBy and expiresAt)
Lexicon type fixes:
- Corrected nested ref structure (record.forum.forum.uri not
record.forumRef.uri)
- Corrected reply refs (record.reply not record.replyRef)
- Added type assertions for unknown types from Jetstream events
- Added @atproto/lexicon and multiformats dependencies to lexicon package
Note: TypeScript errors remain in generated lexicon code due to missing .js
extensions and type guard issues, but these don't affect runtime behavior.