1 import * as request from 'supertest'
2 import { AbusePredefinedReasonsString, AbuseState, AbuseUpdate, AbuseVideoIs } from '@shared/models'
3 import { makeDeleteRequest, makeGetRequest, makePutBodyRequest } from '../requests/requests'
8 videoId: number | string,
10 predefinedReasons?: AbusePredefinedReasonsString[],
15 const path = '/api/v1/videos/' + videoId + '/abuse'
19 .set('Accept', 'application/json')
20 .set('Authorization', 'Bearer ' + token)
21 .send({ reason, predefinedReasons, startAt, endAt })
22 .expect(specialStatus)
25 function getAbusesList (options: {
29 predefinedReason?: AbusePredefinedReasonsString
32 videoIs?: AbuseVideoIs
33 searchReporter?: string
34 searchReportee?: string
36 searchVideoChannel?: string
51 const path = '/api/v1/videos/abuse'
66 return makeGetRequest({
71 statusCodeExpected: 200
75 function updateAbuse (
78 videoId: string | number,
81 statusCodeExpected = 204
83 const path = '/api/v1/videos/' + videoId + '/abuse/' + videoAbuseId
85 return makePutBodyRequest({
94 function deleteAbuse (url: string, token: string, videoId: string | number, videoAbuseId: number, statusCodeExpected = 204) {
95 const path = '/api/v1/videos/' + videoId + '/abuse/' + videoAbuseId
97 return makeDeleteRequest({
105 // ---------------------------------------------------------------------------