aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/types
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-07-27 16:26:25 +0200
committerChocobozzz <chocobozzz@cpy.re>2020-07-31 11:35:19 +0200
commit594d3e48d8a887bbf48ce4cc594c1c36c9640fb1 (patch)
treebae28fa6215a3a3c6ccd78aea6ea7e75c500a96f /server/types
parent94148c9028829b5576a5dcbfba2c7fb9cf6443d3 (diff)
downloadPeerTube-594d3e48d8a887bbf48ce4cc594c1c36c9640fb1.tar.gz
PeerTube-594d3e48d8a887bbf48ce4cc594c1c36c9640fb1.tar.zst
PeerTube-594d3e48d8a887bbf48ce4cc594c1c36c9640fb1.zip
Add abuse messages/states notifications
Diffstat (limited to 'server/types')
-rw-r--r--server/types/models/moderation/abuse.ts21
-rw-r--r--server/types/models/user/user-notification.ts2
2 files changed, 12 insertions, 11 deletions
diff --git a/server/types/models/moderation/abuse.ts b/server/types/models/moderation/abuse.ts
index d793a720f..5409dfd6b 100644
--- a/server/types/models/moderation/abuse.ts
+++ b/server/types/models/moderation/abuse.ts
@@ -5,6 +5,7 @@ import { AbuseModel } from '../../../models/abuse/abuse'
5import { MAccountDefault, MAccountFormattable, MAccountLight, MAccountUrl, MAccount } from '../account' 5import { MAccountDefault, MAccountFormattable, MAccountLight, MAccountUrl, MAccount } from '../account'
6import { MCommentOwner, MCommentUrl, MVideoUrl, MCommentOwnerVideo, MComment, MCommentVideo } from '../video' 6import { MCommentOwner, MCommentUrl, MVideoUrl, MCommentOwnerVideo, MComment, MCommentVideo } from '../video'
7import { MVideo, MVideoAccountLightBlacklistAllFiles } from '../video/video' 7import { MVideo, MVideoAccountLightBlacklistAllFiles } from '../video/video'
8import { VideoCommentModel } from '@server/models/video/video-comment'
8 9
9type Use<K extends keyof AbuseModel, M> = PickWith<AbuseModel, K, M> 10type Use<K extends keyof AbuseModel, M> = PickWith<AbuseModel, K, M>
10type UseVideoAbuse<K extends keyof VideoAbuseModel, M> = PickWith<VideoAbuseModel, K, M> 11type UseVideoAbuse<K extends keyof VideoAbuseModel, M> = PickWith<VideoAbuseModel, K, M>
@@ -34,7 +35,7 @@ export type MVideoAbuseVideoUrl =
34 35
35export type MVideoAbuseVideoFull = 36export type MVideoAbuseVideoFull =
36 MVideoAbuse & 37 MVideoAbuse &
37 UseVideoAbuse<'Video', MVideoAccountLightBlacklistAllFiles> 38 UseVideoAbuse<'Video', Omit<MVideoAccountLightBlacklistAllFiles, 'VideoFiles' | 'VideoStreamingPlaylists'>>
38 39
39export type MVideoAbuseFormattable = 40export type MVideoAbuseFormattable =
40 MVideoAbuse & 41 MVideoAbuse &
@@ -49,7 +50,7 @@ export type MCommentAbuseAccount =
49 50
50export type MCommentAbuseAccountVideo = 51export type MCommentAbuseAccountVideo =
51 MCommentAbuse & 52 MCommentAbuse &
52 UseCommentAbuse<'VideoComment', MCommentOwnerVideo> 53 UseCommentAbuse<'VideoComment', MCommentOwner & PickWith<VideoCommentModel, 'Video', MVideo>>
53 54
54export type MCommentAbuseUrl = 55export type MCommentAbuseUrl =
55 MCommentAbuse & 56 MCommentAbuse &
@@ -79,14 +80,6 @@ export type MAbuseAccountVideo =
79 Use<'VideoAbuse', MVideoAbuseVideoFull> & 80 Use<'VideoAbuse', MVideoAbuseVideoFull> &
80 Use<'ReporterAccount', MAccountDefault> 81 Use<'ReporterAccount', MAccountDefault>
81 82
82export type MAbuseAP =
83 MAbuse &
84 Pick<AbuseModel, 'toActivityPubObject'> &
85 Use<'ReporterAccount', MAccountUrl> &
86 Use<'FlaggedAccount', MAccountUrl> &
87 Use<'VideoAbuse', MVideoAbuseVideo> &
88 Use<'VideoCommentAbuse', MCommentAbuseAccount>
89
90export type MAbuseFull = 83export type MAbuseFull =
91 MAbuse & 84 MAbuse &
92 Pick<AbuseModel, 'toActivityPubObject'> & 85 Pick<AbuseModel, 'toActivityPubObject'> &
@@ -111,3 +104,11 @@ export type MAbuseUserFormattable =
111 Use<'FlaggedAccount', MAccountFormattable> & 104 Use<'FlaggedAccount', MAccountFormattable> &
112 Use<'VideoAbuse', MVideoAbuseFormattable> & 105 Use<'VideoAbuse', MVideoAbuseFormattable> &
113 Use<'VideoCommentAbuse', MCommentAbuseFormattable> 106 Use<'VideoCommentAbuse', MCommentAbuseFormattable>
107
108export type MAbuseAP =
109 MAbuse &
110 Pick<AbuseModel, 'toActivityPubObject'> &
111 Use<'ReporterAccount', MAccountUrl> &
112 Use<'FlaggedAccount', MAccountUrl> &
113 Use<'VideoAbuse', MVideoAbuseVideo> &
114 Use<'VideoCommentAbuse', MCommentAbuseAccount>
diff --git a/server/types/models/user/user-notification.ts b/server/types/models/user/user-notification.ts
index f59eb7260..58764a748 100644
--- a/server/types/models/user/user-notification.ts
+++ b/server/types/models/user/user-notification.ts
@@ -56,7 +56,7 @@ export module UserNotificationIncludes {
56 PickWith<VideoCommentModel, 'Video', Pick<VideoModel, 'id' | 'name' | 'uuid'>>> 56 PickWith<VideoCommentModel, 'Video', Pick<VideoModel, 'id' | 'name' | 'uuid'>>>
57 57
58 export type AbuseInclude = 58 export type AbuseInclude =
59 Pick<AbuseModel, 'id'> & 59 Pick<AbuseModel, 'id' | 'state'> &
60 PickWith<AbuseModel, 'VideoAbuse', VideoAbuseInclude> & 60 PickWith<AbuseModel, 'VideoAbuse', VideoAbuseInclude> &
61 PickWith<AbuseModel, 'VideoCommentAbuse', VideoCommentAbuseInclude> & 61 PickWith<AbuseModel, 'VideoCommentAbuse', VideoCommentAbuseInclude> &
62 PickWith<AbuseModel, 'FlaggedAccount', AccountIncludeActor> 62 PickWith<AbuseModel, 'FlaggedAccount', AccountIncludeActor>