aboutsummaryrefslogblamecommitdiffhomepage
path: root/shared/extra-utils/videos/services.ts
blob: e13a788bd885152e09299a50bd8b610d7e8482e6 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
                                    
                                                                                  













                                                                                                             
                                        






                                                                              
import * as request from 'supertest'
import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes'

function getOEmbed (url: string, oembedUrl: string, format?: string, maxHeight?: number, maxWidth?: number) {
  const path = '/services/oembed'
  const query = {
    url: oembedUrl,
    format,
    maxheight: maxHeight,
    maxwidth: maxWidth
  }

  return request(url)
          .get(path)
          .query(query)
          .set('Accept', 'application/json')
          .expect(HttpStatusCode.OK_200)
}

// ---------------------------------------------------------------------------

export {
  getOEmbed
}