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