X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;ds=sidebyside;f=support%2Fdoc%2Fapi%2Fopenapi.yaml;h=f3edca6824ce23d9845beb4a32632402e3ac3f69;hb=2291a412d25bd139398ca9e7a5131d0c1e4ffd7d;hp=7d308a114b5abccf4ee55d5b88ebf491b5f4ec29;hpb=97aaeadad537cc6b19f508f074c3fba01ed1e93b;p=github%2FChocobozzz%2FPeerTube.git diff --git a/support/doc/api/openapi.yaml b/support/doc/api/openapi.yaml index 7d308a114..f3edca682 100644 --- a/support/doc/api/openapi.yaml +++ b/support/doc/api/openapi.yaml @@ -106,9 +106,9 @@ tags: Managing plugins installed from a local path or from NPM, or search for new ones. externalDocs: url: https://docs.joinpeertube.org/#/api-plugins - - name: Video Abuses + - name: Abuses description: | - Video abuses deal with reports of local or remote videos alike. + Abuses deal with reports of local or remote videos/comments/accounts alike. - name: Video description: | Operations dealing with listing, uploading, fetching or modifying videos. @@ -166,7 +166,7 @@ x-tagGroups: - Search - name: Moderation tags: - - Video Abuses + - Abuses - Video Blocks - Account Blocks - Server Blocks @@ -893,7 +893,7 @@ paths: $ref: '#/components/schemas/NotificationSettingValue' newCommentOnMyVideo: $ref: '#/components/schemas/NotificationSettingValue' - videoAbuseAsModerator: + abuseAsModerator: $ref: '#/components/schemas/NotificationSettingValue' videoAutoBlacklistAsModerator: $ref: '#/components/schemas/NotificationSettingValue' @@ -1471,16 +1471,15 @@ paths: description: HTTP or Torrent/magnetURI import not enabled '400': description: '`magnetUri` or `targetUrl` or a torrent file missing' - /videos/abuse: + /abuses: get: - deprecated: true - summary: List video abuses + summary: List abuses security: - OAuth2: - admin - moderator tags: - - Video Abuses + - Abuses parameters: - name: id in: query @@ -1491,16 +1490,7 @@ paths: in: query description: predefined reason the listed reports should contain schema: - type: string - enum: - - violentOrAbusive - - hatefulOrAbusive - - spamOrMisleading - - privacy - - rights - - serverRules - - thumbnails - - captions + $ref: '#/components/schemas/PredefinedAbuseReasons' - name: search in: query description: plain search that will match with video titles, reporter names and more @@ -1508,7 +1498,7 @@ paths: type: string - name: state in: query - description: 'The video playlist privacy (Pending = `1`, Rejected = `2`, Accepted = `3`)' + description: 'The abuse state (Pending = `1`, Rejected = `2`, Accepted = `3`)' schema: type: integer enum: @@ -1535,6 +1525,23 @@ paths: description: only list reports of a specific video channel schema: type: string + - name: videoIs + in: query + description: only list blacklisted or deleted videos + schema: + type: string + enum: + - 'deleted' + - 'blacklisted' + - name: filter + in: query + description: only list account, comment or video reports + schema: + type: string + enum: + - 'video' + - 'comment' + - 'account' - $ref: '#/components/parameters/start' - $ref: '#/components/parameters/count' - $ref: '#/components/parameters/abusesSort' @@ -1547,17 +1554,13 @@ paths: type: array items: $ref: '#/components/schemas/VideoAbuse' - '/videos/{id}/abuse': + post: - deprecated: true summary: Report an abuse security: - OAuth2: [] tags: - - Video Abuses - - Videos - parameters: - - $ref: '#/components/parameters/idOrUUID' + - Abuses requestBody: required: true content: @@ -1570,27 +1573,34 @@ paths: type: string minLength: 4 predefinedReasons: - description: Reason categories that help triage reports - type: array - items: - type: string - enum: - - violentOrAbusive - - hatefulOrAbusive - - spamOrMisleading - - privacy - - rights - - serverRules - - thumbnails - - captions - startAt: - type: integer - description: Timestamp in the video that marks the beginning of the report - minimum: 0 - endAt: - type: integer - description: Timestamp in the video that marks the ending of the report - minimum: 0 + $ref: '#/components/schemas/PredefinedAbuseReasons' + + video: + type: object + properties: + id: + description: Video id to report + type: number + startAt: + type: integer + description: Timestamp in the video that marks the beginning of the report + minimum: 0 + endAt: + type: integer + description: Timestamp in the video that marks the ending of the report + minimum: 0 + comment: + type: object + properties: + id: + description: Comment id to report + type: number + account: + type: object + properties: + id: + description: Account id to report + type: number required: - reason responses: @@ -1598,18 +1608,16 @@ paths: description: successful operation '400': description: incorrect request parameters - '/videos/{id}/abuse/{abuseId}': + '/abuses/{abuseId}': put: - deprecated: true summary: Update an abuse security: - OAuth2: - admin - moderator tags: - - Video Abuses + - Abuses parameters: - - $ref: '#/components/parameters/idOrUUID' - $ref: '#/components/parameters/abuseId' requestBody: content: @@ -1618,7 +1626,7 @@ paths: type: object properties: state: - $ref: '#/components/schemas/VideoAbuseStateSet' + $ref: '#/components/schemas/AbuseStateSet' moderationComment: type: string description: Update the report comment visible only to the moderation team @@ -1626,18 +1634,16 @@ paths: '204': description: successful operation '404': - description: video abuse not found + description: abuse not found delete: - deprecated: true tags: - - Video Abuses + - Abuses summary: Delete an abuse security: - OAuth2: - admin - moderator parameters: - - $ref: '#/components/parameters/idOrUUID' - $ref: '#/components/parameters/abuseId' responses: '204': @@ -3320,7 +3326,7 @@ components: name: abuseId in: path required: true - description: Video abuse id + description: Abuse id schema: type: integer captionLanguage: @@ -3584,20 +3590,20 @@ components: label: type: string - VideoAbuseStateSet: + AbuseStateSet: type: integer enum: - 1 - 2 - 3 description: 'The video playlist privacy (Pending = `1`, Rejected = `2`, Accepted = `3`)' - VideoAbuseStateConstant: + AbuseStateConstant: properties: id: - $ref: '#/components/schemas/VideoAbuseStateSet' + $ref: '#/components/schemas/AbuseStateSet' label: type: string - VideoAbusePredefinedReasons: + AbusePredefinedReasons: type: array items: type: string @@ -3960,11 +3966,11 @@ components: type: string example: The video is a spam predefinedReasons: - $ref: '#/components/schemas/VideoAbusePredefinedReasons' + $ref: '#/components/schemas/AbusePredefinedReasons' reporterAccount: $ref: '#/components/schemas/Account' state: - $ref: '#/components/schemas/VideoAbuseStateConstant' + $ref: '#/components/schemas/AbuseStateConstant' moderationComment: type: string example: Decided to ban the server since it spams us regularly @@ -4553,6 +4559,22 @@ components: updatedAt: type: string format: date-time + + PredefinedAbuseReasons: + description: Reason categories that help triage reports + type: array + items: + type: string + enum: + - violentOrAbusive + - hatefulOrAbusive + - spamOrMisleading + - privacy + - rights + - serverRules + - thumbnails + - captions + Job: properties: id: @@ -4690,11 +4712,11 @@ components: description: The user daily video quota videosCount: type: integer - videoAbusesCount: + abusesCount: type: integer - videoAbusesAcceptedCount: + abusesAcceptedCount: type: integer - videoAbusesCreatedCount: + abusesCreatedCount: type: integer videoCommentsCount: type: integer @@ -5098,7 +5120,7 @@ components: - `2` NEW_COMMENT_ON_MY_VIDEO - - `3` NEW_VIDEO_ABUSE_FOR_MODERATORS + - `3` NEW_ABUSE_FOR_MODERATORS - `4` BLACKLIST_ON_MY_VIDEO