]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - server/typings/models/user/user-notification.ts
Fix tests
[github/Chocobozzz/PeerTube.git] / server / typings / models / user / user-notification.ts
CommitLineData
453e83ea
C
1import { UserNotificationModel } from '../../../models/account/user-notification'
2import { PickWith } from '../../utils'
3import { VideoModel } from '../../../models/video/video'
4import { ActorModel } from '../../../models/activitypub/actor'
5import { ServerModel } from '../../../models/server/server'
6import { AvatarModel } from '../../../models/avatar/avatar'
7import { VideoChannelModel } from '../../../models/video/video-channel'
8import { AccountModel } from '../../../models/account/account'
9import { VideoCommentModel } from '../../../models/video/video-comment'
10import { VideoAbuseModel } from '../../../models/video/video-abuse'
11import { VideoBlacklistModel } from '../../../models/video/video-blacklist'
12import { VideoImportModel } from '../../../models/video/video-import'
13import { ActorFollowModel } from '../../../models/activitypub/actor-follow'
14
15export namespace UserNotificationIncludes {
16 export type VideoInclude = Pick<VideoModel, 'id' | 'uuid' | 'name'>
17 export type VideoIncludeChannel = VideoInclude &
18 PickWith<VideoModel, 'VideoChannel', VideoChannelIncludeActor>
19
20 export type ActorInclude = Pick<ActorModel, 'preferredUsername' | 'getHost'> &
21 PickWith<ActorModel, 'Avatar', Pick<AvatarModel, 'filename' | 'getStaticPath'>> &
22 PickWith<ActorModel, 'Server', Pick<ServerModel, 'host'>>
23
24 export type VideoChannelInclude = Pick<VideoChannelModel, 'id' | 'name' | 'getDisplayName'>
25 export type VideoChannelIncludeActor = VideoChannelInclude &
26 PickWith<VideoChannelModel, 'Actor', ActorInclude>
27
28 export type AccountInclude = Pick<AccountModel, 'id' | 'name' | 'getDisplayName'>
29 export type AccountIncludeActor = AccountInclude &
30 PickWith<AccountModel, 'Actor', ActorInclude>
31
32 export type VideoCommentInclude = Pick<VideoCommentModel, 'id' | 'originCommentId' | 'getThreadId'> &
33 PickWith<VideoCommentModel, 'Account', AccountIncludeActor> &
34 PickWith<VideoCommentModel, 'Video', VideoInclude>
35
36 export type VideoAbuseInclude = Pick<VideoAbuseModel, 'id'> &
37 PickWith<VideoAbuseModel, 'Video', VideoInclude>
38
39 export type VideoBlacklistInclude = Pick<VideoBlacklistModel, 'id'> &
40 PickWith<VideoAbuseModel, 'Video', VideoInclude>
41
42 export type VideoImportInclude = Pick<VideoImportModel, 'id' | 'magnetUri' | 'targetUrl' | 'torrentName'> &
43 PickWith<VideoImportModel, 'Video', VideoInclude>
44
45 export type ActorFollower = Pick<ActorModel, 'preferredUsername' | 'getHost'> &
46 PickWith<ActorModel, 'Account', AccountInclude> &
47 PickWith<ActorModel, 'Avatar', Pick<AvatarModel, 'filename' | 'getStaticPath'>> &
48 PickWith<ActorModel, 'Server', Pick<ServerModel, 'host'>>
49
50 export type ActorFollowing = Pick<ActorModel, 'preferredUsername'> &
51 PickWith<ActorModel, 'VideoChannel', VideoChannelInclude> &
52 PickWith<ActorModel, 'Account', AccountInclude>
53
54 export type ActorFollowInclude = Pick<ActorFollowModel, 'id' | 'state'> &
55 PickWith<ActorFollowModel, 'ActorFollower', ActorFollower> &
56 PickWith<ActorFollowModel, 'ActorFollowing', ActorFollowing>
57}
58
59export type UserNotificationModelOnly = Omit<UserNotificationModel, 'User' | 'Video' | 'Comment' | 'VideoAbuse' | 'VideoBlacklist' |
60 'VideoImport' | 'Account' | 'ActorFollow'>
61
62export type UserNotificationModelForApi = UserNotificationModelOnly &
63 PickWith<UserNotificationModel, 'Video', UserNotificationIncludes.VideoIncludeChannel> &
64 PickWith<UserNotificationModel, 'Comment', UserNotificationIncludes.VideoCommentInclude> &
65 PickWith<UserNotificationModel, 'VideoAbuse', UserNotificationIncludes.VideoAbuseInclude> &
66 PickWith<UserNotificationModel, 'VideoBlacklist', UserNotificationIncludes.VideoBlacklistInclude> &
67 PickWith<UserNotificationModel, 'VideoImport', UserNotificationIncludes.VideoImportInclude> &
68 PickWith<UserNotificationModel, 'ActorFollow', UserNotificationIncludes.ActorFollowInclude> &
69 PickWith<UserNotificationModel, 'Account', UserNotificationIncludes.AccountIncludeActor>