diff options
author | Chocobozzz <me@florianbigard.com> | 2020-07-28 11:12:16 +0200 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2020-07-31 11:35:19 +0200 |
commit | 668b7f096ead74d6e7692944a026c936f581dae8 (patch) | |
tree | d969753941012d080e4bd6d74e65dee95581479f /server | |
parent | d573926e9b94fb19c8f51c53f71fc853182e1761 (diff) | |
download | PeerTube-668b7f096ead74d6e7692944a026c936f581dae8.tar.gz PeerTube-668b7f096ead74d6e7692944a026c936f581dae8.tar.zst PeerTube-668b7f096ead74d6e7692944a026c936f581dae8.zip |
Add openapi doc
Diffstat (limited to 'server')
-rw-r--r-- | server/lib/notifier.ts | 3 | ||||
-rw-r--r-- | server/middlewares/validators/abuse.ts | 2 | ||||
-rw-r--r-- | server/tests/api/check-params/abuses.ts | 1 | ||||
-rw-r--r-- | server/types/models/moderation/abuse.ts | 6 | ||||
-rw-r--r-- | server/typings/express/index.d.ts | 5 |
5 files changed, 7 insertions, 10 deletions
diff --git a/server/lib/notifier.ts b/server/lib/notifier.ts index 9c2f16c27..1da81a535 100644 --- a/server/lib/notifier.ts +++ b/server/lib/notifier.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import { AbuseMessageModel } from '@server/models/abuse/abuse-message' | 1 | import { AccountModel } from '@server/models/account/account' |
2 | import { getServerActor } from '@server/models/application/application' | 2 | import { getServerActor } from '@server/models/application/application' |
3 | import { ServerBlocklistModel } from '@server/models/server/server-blocklist' | 3 | import { ServerBlocklistModel } from '@server/models/server/server-blocklist' |
4 | import { | 4 | import { |
@@ -24,7 +24,6 @@ import { MCommentOwnerVideo, MVideoAccountLight, MVideoFullLight } from '../type | |||
24 | import { isBlockedByServerOrAccount } from './blocklist' | 24 | import { isBlockedByServerOrAccount } from './blocklist' |
25 | import { Emailer } from './emailer' | 25 | import { Emailer } from './emailer' |
26 | import { PeerTubeSocket } from './peertube-socket' | 26 | import { PeerTubeSocket } from './peertube-socket' |
27 | import { AccountModel } from '@server/models/account/account' | ||
28 | 27 | ||
29 | class Notifier { | 28 | class Notifier { |
30 | 29 | ||
diff --git a/server/middlewares/validators/abuse.ts b/server/middlewares/validators/abuse.ts index 2a096e0af..f99d850a5 100644 --- a/server/middlewares/validators/abuse.ts +++ b/server/middlewares/validators/abuse.ts | |||
@@ -208,7 +208,7 @@ const checkAbuseValidForMessagesValidator = [ | |||
208 | const abuse = res.locals.abuse | 208 | const abuse = res.locals.abuse |
209 | if (abuse.ReporterAccount.isOwned() === false) { | 209 | if (abuse.ReporterAccount.isOwned() === false) { |
210 | return res.status(400).json({ | 210 | return res.status(400).json({ |
211 | error: 'This abuse was created by a user of your instance.', | 211 | error: 'This abuse was created by a user of your instance.' |
212 | }) | 212 | }) |
213 | } | 213 | } |
214 | 214 | ||
diff --git a/server/tests/api/check-params/abuses.ts b/server/tests/api/check-params/abuses.ts index 0ef8f6cac..1f040bbcf 100644 --- a/server/tests/api/check-params/abuses.ts +++ b/server/tests/api/check-params/abuses.ts | |||
@@ -427,4 +427,3 @@ describe('Test abuses API validators', function () { | |||
427 | await cleanupTests([ server ]) | 427 | await cleanupTests([ server ]) |
428 | }) | 428 | }) |
429 | }) | 429 | }) |
430 | |||
diff --git a/server/types/models/moderation/abuse.ts b/server/types/models/moderation/abuse.ts index 5409dfd6b..6fd83684c 100644 --- a/server/types/models/moderation/abuse.ts +++ b/server/types/models/moderation/abuse.ts | |||
@@ -1,11 +1,11 @@ | |||
1 | import { VideoAbuseModel } from '@server/models/abuse/video-abuse' | 1 | import { VideoAbuseModel } from '@server/models/abuse/video-abuse' |
2 | import { VideoCommentAbuseModel } from '@server/models/abuse/video-comment-abuse' | 2 | import { VideoCommentAbuseModel } from '@server/models/abuse/video-comment-abuse' |
3 | import { VideoCommentModel } from '@server/models/video/video-comment' | ||
3 | import { PickWith } from '@shared/core-utils' | 4 | import { PickWith } from '@shared/core-utils' |
4 | import { AbuseModel } from '../../../models/abuse/abuse' | 5 | import { AbuseModel } from '../../../models/abuse/abuse' |
5 | import { MAccountDefault, MAccountFormattable, MAccountLight, MAccountUrl, MAccount } from '../account' | 6 | import { MAccountDefault, MAccountFormattable, MAccountLight, MAccountUrl } from '../account' |
6 | import { MCommentOwner, MCommentUrl, MVideoUrl, MCommentOwnerVideo, MComment, MCommentVideo } from '../video' | 7 | import { MComment, MCommentOwner, MCommentUrl, MCommentVideo, MVideoUrl } from '../video' |
7 | import { MVideo, MVideoAccountLightBlacklistAllFiles } from '../video/video' | 8 | import { MVideo, MVideoAccountLightBlacklistAllFiles } from '../video/video' |
8 | import { VideoCommentModel } from '@server/models/video/video-comment' | ||
9 | 9 | ||
10 | type Use<K extends keyof AbuseModel, M> = PickWith<AbuseModel, K, M> | 10 | type Use<K extends keyof AbuseModel, M> = PickWith<AbuseModel, K, M> |
11 | type UseVideoAbuse<K extends keyof VideoAbuseModel, M> = PickWith<VideoAbuseModel, K, M> | 11 | type UseVideoAbuse<K extends keyof VideoAbuseModel, M> = PickWith<VideoAbuseModel, K, M> |
diff --git a/server/typings/express/index.d.ts b/server/typings/express/index.d.ts index d95b8925d..cd8e544e0 100644 --- a/server/typings/express/index.d.ts +++ b/server/typings/express/index.d.ts | |||
@@ -1,7 +1,7 @@ | |||
1 | import { RegisterServerAuthExternalOptions } from '@server/types' | 1 | import { RegisterServerAuthExternalOptions } from '@server/types' |
2 | import { | 2 | import { |
3 | MAbuse, | ||
4 | MAbuseMessage, | 3 | MAbuseMessage, |
4 | MAbuseReporter, | ||
5 | MAccountBlocklist, | 5 | MAccountBlocklist, |
6 | MActorUrl, | 6 | MActorUrl, |
7 | MStreamingPlaylist, | 7 | MStreamingPlaylist, |
@@ -9,8 +9,7 @@ import { | |||
9 | MVideoFile, | 9 | MVideoFile, |
10 | MVideoImmutable, | 10 | MVideoImmutable, |
11 | MVideoPlaylistFull, | 11 | MVideoPlaylistFull, |
12 | MVideoPlaylistFullSummary, | 12 | MVideoPlaylistFullSummary |
13 | MAbuseReporter | ||
14 | } from '@server/types/models' | 13 | } from '@server/types/models' |
15 | import { MOAuthTokenUser } from '@server/types/models/oauth/oauth-token' | 14 | import { MOAuthTokenUser } from '@server/types/models/oauth/oauth-token' |
16 | import { MPlugin, MServer, MServerBlocklist } from '@server/types/models/server' | 15 | import { MPlugin, MServer, MServerBlocklist } from '@server/types/models/server' |