This repository has no description
1import { Result } from 'src/shared/core/Result';
2import { Follow } from '../Follow';
3import { FollowTargetType } from '../value-objects/FollowTargetType';
4
5export interface IFollowsRepository {
6 /**
7 * Get all followers of a specific target (user or collection).
8 *
9 * @param targetId - The ID of the entity being followed (User DID or Collection UUID)
10 * @param targetType - The type of entity being followed (USER or COLLECTION)
11 * @returns Array of Follow records (can be empty if no followers)
12 *
13 * Example:
14 * getFollowers('did:plc:alice123', FollowTargetType.USER)
15 * → [Follow{ followerId: DID('did:plc:bob456'), targetId: 'did:plc:alice123', ... }]
16 */
17 getFollowers(
18 targetId: string,
19 targetType: FollowTargetType,
20 ): Promise<Result<Follow[]>>;
21
22 /**
23 * Get all followers of multiple collections (combined, deduplicated at use case level).
24 *
25 * @param collectionIds - Array of collection UUIDs
26 * @returns Array of Follow records (can be empty)
27 *
28 * Example:
29 * getFollowersOfCollections(['uuid-1', 'uuid-2'])
30 * → [
31 * Follow{ followerId: DID('did:plc:bob456'), targetId: 'uuid-1', ... },
32 * Follow{ followerId: DID('did:plc:carol789'), targetId: 'uuid-2', ... }
33 * ]
34 *
35 * Notes:
36 * - Returns empty array if collectionIds is empty
37 * - Results may include duplicates if a user follows multiple input collections
38 * (deduplication happens at use case level)
39 */
40 getFollowersOfCollections(collectionIds: string[]): Promise<Result<Follow[]>>;
41}