.expect('Content-Type', /json/)
}
+function getVideosListWithToken (url: string, token: string) {
+ const path = '/api/v1/videos'
+
+ return request(url)
+ .get(path)
+ .set('Authorization', 'Bearer ' + token)
+ .query({ sort: 'name' })
+ .set('Accept', 'application/json')
+ .expect(200)
+ .expect('Content-Type', /json/)
+}
+
function getLocalVideos (url: string) {
const path = '/api/v1/videos'
.expect('Content-Type', /json/)
}
+function searchVideoWithToken (url: string, search: string, token: string) {
+ const path = '/api/v1/videos'
+ const req = request(url)
+ .get(path + '/search')
+ .set('Authorization', 'Bearer ' + token)
+ .query({ search })
+ .set('Accept', 'application/json')
+
+ return req.expect(200)
+ .expect('Content-Type', /json/)
+}
+
function searchVideoWithPagination (url: string, search: string, start: number, count: number, sort?: string) {
const path = '/api/v1/videos'
getVideoPrivacies,
getVideoLanguages,
getMyVideos,
+ searchVideoWithToken,
getVideo,
getVideoWithToken,
getVideosList,
searchVideo,
searchVideoWithPagination,
searchVideoWithSort,
+ getVideosListWithToken,
uploadVideo,
updateVideo,
rateVideo,