remove unused packages

pull/55/head
unknown 2019-05-06 18:37:47 -04:00
parent 195168cdf8
commit 0305510ab3
3 changed files with 0 additions and 11539 deletions

View File

@ -1,19 +1,3 @@
const xmldom = require('xmldom')
const { XML } = require('r2-utils-js/dist/es8-es2017/src/_utils/xml-js-mapper')
const { JSON: TAJSON } = require('ta-json-x')
const { initGlobalConverters_GENERIC: initGlobalConvertersGENERIC, initGlobalConverters_OPDS: initGlobalConvertersOPDS } = require('r2-opds-js/dist/es8-es2017/src/opds/init-globals')
// opds 1
const { OPDS } = require('r2-opds-js/dist/es8-es2017/src/opds/opds1/opds')
const { Entry } = require('r2-opds-js/dist/es8-es2017/src/opds/opds1/opds-entry')
// opds 2
// const { OPDSFeed } = require('r2-opds-js/dist/es6-es2015/src/opds/opds2/opds2')
const { OPDSPublication } = require('r2-opds-js/dist/es8-es2017/src/opds/opds2/opds2-publication')
const { convertOpds1ToOpds2, convertOpds1ToOpds2_EntryToPublication: convertOpds1ToOpds2EntryToPublication } = require('r2-opds-js/dist/es8-es2017/src/opds/converter')
initGlobalConvertersGENERIC()
initGlobalConvertersOPDS()
module.exports = {
friendlyName: 'Load OpdsHelper',
description: 'Load a OpdsHelper instance',
@ -30,30 +14,6 @@ module.exports = {
}
function OpdsHelper () {
this.deserializeOpds1 = function (xml) {
const xmlDom = new xmldom.DOMParser().parseFromString(xml)
if (!xmlDom || !xmlDom.documentElement) return false
const isEntry = xmlDom.documentElement.localName === 'entry'
if (isEntry) {
return XML.deserialize(xmlDom, Entry)
} else {
return XML.deserialize(xmlDom, OPDS)
}
}
this.deserializeOpds2 = function (data) {
return TAJSON.deserialize(data, OPDSPublication)
}
this.serializeJSON = function (json) {
return TAJSON.serialize(json)
}
this.xml2json = function (xml) {
const deserialized = this.deserializeOpds1(xml)
if (deserialized.type === 'entry') {
return convertOpds1ToOpds2EntryToPublication(deserialized.data)
} else {
return convertOpds1ToOpds2(deserialized.data)
}
}
this.book2opds = async function (book) {
return new Promise((resolve, reject) => {
const metadata = {

View File

@ -44,8 +44,6 @@
"passport-google-oauth20": "^1.0.0",
"passport-local": "^1.0.0",
"pm2": "^3.2.2",
"r2-opds-js": "^1.0.6",
"r2-utils-js": "^1.0.6",
"react": "^16.6.0",
"react-dom": "^16.6.0",
"request": "^2.88.0",
@ -55,10 +53,8 @@
"sails-hook-sockets": "^1.4.0",
"sails-postgresql": "^1.0.2",
"showdown": "^1.9.0",
"ta-json-x": "^2.5.0",
"webpack": "^4.23.1",
"webpack-cli": "^3.1.2",
"xmldom": "^0.1.27",
"@babel/core": "^7.1.2",
"@babel/plugin-proposal-object-rest-spread": "^7.0.0",
"@babel/polyfill": "^7.0.0",

File diff suppressed because it is too large Load Diff