import { VideoAbuseModel } from '@server/models/abuse/video-abuse'
import { VideoCommentAbuseModel } from '@server/models/abuse/video-comment-abuse'
+import { VideoCommentModel } from '@server/models/video/video-comment'
import { PickWith } from '@shared/core-utils'
import { AbuseModel } from '../../../models/abuse/abuse'
import { MAccountDefault, MAccountFormattable, MAccountLight, MAccountUrl } from '../account'
-import { MCommentOwner, MCommentUrl, MVideoUrl, MCommentOwnerVideo, MComment, MCommentVideo } from '../video'
+import { MComment, MCommentOwner, MCommentUrl, MCommentVideo, MVideoUrl } from '../video'
import { MVideo, MVideoAccountLightBlacklistAllFiles } from '../video/video'
type Use<K extends keyof AbuseModel, M> = PickWith<AbuseModel, K, M>
export type MCommentAbuse = Omit<VideoCommentAbuseModel, 'Abuse' | 'VideoComment'>
+export type MAbuseReporter =
+ MAbuse &
+ Use<'ReporterAccount', MAccountDefault>
+
// ############################################################################
export type MVideoAbuseVideo =
export type MVideoAbuseVideoFull =
MVideoAbuse &
- UseVideoAbuse<'Video', MVideoAccountLightBlacklistAllFiles>
+ UseVideoAbuse<'Video', Omit<MVideoAccountLightBlacklistAllFiles, 'VideoFiles' | 'VideoStreamingPlaylists'>>
export type MVideoAbuseFormattable =
MVideoAbuse &
export type MCommentAbuseAccountVideo =
MCommentAbuse &
- UseCommentAbuse<'VideoComment', MCommentOwnerVideo>
+ UseCommentAbuse<'VideoComment', MCommentOwner & PickWith<VideoCommentModel, 'Video', MVideo>>
export type MCommentAbuseUrl =
MCommentAbuse &
Use<'VideoAbuse', MVideoAbuseVideoFull> &
Use<'ReporterAccount', MAccountDefault>
-export type MAbuseAP =
- MAbuse &
- Pick<AbuseModel, 'toActivityPubObject'> &
- Use<'ReporterAccount', MAccountUrl> &
- Use<'FlaggedAccount', MAccountUrl> &
- Use<'VideoAbuse', MVideoAbuseVideo> &
- Use<'VideoCommentAbuse', MCommentAbuseAccount>
-
export type MAbuseFull =
MAbuse &
Pick<AbuseModel, 'toActivityPubObject'> &
// Format for API or AP object
-export type MAbuseFormattable =
+export type MAbuseAdminFormattable =
MAbuse &
Use<'ReporterAccount', MAccountFormattable> &
Use<'FlaggedAccount', MAccountFormattable> &
Use<'VideoAbuse', MVideoAbuseFormattable> &
Use<'VideoCommentAbuse', MCommentAbuseFormattable>
+
+export type MAbuseUserFormattable =
+ MAbuse &
+ Use<'FlaggedAccount', MAccountFormattable> &
+ Use<'VideoAbuse', MVideoAbuseFormattable> &
+ Use<'VideoCommentAbuse', MCommentAbuseFormattable>
+
+export type MAbuseAP =
+ MAbuse &
+ Pick<AbuseModel, 'toActivityPubObject'> &
+ Use<'ReporterAccount', MAccountUrl> &
+ Use<'FlaggedAccount', MAccountUrl> &
+ Use<'VideoAbuse', MVideoAbuseVideo> &
+ Use<'VideoCommentAbuse', MCommentAbuseAccount>