This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

semble / src / modules / atproto / application / handlers / FirehoseEventHandler.ts
691 B 26 lines
1import { Result } from 'src/shared/core/Result'; 2import { ProcessFirehoseEventUseCase } from '../useCases/ProcessFirehoseEventUseCase'; 3 4export interface AtProtoFirehoseEvent { 5 uri: string; 6 cid: string | null; 7 eventType: 'create' | 'update' | 'delete'; 8 record?: any; 9 did?: string; 10 collection?: string; 11} 12 13export class FirehoseEventHandler { 14 constructor( 15 private processFirehoseEventUseCase: ProcessFirehoseEventUseCase, 16 ) {} 17 18 async handle(event: AtProtoFirehoseEvent): Promise<Result<void>> { 19 return this.processFirehoseEventUseCase.execute({ 20 atUri: event.uri, 21 cid: event.cid, 22 eventType: event.eventType, 23 record: event.record, 24 }); 25 } 26}