]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - shared/extra-utils/overviews/overviews-command.ts
Introduce overviews command
[github/Chocobozzz/PeerTube.git] / shared / extra-utils / overviews / overviews-command.ts
1 import { HttpStatusCode } from '@shared/core-utils'
2 import { VideosOverview } from '@shared/models'
3 import { AbstractCommand, OverrideCommandOptions } from '../shared'
4
5 export class OverviewsCommand extends AbstractCommand {
6
7 getVideos (options: OverrideCommandOptions & {
8 page: number
9 token?: string
10 }) {
11 const { token, page } = options
12 const path = '/api/v1/overviews/videos'
13
14 const query = { page }
15
16 return this.getRequestBody<VideosOverview>({
17 ...options,
18
19 token: token || null,
20 path,
21 query,
22 defaultExpectedStatus: HttpStatusCode.OK_200
23 })
24 }
25 }