]>
Commit | Line | Data |
---|---|---|
453e83ea | 1 | import { ActorFollowModel } from '../../../models/activitypub/actor-follow' |
0283eaac C |
2 | import { |
3 | MActor, | |
0283eaac C |
4 | MActorChannelAccountActor, |
5 | MActorDefault, | |
d7a25329 | 6 | MActorDefaultAccountChannel, |
1ca9f7c3 | 7 | MActorFormattable, |
0283eaac C |
8 | MActorHost, |
9 | MActorUsername | |
10 | } from './actor' | |
453e83ea | 11 | import { PickWith } from '../../utils' |
0283eaac | 12 | import { ActorModel } from '@server/models/activitypub/actor' |
d7a25329 | 13 | import { MChannelDefault } from '../video/video-channels' |
0283eaac C |
14 | |
15 | type Use<K extends keyof ActorFollowModel, M> = PickWith<ActorFollowModel, K, M> | |
16 | ||
17 | // ############################################################################ | |
453e83ea C |
18 | |
19 | export type MActorFollow = Omit<ActorFollowModel, 'ActorFollower' | 'ActorFollowing'> | |
20 | ||
0283eaac C |
21 | // ############################################################################ |
22 | ||
a1587156 C |
23 | export type MActorFollowFollowingHost = |
24 | MActorFollow & | |
0283eaac C |
25 | Use<'ActorFollowing', MActorUsername & MActorHost> |
26 | ||
27 | // ############################################################################ | |
28 | ||
29 | // With actors or actors default | |
30 | ||
a1587156 C |
31 | export type MActorFollowActors = |
32 | MActorFollow & | |
0283eaac C |
33 | Use<'ActorFollower', MActor> & |
34 | Use<'ActorFollowing', MActor> | |
453e83ea | 35 | |
a1587156 C |
36 | export type MActorFollowActorsDefault = |
37 | MActorFollow & | |
0283eaac C |
38 | Use<'ActorFollower', MActorDefault> & |
39 | Use<'ActorFollowing', MActorDefault> | |
453e83ea | 40 | |
a1587156 C |
41 | export type MActorFollowFull = |
42 | MActorFollow & | |
8424c402 C |
43 | Use<'ActorFollower', MActorDefaultAccountChannel> & |
44 | Use<'ActorFollowing', MActorDefaultAccountChannel> | |
453e83ea | 45 | |
0283eaac C |
46 | // ############################################################################ |
47 | ||
48 | // For subscriptions | |
49 | ||
a1587156 C |
50 | type SubscriptionFollowing = |
51 | MActorDefault & | |
1ca9f7c3 C |
52 | PickWith<ActorModel, 'VideoChannel', MChannelDefault> |
53 | ||
a1587156 C |
54 | export type MActorFollowActorsDefaultSubscription = |
55 | MActorFollow & | |
0283eaac | 56 | Use<'ActorFollower', MActorDefault> & |
1ca9f7c3 | 57 | Use<'ActorFollowing', SubscriptionFollowing> |
0283eaac | 58 | |
a1587156 C |
59 | export type MActorFollowSubscriptions = |
60 | MActorFollow & | |
0283eaac | 61 | Use<'ActorFollowing', MActorChannelAccountActor> |
1ca9f7c3 C |
62 | |
63 | // ############################################################################ | |
64 | ||
65 | // Format for API or AP object | |
66 | ||
a1587156 C |
67 | export type MActorFollowFormattable = |
68 | Pick<MActorFollow, 'id' | 'score' | 'state' | 'createdAt' | 'updatedAt'> & | |
1ca9f7c3 C |
69 | Use<'ActorFollower', MActorFormattable> & |
70 | Use<'ActorFollowing', MActorFormattable> |