PeerTube/shared/server-commands/videos/services-command.ts

30 lines
673 B
TypeScript
Raw Normal View History

2021-07-16 10:42:24 +02:00
import { HttpStatusCode } from '@shared/models'
2021-07-08 10:23:21 +02:00
import { AbstractCommand, OverrideCommandOptions } from '../shared'
export class ServicesCommand extends AbstractCommand {
getOEmbed (options: OverrideCommandOptions & {
oembedUrl: string
format?: string
maxHeight?: number
maxWidth?: number
}) {
const path = '/services/oembed'
const query = {
url: options.oembedUrl,
format: options.format,
maxheight: options.maxHeight,
maxwidth: options.maxWidth
}
return this.getRequest({
...options,
path,
query,
implicitToken: false,
2021-07-08 10:23:21 +02:00
defaultExpectedStatus: HttpStatusCode.OK_200
})
}
}