1 import { HttpStatusCode, ResultList, Video } from '@shared/models'
2 import { AbstractCommand, OverrideCommandOptions } from '../shared'
4 export class HistoryCommand extends AbstractCommand {
6 list (options: OverrideCommandOptions & {
9 const { search } = options
10 const path = '/api/v1/users/me/history/videos'
12 return this.getRequestBody<ResultList<Video>>({
20 defaultExpectedStatus: HttpStatusCode.OK_200
24 removeElement (options: OverrideCommandOptions & {
27 const { videoId } = options
28 const path = '/api/v1/users/me/history/videos/' + videoId
30 return this.deleteRequest({
35 defaultExpectedStatus: HttpStatusCode.NO_CONTENT_204
39 removeAll (options: OverrideCommandOptions & {
42 const { beforeDate } = options
43 const path = '/api/v1/users/me/history/videos/remove'
45 return this.postBodyRequest({
49 fields: { beforeDate },
51 defaultExpectedStatus: HttpStatusCode.NO_CONTENT_204