remove unused packages
parent
195168cdf8
commit
0305510ab3
|
@ -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 = {
|
module.exports = {
|
||||||
friendlyName: 'Load OpdsHelper',
|
friendlyName: 'Load OpdsHelper',
|
||||||
description: 'Load a OpdsHelper instance',
|
description: 'Load a OpdsHelper instance',
|
||||||
|
@ -30,30 +14,6 @@ module.exports = {
|
||||||
}
|
}
|
||||||
|
|
||||||
function OpdsHelper () {
|
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) {
|
this.book2opds = async function (book) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
const metadata = {
|
const metadata = {
|
||||||
|
|
|
@ -44,8 +44,6 @@
|
||||||
"passport-google-oauth20": "^1.0.0",
|
"passport-google-oauth20": "^1.0.0",
|
||||||
"passport-local": "^1.0.0",
|
"passport-local": "^1.0.0",
|
||||||
"pm2": "^3.2.2",
|
"pm2": "^3.2.2",
|
||||||
"r2-opds-js": "^1.0.6",
|
|
||||||
"r2-utils-js": "^1.0.6",
|
|
||||||
"react": "^16.6.0",
|
"react": "^16.6.0",
|
||||||
"react-dom": "^16.6.0",
|
"react-dom": "^16.6.0",
|
||||||
"request": "^2.88.0",
|
"request": "^2.88.0",
|
||||||
|
@ -55,10 +53,8 @@
|
||||||
"sails-hook-sockets": "^1.4.0",
|
"sails-hook-sockets": "^1.4.0",
|
||||||
"sails-postgresql": "^1.0.2",
|
"sails-postgresql": "^1.0.2",
|
||||||
"showdown": "^1.9.0",
|
"showdown": "^1.9.0",
|
||||||
"ta-json-x": "^2.5.0",
|
|
||||||
"webpack": "^4.23.1",
|
"webpack": "^4.23.1",
|
||||||
"webpack-cli": "^3.1.2",
|
"webpack-cli": "^3.1.2",
|
||||||
"xmldom": "^0.1.27",
|
|
||||||
"@babel/core": "^7.1.2",
|
"@babel/core": "^7.1.2",
|
||||||
"@babel/plugin-proposal-object-rest-spread": "^7.0.0",
|
"@babel/plugin-proposal-object-rest-spread": "^7.0.0",
|
||||||
"@babel/polyfill": "^7.0.0",
|
"@babel/polyfill": "^7.0.0",
|
||||||
|
|
11495
shrinkwrap.yaml
11495
shrinkwrap.yaml
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue