diff options
Diffstat (limited to 'server/types/models/moderation')
-rw-r--r-- | server/types/models/moderation/abuse-message.ts | 20 | ||||
-rw-r--r-- | server/types/models/moderation/abuse.ts | 8 | ||||
-rw-r--r-- | server/types/models/moderation/index.ts | 1 |
3 files changed, 28 insertions, 1 deletions
diff --git a/server/types/models/moderation/abuse-message.ts b/server/types/models/moderation/abuse-message.ts new file mode 100644 index 000000000..565eca706 --- /dev/null +++ b/server/types/models/moderation/abuse-message.ts | |||
@@ -0,0 +1,20 @@ | |||
1 | import { AbuseMessageModel } from '@server/models/abuse/abuse-message' | ||
2 | import { PickWith } from '@shared/core-utils' | ||
3 | import { AbuseModel } from '../../../models/abuse/abuse' | ||
4 | import { MAccountFormattable } from '../account' | ||
5 | |||
6 | type Use<K extends keyof AbuseMessageModel, M> = PickWith<AbuseMessageModel, K, M> | ||
7 | |||
8 | // ############################################################################ | ||
9 | |||
10 | export type MAbuseMessage = Omit<AbuseMessageModel, 'Account' | 'Abuse' | 'toFormattedJSON'> | ||
11 | |||
12 | export type MAbuseMessageId = Pick<AbuseModel, 'id'> | ||
13 | |||
14 | // ############################################################################ | ||
15 | |||
16 | // Format for API | ||
17 | |||
18 | export type MAbuseMessageFormattable = | ||
19 | MAbuseMessage & | ||
20 | Use<'Account', MAccountFormattable> | ||
diff --git a/server/types/models/moderation/abuse.ts b/server/types/models/moderation/abuse.ts index a0bf4b08f..39ef50771 100644 --- a/server/types/models/moderation/abuse.ts +++ b/server/types/models/moderation/abuse.ts | |||
@@ -95,9 +95,15 @@ export type MAbuseFull = | |||
95 | 95 | ||
96 | // Format for API or AP object | 96 | // Format for API or AP object |
97 | 97 | ||
98 | export type MAbuseFormattable = | 98 | export type MAbuseAdminFormattable = |
99 | MAbuse & | 99 | MAbuse & |
100 | Use<'ReporterAccount', MAccountFormattable> & | 100 | Use<'ReporterAccount', MAccountFormattable> & |
101 | Use<'FlaggedAccount', MAccountFormattable> & | 101 | Use<'FlaggedAccount', MAccountFormattable> & |
102 | Use<'VideoAbuse', MVideoAbuseFormattable> & | 102 | Use<'VideoAbuse', MVideoAbuseFormattable> & |
103 | Use<'VideoCommentAbuse', MCommentAbuseFormattable> | 103 | Use<'VideoCommentAbuse', MCommentAbuseFormattable> |
104 | |||
105 | export type MAbuseUserFormattable = | ||
106 | MAbuse & | ||
107 | Use<'FlaggedAccount', MAccountFormattable> & | ||
108 | Use<'VideoAbuse', MVideoAbuseFormattable> & | ||
109 | Use<'VideoCommentAbuse', MCommentAbuseFormattable> | ||
diff --git a/server/types/models/moderation/index.ts b/server/types/models/moderation/index.ts index 8bea1708f..1ed91b249 100644 --- a/server/types/models/moderation/index.ts +++ b/server/types/models/moderation/index.ts | |||
@@ -1 +1,2 @@ | |||
1 | export * from './abuse' | 1 | export * from './abuse' |
2 | export * from './abuse-message' | ||