2021-01-14 17:01:43 +00:00
|
|
|
const config = require('../../../shared/config');
|
|
|
|
const externalRequest = require('../../lib/request-external');
|
2021-05-03 17:29:44 +01:00
|
|
|
const i18n = require('../../../shared/i18n');
|
2021-01-14 17:01:43 +00:00
|
|
|
const OEmbed = require('../../services/oembed');
|
|
|
|
const oembed = new OEmbed({config, externalRequest, i18n});
|
2020-06-08 15:06:00 +01:00
|
|
|
|
2019-08-09 19:41:24 +05:30
|
|
|
module.exports = {
|
|
|
|
docName: 'oembed',
|
|
|
|
|
|
|
|
read: {
|
|
|
|
permissions: false,
|
|
|
|
data: [
|
2019-08-27 19:31:02 +05:30
|
|
|
'url',
|
|
|
|
'type'
|
2019-08-09 19:41:24 +05:30
|
|
|
],
|
|
|
|
options: [],
|
|
|
|
query({data}) {
|
2019-08-27 19:31:02 +05:30
|
|
|
let {url, type} = data;
|
2019-08-09 19:41:24 +05:30
|
|
|
|
2021-08-23 10:36:18 +04:00
|
|
|
return oembed.fetchOembedDataFromUrl(url, type);
|
2019-08-09 19:41:24 +05:30
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|