4.7.135 • Published 11 months ago

@ellentorg/doloribus-deserunt-odio v4.7.135

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

NodeJS / TypeScript Readium-2 "opds" components

NodeJS implementation (written in TypeScript) of OPDS functionality for the Readium2 architecture ( https://github.com/readium/architecture/ ).

License

Build status

NPM David

Changelog

Prerequisites

1) https://nodejs.org NodeJS >= 8, NPM >= 5 (check with command line node --version and npm --version) 2) OPTIONAL: https://yarnpkg.com Yarn >= 1.0 (check with command line yarn --version)

GitHub repository

https://github.com/ellentorg/doloribus-deserunt-odio

There is no github.io site for this project (no gh-pages branch).

NPM package

https://www.npmjs.com/package/@ellentorg/doloribus-deserunt-odio

Command line install:

npm install @ellentorg/doloribus-deserunt-odio OR yarn add @ellentorg/doloribus-deserunt-odio

...or manually add in your package.json:

  "dependencies": {
    "@ellentorg/doloribus-deserunt-odio": "latest"
  }

The JavaScript code distributed in the NPM package is usable as-is (no transpilation required), as it is automatically-generated from the TypeScript source.

Several ECMAScript flavours are provided out-of-the-box: ES5, ES6-2015, ES7-2016, ES8-2017:

https://unpkg.com/@ellentorg/doloribus-deserunt-odio/dist/

(alternatively, GitHub mirror with semantic-versioning release tags: https://github.com/edrlab/@ellentorg/doloribus-deserunt-odio-dist/tree/develop/dist/ )

The JavaScript code is not bundled, and it uses require() statement for imports (NodeJS style).

More information about NodeJS compatibility:

http://node.green

Note that web-browser Javascript is currently not supported (only NodeJS runtimes).

The type definitions (aka "typings") are included as *.d.ts files in ./node_modules/@ellentorg/doloribus-deserunt-odio/dist/**, so this package can be used directly in a TypeScript project.

Dependencies

https://david-dm.org/readium/@ellentorg/doloribus-deserunt-odio

A package-lock.json is provided (modern NPM replacement for npm-shrinkwrap.json).

A yarn.lock file is currently not provided at the root of the source tree.

Continuous Integration

TODO (unit tests?) https://travis-ci.org/readium/@ellentorg/doloribus-deserunt-odio

Badge: [![Travis](https://travis-ci.org/readium/@ellentorg/doloribus-deserunt-odio.svg?branch=develop)](https://travis-ci.org/readium/@ellentorg/doloribus-deserunt-odio)

Version(s), Git revision(s)

NPM package (latest published):

https://unpkg.com/@ellentorg/doloribus-deserunt-odio/dist/gitrev.json

Alternatively, GitHub mirror with semantic-versioning release tags:

https://raw.githack.com/edrlab/@ellentorg/doloribus-deserunt-odio-dist/develop/dist/gitrev.json

Developer quick start

Command line steps (NPM, but similar with YARN):

1) cd @ellentorg/doloribus-deserunt-odio 2) git status (please ensure there are no local changes, especially in package-lock.json and the dependency versions in package.json) 3) rm -rf node_modules (to start from a clean slate) 4) npm install, or alternatively npm ci (both commands initialize the node_modules tree of package dependencies, based on the strict package-lock.json definition) 5) npm run build:all (invoke the main build script: clean, lint, compile) 6) ls dist (that's the build output which gets published as NPM package)

Documentation

(de)serialization / (un)marshalling of JSON and XML

Due to the "factory" registration pattern in the TA-JSON library dependency (and its corresponding XML fork/adaptation), the functions initGlobalConverters_GENERIC() and initGlobalConverters_OPDS() must be called before invoking the actual OPDS1/2 parsers.

https://github.com/ellentorg/doloribus-deserunt-odio/blob/develop/src/opds/init-globals.ts

// npm install @ellentorg/doloribus-deserunt-odio
// "@opds" is a dist path alias, for example EcmaScript6/ES2015 'node_modules/@ellentorg/doloribus-deserunt-odio/dist/es6-es2015/src/opds/'
import { initGlobalConverters_GENERIC, initGlobalConverters_OPDS } from "@opds/init-globals";

initGlobalConverters_GENERIC();
initGlobalConverters_OPDS();

OPDS 1

The XML (Atom) markup of an OPDS1 "feed" (or "entry") can be loaded/parsed into an in-memory data model.

https://github.com/ellentorg/doloribus-deserunt-odio/tree/develop/src/opds/opds1

// npm install xmldom
import * as xmldom from "xmldom";

// npm install r2-utils-js
// "@utils" is a dist path alias, for example EcmaScript6/ES2015 'node_modules/r2-utils-js/dist/es6-es2015/src/_utils/'
import { XML } from "@utils/xml-js-mapper";

// npm install @ellentorg/doloribus-deserunt-odio
// "@opds" is a dist path alias, for example EcmaScript6/ES2015 'node_modules/@ellentorg/doloribus-deserunt-odio/dist/es6-es2015/src/opds/'
import { OPDS } from "@opds/opds1/opds";
import { Entry } from "@opds/opds1/opds-entry";

const xmlDom = new xmldom.DOMParser().parseFromString(xmlStr);
if (!xmlDom || !xmlDom.documentElement) {
    return;
}
const isEntry = xmlDom.documentElement.localName === "entry";
if (isEntry) {
    let opds1Entry = XML.deserialize<Entry>(xmlDom, Entry);
    // ...
} else {
    let opds1Feed = XML.deserialize<OPDS>(xmlDom, OPDS);
    // ...
}

OPDS 2

The JSON serialization of an OPDS2 "feed" (or "publication") can be loaded/parsed into an in-memory data model.

https://github.com/ellentorg/doloribus-deserunt-odio/tree/develop/src/opds/opds2

import { TaJsonDeserialize, TaJsonSerialize } from "@r2-lcp-js/serializable";

// npm install @ellentorg/doloribus-deserunt-odio
// "@opds" is a dist path alias, for example EcmaScript6/ES2015 'node_modules/@ellentorg/doloribus-deserunt-odio/dist/es6-es2015/src/opds/'
import { OPDSFeed } from "@opds/opds2/opds2";
import { OPDSPublication } from "@opds/opds2/opds2-publication";

// feed
var opds2Feed: OPDSFeed;
const opds2Feed_JSON = TaJsonSerialize(opds2Feed);
// ...and the reverse:
opds2Feed = TaJsonDeserialize<OPDSFeed>(opds2Feed_JSON, OPDSFeed);

// publication
var opds2Publication: OPDSPublication;
const opds2Publication_JSON = TaJsonSerialize(opds2Publication);
// ...and the reverse:
opds2Publication = TaJsonDeserialize<OPDSPublication>(opds2Publication_JSON, OPDSPublication);

OPDS 1 - OPDS 2 Converter

An OPDS1 "feed" (or "entry") can be converted into an OPDS2 representation.

https://github.com/ellentorg/doloribus-deserunt-odio/blob/develop/src/opds/converter.ts

// npm install xmldom
import * as xmldom from "xmldom";

// npm install r2-utils-js
// "@utils" is a dist path alias, for example EcmaScript6/ES2015 'node_modules/r2-utils-js/dist/es6-es2015/src/_utils/'
import { XML } from "@utils/xml-js-mapper";

// npm install @ellentorg/doloribus-deserunt-odio
// "@opds" is a dist path alias, for example EcmaScript6/ES2015 'node_modules/@ellentorg/doloribus-deserunt-odio/dist/es6-es2015/src/opds/'
import { OPDS } from "@opds/opds1/opds";
import { Entry } from "@opds/opds1/opds-entry";
import { OPDSFeed } from "@opds/opds2/opds2";
import { OPDSPublication } from "@opds/opds2/opds2-publication";
import { convertOpds1ToOpds2, convertOpds1ToOpds2_EntryToPublication } from "@opds/converter";

const xmlDom = new xmldom.DOMParser().parseFromString(xmlStr);
if (!xmlDom || !xmlDom.documentElement) {
    return;
}
const isEntry = xmlDom.documentElement.localName === "entry";
if (isEntry) {
    let opds1Entry = XML.deserialize<Entry>(xmlDom, Entry);

    let opds2Publication: OPDSPublication = convertOpds1ToOpds2_EntryToPublication(opds1Entry);
    // ...
} else {
    let opds1Feed = XML.deserialize<OPDS>(xmlDom, OPDS);

    var opds2Feed: OPDSFeed = convertOpds1ToOpds2(opds1Feed);
    // ...
}
irqqsrobusttelephonestreamserializefast-deep-copymruparseres-shim APImergefindhardlinksxhrstatusjsdomfunctionsMapless cssUint8ArraydirWebSocketsfunctionArray.prototype.flattenmobilesharedarraybuffercallboundwindowsisConcatSpreadableeslintpluginObservablelazycompileriskoreanObject.keyscss variablewrapsetstyleperformanceprocessrm -rfcreatetypedarraymapreduceYAMLstringifyrmdirmimetypesnameslooktc39ecmascriptES2019ponyfilldrop256Array.prototype.includesES2018uninstallsymbolsmomententriesslotamazondependenciestrimLeftcryptoastjsdifftypeerrornamemacosstreamses7linewrapexit-codegetoptchromiumttyInt8Arraywordbreakspinnerszeroenumerableformsyntaxstreams2textlengthdebugbootstrap lessprivate datapluginString.prototype.trimmakemimedeepreact-hook-formbcrypttypanionTypeScriptSymbol.toStringTagequalfindLastFunction.prototype.namerapidsomesymlinkstappreserve-symlinksReactiveExtensionsjwtfast-deep-cloneworkspace:*privatechecktestcharactersendpointwatchinggdprarraybufferCSSestreecharactersqseventEmitterduplexless.jsTypedArraytypescriptescapetesterebsemojifetchenvironmentsprogressspeedlinkfindLastIndexchromebyteOffsetframeworkworkerflagreducerfindupSymbolvalidateloadingtsfast-clonesortediterationuuidexpressformsprefixdirectoryvariables in cssInt16Arrayaccessorclassnamesglobcallsnsfull-widthvariablescall-boundlook-upperformantchanneloptimistlastform-validation@@toStringTages2017RFC-6455parentECMAScript 2017ES2021compareglobalflatMapcachejesthttpRegExp#flagsformatterminaldiffES6browserlistsetImmediatesliceless compilerfast-copyroutercssproxyECMAScript 2023idawsforEachpnpm9weakmapcompile lessstringstableinternaldescriptorstructuredClonesortmochadeterministictyped arrayECMAScript 2016flagsArray.prototype.containsArrayBuffer.prototype.slicefastifyReactiveXauthenticationchineserestbatchtoobject_.extendargsArray.prototype.filterArray.prototype.findLastIndexbundlingbundlerredactfastcopytoolsjapanesenativefastoptionhelpersbusytypedarraystslibpackagescryptsidejQueryimportexportquotejasminethroatstylesECMAScript 2015sigtermtoArraywalkingintrinsictrimStartconcatMapbreakwebObject.assignawesomesaucebufferdatastructureECMAScript 7mixinsmiddlewarehasOwnPropertydynamodbfullBigUint64Arraypolyfillreal-timecommandString.prototype.matchAllelasticachedefineprotoi18nfunctionaltypesstoragegatewayECMAScript 2019ObservablesrestfulsyntaxerrormkdirsobjRegExp.prototype.flagsdayjsfolderpromisewait
1.3.50

1 year ago

4.7.121

11 months ago

3.6.100

12 months ago

3.6.101

12 months ago

4.7.133

11 months ago

4.7.134

11 months ago

3.5.79

1 year ago

4.7.135

11 months ago

3.5.78

1 year ago

3.5.77

1 year ago

3.5.76

1 year ago

3.5.75

1 year ago

3.6.110

12 months ago

3.6.106

12 months ago

3.6.107

12 months ago

3.6.108

12 months ago

3.6.109

12 months ago

3.6.102

12 months ago

3.6.103

12 months ago

3.6.104

12 months ago

3.6.105

12 months ago

1.3.36

1 year ago

1.3.39

1 year ago

1.3.37

1 year ago

1.3.38

1 year ago

4.7.122

11 months ago

4.7.123

11 months ago

1.1.19

1 year ago

4.7.124

11 months ago

4.7.125

11 months ago

4.7.126

11 months ago

4.7.127

11 months ago

4.7.128

11 months ago

4.7.129

11 months ago

3.5.84

1 year ago

1.3.42

1 year ago

1.3.43

1 year ago

1.3.40

1 year ago

1.3.41

1 year ago

3.5.83

1 year ago

2.3.53

1 year ago

1.3.46

1 year ago

1.1.23

1 year ago

3.5.82

1 year ago

2.3.52

1 year ago

1.3.47

1 year ago

1.1.22

1 year ago

3.5.81

1 year ago

2.3.55

1 year ago

1.3.44

1 year ago

1.1.21

1 year ago

3.5.80

1 year ago

2.3.54

1 year ago

1.3.45

1 year ago

1.1.20

1 year ago

4.7.130

11 months ago

4.7.131

11 months ago

2.3.51

1 year ago

1.3.48

1 year ago

4.7.132

11 months ago

2.3.50

1 year ago

1.3.49

1 year ago

1.1.24

1 year ago

4.6.118

11 months ago

4.6.119

11 months ago

4.6.116

11 months ago

4.6.117

11 months ago

4.6.114

12 months ago

4.6.115

12 months ago

4.6.112

12 months ago

4.6.113

12 months ago

4.6.121

11 months ago

4.6.120

11 months ago

4.6.110

12 months ago

4.6.111

12 months ago

3.4.69

1 year ago

3.6.89

1 year ago

3.6.88

1 year ago

3.6.87

1 year ago

3.6.86

1 year ago

3.6.85

1 year ago

3.4.63

1 year ago

3.4.64

1 year ago

3.4.65

1 year ago

3.4.66

1 year ago

3.4.67

1 year ago

3.4.68

1 year ago

2.4.58

1 year ago

2.4.57

1 year ago

2.4.59

1 year ago

3.6.84

1 year ago

1.2.24

1 year ago

2.4.56

1 year ago

2.4.55

1 year ago

1.2.27

1 year ago

1.2.28

1 year ago

1.2.25

1 year ago

1.2.26

1 year ago

1.2.29

1 year ago

3.6.99

12 months ago

3.6.98

12 months ago

3.6.97

12 months ago

3.6.96

1 year ago

3.4.72

1 year ago

3.4.73

1 year ago

3.4.74

1 year ago

3.4.75

1 year ago

1.2.30

1 year ago

1.2.31

1 year ago

3.4.70

1 year ago

3.4.71

1 year ago

3.6.95

1 year ago

1.2.34

1 year ago

3.6.94

1 year ago

1.2.35

1 year ago

3.6.93

1 year ago

1.2.32

1 year ago

3.6.92

1 year ago

1.2.33

1 year ago

3.6.91

1 year ago

2.4.61

1 year ago

3.6.90

1 year ago

2.4.60

1 year ago

2.4.63

1 year ago

1.2.36

1 year ago

2.4.62

1 year ago

1.1.18

1 year ago

1.1.17

1 year ago

1.1.16

1 year ago

1.1.15

1 year ago

1.1.14

1 year ago

1.1.13

1 year ago

1.1.12

1 year ago

1.1.11

1 year ago

1.1.10

1 year ago

1.1.9

1 year ago

1.1.8

1 year ago

1.1.7

1 year ago

1.1.6

1 year ago

1.1.5

1 year ago

1.1.4

1 year ago

1.1.3

1 year ago

1.1.2

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago

1.0.0

1 year ago