]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - server/types/models/account/actor-follow.ts
Fix live ending banner
[github/Chocobozzz/PeerTube.git] / server / types / models / account / actor-follow.ts
1 import { PickWith } from '@shared/core-utils'
2 import { ActorFollowModel } from '../../../models/activitypub/actor-follow'
3 import {
4 MActor,
5 MActorChannelAccountActor,
6 MActorDefault,
7 MActorDefaultAccountChannel,
8 MActorDefaultChannelId,
9 MActorFormattable,
10 MActorHost,
11 MActorUsername
12 } from './actor'
13
14 type Use<K extends keyof ActorFollowModel, M> = PickWith<ActorFollowModel, K, M>
15
16 // ############################################################################
17
18 export type MActorFollow = Omit<ActorFollowModel, 'ActorFollower' | 'ActorFollowing'>
19
20 // ############################################################################
21
22 export type MActorFollowFollowingHost =
23 MActorFollow &
24 Use<'ActorFollowing', MActorUsername & MActorHost>
25
26 // ############################################################################
27
28 // With actors or actors default
29
30 export type MActorFollowActors =
31 MActorFollow &
32 Use<'ActorFollower', MActor> &
33 Use<'ActorFollowing', MActor>
34
35 export type MActorFollowActorsDefault =
36 MActorFollow &
37 Use<'ActorFollower', MActorDefault> &
38 Use<'ActorFollowing', MActorDefault>
39
40 export type MActorFollowFull =
41 MActorFollow &
42 Use<'ActorFollower', MActorDefaultAccountChannel> &
43 Use<'ActorFollowing', MActorDefaultAccountChannel>
44
45 // ############################################################################
46
47 // For subscriptions
48
49 export type MActorFollowActorsDefaultSubscription =
50 MActorFollow &
51 Use<'ActorFollower', MActorDefault> &
52 Use<'ActorFollowing', MActorDefaultChannelId>
53
54 export type MActorFollowSubscriptions =
55 MActorFollow &
56 Use<'ActorFollowing', MActorChannelAccountActor>
57
58 // ############################################################################
59
60 // Format for API or AP object
61
62 export type MActorFollowFormattable =
63 Pick<MActorFollow, 'id' | 'score' | 'state' | 'createdAt' | 'updatedAt'> &
64 Use<'ActorFollower', MActorFormattable> &
65 Use<'ActorFollowing', MActorFormattable>