2 import { HttpStatusCode } from '../../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',
23 defaultExpectedStatus: HttpStatusCode.OK_200
27 getJSON (options: OverrideCommandOptions & {
29 query?: { [ id: string ]: any }
31 const { feed, query } = options
32 const path = '/feeds/' + feed + '.json'
34 return this.getRequestText({
39 accept: 'application/json',
41 defaultExpectedStatus: HttpStatusCode.OK_200