aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/typings/models/account/actor-follow.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-08-20 19:05:31 +0200
committerChocobozzz <me@florianbigard.com>2019-08-20 19:23:10 +0200
commit1ca9f7c3f7afac2af4c4c25b98426731f7e789c6 (patch)
tree27fe65c4ea5e9250d2523033d5c65b315bfca23d /server/typings/models/account/actor-follow.ts
parent0283eaac2a8e73006c66df3cf5bb9012e37450e5 (diff)
downloadPeerTube-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.ts16
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'
12import { PickWith } from '../../utils' 12import { PickWith } from '../../utils'
13import { ActorModel } from '@server/models/activitypub/actor' 13import { ActorModel } from '@server/models/activitypub/actor'
14import { MChannelDefault } from '@server/typings/models'
14 15
15type Use<K extends keyof ActorFollowModel, M> = PickWith<ActorFollowModel, K, M> 16type 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
47type SubscriptionFollowing = MActorDefault &
48 PickWith<ActorModel, 'VideoChannel', MChannelDefault>
49
46export type MActorFollowActorsDefaultSubscription = MActorFollow & 50export type MActorFollowActorsDefaultSubscription = MActorFollow &
47 Use<'ActorFollower', MActorDefault> & 51 Use<'ActorFollower', MActorDefault> &
48 Use<'ActorFollowing', MActorDefault & MActorChannel> 52 Use<'ActorFollowing', SubscriptionFollowing>
49 53
50export type MActorFollowFollowingFullFollowerAccount = MActorFollow & 54export type MActorFollowFollowingFullFollowerAccount = MActorFollow &
51 Use<'ActorFollower', MActorAccount> & 55 Use<'ActorFollower', MActorAccount> &
@@ -53,3 +57,11 @@ export type MActorFollowFollowingFullFollowerAccount = MActorFollow &
53 57
54export type MActorFollowSubscriptions = MActorFollow & 58export type MActorFollowSubscriptions = MActorFollow &
55 Use<'ActorFollowing', MActorChannelAccountActor> 59 Use<'ActorFollowing', MActorChannelAccountActor>
60
61// ############################################################################
62
63// Format for API or AP object
64
65export type MActorFollowFormattable = Pick<MActorFollow, 'id' | 'score' | 'state' | 'createdAt' | 'updatedAt'> &
66 Use<'ActorFollower', MActorFormattable> &
67 Use<'ActorFollowing', MActorFormattable>