mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-01 22:01:10 +00:00
Refactors the update book slice across the stack
This commit is contained in:
1 parent
9a71a6d32b
commit
001146eefc
27 files changed
+4065
-632
No files matched your search
@@ -14,6 +14,9 @@
|
||||
- [Get Books Lite](#get-books-lite)
|
||||
- [Get Books Lite Request](#get-books-lite-request)
|
||||
- [Get Books Lite Response](#get-books-lite-response)
|
||||
- [Update Book](#update-book)
|
||||
- [Update Book Request](#update-book-request)
|
||||
- [Update Book Response](#update-book-response)
|
||||
- [Get Reading Availability](#get-reading-availability)
|
||||
- [Get Reading Availability Request](#get-reading-availability-request)
|
||||
- [Get Reading Availability Response](#get-reading-availability-response)
|
||||
@@ -34,13 +37,12 @@
|
||||
#### Add Book Request
|
||||
|
||||
```js
|
||||
POST api/v1/books
|
||||
POST api/v1/libraries/3b3a19f3-1f5a-4d5a-9a3a-5c5a4a3a2a1a/books
|
||||
```
|
||||
|
||||
```json
|
||||
{
|
||||
"libraryId": "3b3a19f3-1f5a-4d5a-9a3a-5c5a4a3a2a1a",
|
||||
"path": "/books/the-fellowship-of-the-ring.pdf",
|
||||
"path": "/media/libraries/books/the-fellowship-of-the-ring.pdf",
|
||||
"metadata": {
|
||||
"title": "The Fellowship of the Ring",
|
||||
"originalTitle": "The Fellowship of the Ring",
|
||||
@@ -50,7 +52,7 @@ POST api/v1/books
|
||||
"originalReleaseYear": 1954,
|
||||
"reReleaseDate": "2001-09-06",
|
||||
"reReleaseYear": 2001,
|
||||
"releaseCountry": "uk",
|
||||
"releaseCountry": "GB",
|
||||
"releaseVersion": "50th Anniversary Edition"
|
||||
},
|
||||
"genres": [
|
||||
@@ -93,31 +95,27 @@ POST api/v1/books
|
||||
"appleBooksId": "id395211",
|
||||
"isbns": [
|
||||
{
|
||||
"value": "0395272238",
|
||||
"format": "Isbn10"
|
||||
"value": "0395272238",
|
||||
"format": "Isbn10"
|
||||
},
|
||||
{
|
||||
"value": "9780395272237",
|
||||
"format": "Isbn13"
|
||||
"value": "9780395272237",
|
||||
"format": "Isbn13"
|
||||
}
|
||||
],
|
||||
"contributors": [
|
||||
{
|
||||
"name": {
|
||||
"displayName": "J.R.R. Tolkien"
|
||||
},
|
||||
"contributorId": "6a3f0c2d-1b4e-4f5a-8c6d-9e0f1a2b3c4d",
|
||||
"role": "Author"
|
||||
},
|
||||
{
|
||||
"name": {
|
||||
"displayName": "Alan Lee"
|
||||
},
|
||||
"contributorId": "7b4e1d3f-2c5a-4e6b-9d7e-0f1a2b3c4d5e",
|
||||
"role": "Illustrator"
|
||||
}
|
||||
],
|
||||
"ratings": [
|
||||
{
|
||||
"source": "Goodreads",
|
||||
"source": "GoogleBooks",
|
||||
"value": 4.36,
|
||||
"maxValue": 5,
|
||||
"voteCount": 2345678
|
||||
@@ -142,7 +140,7 @@ POST api/v1/books
|
||||
{
|
||||
"id": "32b336e8-dafc-4a08-9dec-9454e66dd55d",
|
||||
"libraryId": "3b3a19f3-1f5a-4d5a-9a3a-5c5a4a3a2a1a",
|
||||
"path": "/books/the-fellowship-of-the-ring.pdf",
|
||||
"path": "/media/libraries/books/the-fellowship-of-the-ring.pdf",
|
||||
"metadata": {
|
||||
"publisher": "Houghton Mifflin",
|
||||
"pageCount": 398,
|
||||
@@ -154,7 +152,7 @@ POST api/v1/books
|
||||
"originalReleaseYear": 1954,
|
||||
"reReleaseDate": "2001-09-06",
|
||||
"reReleaseYear": 2001,
|
||||
"releaseCountry": "uk",
|
||||
"releaseCountry": "GB",
|
||||
"releaseVersion": "50th Anniversary Edition"
|
||||
},
|
||||
"language": {
|
||||
@@ -213,14 +211,19 @@ POST api/v1/books
|
||||
"format": "Isbn13"
|
||||
}
|
||||
],
|
||||
"contributors": [],
|
||||
"contributors": [
|
||||
{ "contributorId": "6a3f0c2d-1b4e-4f5a-8c6d-9e0f1a2b3c4d", "role": "Author" },
|
||||
{ "contributorId": "7b4e1d3f-2c5a-4e6b-9d7e-0f1a2b3c4d5e", "role": "Illustrator" }
|
||||
],
|
||||
"ratings": [
|
||||
{
|
||||
"source": "GoogleBooks",
|
||||
"value": 4.36,
|
||||
"maxValue": 5,
|
||||
"voteCount": 2345678
|
||||
},
|
||||
{
|
||||
"source": "Amazon",
|
||||
"value": 4.7,
|
||||
"maxValue": 5,
|
||||
"voteCount": 87654
|
||||
@@ -230,7 +233,8 @@ POST api/v1/books
|
||||
"lastMetadataUpdateUtc": null,
|
||||
"metadataProvider": null,
|
||||
"createdOnUtc": "2025-01-01T12:00:00.0000000Z",
|
||||
"updatedOnUtc": null
|
||||
"updatedOnUtc": null,
|
||||
"coverPath": null
|
||||
}
|
||||
```
|
||||
|
||||
@@ -239,7 +243,7 @@ POST api/v1/books
|
||||
#### Get Book Request
|
||||
|
||||
```js
|
||||
GET api/v1/books/{id}
|
||||
GET api/v1/libraries/3b3a19f3-1f5a-4d5a-9a3a-5c5a4a3a2a1a/books/{bookId}
|
||||
```
|
||||
|
||||
#### Get Book Response
|
||||
@@ -255,12 +259,11 @@ Returns an empty response. This endpoint is not yet implemented.
|
||||
#### Get Books Request
|
||||
|
||||
```js
|
||||
GET api/v1/books?libraryId=3b3a19f3-1f5a-4d5a-9a3a-5c5a4a3a2a1a¤tPage=1&perPage=10&searchTerm=fellowship&sortBy=title&sortOrder=Ascending
|
||||
GET api/v1/libraries/3b3a19f3-1f5a-4d5a-9a3a-5c5a4a3a2a1a/books?currentPage=1&perPage=10&searchTerm=fellowship&sortBy=title&sortOrder=Ascending
|
||||
```
|
||||
|
||||
| Query Parameter | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| `libraryId` | `string` (GUID) | Required. The Id of the media library whose books are retrieved. |
|
||||
| `currentPage` | `int` | Optional. The page of results to retrieve. |
|
||||
| `perPage` | `int` | Optional. The maximum number of books to retrieve per page. |
|
||||
| `searchTerm` | `string` | Optional. The search term used to filter results. |
|
||||
@@ -279,7 +282,7 @@ GET api/v1/books?libraryId=3b3a19f3-1f5a-4d5a-9a3a-5c5a4a3a2a1a¤tPage=1&pe
|
||||
{
|
||||
"id": "32b336e8-dafc-4a08-9dec-9454e66dd55d",
|
||||
"libraryId": "3b3a19f3-1f5a-4d5a-9a3a-5c5a4a3a2a1a",
|
||||
"path": "/books/the-fellowship-of-the-ring.pdf",
|
||||
"path": "/media/libraries/books/the-fellowship-of-the-ring.pdf",
|
||||
"metadata": {
|
||||
"title": "The Fellowship of the Ring",
|
||||
"originalTitle": "The Fellowship of the Ring",
|
||||
@@ -289,7 +292,7 @@ GET api/v1/books?libraryId=3b3a19f3-1f5a-4d5a-9a3a-5c5a4a3a2a1a¤tPage=1&pe
|
||||
"originalReleaseYear": 1954,
|
||||
"reReleaseDate": "2001-09-06",
|
||||
"reReleaseYear": 2001,
|
||||
"releaseCountry": "uk",
|
||||
"releaseCountry": "GB",
|
||||
"releaseVersion": "50th Anniversary Edition"
|
||||
},
|
||||
"genres": [
|
||||
@@ -343,6 +346,7 @@ GET api/v1/books?libraryId=3b3a19f3-1f5a-4d5a-9a3a-5c5a4a3a2a1a¤tPage=1&pe
|
||||
"contributors": [],
|
||||
"ratings": [
|
||||
{
|
||||
"source": "GoogleBooks",
|
||||
"value": 4.36,
|
||||
"maxValue": 5,
|
||||
"voteCount": 2345678
|
||||
@@ -367,12 +371,11 @@ GET api/v1/books?libraryId=3b3a19f3-1f5a-4d5a-9a3a-5c5a4a3a2a1a¤tPage=1&pe
|
||||
#### Get Books Lite Request
|
||||
|
||||
```js
|
||||
GET api/v1/books/lite?libraryId=3b3a19f3-1f5a-4d5a-9a3a-5c5a4a3a2a1a¤tPage=1&perPage=10&searchTerm=fellowship&filterAlphaKey=f&ignoreThePrefixForAlphaPicker=true&sortBy=title&sortOrder=Ascending
|
||||
GET api/v1/libraries/3b3a19f3-1f5a-4d5a-9a3a-5c5a4a3a2a1a/books/lite?currentPage=1&perPage=10&searchTerm=fellowship&filterAlphaKey=f&ignoreThePrefixForAlphaPicker=true&sortBy=title&sortOrder=Ascending
|
||||
```
|
||||
|
||||
| Query Parameter | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| `libraryId` | `string` (GUID) | Required. The Id of the media library whose books are retrieved. |
|
||||
| `currentPage` | `int` | Optional. The page of results to retrieve. |
|
||||
| `perPage` | `int` | Optional. The maximum number of books to retrieve per page. |
|
||||
| `searchTerm` | `string` | Optional. The search term used to filter results. |
|
||||
@@ -404,12 +407,217 @@ GET api/v1/books/lite?libraryId=3b3a19f3-1f5a-4d5a-9a3a-5c5a4a3a2a1a¤tPage
|
||||
}
|
||||
```
|
||||
|
||||
### Update Book
|
||||
|
||||
#### Update Book Request
|
||||
|
||||
```js
|
||||
PUT api/v1/libraries/3b3a19f3-1f5a-4d5a-9a3a-5c5a4a3a2a1a/books/{bookId}
|
||||
```
|
||||
|
||||
```json
|
||||
{
|
||||
"metadata": {
|
||||
"title": "The Fellowship of the Ring",
|
||||
"originalTitle": "The Fellowship of the Ring",
|
||||
"description": "The first part of J.R.R. Tolkien's epic adventure The Lord of the Rings. In a sleepy village in the Shire, young Frodo Baggins finds himself faced with an immense task, as his elderly cousin Bilbo entrusts the Ring to his care. Frodo must leave his home and make a perilous journey across Middle-earth to the Cracks of Doom, there to destroy the Ring and foil the Dark Lord in his evil purpose.",
|
||||
"releaseInfo": {
|
||||
"originalReleaseDate": "1954-07-29",
|
||||
"originalReleaseYear": 1954,
|
||||
"reReleaseDate": "2001-09-06",
|
||||
"reReleaseYear": 2001,
|
||||
"releaseCountry": "GB",
|
||||
"releaseVersion": "50th Anniversary Edition"
|
||||
},
|
||||
"genres": [
|
||||
{ "name": "fantasy" },
|
||||
{ "name": "adventure" },
|
||||
{ "name": "classic" }
|
||||
],
|
||||
"tags": [
|
||||
{ "name": "epic fantasy" },
|
||||
{ "name": "quest" },
|
||||
{ "name": "middle-earth" }
|
||||
],
|
||||
"language": {
|
||||
"languageCode": "en",
|
||||
"languageName": "English",
|
||||
"nativeName": "English"
|
||||
},
|
||||
"originalLanguage": {
|
||||
"languageCode": "en",
|
||||
"languageName": "English",
|
||||
"nativeName": "English"
|
||||
},
|
||||
"publisher": "Houghton Mifflin",
|
||||
"pageCount": 398
|
||||
},
|
||||
"format": "Paperback",
|
||||
"edition": "50th Anniversary Edition",
|
||||
"volumeNumber": 1,
|
||||
"series": {
|
||||
"title": "The Lord of the Rings"
|
||||
},
|
||||
"asin": "B007978NPG",
|
||||
"goodreadsId": "3",
|
||||
"lccn": "54009621",
|
||||
"oclcNumber": "ocm00012345",
|
||||
"openLibraryId": "OL7603910M",
|
||||
"libraryThingId": "3203347",
|
||||
"googleBooksId": "aWZzLPhY4o0C",
|
||||
"barnesAndNobleId": "1100307790",
|
||||
"appleBooksId": "id395211",
|
||||
"isbns": [
|
||||
{
|
||||
"value": "0395272238",
|
||||
"format": "Isbn10"
|
||||
},
|
||||
{
|
||||
"value": "9780395272237",
|
||||
"format": "Isbn13"
|
||||
}
|
||||
],
|
||||
"contributors": [
|
||||
{
|
||||
"contributorId": "6a3f0c2d-1b4e-4f5a-8c6d-9e0f1a2b3c4d",
|
||||
"role": "Author"
|
||||
},
|
||||
{
|
||||
"contributorId": "7b4e1d3f-2c5a-4e6b-9d7e-0f1a2b3c4d5e",
|
||||
"role": "Illustrator"
|
||||
}
|
||||
],
|
||||
"ratings": [
|
||||
{
|
||||
"source": "GoogleBooks",
|
||||
"value": 4.36,
|
||||
"maxValue": 5,
|
||||
"voteCount": 2345678
|
||||
},
|
||||
{
|
||||
"source": "Amazon",
|
||||
"value": 4.7,
|
||||
"maxValue": 5,
|
||||
"voteCount": 87654
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
#### Update Book Response
|
||||
|
||||
```js
|
||||
200 Ok
|
||||
```
|
||||
|
||||
```json
|
||||
{
|
||||
"id": "32b336e8-dafc-4a08-9dec-9454e66dd55d",
|
||||
"libraryId": "3b3a19f3-1f5a-4d5a-9a3a-5c5a4a3a2a1a",
|
||||
"path": "/media/libraries/books/the-fellowship-of-the-ring.pdf",
|
||||
"metadata": {
|
||||
"publisher": "Houghton Mifflin",
|
||||
"pageCount": 398,
|
||||
"title": "The Fellowship of the Ring",
|
||||
"originalTitle": "The Fellowship of the Ring",
|
||||
"description": "The first part of J.R.R. Tolkien's epic adventure The Lord of the Rings. In a sleepy village in the Shire, young Frodo Baggins finds himself faced with an immense task, as his elderly cousin Bilbo entrusts the Ring to his care. Frodo must leave his home and make a perilous journey across Middle-earth to the Cracks of Doom, there to destroy the Ring and foil the Dark Lord in his evil purpose.",
|
||||
"releaseInfo": {
|
||||
"originalReleaseDate": "1954-07-29",
|
||||
"originalReleaseYear": 1954,
|
||||
"reReleaseDate": "2001-09-06",
|
||||
"reReleaseYear": 2001,
|
||||
"releaseCountry": "GB",
|
||||
"releaseVersion": "50th Anniversary Edition"
|
||||
},
|
||||
"language": {
|
||||
"languageCode": "en",
|
||||
"languageName": "English",
|
||||
"nativeName": "English"
|
||||
},
|
||||
"originalLanguage": {
|
||||
"languageCode": "en",
|
||||
"languageName": "English",
|
||||
"nativeName": "English"
|
||||
},
|
||||
"tags": [
|
||||
{
|
||||
"name": "epic fantasy"
|
||||
},
|
||||
{
|
||||
"name": "quest"
|
||||
},
|
||||
{
|
||||
"name": "middle-earth"
|
||||
}
|
||||
],
|
||||
"genres": [
|
||||
{
|
||||
"name": "fantasy"
|
||||
},
|
||||
{
|
||||
"name": "adventure"
|
||||
},
|
||||
{
|
||||
"name": "classic"
|
||||
}
|
||||
]
|
||||
},
|
||||
"format": "Paperback",
|
||||
"edition": "50th Anniversary Edition",
|
||||
"volumeNumber": 1,
|
||||
"series": null,
|
||||
"asin": "B007978NPG",
|
||||
"goodreadsId": "3",
|
||||
"lccn": "54009621",
|
||||
"oclcNumber": "ocm00012345",
|
||||
"openLibraryId": "OL7603910M",
|
||||
"libraryThingId": "3203347",
|
||||
"googleBooksId": "aWZzLPhY4o0C",
|
||||
"barnesAndNobleId": "1100307790",
|
||||
"appleBooksId": "id395211",
|
||||
"isbns": [
|
||||
{
|
||||
"value": "0395272238",
|
||||
"format": "Isbn10"
|
||||
},
|
||||
{
|
||||
"value": "9780395272237",
|
||||
"format": "Isbn13"
|
||||
}
|
||||
],
|
||||
"contributors": [
|
||||
{ "contributorId": "6a3f0c2d-1b4e-4f5a-8c6d-9e0f1a2b3c4d", "role": "Author" },
|
||||
{ "contributorId": "7b4e1d3f-2c5a-4e6b-9d7e-0f1a2b3c4d5e", "role": "Illustrator" }
|
||||
],
|
||||
"ratings": [
|
||||
{
|
||||
"source": "GoogleBooks",
|
||||
"value": 4.36,
|
||||
"maxValue": 5,
|
||||
"voteCount": 2345678
|
||||
},
|
||||
{
|
||||
"source": "Amazon",
|
||||
"value": 4.7,
|
||||
"maxValue": 5,
|
||||
"voteCount": 87654
|
||||
}
|
||||
],
|
||||
"metadataStatus": "Enriched",
|
||||
"lastMetadataUpdateUtc": "2025-01-01T12:00:00.0000000Z",
|
||||
"metadataProvider": "GoogleBooks",
|
||||
"createdOnUtc": "2025-01-01T12:00:00.0000000Z",
|
||||
"updatedOnUtc": "2025-02-01T12:00:00.0000000Z",
|
||||
"coverPath": "/media/books/books-3f2504e0-4f89-41d3-9a0c-0305e82c3301/The Lord of the Rings-2b0e5f5a-0b3f-4b7e-8f4a-8c9e3d2f5a6b/cover.jpg"
|
||||
}
|
||||
```
|
||||
|
||||
### Get Reading Availability
|
||||
|
||||
#### Get Reading Availability Request
|
||||
|
||||
```js
|
||||
GET api/v1/books/{bookId}/reading/availability
|
||||
GET api/v1/libraries/3b3a19f3-1f5a-4d5a-9a3a-5c5a4a3a2a1a/books/{bookId}/reading/availability
|
||||
```
|
||||
|
||||
Reports whether the book identified by `bookId` can be opened for reading: the book reader that supports the format of the book is resolved and its enablement for the media library of the book is checked, without extracting the book. When the book cannot be read, the response carries the code of the error preventing it, so the client can tell a missing book reader apart from a disabled one.
|
||||
@@ -434,7 +642,7 @@ Reports whether the book identified by `bookId` can be opened for reading: the b
|
||||
#### Get Reading Manifest Request
|
||||
|
||||
```js
|
||||
GET api/v1/books/{bookId}/reading/manifest
|
||||
GET api/v1/libraries/3b3a19f3-1f5a-4d5a-9a3a-5c5a4a3a2a1a/books/{bookId}/reading/manifest
|
||||
```
|
||||
|
||||
Opens the book identified by `bookId` for reading by extracting its contents through the book reader that is enabled for its media library, and returns the reading manifest: the title and author of the book, its hierarchical table of contents, its ordered spine of reading sections, the keys of its resources, and whether it has extractable text content. A scanned book, whose pages are only images, has no text content and is displayed as page images.
|
||||
@@ -485,7 +693,7 @@ Opens the book identified by `bookId` for reading by extracting its contents thr
|
||||
#### Get Reading Section Request
|
||||
|
||||
```js
|
||||
GET api/v1/books/{bookId}/reading/sections/{locationRef}
|
||||
GET api/v1/libraries/3b3a19f3-1f5a-4d5a-9a3a-5c5a4a3a2a1a/books/{bookId}/reading/sections/{locationRef}
|
||||
```
|
||||
|
||||
Returns the reading section identified by `locationRef` of the book identified by `bookId`. The section content is sanitized by the host before it is served, and its references to the resources of the book are resolved by the client through the resource endpoint. The `locationRef` of a section is taken from the spine of the reading manifest of the book.
|
||||
@@ -509,7 +717,7 @@ Returns the reading section identified by `locationRef` of the book identified b
|
||||
#### Get Reading Resource Request
|
||||
|
||||
```js
|
||||
GET api/v1/books/{bookId}/reading/resources/{resourceKey}
|
||||
GET api/v1/libraries/3b3a19f3-1f5a-4d5a-9a3a-5c5a4a3a2a1a/books/{bookId}/reading/resources/{resourceKey}
|
||||
```
|
||||
|
||||
Returns the binary resource identified by `resourceKey` of the book identified by `bookId` (for example an image, a font, or a stylesheet of the book, or a page image of a scanned PDF that is rendered on demand). The `resourceKey` of a resource is taken from the reading manifest of the book.
|
||||
|
||||
Reference in new issue
Block a user