Skip to main content

@storyteller-platform/opds API

Acquisition​

Defined in: node_modules/@readium/shared/types/src/opds/Acquisition.d.ts:6

OPDS Acquisition Object.

https://drafts.opds.io/schema/acquisition-object.schema.json

Constructors​

Constructor​

new Acquisition(values): Acquisition

Defined in: node_modules/@readium/shared/types/src/opds/Acquisition.d.ts:13

Creates a [Acquisition].

Parameters​
ParameterType
values{ children?: Acquisition[]; type: string; }
values.children?Acquisition[]
values.typestring
Returns​

Acquisition

Properties​

children?​

optional children: Acquisition[]

Defined in: node_modules/@readium/shared/types/src/opds/Acquisition.d.ts:11

Price value, should only be used for display purposes, because of precision issues inherent with Double and the JSON parsing.

type​

type: string

Defined in: node_modules/@readium/shared/types/src/opds/Acquisition.d.ts:8

Currency for the price, eg. EUR.

Methods​

serialize()​

serialize(): any

Defined in: node_modules/@readium/shared/types/src/opds/Acquisition.d.ts:25

Serializes a [Acquisition] to its RWPM JSON representation.

Returns​

any

deserialize()​

static deserialize(json): undefined | Acquisition

Defined in: node_modules/@readium/shared/types/src/opds/Acquisition.d.ts:20

Parses a [Acquisition] from its RWPM JSON representation.

Parameters​
ParameterType
jsonany
Returns​

undefined | Acquisition

deserializeArray()​

static deserializeArray(json): undefined | > Acquisition[]

Defined in: node_modules/@readium/shared/types/src/opds/Acquisition.d.ts:21

Parameters​
ParameterType
jsonany
Returns​

undefined | Acquisition[]


Defined in: opds/model/OPDSPublication.ts:14

A link that represents an acquisition of a publication Since this extends Link, it does not follow the same Result pattern as other models.

Extends​

  • Link

Constructors​

Constructor​

new AcquisitionLink(values): AcquisitionLink

Defined in: opds/model/OPDSPublication.ts:15

Parameters​
ParameterType
values{ href: string; rel: "acquisition" | "buy" | "borrow" | "download" | "preview" | "subscribe"; type: string; }
values.hrefstring
values.rel"acquisition" | "buy" | "borrow" | "download" | "preview" | "subscribe"
values.typestring
Returns​

AcquisitionLink

Overrides​

Link.constructor

Properties​

alternates?​

readonly optional alternates: Links

Defined in: node_modules/@readium/shared/types/src/publication/Link.d.ts:34

Alternate resources for the linked resource.

Inherited from​

Link.alternates

bitrate?​

readonly optional bitrate: number

Defined in: node_modules/@readium/shared/types/src/publication/Link.d.ts:30

Bitrate of the linked resource in kbps.

Inherited from​

Link.bitrate

children?​

readonly optional children: Links

Defined in: node_modules/@readium/shared/types/src/publication/Link.d.ts:36

Resources that are children of the linked resource, in the context of a given collection role.

Inherited from​

Link.children

duration?​

readonly optional duration: number

Defined in: node_modules/@readium/shared/types/src/publication/Link.d.ts:28

Length of the linked resource in seconds.

Inherited from​

Link.duration

height?​

readonly optional height: number

Defined in: node_modules/@readium/shared/types/src/publication/Link.d.ts:22

Height of the linked resource in pixels.

Inherited from​

Link.height

href​

readonly href: string

Defined in: node_modules/@readium/shared/types/src/publication/Link.d.ts:10

URI or URI template of the linked resource.

Inherited from​

Link.href

languages?​

readonly optional languages: string[]

Defined in: node_modules/@readium/shared/types/src/publication/Link.d.ts:32

Expected language of the linked resource.

Inherited from​

Link.languages

properties?​

optional properties: Properties

Defined in: node_modules/@readium/shared/types/src/publication/Link.d.ts:20

Properties associated to the linked resource.

Inherited from​

Link.properties

rels?​

readonly optional rels: Set<string>

Defined in: node_modules/@readium/shared/types/src/publication/Link.d.ts:18

Relation between the linked resource and its containing collection.

Inherited from​

Link.rels

size?​

readonly optional size: number

Defined in: node_modules/@readium/shared/types/src/publication/Link.d.ts:26

Size of the linked resource in bytes.

Inherited from​

Link.size

templated?​

readonly optional templated: boolean

Defined in: node_modules/@readium/shared/types/src/publication/Link.d.ts:12

Indicates that a URI template is used in href.

Inherited from​

Link.templated

title?​

readonly optional title: string

Defined in: node_modules/@readium/shared/types/src/publication/Link.d.ts:16

Title of the linked resource.

Inherited from​

Link.title

type?​

readonly optional type: string

Defined in: node_modules/@readium/shared/types/src/publication/Link.d.ts:14

MIME type of the linked resource.

Inherited from​

Link.type

width?​

readonly optional width: number

Defined in: node_modules/@readium/shared/types/src/publication/Link.d.ts:24

Width of the linked resource in pixels.

Inherited from​

Link.width

Accessors​

locator​

Get Signature​

get locator(): Locator

Defined in: node_modules/@readium/shared/types/src/publication/Link.d.ts:87

Creates a [Locator] from a reading order [Link].

Returns​

Locator

Inherited from​

Link.locator

mediaType​

Get Signature​

get mediaType(): MediaType

Defined in: node_modules/@readium/shared/types/src/publication/Link.d.ts:65

MediaType of the linked resource.

Returns​

MediaType

Inherited from​

Link.mediaType

templateParameters​

Get Signature​

get templateParameters(): Set<string>

Defined in: node_modules/@readium/shared/types/src/publication/Link.d.ts:71

List of URI template parameter keys, if the Link is templated.

Returns​

Set<string>

Inherited from​

Link.templateParameters

Methods​

addProperties()​

addProperties(properties): Link

Defined in: node_modules/@readium/shared/types/src/publication/Link.d.ts:81

Makes a copy of this [Link] after merging in the given additional other [properties].

Parameters​
ParameterType
properties{[key: string]: any; }
Returns​

Link

Inherited from​

Link.addProperties

expandTemplate()​

expandTemplate(parameters): Link

Defined in: node_modules/@readium/shared/types/src/publication/Link.d.ts:75

Expands the Link's HREF by replacing URI template variables by the given parameters. See RFC 6570 on URI template: https://tools.ietf.org/html/rfc6570

Parameters​
ParameterType
parameters{[param: string]: string; }
Returns​

Link

Inherited from​

Link.expandTemplate

serialize()​

serialize(): any

Defined in: node_modules/@readium/shared/types/src/publication/Link.d.ts:63

Serializes a [Link] to its RWPM JSON representation.

Returns​

any

Inherited from​

Link.serialize

toURL()​

toURL(baseUrl?): undefined | string

Defined in: node_modules/@readium/shared/types/src/publication/Link.d.ts:69

Computes an absolute URL to the link, relative to the given baseURL. If the link's href is already absolute, the baseURL is ignored.

Parameters​
ParameterType
baseUrl?string
Returns​

undefined | string

Inherited from​

Link.toURL

deserialize()​

static deserialize(json): undefined | > AcquisitionLink

Defined in: opds/model/OPDSPublication.ts:27

Parses a [Link] from its RWPM JSON representation.

Parameters​
ParameterType
jsonunknown
Returns​

undefined | AcquisitionLink

Overrides​

Link.deserialize


AuthDocument​

Defined in: opds/model/auth/AuthDocument.ts:56

an OPDS authentication document, served with a 401 to tell a client how to authenticate. https://drafts.opds.io/authentication-for-opds-1.0.html

Constructors​

Constructor​

new AuthDocument(values): AuthDocument

Defined in: opds/model/auth/AuthDocument.ts:63

Parameters​
ParameterType
values{ authentication: AuthFlow[]; description?: string; id: string; links?: Links; title: string; }
values.authenticationAuthFlow[]
values.description?string
values.idstring
values.links?Links
values.titlestring
Returns​

AuthDocument

Properties​

authentication​

readonly authentication: AuthFlow[]

Defined in: opds/model/auth/AuthDocument.ts:59

description?​

readonly optional description: string

Defined in: opds/model/auth/AuthDocument.ts:60

id​

readonly id: string

Defined in: opds/model/auth/AuthDocument.ts:57

readonly optional links: Links

Defined in: opds/model/auth/AuthDocument.ts:61

title​

readonly title: string

Defined in: opds/model/auth/AuthDocument.ts:58

Methods​

serialize()​

serialize(): OPDSAuthenticationDocument

Defined in: opds/model/auth/AuthDocument.ts:107

Returns​

OPDSAuthenticationDocument

deserialize()​

static deserialize(json, options): Result<AuthDocument>

Defined in: opds/model/auth/AuthDocument.ts:77

Parameters​
ParameterType
jsonunknown
options{ validate?: (json) => null | OPDSError[]; }
options.validate?(json) => null | OPDSError[]
Returns​

Result<AuthDocument>


Availability​

Defined in: node_modules/@readium/shared/types/src/opds/Availability.d.ts:12

Indicated the availability of a given resource.

https://drafts.opds.io/schema/properties.schema.json

Constructors​

Constructor​

new Availability(values): Availability

Defined in: node_modules/@readium/shared/types/src/opds/Availability.d.ts:19

Creates a [Availability].

Parameters​
ParameterType
values{ since?: Date; state: AvailabilityStatus; until?: Date; }
values.since?Date
values.stateAvailabilityStatus
values.until?Date
Returns​

Availability

Properties​

since?​

optional since: Date

Defined in: node_modules/@readium/shared/types/src/opds/Availability.d.ts:14

Timestamp for the previous state change.

state​

state: AvailabilityStatus

Defined in: node_modules/@readium/shared/types/src/opds/Availability.d.ts:17

until?​

optional until: Date

Defined in: node_modules/@readium/shared/types/src/opds/Availability.d.ts:16

Timestamp for the next state change.

Methods​

serialize()​

serialize(): any

Defined in: node_modules/@readium/shared/types/src/opds/Availability.d.ts:31

Serializes a [Availability] to its RWPM JSON representation.

Returns​

any

deserialize()​

static deserialize(json): undefined | > Availability

Defined in: node_modules/@readium/shared/types/src/opds/Availability.d.ts:27

Parses a [Availability] from its RWPM JSON representation.

Parameters​
ParameterType
jsonany
Returns​

undefined | Availability


Copies​

Defined in: node_modules/@readium/shared/types/src/opds/Copies.d.ts:6

Library-specific feature that contains information about the copies that a library has acquired.

https://drafts.opds.io/schema/properties.schema.json

Constructors​

Constructor​

new Copies(values): Copies

Defined in: node_modules/@readium/shared/types/src/opds/Copies.d.ts:10

Creates a [Copies].

Parameters​
ParameterType
values{ available?: number; total?: number; }
values.available?number
values.total?number
Returns​

Copies

Properties​

available?​

optional available: number

Defined in: node_modules/@readium/shared/types/src/opds/Copies.d.ts:8

total?​

optional total: number

Defined in: node_modules/@readium/shared/types/src/opds/Copies.d.ts:7

Methods​

serialize()​

serialize(): any

Defined in: node_modules/@readium/shared/types/src/opds/Copies.d.ts:21

Serializes a [Copies] to its RWPM JSON representation.

Returns​

any

deserialize()​

static deserialize(json): undefined | Copies

Defined in: node_modules/@readium/shared/types/src/opds/Copies.d.ts:17

Parses a [Copies] from its RWPM JSON representation.

Parameters​
ParameterType
jsonany
Returns​

undefined | Copies


Facet​

Defined in: opds/model/Facet.ts:11

a facet re-orders or filters the current list of publications

Constructors​

Constructor​

new Facet(values): Facet

Defined in: opds/model/Facet.ts:15

Parameters​
ParameterType
values{ links: Links; metadata?: FeedMetadata; }
values.linksLinks
values.metadata?FeedMetadata
Returns​

Facet

Properties​

readonly links: Links

Defined in: opds/model/Facet.ts:13

metadata?​

readonly optional metadata: FeedMetadata

Defined in: opds/model/Facet.ts:12

Methods​

serialize()​

serialize(): { links?: [Link, ...Link[]]; metadata?: OPDSMetadata; } | { links?: [Link, ...Link[]]; metadata?: OPDSMetadata; }

Defined in: opds/model/Facet.ts:41

Returns​

{ links?: [Link, ...Link[]]; metadata?: OPDSMetadata; }

optional links: [Link, ...Link[]]

Min Items​

1

metadata?​

optional metadata: OPDSMetadata

{ links?: [Link, ...Link[]]; metadata?: OPDSMetadata; }

optional links: [Link, ...Link[]]

Min Items​

1

metadata?​

optional metadata: OPDSMetadata

deserialize()​

static deserialize(json, path): Result<Facet>

Defined in: opds/model/Facet.ts:20

Parameters​
ParameterType
json{ links?: [Link, ...Link[]]; metadata?: OPDSMetadata; } | { links?: [Link, ...Link[]]; metadata?: OPDSMetadata; }
pathstring
Returns​

Result<Facet>


Feed​

Defined in: opds/model/Feed.ts:29

An OPDS 2.0 feed. the canonical model: serialize() emits OPDS2 JSON

Can be used to generate an OPDS1 atom feed (see serialize/atom)

See https://specs.opds.io/schema/feed.schema.json

Constructors​

Constructor​

new Feed(values): Feed

Defined in: opds/model/Feed.ts:37

Parameters​
ParameterType
values{ facets?: Facet[]; groups?: Group[]; links: Links; metadata: FeedMetadata; navigation?: NavigationLinks; publications?: OPDSPublication[]; }
values.facets?Facet[]
values.groups?Group[]
values.linksLinks
values.metadataFeedMetadata
values.navigation?NavigationLinks
values.publications?OPDSPublication[]
Returns​

Feed

Properties​

facets?​

readonly optional facets: Facet[]

Defined in: opds/model/Feed.ts:34

groups?​

readonly optional groups: Group[]

Defined in: opds/model/Feed.ts:35

readonly links: Links

Defined in: opds/model/Feed.ts:31

metadata​

readonly metadata: FeedMetadata

Defined in: opds/model/Feed.ts:30

readonly optional navigation: NavigationLinks

Defined in: opds/model/Feed.ts:33

publications?​

readonly optional publications: OPDSPublication[]

Defined in: opds/model/Feed.ts:32

Methods​

serialize()​

serialize(): OPDSFeed

Defined in: opds/model/Feed.ts:122

Returns​

OPDSFeed

deserialize()​

static deserialize(json, options): Result<Feed>

Defined in: opds/model/Feed.ts:60

parses a feed from its OPDS2 JSON. unlike @readium/shared's deserialize this never silently returns undefined or drops invalid entries, it returns a Result that locates every problem. with options.validate it reports the full set of schema errors, without it only cheap structural checks run

Parameters​
ParameterType
jsonunknown
optionsDeserializeOptions
Returns​

Result<Feed>


FeedMetadata​

Defined in: opds/model/FeedMetadata.ts:8

Feed-level metadata

See https://specs.opds.io/schema/feed-metadata.schema.json

Constructors​

Constructor​

new FeedMetadata(values): FeedMetadata

Defined in: opds/model/FeedMetadata.ts:21

Parameters​
ParameterType
values{ currentPage?: number; description?: string; extra?: Record<string, unknown>; identifier?: string; itemsPerPage?: number; modified?: string; numberOfItems?: number; subtitle?: string | { } | unknown[]; title: string | { } | unknown[]; type?: string; }
values.currentPage?number
values.description?string
values.extra?Record<string, unknown>
values.identifier?string
values.itemsPerPage?number
values.modified?string
values.numberOfItems?number
values.subtitle?string | { } | unknown[]
values.titlestring | { } | unknown[]
values.type?string
Returns​

FeedMetadata

Properties​

currentPage?​

readonly optional currentPage: number

Defined in: opds/model/FeedMetadata.ts:16

description?​

readonly optional description: string

Defined in: opds/model/FeedMetadata.ts:14

extra?​

readonly optional extra: Record<string, unknown>

Defined in: opds/model/FeedMetadata.ts:19

any properties outside the known set, preserved on round-trip

identifier?​

readonly optional identifier: string

Defined in: opds/model/FeedMetadata.ts:10

itemsPerPage?​

readonly optional itemsPerPage: number

Defined in: opds/model/FeedMetadata.ts:15

modified?​

readonly optional modified: string

Defined in: opds/model/FeedMetadata.ts:13

numberOfItems?​

readonly optional numberOfItems: number

Defined in: opds/model/FeedMetadata.ts:17

subtitle?​

readonly optional subtitle: string | { } | unknown[]

Defined in: opds/model/FeedMetadata.ts:12

title​

readonly title: string | { } | unknown[]

Defined in: opds/model/FeedMetadata.ts:9

type?​

readonly optional type: string

Defined in: opds/model/FeedMetadata.ts:11

Methods​

serialize()​

serialize(): OPDSMetadata

Defined in: opds/model/FeedMetadata.ts:72

Returns​

OPDSMetadata

deserialize()​

static deserialize(json): FeedMetadata

Defined in: opds/model/FeedMetadata.ts:45

Parameters​
ParameterType
jsonOPDSMetadata
Returns​

FeedMetadata


Group​

Defined in: opds/model/Group.ts:14

A Group curates publications or navigation links under a shared heading

Constructors​

Constructor​

new Group(values): Group

Defined in: opds/model/Group.ts:20

Parameters​
ParameterType
values{ links?: Links; metadata: FeedMetadata; navigation?: Links; publications?: OPDSPublication[]; }
values.links?Links
values.metadataFeedMetadata
values.navigation?Links
values.publications?OPDSPublication[]
Returns​

Group

Properties​

readonly optional links: Links

Defined in: opds/model/Group.ts:16

metadata​

readonly metadata: FeedMetadata

Defined in: opds/model/Group.ts:15

readonly optional navigation: Links

Defined in: opds/model/Group.ts:18

publications?​

readonly optional publications: OPDSPublication[]

Defined in: opds/model/Group.ts:17

Methods​

serialize()​

serialize(): object

Defined in: opds/model/Group.ts:58

Returns​

optional links: [Link, ...Link[]]

Min Items​

1

metadata​

metadata: OPDSMetadata

optional navigation: [Link, ...Link[]]

Min Items​

1

publications?​

optional publications: [OPDSPublicationJSON, ...OPDSPublicationJSON[]]

Min Items​

1

deserialize()​

static deserialize(json, path): Result<Group>

Defined in: opds/model/Group.ts:32

Parameters​
ParameterTypeDefault valueDescription
json{ links?: [Link, ...Link[]]; metadata: OPDSMetadata; navigation?: [Link, ...Link[]]; publications?: [OPDSPublicationJSON, ...OPDSPublicationJSON[]]; }undefined-
json.links?[Link, ...Link[]]undefinedMin Items 1
json.metadataOPDSMetadataundefined-
json.navigation?[Link, ...Link[]]undefinedMin Items 1
json.publications?[OPDSPublicationJSON, ...OPDSPublicationJSON[]]undefinedMin Items 1
pathstring""-
Returns​

Result<Group>


Holds​

Defined in: node_modules/@readium/shared/types/src/opds/Holds.d.ts:6

Library-specific features when a specific book is unavailable but provides a hold list.

https://drafts.opds.io/schema/properties.schema.json

Constructors​

Constructor​

new Holds(values): Holds

Defined in: node_modules/@readium/shared/types/src/opds/Holds.d.ts:10

Creates a [Price].

Parameters​
ParameterType
values{ position?: number; total?: number; }
values.position?number
values.total?number
Returns​

Holds

Properties​

position?​

optional position: number

Defined in: node_modules/@readium/shared/types/src/opds/Holds.d.ts:8

total?​

optional total: number

Defined in: node_modules/@readium/shared/types/src/opds/Holds.d.ts:7

Methods​

serialize()​

serialize(): any

Defined in: node_modules/@readium/shared/types/src/opds/Holds.d.ts:21

Serializes a [Holds] to its RWPM JSON representation.

Returns​

any

deserialize()​

static deserialize(json): undefined | Holds

Defined in: node_modules/@readium/shared/types/src/opds/Holds.d.ts:17

Parses a [Holds] from its RWPM JSON representation.

Parameters​
ParameterType
jsonany
Returns​

undefined | Holds


Defined in: opds/model/NavigationLinks.ts:31

Same as Link but with a required title Since this extends Link, it does not follow the same Result pattern as other models.

Extends​

  • Link

Constructors​

Constructor​

new NavigationLink(values): NavigationLink

Defined in: opds/model/NavigationLinks.ts:33

Parameters​
ParameterType
valuesOmit<{ alternates?: Links; bitrate?: number; children?: Links; duration?: number; height?: number; href: string; languages?: string[]; properties?: Properties; rels?: Set<string>; size?: number; templated?: boolean; title?: string; type?: string; width?: number; }, "title"> & object
Returns​

NavigationLink

Overrides​

Link.constructor

Properties​

alternates?​

readonly optional alternates: Links

Defined in: node_modules/@readium/shared/types/src/publication/Link.d.ts:34

Alternate resources for the linked resource.

Inherited from​

Link.alternates

bitrate?​

readonly optional bitrate: number

Defined in: node_modules/@readium/shared/types/src/publication/Link.d.ts:30

Bitrate of the linked resource in kbps.

Inherited from​

Link.bitrate

children?​

readonly optional children: Links

Defined in: node_modules/@readium/shared/types/src/publication/Link.d.ts:36

Resources that are children of the linked resource, in the context of a given collection role.

Inherited from​

Link.children

duration?​

readonly optional duration: number

Defined in: node_modules/@readium/shared/types/src/publication/Link.d.ts:28

Length of the linked resource in seconds.

Inherited from​

Link.duration

height?​

readonly optional height: number

Defined in: node_modules/@readium/shared/types/src/publication/Link.d.ts:22

Height of the linked resource in pixels.

Inherited from​

Link.height

href​

readonly href: string

Defined in: node_modules/@readium/shared/types/src/publication/Link.d.ts:10

URI or URI template of the linked resource.

Inherited from​

Link.href

languages?​

readonly optional languages: string[]

Defined in: node_modules/@readium/shared/types/src/publication/Link.d.ts:32

Expected language of the linked resource.

Inherited from​

Link.languages

properties?​

optional properties: Properties

Defined in: node_modules/@readium/shared/types/src/publication/Link.d.ts:20

Properties associated to the linked resource.

Inherited from​

Link.properties

rels?​

readonly optional rels: Set<string>

Defined in: node_modules/@readium/shared/types/src/publication/Link.d.ts:18

Relation between the linked resource and its containing collection.

Inherited from​

Link.rels

size?​

readonly optional size: number

Defined in: node_modules/@readium/shared/types/src/publication/Link.d.ts:26

Size of the linked resource in bytes.

Inherited from​

Link.size

templated?​

readonly optional templated: boolean

Defined in: node_modules/@readium/shared/types/src/publication/Link.d.ts:12

Indicates that a URI template is used in href.

Inherited from​

Link.templated

title?​

readonly optional title: string

Defined in: node_modules/@readium/shared/types/src/publication/Link.d.ts:16

Title of the linked resource.

Inherited from​

Link.title

type?​

readonly optional type: string

Defined in: node_modules/@readium/shared/types/src/publication/Link.d.ts:14

MIME type of the linked resource.

Inherited from​

Link.type

width?​

readonly optional width: number

Defined in: node_modules/@readium/shared/types/src/publication/Link.d.ts:24

Width of the linked resource in pixels.

Inherited from​

Link.width

Accessors​

locator​

Get Signature​

get locator(): Locator

Defined in: node_modules/@readium/shared/types/src/publication/Link.d.ts:87

Creates a [Locator] from a reading order [Link].

Returns​

Locator

Inherited from​

Link.locator

mediaType​

Get Signature​

get mediaType(): MediaType

Defined in: node_modules/@readium/shared/types/src/publication/Link.d.ts:65

MediaType of the linked resource.

Returns​

MediaType

Inherited from​

Link.mediaType

templateParameters​

Get Signature​

get templateParameters(): Set<string>

Defined in: node_modules/@readium/shared/types/src/publication/Link.d.ts:71

List of URI template parameter keys, if the Link is templated.

Returns​

Set<string>

Inherited from​

Link.templateParameters

Methods​

addProperties()​

addProperties(properties): Link

Defined in: node_modules/@readium/shared/types/src/publication/Link.d.ts:81

Makes a copy of this [Link] after merging in the given additional other [properties].

Parameters​
ParameterType
properties{[key: string]: any; }
Returns​

Link

Inherited from​

Link.addProperties

expandTemplate()​

expandTemplate(parameters): Link

Defined in: node_modules/@readium/shared/types/src/publication/Link.d.ts:75

Expands the Link's HREF by replacing URI template variables by the given parameters. See RFC 6570 on URI template: https://tools.ietf.org/html/rfc6570

Parameters​
ParameterType
parameters{[param: string]: string; }
Returns​

Link

Inherited from​

Link.expandTemplate

serialize()​

serialize(): any

Defined in: node_modules/@readium/shared/types/src/publication/Link.d.ts:63

Serializes a [Link] to its RWPM JSON representation.

Returns​

any

Inherited from​

Link.serialize

toURL()​

toURL(baseUrl?): undefined | string

Defined in: node_modules/@readium/shared/types/src/publication/Link.d.ts:69

Computes an absolute URL to the link, relative to the given baseURL. If the link's href is already absolute, the baseURL is ignored.

Parameters​
ParameterType
baseUrl?string
Returns​

undefined | string

Inherited from​

Link.toURL

deserialize()​

static deserialize(json): undefined | > NavigationLink

Defined in: opds/model/NavigationLinks.ts:41

Parses a [Link] from its RWPM JSON representation.

Parameters​
ParameterType
jsonunknown
Returns​

undefined | NavigationLink

Overrides​

Link.deserialize


Defined in: opds/model/NavigationLinks.ts:7

A collection of NavigationLinks Since this extends Links, it does not follow the same Result pattern as other models.

Extends​

  • Links

Constructors​

Constructor​

new NavigationLinks(links): NavigationLinks

Defined in: opds/model/NavigationLinks.ts:8

Parameters​
ParameterType
linksNavigationLink[]
Returns​

NavigationLinks

Overrides​

Links.constructor

Properties​

items​

items: Link[]

Defined in: node_modules/@readium/shared/types/src/publication/Link.d.ts:93

Inherited from​

Links.items

links: NavigationLink[]

Defined in: opds/model/NavigationLinks.ts:8

Methods​

everyIsAudio()​

everyIsAudio(): boolean

Defined in: node_modules/@readium/shared/types/src/publication/Link.d.ts:121

Returns whether all the resources in the collection are audio clips.

Returns​

boolean

Inherited from​

Links.everyIsAudio

everyIsBitmap()​

everyIsBitmap(): boolean

Defined in: node_modules/@readium/shared/types/src/publication/Link.d.ts:123

Returns whether all the resources in the collection are bitmaps.

Returns​

boolean

Inherited from​

Links.everyIsBitmap

everyIsHTML()​

everyIsHTML(): boolean

Defined in: node_modules/@readium/shared/types/src/publication/Link.d.ts:125

Returns whether all the resources in the collection are HTML documents.

Returns​

boolean

Inherited from​

Links.everyIsHTML

everyIsVideo()​

everyIsVideo(): boolean

Defined in: node_modules/@readium/shared/types/src/publication/Link.d.ts:127

Returns whether all the resources in the collection are video clips.

Returns​

boolean

Inherited from​

Links.everyIsVideo

everyMatchesMediaType()​

everyMatchesMediaType(mediaTypes): boolean

Defined in: node_modules/@readium/shared/types/src/publication/Link.d.ts:129

Returns whether all the resources in the collection are matching any of the given media types.

Parameters​
ParameterType
mediaTypesstring | string[]
Returns​

boolean

Inherited from​

Links.everyMatchesMediaType

filterByMediaType()​

filterByMediaType(mediaType): Link[]

Defined in: node_modules/@readium/shared/types/src/publication/Link.d.ts:117

Finds all the links matching the given media type.

Parameters​
ParameterType
mediaTypestring
Returns​

Link[]

Inherited from​

Links.filterByMediaType

filterByMediaTypes()​

filterByMediaTypes(mediaTypes): Link[]

Defined in: node_modules/@readium/shared/types/src/publication/Link.d.ts:119

Finds all the links matching any of the given media types.

Parameters​
ParameterType
mediaTypesstring[]
Returns​

Link[]

Inherited from​

Links.filterByMediaTypes

filterByRel()​

filterByRel(rel): Link[]

Defined in: node_modules/@readium/shared/types/src/publication/Link.d.ts:109

Finds all the links with the given relation.

Parameters​
ParameterType
relstring
Returns​

Link[]

Inherited from​

Links.filterByRel

filterLinksHasType()​

filterLinksHasType(): Link[]

Defined in: node_modules/@readium/shared/types/src/publication/Link.d.ts:130

Returns​

Link[]

Inherited from​

Links.filterLinksHasType

findIndexWithHref()​

findIndexWithHref(href): number

Defined in: node_modules/@readium/shared/types/src/publication/Link.d.ts:113

Finds the index of the first link matching the given HREF.

Parameters​
ParameterType
hrefstring
Returns​

number

Inherited from​

Links.findIndexWithHref

findWithHref()​

findWithHref(href): undefined | Link

Defined in: node_modules/@readium/shared/types/src/publication/Link.d.ts:111

Finds the first link matching the given HREF.

Parameters​
ParameterType
hrefstring
Returns​

undefined | Link

Inherited from​

Links.findWithHref

findWithMediaType()​

findWithMediaType(mediaType): undefined | Link

Defined in: node_modules/@readium/shared/types/src/publication/Link.d.ts:115

Finds the first link matching the given media type.

Parameters​
ParameterType
mediaTypestring
Returns​

undefined | Link

Inherited from​

Links.findWithMediaType

findWithRel()​

findWithRel(rel): undefined | Link

Defined in: node_modules/@readium/shared/types/src/publication/Link.d.ts:107

Finds the first link with the given relation.

Parameters​
ParameterType
relstring
Returns​

undefined | Link

Inherited from​

Links.findWithRel

serialize()​

serialize(): any

Defined in: node_modules/@readium/shared/types/src/publication/Link.d.ts:105

Serializes an array of [Link] to its RWPM JSON representation.

Returns​

any

Inherited from​

Links.serialize

deserialize()​

static deserialize(json): undefined | > NavigationLinks

Defined in: opds/model/NavigationLinks.ts:11

Creates a list of [Link] from its RWPM JSON representation.

Parameters​
ParameterType
jsonunknown
Returns​

undefined | NavigationLinks

Overrides​

Links.deserialize


OPDSPublication​

Defined in: opds/model/OPDSPublication.ts:48

A publication entry in an OPDS feed

See https://specs.opds.io/schema/publication.schema.json

Constructors​

Constructor​

new OPDSPublication(values): OPDSPublication

Defined in: opds/model/OPDSPublication.ts:53

Parameters​
ParameterType
values{ images?: Links; links: Links; metadata: Metadata; }
values.images?Links
values.linksLinks
values.metadataMetadata
Returns​

OPDSPublication

Properties​

images?​

readonly optional images: Links

Defined in: opds/model/OPDSPublication.ts:51

readonly links: Links

Defined in: opds/model/OPDSPublication.ts:50

metadata​

readonly metadata: Metadata

Defined in: opds/model/OPDSPublication.ts:49

Methods​

serialize()​

serialize(): OPDSPublicationJSON

Defined in: opds/model/OPDSPublication.ts:106

Returns​

OPDSPublicationJSON

deserialize()​

static deserialize(json, path): Result<OPDSPublication>

Defined in: opds/model/OPDSPublication.ts:59

Parameters​
ParameterType
jsonOPDSPublicationJSON
pathstring
Returns​

Result<OPDSPublication>


Price​

Defined in: node_modules/@readium/shared/types/src/opds/Price.d.ts:10

The price of a publication in an OPDS link.

https://drafts.opds.io/schema/properties.schema.json

currency Currency for the price, eg. EUR. value Price value, should only be used for display purposes, because of precision issues inherent with Double and the JSON parsing.

Constructors​

Constructor​

new Price(values): Price

Defined in: node_modules/@readium/shared/types/src/opds/Price.d.ts:17

Creates a [Price].

Parameters​
ParameterType
values{ currency: string; value: number; }
values.currencystring
values.valuenumber
Returns​

Price

Properties​

currency​

currency: string

Defined in: node_modules/@readium/shared/types/src/opds/Price.d.ts:12

Currency for the price, eg. EUR.

value​

value: number

Defined in: node_modules/@readium/shared/types/src/opds/Price.d.ts:15

Price value, should only be used for display purposes, because of precision issues inherent with Double and the JSON parsing.

Methods​

serialize()​

serialize(): any

Defined in: node_modules/@readium/shared/types/src/opds/Price.d.ts:28

Serializes a [Price] to its RWPM JSON representation.

Returns​

any

deserialize()​

static deserialize(json): undefined | Price

Defined in: node_modules/@readium/shared/types/src/opds/Price.d.ts:24

Parses a [Price] from its RWPM JSON representation.

Parameters​
ParameterType
jsonany
Returns​

undefined | Price


AjvErrorLike​

Defined in: opds/result.ts:25

the shape of an ajv error object, typed structurally so the core never imports ajv

Properties​

instancePath?​

optional instancePath: string

Defined in: opds/result.ts:26

keyword?​

optional keyword: string

Defined in: opds/result.ts:28

message?​

optional message: string

Defined in: opds/result.ts:27


AuthFlow​

Defined in: opds/model/auth/AuthDocument.ts:16

Properties​

labels?​

optional labels: object

Defined in: opds/model/auth/AuthDocument.ts:19

login?​

optional login: string

password?​

optional password: string

optional links: Links

Defined in: opds/model/auth/AuthDocument.ts:18

type​

type: string

Defined in: opds/model/auth/AuthDocument.ts:17


DeserializeOptions​

Defined in: opds/model/Feed.ts:12

Properties​

validate()?​

optional validate: (json) => null | OPDSError[]

Defined in: opds/model/Feed.ts:19

runs before construction, returns the schema errors (with JSON pointer paths) or null when valid. pass validateFeed from @storyteller-platform/opds/validate for full AJV validation, omit it to (mostly) trust the input

Parameters​
ParameterType
jsonunknown
Returns​

null | OPDSError[]


OPDSAuthenticationDocument​

Defined in: opds/types/authentication.ts:9

Properties​

authentication​

authentication: object[]

Defined in: opds/types/authentication.ts:26

A list of supported Authentication Flows

labels?​

optional labels: object

labels.login?​

optional login: string

labels.password?​

optional password: string

optional links: Link[]

type​

type: string

description?​

optional description: string

Defined in: opds/types/authentication.ts:21

A description of the service being displayed to the user

id​

id: string

Defined in: opds/types/authentication.ts:17

Unique identifier for the Catalog provider and canonical location for the Authentication Document

optional links: Link[]

Defined in: opds/types/authentication.ts:22

title​

title: string

Defined in: opds/types/authentication.ts:13

Title of the Catalog being accessed


OPDSError​

Defined in: opds/result.ts:5

a deserialize result that, unlike @readium/shared's T | undefined, says what went wrong and where. paths are JSON pointers into the source document

Properties​

keyword​

keyword: string

Defined in: opds/result.ts:10

the failing rule, e.g. "required" | "type" | "format"

message​

message: string

Defined in: opds/result.ts:8

path​

path: string

Defined in: opds/result.ts:7

JSON pointer to the offending value, e.g. "/publications/3/links/0/href"


OPDSProgressionDocument​

Defined in: opds/types/progression.ts:7

GENERATED by schemas/sync.ts from the OPDS/Readium JSON Schemas. DO NOT EDIT BY HAND. run yarn schemas:sync to regenerate.

Properties​

device​

device: object

Defined in: opds/types/progression.ts:10

id​

id: string

name​

name: string

modified​

modified: string

Defined in: opds/types/progression.ts:9

progression​

progression: number

Defined in: opds/types/progression.ts:14

references?​

optional references: string[]

Defined in: opds/types/progression.ts:15

title?​

optional title: string

Defined in: opds/types/progression.ts:8


OPDSPublicationJSON​

Defined in: opds/types/feed.ts:527

Properties​

images?​

optional images: [Link, ...Link[]]

Defined in: opds/types/feed.ts:535

Images are meant to be displayed to the user when browsing publications

Min Items​

1

links: Link[]

Defined in: opds/types/feed.ts:529

metadata​

metadata: Metadata

Defined in: opds/types/feed.ts:528


ToAtomXmlOptions​

Defined in: opds/serialize/atom.ts:164

Properties​

pretty?​

optional pretty: boolean

Defined in: opds/serialize/atom.ts:166

pretty-print with indentation, defaults to true


OPDSFeed​

OPDSFeed = object

Defined in: opds/types/feed.ts:7

GENERATED by schemas/sync.ts from the OPDS/Readium JSON Schemas. DO NOT EDIT BY HAND. run yarn schemas:sync to regenerate.

Indexable​

[k: string]: unknown

Properties​

facets?​

optional facets: [{ links?: [Link, ...Link[]]; metadata?: OPDSMetadata; }, ...{ links?: [Link, ...Link[]]; metadata?: OPDSMetadata }[]]

Defined in: opds/types/feed.ts:32

Facets are meant to re-order or obtain a subset for the current list of publications

Min Items​

1

groups?​

optional groups: object[]

Defined in: opds/types/feed.ts:51

Groups provide a curated experience, grouping publications or navigation links together

optional links: [Link, ...Link[]]

Min Items​

1

metadata​

metadata: OPDSMetadata

optional navigation: [Link, ...Link[]]

Min Items​

1

publications?​

optional publications: [OPDSPublicationJSON, ...OPDSPublicationJSON[]]

Min Items​

1

links: [Link, ...Link[]]

Defined in: opds/types/feed.ts:14

Feed-level links such as search or pagination

Min Items​

1

metadata​

metadata: OPDSMetadata

Defined in: opds/types/feed.ts:8

optional navigation: [Link, ...Link[]]

Defined in: opds/types/feed.ts:26

Navigation for the catalog using links

Min Items​

1

publications?​

optional publications: [OPDSPublicationJSON, ...OPDSPublicationJSON[]]

Defined in: opds/types/feed.ts:20

A list of publications that can be acquired

Min Items​

1


Result<T>​

Result<T> = { ok: true; value: T; } | { errors: OPDSError[]; ok: false; }

Defined in: opds/result.ts:13

Type Parameters​

Type Parameter
T

ACQUISITION_RELS​

const ACQUISITION_RELS: object

Defined in: opds/model/constants.ts:11

all valid acquisition rels as an "enum"

Type Declaration​

acquisition​

readonly acquisition: "http://opds-spec.org/acquisition" = "http://opds-spec.org/acquisition"

borrow​

readonly borrow: "http://opds-spec.org/acquisition/borrow" = "http://opds-spec.org/acquisition/borrow"

buy​

readonly buy: "http://opds-spec.org/acquisition/buy" = "http://opds-spec.org/acquisition/buy"

download​

readonly download: "http://opds-spec.org/acquisition/open-access" = "http://opds-spec.org/acquisition/open-access"

preview​

readonly preview: "http://opds-spec.org/acquisition/sample" = "http://opds-spec.org/acquisition/sample"

subscribe​

readonly subscribe: "http://opds-spec.org/acquisition/subscribe" = "http://opds-spec.org/acquisition/subscribe"


ACQUISITION_RELS_ARRAY​

const ACQUISITION_RELS_ARRAY: string[]

Defined in: opds/model/constants.ts:23

all valid acquisition rels as an array


ATOM_ACQ​

const ATOM_ACQ: "application/atom+xml;profile=opds-catalog;kind=acquisition"

Defined in: opds/model/constants.ts:3


ATOM_NAV​

const ATOM_NAV: "application/atom+xml;profile=opds-catalog;kind=navigation"

Defined in: opds/model/constants.ts:1


AuthFlowType​

const AuthFlowType: object

Defined in: opds/model/auth/AuthDocument.ts:10

well-known OPDS authentication flow type URIs

Type Declaration​

basic​

readonly basic: "http://opds-spec.org/auth/basic" = "http://opds-spec.org/auth/basic"

oauthImplicit​

readonly oauthImplicit: "http://opds-spec.org/auth/oauth/implicit" = "http://opds-spec.org/auth/oauth/implicit"

oauthPassword​

readonly oauthPassword: "http://opds-spec.org/auth/oauth/password" = "http://opds-spec.org/auth/oauth/password"


OPDS_JSON​

const OPDS_JSON: "application/opds+json"

Defined in: opds/model/constants.ts:5


OPDS_PUBLICATION_JSON​

const OPDS_PUBLICATION_JSON: "application/opds-publication+json" = "application/opds-publication+json"

Defined in: opds/model/constants.ts:6


THUMBNAIL_REL​

const THUMBNAIL_REL: "http://opds-spec.org/image/thumbnail"

Defined in: opds/model/constants.ts:28


basic()​

basic(labels?): AuthFlow

Defined in: opds/model/auth/AuthDocument.ts:23

HTTP basic auth flow

Parameters​

ParameterType
labels?{ login?: string; password?: string; }
labels.login?string
labels.password?string

Returns​

AuthFlow


err()​

err(errors): Result<never>

Defined in: opds/result.ts:19

Parameters​

ParameterType
errorsOPDSError[]

Returns​

Result<never>


oauthImplicit()​

oauthImplicit(authenticate): AuthFlow

Defined in: opds/model/auth/AuthDocument.ts:45

OAuth implicit flow, authenticate is the authorization page

Parameters​

ParameterType
authenticatestring

Returns​

AuthFlow


oauthPassword()​

oauthPassword(authenticate, labels?): AuthFlow

Defined in: opds/model/auth/AuthDocument.ts:29

OAuth password-grant flow, authenticate is the token endpoint

Parameters​

ParameterType
authenticatestring
labels?{ login?: string; password?: string; }
labels.login?string
labels.password?string

Returns​

AuthFlow


ok()​

ok<T>(value): Result<T>

Defined in: opds/result.ts:17

Type Parameters​

Type Parameter
T

Parameters​

ParameterType
valueT

Returns​

Result<T>


toAtomXml()​

toAtomXml(feed, options): string

Defined in: opds/serialize/atom.ts:170

renders a Feed as an OPDS 1.2 atom XML document

Parameters​

ParameterType
feedFeed
optionsToAtomXmlOptions

Returns​

string


toOPDSError()​

toOPDSError(e): OPDSError

Defined in: opds/result.ts:31

Parameters​

ParameterType
eAjvErrorLike

Returns​

OPDSError