diff options
author | Chocobozzz <me@florianbigard.com> | 2019-08-20 19:05:31 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-08-20 19:23:10 +0200 |
commit | 1ca9f7c3f7afac2af4c4c25b98426731f7e789c6 (patch) | |
tree | 27fe65c4ea5e9250d2523033d5c65b315bfca23d /server/typings/models/account/actor-follow.ts | |
parent | 0283eaac2a8e73006c66df3cf5bb9012e37450e5 (diff) | |
download | PeerTube-1ca9f7c3f7afac2af4c4c25b98426731f7e789c6.tar.gz PeerTube-1ca9f7c3f7afac2af4c4c25b98426731f7e789c6.tar.zst PeerTube-1ca9f7c3f7afac2af4c4c25b98426731f7e789c6.zip |
Type toFormattedJSON
Diffstat (limited to 'server/typings/models/account/actor-follow.ts')
-rw-r--r-- | server/typings/models/account/actor-follow.ts | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/server/typings/models/account/actor-follow.ts b/server/typings/models/account/actor-follow.ts index 87050ac63..17a47b8df 100644 --- a/server/typings/models/account/actor-follow.ts +++ b/server/typings/models/account/actor-follow.ts | |||
@@ -3,14 +3,15 @@ import { | |||
3 | MActor, | 3 | MActor, |
4 | MActorAccount, | 4 | MActorAccount, |
5 | MActorAccountChannel, | 5 | MActorAccountChannel, |
6 | MActorChannel, | ||
7 | MActorChannelAccountActor, | 6 | MActorChannelAccountActor, |
8 | MActorDefault, | 7 | MActorDefault, |
8 | MActorFormattable, | ||
9 | MActorHost, | 9 | MActorHost, |
10 | MActorUsername | 10 | MActorUsername |
11 | } from './actor' | 11 | } from './actor' |
12 | import { PickWith } from '../../utils' | 12 | import { PickWith } from '../../utils' |
13 | import { ActorModel } from '@server/models/activitypub/actor' | 13 | import { ActorModel } from '@server/models/activitypub/actor' |
14 | import { MChannelDefault } from '@server/typings/models' | ||
14 | 15 | ||
15 | type Use<K extends keyof ActorFollowModel, M> = PickWith<ActorFollowModel, K, M> | 16 | type Use<K extends keyof ActorFollowModel, M> = PickWith<ActorFollowModel, K, M> |
16 | 17 | ||
@@ -43,9 +44,12 @@ export type MActorFollowFull = MActorFollow & | |||
43 | 44 | ||
44 | // For subscriptions | 45 | // For subscriptions |
45 | 46 | ||
47 | type SubscriptionFollowing = MActorDefault & | ||
48 | PickWith<ActorModel, 'VideoChannel', MChannelDefault> | ||
49 | |||
46 | export type MActorFollowActorsDefaultSubscription = MActorFollow & | 50 | export type MActorFollowActorsDefaultSubscription = MActorFollow & |
47 | Use<'ActorFollower', MActorDefault> & | 51 | Use<'ActorFollower', MActorDefault> & |
48 | Use<'ActorFollowing', MActorDefault & MActorChannel> | 52 | Use<'ActorFollowing', SubscriptionFollowing> |
49 | 53 | ||
50 | export type MActorFollowFollowingFullFollowerAccount = MActorFollow & | 54 | export type MActorFollowFollowingFullFollowerAccount = MActorFollow & |
51 | Use<'ActorFollower', MActorAccount> & | 55 | Use<'ActorFollower', MActorAccount> & |
@@ -53,3 +57,11 @@ export type MActorFollowFollowingFullFollowerAccount = MActorFollow & | |||
53 | 57 | ||
54 | export type MActorFollowSubscriptions = MActorFollow & | 58 | export type MActorFollowSubscriptions = MActorFollow & |
55 | Use<'ActorFollowing', MActorChannelAccountActor> | 59 | Use<'ActorFollowing', MActorChannelAccountActor> |
60 | |||
61 | // ############################################################################ | ||
62 | |||
63 | // Format for API or AP object | ||
64 | |||
65 | export type MActorFollowFormattable = Pick<MActorFollow, 'id' | 'score' | 'state' | 'createdAt' | 'updatedAt'> & | ||
66 | Use<'ActorFollower', MActorFormattable> & | ||
67 | Use<'ActorFollowing', MActorFormattable> | ||