aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/typings/models/user/user-notification.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/typings/models/user/user-notification.ts')
-rw-r--r--server/typings/models/user/user-notification.ts26
1 files changed, 17 insertions, 9 deletions
diff --git a/server/typings/models/user/user-notification.ts b/server/typings/models/user/user-notification.ts
index b872c5dc5..f9daf5eb2 100644
--- a/server/typings/models/user/user-notification.ts
+++ b/server/typings/models/user/user-notification.ts
@@ -12,6 +12,10 @@ import { VideoBlacklistModel } from '../../../models/video/video-blacklist'
12import { VideoImportModel } from '../../../models/video/video-import' 12import { VideoImportModel } from '../../../models/video/video-import'
13import { ActorFollowModel } from '../../../models/activitypub/actor-follow' 13import { ActorFollowModel } from '../../../models/activitypub/actor-follow'
14 14
15type Use<K extends keyof UserNotificationModel, M> = PickWith<UserNotificationModel, K, M>
16
17// ############################################################################
18
15export namespace UserNotificationIncludes { 19export namespace UserNotificationIncludes {
16 export type VideoInclude = Pick<VideoModel, 'id' | 'uuid' | 'name'> 20 export type VideoInclude = Pick<VideoModel, 'id' | 'uuid' | 'name'>
17 export type VideoIncludeChannel = VideoInclude & 21 export type VideoIncludeChannel = VideoInclude &
@@ -56,14 +60,18 @@ export namespace UserNotificationIncludes {
56 PickWith<ActorFollowModel, 'ActorFollowing', ActorFollowing> 60 PickWith<ActorFollowModel, 'ActorFollowing', ActorFollowing>
57} 61}
58 62
59export type UserNotificationModelOnly = Omit<UserNotificationModel, 'User' | 'Video' | 'Comment' | 'VideoAbuse' | 'VideoBlacklist' | 63// ############################################################################
64
65export type MUserNotification = Omit<UserNotificationModel, 'User' | 'Video' | 'Comment' | 'VideoAbuse' | 'VideoBlacklist' |
60 'VideoImport' | 'Account' | 'ActorFollow'> 66 'VideoImport' | 'Account' | 'ActorFollow'>
61 67
62export type UserNotificationModelForApi = UserNotificationModelOnly & 68// ############################################################################
63 PickWith<UserNotificationModel, 'Video', UserNotificationIncludes.VideoIncludeChannel> & 69
64 PickWith<UserNotificationModel, 'Comment', UserNotificationIncludes.VideoCommentInclude> & 70export type UserNotificationModelForApi = MUserNotification &
65 PickWith<UserNotificationModel, 'VideoAbuse', UserNotificationIncludes.VideoAbuseInclude> & 71 Use<'Video', UserNotificationIncludes.VideoIncludeChannel> &
66 PickWith<UserNotificationModel, 'VideoBlacklist', UserNotificationIncludes.VideoBlacklistInclude> & 72 Use<'Comment', UserNotificationIncludes.VideoCommentInclude> &
67 PickWith<UserNotificationModel, 'VideoImport', UserNotificationIncludes.VideoImportInclude> & 73 Use<'VideoAbuse', UserNotificationIncludes.VideoAbuseInclude> &
68 PickWith<UserNotificationModel, 'ActorFollow', UserNotificationIncludes.ActorFollowInclude> & 74 Use<'VideoBlacklist', UserNotificationIncludes.VideoBlacklistInclude> &
69 PickWith<UserNotificationModel, 'Account', UserNotificationIncludes.AccountIncludeActor> 75 Use<'VideoImport', UserNotificationIncludes.VideoImportInclude> &
76 Use<'ActorFollow', UserNotificationIncludes.ActorFollowInclude> &
77 Use<'Account', UserNotificationIncludes.AccountIncludeActor>