Creates a new Publication instance.
The options for the publication.
Creates a new Publication instance with identifier and title.
The unique identifier (URI) of the publication. (e.g. urn:isbn:9780000000002)
The title of the publication.
Adds an acquisition link to the publication.
The URL of the acquisition link.
The media type of the resource (e.g. application/epub+zip).
The acquisition relation (default: acquisition). See https://specs.opds.io/opds-2.0#53-acquisition-links
Optionalproperties: LinkProperties
Additional link properties, such as price or indirectAcquisition (optional).
The Publication instance (for chaining).
Adds an author to the publication.
The name of the author, or a contributor object.
The Publication instance (for chaining).
Adds a collection the publication belongs to.
The name of the collection, or a collection object.
The Publication instance (for chaining).
Adds a contributor with the given role. Multiple contributors with the same role are collected in a list.
The role of the contributor (e.g. author, translator, publisher).
The name of the contributor, or a contributor object.
The Publication instance (for chaining).
Adds an extra top-level property (e.g. a custom sub-collection) to the publication.
The key of the property.
The value of the property.
The Publication instance (for chaining).
Adds an image to the images collection of the publication.
The URL of the image.
The media type of the image (default: image/jpeg).
Optionalsize: { height?: number; width?: number }
The dimensions of the image in pixels (optional).
The Publication instance (for chaining).
Adds one or more links to the publication.
The links to add.
The Publication instance (for chaining).
Adds multiple links to the publication.
The links to add.
The Publication instance (for chaining).
Adds a self link to the publication, pointing to its OPDS publication document.
The URL of the publication document.
The Publication instance (for chaining).
Adds a subject to the publication.
The subject name, or a subject object.
The Publication instance (for chaining).
Gets the identifier of the publication.
The identifier of the publication.
Gets the self link of the publication.
The self link, or undefined if not found.
Sets the description of the publication.
The description text.
The Publication instance (for chaining).
Sets the language(s) of the publication.
BCP 47 language tag(s) (e.g. en).
The Publication instance (for chaining).
Merges the given fields into the metadata of the publication.
The metadata fields to set.
The Publication instance (for chaining).
Sets a specific metadata field of the publication.
The key of the metadata field.
The value to set.
The Publication instance (for chaining).
Sets the last modification date of the publication.
The date in ISO 8601 format.
The Publication instance (for chaining).
Sets the number of pages of the publication.
The number of pages.
The Publication instance (for chaining).
Sets the publication date of the publication.
The date in ISO 8601 format.
The Publication instance (for chaining).
Sets the publisher of the publication.
The name of the publisher, or a contributor object.
The Publication instance (for chaining).
Sets the series the publication belongs to.
The name of the series.
Optionalposition: number
The position of the publication in the series (optional).
Optionallinks: Link[]
Links related to the series, e.g. to a feed of the series (optional).
The Publication instance (for chaining).
Sets the subtitle of the publication.
The subtitle.
The Publication instance (for chaining).
Sets the schema.org type of the publication.
The type URI (e.g. http://schema.org/Book).
The Publication instance (for chaining).
Converts the publication to an OPDS 2.0 JSON string.
Serialization options.
The publication as a JSON string.
Used by JSON.stringify to serialize the publication.
Converts the publication to a plain object following the OPDS 2.0 JSON structure. Blank values are removed.
Serialization options (only baseUrl is used).
The publication as a plain object.
Checks the publication against the requirements of the OPDS 2.0 specification.
A list of problems. An empty list means the publication is valid.
StaticfromCreates a Publication instance from OPDS 2.0 JSON.
The JSON string or an already parsed object.
A new Publication instance.
An OPDS 2.0 publication.