]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/types/models/user/user-notification.ts
Merge branch 'release/4.1.0' into develop
[github/Chocobozzz/PeerTube.git] / server / types / models / user / user-notification.ts
index db9ec040089a58010ad488baad52b6a95daf7f55..d4715a0b68e027d12f73032d163d14ebba9f76fd 100644 (file)
@@ -21,6 +21,7 @@ type Use<K extends keyof UserNotificationModel, M> = PickWith<UserNotificationMo
 // ############################################################################
 
 export module UserNotificationIncludes {
+  export type ActorImageInclude = Pick<ActorImageModel, 'createdAt' | 'filename' | 'getStaticPath' | 'width' | 'updatedAt'>
 
   export type VideoInclude = Pick<VideoModel, 'id' | 'uuid' | 'name'>
   export type VideoIncludeChannel =
@@ -29,7 +30,7 @@ export module UserNotificationIncludes {
 
   export type ActorInclude =
     Pick<ActorModel, 'preferredUsername' | 'getHost'> &
-    PickWith<ActorModel, 'Avatar', Pick<ActorImageModel, 'filename' | 'getStaticPath'>> &
+    PickWith<ActorModel, 'Avatars', ActorImageInclude[]> &
     PickWith<ActorModel, 'Server', Pick<ServerModel, 'host'>>
 
   export type VideoChannelInclude = Pick<VideoChannelModel, 'id' | 'name' | 'getDisplayName'>
@@ -75,7 +76,7 @@ export module UserNotificationIncludes {
     Pick<ActorModel, 'preferredUsername' | 'getHost'> &
     PickWith<ActorModel, 'Account', AccountInclude> &
     PickWith<ActorModel, 'Server', Pick<ServerModel, 'host'>> &
-    PickWithOpt<ActorModel, 'Avatar', Pick<ActorImageModel, 'filename' | 'getStaticPath'>>
+    PickWithOpt<ActorModel, 'Avatars', ActorImageInclude[]>
 
   export type ActorFollowing =
     Pick<ActorModel, 'preferredUsername' | 'type' | 'getHost'> &
@@ -98,7 +99,7 @@ export module UserNotificationIncludes {
 // ############################################################################
 
 export type MUserNotification =
-  Omit<UserNotificationModel, 'User' | 'Video' | 'Comment' | 'Abuse' | 'VideoBlacklist' |
+  Omit<UserNotificationModel, 'User' | 'Video' | 'VideoComment' | 'Abuse' | 'VideoBlacklist' |
   'VideoImport' | 'Account' | 'ActorFollow' | 'Plugin' | 'Application'>
 
 // ############################################################################
@@ -106,7 +107,7 @@ export type MUserNotification =
 export type UserNotificationModelForApi =
   MUserNotification &
   Use<'Video', UserNotificationIncludes.VideoIncludeChannel> &
-  Use<'Comment', UserNotificationIncludes.VideoCommentInclude> &
+  Use<'VideoComment', UserNotificationIncludes.VideoCommentInclude> &
   Use<'Abuse', UserNotificationIncludes.AbuseInclude> &
   Use<'VideoBlacklist', UserNotificationIncludes.VideoBlacklistInclude> &
   Use<'VideoImport', UserNotificationIncludes.VideoImportInclude> &