@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
| Parameter | Type |
|---|---|
values | { children?: Acquisition[]; type: string; } |
values.children? | Acquisition[] |
values.type | string |
Returns
Properties
children?
optionalchildren: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()
staticdeserialize(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
| Parameter | Type |
|---|---|
json | any |
Returns
undefined | Acquisition
deserializeArray()
staticdeserializeArray(json):undefined| >Acquisition[]
Defined in: node_modules/@readium/shared/types/src/opds/Acquisition.d.ts:21
Parameters
| Parameter | Type |
|---|---|
json | any |
Returns
undefined | Acquisition[]
AcquisitionLink
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
| Parameter | Type |
|---|---|
values | { href: string; rel: "acquisition" | "buy" | "borrow" | "download" | "preview" | "subscribe"; type: string; } |
values.href | string |
values.rel | "acquisition" | "buy" | "borrow" | "download" | "preview" | "subscribe" |
values.type | string |
Returns
Overrides
Link.constructor
Properties
alternates?
readonlyoptionalalternates: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?
readonlyoptionalbitrate: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?
readonlyoptionalchildren: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?
readonlyoptionalduration: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?
readonlyoptionalheight: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
readonlyhref: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?
readonlyoptionallanguages: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?
optionalproperties: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?
readonlyoptionalrels: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?
readonlyoptionalsize: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?
readonlyoptionaltemplated: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?
readonlyoptionaltitle:string
Defined in: node_modules/@readium/shared/types/src/publication/Link.d.ts:16
Title of the linked resource.
Inherited from
Link.title
type?
readonlyoptionaltype: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?
readonlyoptionalwidth: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
| Parameter | Type |
|---|---|
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
| Parameter | Type |
|---|---|
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
| Parameter | Type |
|---|---|
baseUrl? | string |
Returns
undefined | string
Inherited from
Link.toURL
deserialize()
staticdeserialize(json):undefined| >AcquisitionLink
Defined in: opds/model/OPDSPublication.ts:27
Parses a [Link] from its RWPM JSON representation.
Parameters
| Parameter | Type |
|---|---|
json | unknown |
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
| Parameter | Type |
|---|---|
values | { authentication: AuthFlow[]; description?: string; id: string; links?: Links; title: string; } |
values.authentication | AuthFlow[] |
values.description? | string |
values.id | string |
values.links? | Links |
values.title | string |
Returns
Properties
authentication
readonlyauthentication:AuthFlow[]
Defined in: opds/model/auth/AuthDocument.ts:59
description?
readonlyoptionaldescription:string
Defined in: opds/model/auth/AuthDocument.ts:60
id
readonlyid:string
Defined in: opds/model/auth/AuthDocument.ts:57
links?
readonlyoptionallinks:Links
Defined in: opds/model/auth/AuthDocument.ts:61
title
readonlytitle:string
Defined in: opds/model/auth/AuthDocument.ts:58
Methods
serialize()
serialize():
OPDSAuthenticationDocument
Defined in: opds/model/auth/AuthDocument.ts:107
Returns
deserialize()
staticdeserialize(json,options):Result<AuthDocument>
Defined in: opds/model/auth/AuthDocument.ts:77
Parameters
| Parameter | Type |
|---|---|
json | unknown |
options | { validate?: (json) => null | OPDSError[]; } |
options.validate? | (json) => null | OPDSError[] |
Returns
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
| Parameter | Type |
|---|---|
values | { since?: Date; state: AvailabilityStatus; until?: Date; } |
values.since? | Date |
values.state | AvailabilityStatus |
values.until? | Date |
Returns
Properties
since?
optionalsince: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?
optionaluntil: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()
staticdeserialize(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
| Parameter | Type |
|---|---|
json | any |
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
| Parameter | Type |
|---|---|
values | { available?: number; total?: number; } |
values.available? | number |
values.total? | number |
Returns
Properties
available?
optionalavailable:number
Defined in: node_modules/@readium/shared/types/src/opds/Copies.d.ts:8
total?
optionaltotal: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()
staticdeserialize(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
| Parameter | Type |
|---|---|
json | any |
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
| Parameter | Type |
|---|---|
values | { links: Links; metadata?: FeedMetadata; } |
values.links | Links |
values.metadata? | FeedMetadata |
Returns
Properties
links
readonlylinks:Links
Defined in: opds/model/Facet.ts:13
metadata?
readonlyoptionalmetadata: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; }
links?
optionallinks: [Link,...Link[]]
Min Items
1
metadata?
optionalmetadata:OPDSMetadata
{ links?: [Link, ...Link[]]; metadata?: OPDSMetadata; }
links?
optionallinks: [Link,...Link[]]
Min Items
1
metadata?
optionalmetadata:OPDSMetadata
deserialize()
Defined in: opds/model/Facet.ts:20
Parameters
| Parameter | Type |
|---|---|
json | { links?: [Link, ...Link[]]; metadata?: OPDSMetadata; } | { links?: [Link, ...Link[]]; metadata?: OPDSMetadata; } |
path | string |
Returns
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
| Parameter | Type |
|---|---|
values | { facets?: Facet[]; groups?: Group[]; links: Links; metadata: FeedMetadata; navigation?: NavigationLinks; publications?: OPDSPublication[]; } |
values.facets? | Facet[] |
values.groups? | Group[] |
values.links | Links |
values.metadata | FeedMetadata |
values.navigation? | NavigationLinks |
values.publications? | OPDSPublication[] |
Returns
Properties
facets?
readonlyoptionalfacets:Facet[]
Defined in: opds/model/Feed.ts:34
groups?
readonlyoptionalgroups:Group[]
Defined in: opds/model/Feed.ts:35
links
readonlylinks:Links
Defined in: opds/model/Feed.ts:31
metadata
readonlymetadata:FeedMetadata
Defined in: opds/model/Feed.ts:30
navigation?
readonlyoptionalnavigation:NavigationLinks
Defined in: opds/model/Feed.ts:33
publications?
readonlyoptionalpublications:OPDSPublication[]
Defined in: opds/model/Feed.ts:32
Methods
serialize()
serialize():
OPDSFeed
Defined in: opds/model/Feed.ts:122
Returns
deserialize()
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
| Parameter | Type |
|---|---|
json | unknown |
options | DeserializeOptions |
Returns
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
| Parameter | Type |
|---|---|
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.title | string | { } | unknown[] |
values.type? | string |
Returns
Properties
currentPage?
readonlyoptionalcurrentPage:number
Defined in: opds/model/FeedMetadata.ts:16
description?
readonlyoptionaldescription:string
Defined in: opds/model/FeedMetadata.ts:14
extra?
readonlyoptionalextra:Record<string,unknown>
Defined in: opds/model/FeedMetadata.ts:19
any properties outside the known set, preserved on round-trip
identifier?
readonlyoptionalidentifier:string
Defined in: opds/model/FeedMetadata.ts:10
itemsPerPage?
readonlyoptionalitemsPerPage:number
Defined in: opds/model/FeedMetadata.ts:15
modified?
readonlyoptionalmodified:string
Defined in: opds/model/FeedMetadata.ts:13
numberOfItems?
readonlyoptionalnumberOfItems:number
Defined in: opds/model/FeedMetadata.ts:17
subtitle?
readonlyoptionalsubtitle:string| { } |unknown[]
Defined in: opds/model/FeedMetadata.ts:12
title
readonlytitle:string| { } |unknown[]
Defined in: opds/model/FeedMetadata.ts:9
type?
readonlyoptionaltype:string
Defined in: opds/model/FeedMetadata.ts:11
Methods
serialize()
serialize():
OPDSMetadata
Defined in: opds/model/FeedMetadata.ts:72
Returns
OPDSMetadata
deserialize()
staticdeserialize(json):FeedMetadata
Defined in: opds/model/FeedMetadata.ts:45
Parameters
| Parameter | Type |
|---|---|
json | OPDSMetadata |
Returns
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
| Parameter | Type |
|---|---|
values | { links?: Links; metadata: FeedMetadata; navigation?: Links; publications?: OPDSPublication[]; } |
values.links? | Links |
values.metadata | FeedMetadata |
values.navigation? | Links |
values.publications? | OPDSPublication[] |
Returns
Properties
links?
readonlyoptionallinks:Links
Defined in: opds/model/Group.ts:16
metadata
readonlymetadata:FeedMetadata
Defined in: opds/model/Group.ts:15
navigation?
readonlyoptionalnavigation:Links
Defined in: opds/model/Group.ts:18
publications?
readonlyoptionalpublications:OPDSPublication[]
Defined in: opds/model/Group.ts:17
Methods
serialize()
serialize():
object
Defined in: opds/model/Group.ts:58
Returns
links?
optionallinks: [Link,...Link[]]
Min Items
1
metadata
metadata:
OPDSMetadata
navigation?
optionalnavigation: [Link,...Link[]]
Min Items
1
publications?
optionalpublications: [OPDSPublicationJSON,...OPDSPublicationJSON[]]
Min Items
1
deserialize()
Defined in: opds/model/Group.ts:32
Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
json | { links?: [Link, ...Link[]]; metadata: OPDSMetadata; navigation?: [Link, ...Link[]]; publications?: [OPDSPublicationJSON, ...OPDSPublicationJSON[]]; } | undefined | - |
json.links? | [Link, ...Link[]] | undefined | Min Items 1 |
json.metadata | OPDSMetadata | undefined | - |
json.navigation? | [Link, ...Link[]] | undefined | Min Items 1 |
json.publications? | [OPDSPublicationJSON, ...OPDSPublicationJSON[]] | undefined | Min Items 1 |
path | string | "" | - |
Returns
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
| Parameter | Type |
|---|---|
values | { position?: number; total?: number; } |
values.position? | number |
values.total? | number |
Returns
Properties
position?
optionalposition:number
Defined in: node_modules/@readium/shared/types/src/opds/Holds.d.ts:8
total?
optionaltotal: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()
staticdeserialize(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
| Parameter | Type |
|---|---|
json | any |
Returns
undefined | Holds
NavigationLink
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
| Parameter | Type |
|---|---|
values | Omit<{ 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
Overrides
Link.constructor
Properties
alternates?
readonlyoptionalalternates: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?
readonlyoptionalbitrate: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?
readonlyoptionalchildren: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?
readonlyoptionalduration: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?
readonlyoptionalheight: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
readonlyhref: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?
readonlyoptionallanguages: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?
optionalproperties: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?
readonlyoptionalrels: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?
readonlyoptionalsize: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?
readonlyoptionaltemplated: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?
readonlyoptionaltitle:string
Defined in: node_modules/@readium/shared/types/src/publication/Link.d.ts:16
Title of the linked resource.
Inherited from
Link.title
type?
readonlyoptionaltype: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?
readonlyoptionalwidth: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
| Parameter | Type |
|---|---|
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
| Parameter | Type |
|---|---|
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
| Parameter | Type |
|---|---|
baseUrl? | string |
Returns
undefined | string
Inherited from
Link.toURL
deserialize()
staticdeserialize(json):undefined| >NavigationLink
Defined in: opds/model/NavigationLinks.ts:41
Parses a [Link] from its RWPM JSON representation.
Parameters
| Parameter | Type |
|---|---|
json | unknown |
Returns
undefined | NavigationLink
Overrides
Link.deserialize
NavigationLinks
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
| Parameter | Type |
|---|---|
links | NavigationLink[] |
Returns
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
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
| Parameter | Type |
|---|---|
mediaTypes | string | 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
| Parameter | Type |
|---|---|
mediaType | string |
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
| Parameter | Type |
|---|---|
mediaTypes | string[] |
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
| Parameter | Type |
|---|---|
rel | string |
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
| Parameter | Type |
|---|---|
href | string |
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
| Parameter | Type |
|---|---|
href | string |
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
| Parameter | Type |
|---|---|
mediaType | string |
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
| Parameter | Type |
|---|---|
rel | string |
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()
staticdeserialize(json):undefined| >NavigationLinks
Defined in: opds/model/NavigationLinks.ts:11
Creates a list of [Link] from its RWPM JSON representation.
Parameters
| Parameter | Type |
|---|---|
json | unknown |
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
| Parameter | Type |
|---|---|
values | { images?: Links; links: Links; metadata: Metadata; } |
values.images? | Links |
values.links | Links |
values.metadata | Metadata |
Returns
Properties
images?
readonlyoptionalimages:Links
Defined in: opds/model/OPDSPublication.ts:51
links
readonlylinks:Links
Defined in: opds/model/OPDSPublication.ts:50
metadata
readonlymetadata:Metadata
Defined in: opds/model/OPDSPublication.ts:49
Methods
serialize()
serialize():
OPDSPublicationJSON
Defined in: opds/model/OPDSPublication.ts:106
Returns
deserialize()
staticdeserialize(json,path):Result<OPDSPublication>
Defined in: opds/model/OPDSPublication.ts:59
Parameters
| Parameter | Type |
|---|---|
json | OPDSPublicationJSON |
path | string |
Returns
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
| Parameter | Type |
|---|---|
values | { currency: string; value: number; } |
values.currency | string |
values.value | number |
Returns
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()
staticdeserialize(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
| Parameter | Type |
|---|---|
json | any |
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?
optionalinstancePath:string
Defined in: opds/result.ts:26
keyword?
optionalkeyword:string
Defined in: opds/result.ts:28
message?
optionalmessage:string
Defined in: opds/result.ts:27
AuthFlow
Defined in: opds/model/auth/AuthDocument.ts:16
Properties
labels?
optionallabels:object
Defined in: opds/model/auth/AuthDocument.ts:19
login?
optionallogin:string
password?
optionalpassword:string
links?
optionallinks: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()?
optionalvalidate: (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
| Parameter | Type |
|---|---|
json | unknown |
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?
optionallabels:object
labels.login?
optionallogin:string
labels.password?
optionalpassword:string
links?
optionallinks:Link[]
type
type:
string
description?
optionaldescription: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
links?
optionallinks: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?
optionalreferences:string[]
Defined in: opds/types/progression.ts:15
title?
optionaltitle:string
Defined in: opds/types/progression.ts:8
OPDSPublicationJSON
Defined in: opds/types/feed.ts:527
Properties
images?
optionalimages: [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
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?
optionalpretty: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?
optionalfacets: [{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?
optionalgroups:object[]
Defined in: opds/types/feed.ts:51
Groups provide a curated experience, grouping publications or navigation links together
links?
optionallinks: [Link,...Link[]]
Min Items
1
metadata
metadata:
OPDSMetadata
navigation?
optionalnavigation: [Link,...Link[]]
Min Items
1
publications?
optionalpublications: [OPDSPublicationJSON,...OPDSPublicationJSON[]]
Min Items
1
links
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
navigation?
optionalnavigation: [Link,...Link[]]
Defined in: opds/types/feed.ts:26
Navigation for the catalog using links
Min Items
1
publications?
optionalpublications: [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
constACQUISITION_RELS:object
Defined in: opds/model/constants.ts:11
all valid acquisition rels as an "enum"
Type Declaration
acquisition
readonlyacquisition:"http://opds-spec.org/acquisition"="http://opds-spec.org/acquisition"
borrow
readonlyborrow:"http://opds-spec.org/acquisition/borrow"="http://opds-spec.org/acquisition/borrow"
buy
readonlybuy:"http://opds-spec.org/acquisition/buy"="http://opds-spec.org/acquisition/buy"
download
readonlydownload:"http://opds-spec.org/acquisition/open-access"="http://opds-spec.org/acquisition/open-access"
preview
readonlypreview:"http://opds-spec.org/acquisition/sample"="http://opds-spec.org/acquisition/sample"
subscribe
readonlysubscribe:"http://opds-spec.org/acquisition/subscribe"="http://opds-spec.org/acquisition/subscribe"
ACQUISITION_RELS_ARRAY
constACQUISITION_RELS_ARRAY:string[]
Defined in: opds/model/constants.ts:23
all valid acquisition rels as an array
ATOM_ACQ
constATOM_ACQ:"application/atom+xml;profile=opds-catalog;kind=acquisition"
Defined in: opds/model/constants.ts:3
ATOM_NAV
constATOM_NAV:"application/atom+xml;profile=opds-catalog;kind=navigation"
Defined in: opds/model/constants.ts:1
AuthFlowType
constAuthFlowType:object
Defined in: opds/model/auth/AuthDocument.ts:10
well-known OPDS authentication flow type URIs
Type Declaration
basic
readonlybasic:"http://opds-spec.org/auth/basic"="http://opds-spec.org/auth/basic"
oauthImplicit
readonlyoauthImplicit:"http://opds-spec.org/auth/oauth/implicit"="http://opds-spec.org/auth/oauth/implicit"
oauthPassword
readonlyoauthPassword:"http://opds-spec.org/auth/oauth/password"="http://opds-spec.org/auth/oauth/password"
OPDS_JSON
constOPDS_JSON:"application/opds+json"
Defined in: opds/model/constants.ts:5
OPDS_PUBLICATION_JSON
constOPDS_PUBLICATION_JSON:"application/opds-publication+json"="application/opds-publication+json"
Defined in: opds/model/constants.ts:6
THUMBNAIL_REL
constTHUMBNAIL_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
| Parameter | Type |
|---|---|
labels? | { login?: string; password?: string; } |
labels.login? | string |
labels.password? | string |
Returns
err()
err(
errors):Result<never>
Defined in: opds/result.ts:19
Parameters
| Parameter | Type |
|---|---|
errors | OPDSError[] |
Returns
Result<never>
oauthImplicit()
oauthImplicit(
authenticate):AuthFlow
Defined in: opds/model/auth/AuthDocument.ts:45
OAuth implicit flow, authenticate is the authorization page
Parameters
| Parameter | Type |
|---|---|
authenticate | string |
Returns
oauthPassword()
oauthPassword(
authenticate,labels?):AuthFlow
Defined in: opds/model/auth/AuthDocument.ts:29
OAuth password-grant flow, authenticate is the token endpoint
Parameters
| Parameter | Type |
|---|---|
authenticate | string |
labels? | { login?: string; password?: string; } |
labels.login? | string |
labels.password? | string |
Returns
ok()
ok<
T>(value):Result<T>
Defined in: opds/result.ts:17
Type Parameters
| Type Parameter |
|---|
T |
Parameters
| Parameter | Type |
|---|---|
value | T |
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
| Parameter | Type |
|---|---|
feed | Feed |
options | ToAtomXmlOptions |
Returns
string
toOPDSError()
toOPDSError(
e):OPDSError
Defined in: opds/result.ts:31
Parameters
| Parameter | Type |
|---|---|
e | AjvErrorLike |