2 import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes'
3 import { AbstractCommand, OverrideCommandOptions } from '../shared'
5 type FeedType = 'videos' | 'video-comments' | 'subscriptions'
7 export class FeedCommand extends AbstractCommand {
9 getXML (options: OverrideCommandOptions & {
13 const { feed, format } = options
14 const path = '/feeds/' + feed + '.xml'
16 return this.getRequestText({
20 query: format ? { format } : undefined,
21 accept: 'application/xml',
22 defaultExpectedStatus: HttpStatusCode.OK_200
26 getJSON (options: OverrideCommandOptions & {
28 query?: { [ id: string ]: any }
30 const { feed, query } = options
31 const path = '/feeds/' + feed + '.json'
33 return this.getRequestText({
38 accept: 'application/json',
39 defaultExpectedStatus: HttpStatusCode.OK_200