1 /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/no-floating-promises */
3 import { HttpStatusCode, VideoToken } from '@shared/models'
4 import { unwrapBody } from '../requests'
5 import { AbstractCommand, OverrideCommandOptions } from '../shared'
7 export class VideoTokenCommand extends AbstractCommand {
9 create (options: OverrideCommandOptions & {
10 videoId: number | string
12 const { videoId } = options
13 const path = '/api/v1/videos/' + videoId + '/token'
15 return unwrapBody<VideoToken>(this.postBodyRequest({
20 defaultExpectedStatus: HttpStatusCode.OK_200
24 async getVideoFileToken (options: OverrideCommandOptions & {
25 videoId: number | string
27 const { files } = await this.create(options)