const BasePage = require('./BasePage'); const XmlParser = require('../xml/XmlParser'); class OpensearchPage extends BasePage { constructor(config) { super(config); this.id = 'opensearch'; this.title = 'opensearch'; } async body() { const xml = new XmlParser(); const xmlObject = {}; /* inpx-web Поиск по каталогу UTF-8 UTF-8 */ xmlObject['OpenSearchDescription'] = { '*ATTRS': {xmlns: 'http://a9.com/-/spec/opensearch/1.1/'}, ShortName: 'inpx-web', Description: 'Поиск по каталогу', InputEncoding: 'UTF-8', OutputEncoding: 'UTF-8', Url: { '*ATTRS': { type: 'application/atom+xml;profile=opds-catalog;kind=navigation', template: `${this.opdsRoot}/search?term={searchTerms}`, }, }, } xml.fromObject(xmlObject); return xml.toString({format: true}); } } module.exports = OpensearchPage;