diff options
Diffstat (limited to 'server/typings/models/user/user-notification.ts')
-rw-r--r-- | server/typings/models/user/user-notification.ts | 42 |
1 files changed, 28 insertions, 14 deletions
diff --git a/server/typings/models/user/user-notification.ts b/server/typings/models/user/user-notification.ts index 1cdc691b0..2080360e1 100644 --- a/server/typings/models/user/user-notification.ts +++ b/server/typings/models/user/user-notification.ts | |||
@@ -16,59 +16,73 @@ type Use<K extends keyof UserNotificationModel, M> = PickWith<UserNotificationMo | |||
16 | 16 | ||
17 | // ############################################################################ | 17 | // ############################################################################ |
18 | 18 | ||
19 | export namespace UserNotificationIncludes { | 19 | export module UserNotificationIncludes { |
20 | |||
20 | export type VideoInclude = Pick<VideoModel, 'id' | 'uuid' | 'name'> | 21 | export type VideoInclude = Pick<VideoModel, 'id' | 'uuid' | 'name'> |
21 | export type VideoIncludeChannel = VideoInclude & | 22 | export type VideoIncludeChannel = |
23 | VideoInclude & | ||
22 | PickWith<VideoModel, 'VideoChannel', VideoChannelIncludeActor> | 24 | PickWith<VideoModel, 'VideoChannel', VideoChannelIncludeActor> |
23 | 25 | ||
24 | export type ActorInclude = Pick<ActorModel, 'preferredUsername' | 'getHost'> & | 26 | export type ActorInclude = |
27 | Pick<ActorModel, 'preferredUsername' | 'getHost'> & | ||
25 | PickWith<ActorModel, 'Avatar', Pick<AvatarModel, 'filename' | 'getStaticPath'>> & | 28 | PickWith<ActorModel, 'Avatar', Pick<AvatarModel, 'filename' | 'getStaticPath'>> & |
26 | PickWith<ActorModel, 'Server', Pick<ServerModel, 'host'>> | 29 | PickWith<ActorModel, 'Server', Pick<ServerModel, 'host'>> |
27 | 30 | ||
28 | export type VideoChannelInclude = Pick<VideoChannelModel, 'id' | 'name' | 'getDisplayName'> | 31 | export type VideoChannelInclude = Pick<VideoChannelModel, 'id' | 'name' | 'getDisplayName'> |
29 | export type VideoChannelIncludeActor = VideoChannelInclude & | 32 | export type VideoChannelIncludeActor = |
33 | VideoChannelInclude & | ||
30 | PickWith<VideoChannelModel, 'Actor', ActorInclude> | 34 | PickWith<VideoChannelModel, 'Actor', ActorInclude> |
31 | 35 | ||
32 | export type AccountInclude = Pick<AccountModel, 'id' | 'name' | 'getDisplayName'> | 36 | export type AccountInclude = Pick<AccountModel, 'id' | 'name' | 'getDisplayName'> |
33 | export type AccountIncludeActor = AccountInclude & | 37 | export type AccountIncludeActor = |
38 | AccountInclude & | ||
34 | PickWith<AccountModel, 'Actor', ActorInclude> | 39 | PickWith<AccountModel, 'Actor', ActorInclude> |
35 | 40 | ||
36 | export type VideoCommentInclude = Pick<VideoCommentModel, 'id' | 'originCommentId' | 'getThreadId'> & | 41 | export type VideoCommentInclude = |
42 | Pick<VideoCommentModel, 'id' | 'originCommentId' | 'getThreadId'> & | ||
37 | PickWith<VideoCommentModel, 'Account', AccountIncludeActor> & | 43 | PickWith<VideoCommentModel, 'Account', AccountIncludeActor> & |
38 | PickWith<VideoCommentModel, 'Video', VideoInclude> | 44 | PickWith<VideoCommentModel, 'Video', VideoInclude> |
39 | 45 | ||
40 | export type VideoAbuseInclude = Pick<VideoAbuseModel, 'id'> & | 46 | export type VideoAbuseInclude = |
47 | Pick<VideoAbuseModel, 'id'> & | ||
41 | PickWith<VideoAbuseModel, 'Video', VideoInclude> | 48 | PickWith<VideoAbuseModel, 'Video', VideoInclude> |
42 | 49 | ||
43 | export type VideoBlacklistInclude = Pick<VideoBlacklistModel, 'id'> & | 50 | export type VideoBlacklistInclude = |
51 | Pick<VideoBlacklistModel, 'id'> & | ||
44 | PickWith<VideoAbuseModel, 'Video', VideoInclude> | 52 | PickWith<VideoAbuseModel, 'Video', VideoInclude> |
45 | 53 | ||
46 | export type VideoImportInclude = Pick<VideoImportModel, 'id' | 'magnetUri' | 'targetUrl' | 'torrentName'> & | 54 | export type VideoImportInclude = |
55 | Pick<VideoImportModel, 'id' | 'magnetUri' | 'targetUrl' | 'torrentName'> & | ||
47 | PickWith<VideoImportModel, 'Video', VideoInclude> | 56 | PickWith<VideoImportModel, 'Video', VideoInclude> |
48 | 57 | ||
49 | export type ActorFollower = Pick<ActorModel, 'preferredUsername' | 'getHost'> & | 58 | export type ActorFollower = |
59 | Pick<ActorModel, 'preferredUsername' | 'getHost'> & | ||
50 | PickWith<ActorModel, 'Account', AccountInclude> & | 60 | PickWith<ActorModel, 'Account', AccountInclude> & |
51 | PickWith<ActorModel, 'Server', Pick<ServerModel, 'host'>> & | 61 | PickWith<ActorModel, 'Server', Pick<ServerModel, 'host'>> & |
52 | PickWithOpt<ActorModel, 'Avatar', Pick<AvatarModel, 'filename' | 'getStaticPath'>> | 62 | PickWithOpt<ActorModel, 'Avatar', Pick<AvatarModel, 'filename' | 'getStaticPath'>> |
53 | 63 | ||
54 | export type ActorFollowing = Pick<ActorModel, 'preferredUsername' | 'type' | 'getHost'> & | 64 | export type ActorFollowing = |
65 | Pick<ActorModel, 'preferredUsername' | 'type' | 'getHost'> & | ||
55 | PickWith<ActorModel, 'VideoChannel', VideoChannelInclude> & | 66 | PickWith<ActorModel, 'VideoChannel', VideoChannelInclude> & |
56 | PickWith<ActorModel, 'Account', AccountInclude> & | 67 | PickWith<ActorModel, 'Account', AccountInclude> & |
57 | PickWith<ActorModel, 'Server', Pick<ServerModel, 'host'>> | 68 | PickWith<ActorModel, 'Server', Pick<ServerModel, 'host'>> |
58 | 69 | ||
59 | export type ActorFollowInclude = Pick<ActorFollowModel, 'id' | 'state'> & | 70 | export type ActorFollowInclude = |
71 | Pick<ActorFollowModel, 'id' | 'state'> & | ||
60 | PickWith<ActorFollowModel, 'ActorFollower', ActorFollower> & | 72 | PickWith<ActorFollowModel, 'ActorFollower', ActorFollower> & |
61 | PickWith<ActorFollowModel, 'ActorFollowing', ActorFollowing> | 73 | PickWith<ActorFollowModel, 'ActorFollowing', ActorFollowing> |
62 | } | 74 | } |
63 | 75 | ||
64 | // ############################################################################ | 76 | // ############################################################################ |
65 | 77 | ||
66 | export type MUserNotification = Omit<UserNotificationModel, 'User' | 'Video' | 'Comment' | 'VideoAbuse' | 'VideoBlacklist' | | 78 | export type MUserNotification = |
79 | Omit<UserNotificationModel, 'User' | 'Video' | 'Comment' | 'VideoAbuse' | 'VideoBlacklist' | | ||
67 | 'VideoImport' | 'Account' | 'ActorFollow'> | 80 | 'VideoImport' | 'Account' | 'ActorFollow'> |
68 | 81 | ||
69 | // ############################################################################ | 82 | // ############################################################################ |
70 | 83 | ||
71 | export type UserNotificationModelForApi = MUserNotification & | 84 | export type UserNotificationModelForApi = |
85 | MUserNotification & | ||
72 | Use<'Video', UserNotificationIncludes.VideoIncludeChannel> & | 86 | Use<'Video', UserNotificationIncludes.VideoIncludeChannel> & |
73 | Use<'Comment', UserNotificationIncludes.VideoCommentInclude> & | 87 | Use<'Comment', UserNotificationIncludes.VideoCommentInclude> & |
74 | Use<'VideoAbuse', UserNotificationIncludes.VideoAbuseInclude> & | 88 | Use<'VideoAbuse', UserNotificationIncludes.VideoAbuseInclude> & |