services-command.ts 673 B

1234567891011121314151617181920212223242526272829
  1. import { HttpStatusCode } from '@shared/models'
  2. import { AbstractCommand, OverrideCommandOptions } from '../shared'
  3. export class ServicesCommand extends AbstractCommand {
  4. getOEmbed (options: OverrideCommandOptions & {
  5. oembedUrl: string
  6. format?: string
  7. maxHeight?: number
  8. maxWidth?: number
  9. }) {
  10. const path = '/services/oembed'
  11. const query = {
  12. url: options.oembedUrl,
  13. format: options.format,
  14. maxheight: options.maxHeight,
  15. maxwidth: options.maxWidth
  16. }
  17. return this.getRequest({
  18. ...options,
  19. path,
  20. query,
  21. implicitToken: false,
  22. defaultExpectedStatus: HttpStatusCode.OK_200
  23. })
  24. }
  25. }