]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/typings/models/account/actor-follow.ts
Merge branch 'release/1.4.0' into develop
[github/Chocobozzz/PeerTube.git] / server / typings / models / account / actor-follow.ts
index 87050ac63ff7d7d148bf2425cd35d2ebc8d99427..17a47b8df781246c9c8d35af95e6981dacf33d47 100644 (file)
@@ -3,14 +3,15 @@ import {
   MActor,
   MActorAccount,
   MActorAccountChannel,
-  MActorChannel,
   MActorChannelAccountActor,
   MActorDefault,
+  MActorFormattable,
   MActorHost,
   MActorUsername
 } from './actor'
 import { PickWith } from '../../utils'
 import { ActorModel } from '@server/models/activitypub/actor'
+import { MChannelDefault } from '@server/typings/models'
 
 type Use<K extends keyof ActorFollowModel, M> = PickWith<ActorFollowModel, K, M>
 
@@ -43,9 +44,12 @@ export type MActorFollowFull = MActorFollow &
 
 // For subscriptions
 
+type SubscriptionFollowing = MActorDefault &
+  PickWith<ActorModel, 'VideoChannel', MChannelDefault>
+
 export type MActorFollowActorsDefaultSubscription = MActorFollow &
   Use<'ActorFollower', MActorDefault> &
-  Use<'ActorFollowing', MActorDefault & MActorChannel>
+  Use<'ActorFollowing', SubscriptionFollowing>
 
 export type MActorFollowFollowingFullFollowerAccount = MActorFollow &
   Use<'ActorFollower', MActorAccount> &
@@ -53,3 +57,11 @@ export type MActorFollowFollowingFullFollowerAccount = MActorFollow &
 
 export type MActorFollowSubscriptions = MActorFollow &
   Use<'ActorFollowing', MActorChannelAccountActor>
+
+// ############################################################################
+
+// Format for API or AP object
+
+export type MActorFollowFormattable = Pick<MActorFollow, 'id' | 'score' | 'state' | 'createdAt' | 'updatedAt'> &
+  Use<'ActorFollower', MActorFormattable> &
+  Use<'ActorFollowing', MActorFormattable>