1 import * as request from 'supertest'
2 import { AbusePredefinedReasonsString, AbuseState, AbuseUpdate, AbuseVideoIs } from '@shared/models'
3 import { makeDeleteRequest, makeGetRequest, makePutBodyRequest } from '../requests/requests'
5 // FIXME: deprecated in 2.3. Remove this file
7 function reportVideoAbuse (
10 videoId: number | string,
12 predefinedReasons?: AbusePredefinedReasonsString[],
17 const path = '/api/v1/videos/' + videoId + '/abuse'
21 .set('Accept', 'application/json')
22 .set('Authorization', 'Bearer ' + token)
23 .send({ reason, predefinedReasons, startAt, endAt })
24 .expect(specialStatus)
27 function getVideoAbusesList (options: {
31 predefinedReason?: AbusePredefinedReasonsString
34 videoIs?: AbuseVideoIs
35 searchReporter?: string
36 searchReportee?: string
38 searchVideoChannel?: string
53 const path = '/api/v1/videos/abuse'
68 return makeGetRequest({
73 statusCodeExpected: 200
77 function updateVideoAbuse (
80 videoId: string | number,
83 statusCodeExpected = 204
85 const path = '/api/v1/videos/' + videoId + '/abuse/' + videoAbuseId
87 return makePutBodyRequest({
96 function deleteVideoAbuse (url: string, token: string, videoId: string | number, videoAbuseId: number, statusCodeExpected = 204) {
97 const path = '/api/v1/videos/' + videoId + '/abuse/' + videoAbuseId
99 return makeDeleteRequest({
107 // ---------------------------------------------------------------------------