diff --git a/docs/openapi.json b/docs/openapi.json index 444f776ab..74fa7c1f2 100644 --- a/docs/openapi.json +++ b/docs/openapi.json @@ -18,11 +18,6 @@ "type": "http", "scheme": "bearer" } - }, - "responses": { - "ok200": { - "description": "OK" - } } }, "security": [ @@ -31,837 +26,11 @@ } ], "paths": { - "/api/authors/{id}": { - "get": { - "operationId": "getAuthorById", - "summary": "Get a single author by ID on server", - "tags": [ - "Authors" - ], - "parameters": [ - { - "name": "id", - "in": "path", - "description": "Author ID", - "required": true, - "schema": { - "type": "string", - "description": "The ID of the author.", - "format": "uuid", - "example": "e4bb1afb-4a4f-4dd6-8be0-e615d233185b" - } - }, - { - "name": "include", - "in": "query", - "description": "A comma separated list of what to include with the author. The options are `items` and `series`. `series` will only have an effect if `items` is included.", - "required": false, - "schema": { - "type": "string", - "example": "items" - }, - "examples": { - "empty": { - "summary": "Do not return library items", - "value": "" - }, - "itemOnly": { - "summary": "Only return library items", - "value": "items" - }, - "itemsAndSeries": { - "summary": "Return library items and series", - "value": "items,series" - } - } - }, - { - "name": "library", - "in": "query", - "description": "The ID of the library to to include filter included items from.", - "required": false, - "schema": { - "type": "string", - "description": "The ID of the library.", - "format": "uuid", - "example": "e4bb1afb-4a4f-4dd6-8be0-e615d233185b" - } - } - ], - "responses": { - "200": { - "description": "getAuthorById OK", - "content": { - "application/json": { - "schema": { - "oneOf": [ - { - "description": "An author object which includes a description and image path.", - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "The ID of the author.", - "format": "uuid", - "example": "e4bb1afb-4a4f-4dd6-8be0-e615d233185b" - }, - "asin": { - "type": "string", - "description": "The Audible identifier (ASIN) of the author. Will be null if unknown. Not the Amazon identifier.", - "nullable": true, - "example": "B000APZOQA" - }, - "name": { - "description": "The name of the author.", - "type": "string", - "example": "Terry Goodkind" - }, - "description": { - "description": "A description of the author. Will be null if there is none.", - "type": "string", - "nullable": true, - "example": "Terry Goodkind is a #1 New York Times Bestselling Author and creator of the critically acclaimed masterwork,\n‘The Sword of Truth’. He has written 30+ major, bestselling novels, has been published in more than 20\nlanguages world-wide, and has sold more than 26 Million books. ‘The Sword of Truth’ is a revered literary\ntour de force, comprised of 17 volumes, borne from over 25 years of dedicated writing. Terry Goodkind's\nbrilliant books are character-driven stories, with a focus on the complexity of the human psyche. Goodkind\nhas an uncanny grasp for crafting compelling stories about people like you and me, trapped in terrifying\nsituations.\n" - }, - "imagePath": { - "description": "The absolute path for the author image located in the `metadata/` directory. Will be null if there is no image.", - "type": "string", - "nullable": true, - "example": "/metadata/authors/aut_bxxbyjiptmgb56yzoz.jpg" - }, - "addedAt": { - "type": "integer", - "description": "The time (in ms since POSIX epoch) when added to the server.", - "example": 1633522963509 - }, - "updatedAt": { - "type": "integer", - "description": "The time (in ms since POSIX epoch) when last updated.", - "example": 1633522963509 - } - } - }, - { - "type": "object", - "description": "The author schema with an array of items they are associated with.", - "allOf": [ - { - "description": "An author object which includes a description and image path.", - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "The ID of the author.", - "format": "uuid", - "example": "e4bb1afb-4a4f-4dd6-8be0-e615d233185b" - }, - "asin": { - "type": "string", - "description": "The Audible identifier (ASIN) of the author. Will be null if unknown. Not the Amazon identifier.", - "nullable": true, - "example": "B000APZOQA" - }, - "name": { - "description": "The name of the author.", - "type": "string", - "example": "Terry Goodkind" - }, - "description": { - "description": "A description of the author. Will be null if there is none.", - "type": "string", - "nullable": true, - "example": "Terry Goodkind is a #1 New York Times Bestselling Author and creator of the critically acclaimed masterwork,\n‘The Sword of Truth’. He has written 30+ major, bestselling novels, has been published in more than 20\nlanguages world-wide, and has sold more than 26 Million books. ‘The Sword of Truth’ is a revered literary\ntour de force, comprised of 17 volumes, borne from over 25 years of dedicated writing. Terry Goodkind's\nbrilliant books are character-driven stories, with a focus on the complexity of the human psyche. Goodkind\nhas an uncanny grasp for crafting compelling stories about people like you and me, trapped in terrifying\nsituations.\n" - }, - "imagePath": { - "description": "The absolute path for the author image located in the `metadata/` directory. Will be null if there is no image.", - "type": "string", - "nullable": true, - "example": "/metadata/authors/aut_bxxbyjiptmgb56yzoz.jpg" - }, - "addedAt": { - "type": "integer", - "description": "The time (in ms since POSIX epoch) when added to the server.", - "example": 1633522963509 - }, - "updatedAt": { - "type": "integer", - "description": "The time (in ms since POSIX epoch) when last updated.", - "example": 1633522963509 - } - } - }, - { - "type": "object", - "properties": { - "libraryItems": { - "description": "The items associated with the author", - "type": "array" - } - } - } - ] - }, - { - "type": "object", - "description": "The author schema with an array of items and series they are associated with.", - "allOf": [ - { - "type": "object", - "description": "The author schema with an array of items they are associated with.", - "allOf": [ - { - "description": "An author object which includes a description and image path.", - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "The ID of the author.", - "format": "uuid", - "example": "e4bb1afb-4a4f-4dd6-8be0-e615d233185b" - }, - "asin": { - "type": "string", - "description": "The Audible identifier (ASIN) of the author. Will be null if unknown. Not the Amazon identifier.", - "nullable": true, - "example": "B000APZOQA" - }, - "name": { - "description": "The name of the author.", - "type": "string", - "example": "Terry Goodkind" - }, - "description": { - "description": "A description of the author. Will be null if there is none.", - "type": "string", - "nullable": true, - "example": "Terry Goodkind is a #1 New York Times Bestselling Author and creator of the critically acclaimed masterwork,\n‘The Sword of Truth’. He has written 30+ major, bestselling novels, has been published in more than 20\nlanguages world-wide, and has sold more than 26 Million books. ‘The Sword of Truth’ is a revered literary\ntour de force, comprised of 17 volumes, borne from over 25 years of dedicated writing. Terry Goodkind's\nbrilliant books are character-driven stories, with a focus on the complexity of the human psyche. Goodkind\nhas an uncanny grasp for crafting compelling stories about people like you and me, trapped in terrifying\nsituations.\n" - }, - "imagePath": { - "description": "The absolute path for the author image located in the `metadata/` directory. Will be null if there is no image.", - "type": "string", - "nullable": true, - "example": "/metadata/authors/aut_bxxbyjiptmgb56yzoz.jpg" - }, - "addedAt": { - "type": "integer", - "description": "The time (in ms since POSIX epoch) when added to the server.", - "example": 1633522963509 - }, - "updatedAt": { - "type": "integer", - "description": "The time (in ms since POSIX epoch) when last updated.", - "example": 1633522963509 - } - } - }, - { - "type": "object", - "properties": { - "libraryItems": { - "description": "The items associated with the author", - "type": "array" - } - } - } - ] - }, - { - "type": "object", - "properties": { - "series": { - "description": "The series associated with the author", - "type": "array", - "items": { - "type": "object", - "description": "Series and the included library items that an author has written.", - "properties": { - "id": { - "type": "string", - "description": "The ID of the series.", - "format": "uuid", - "example": "e4bb1afb-4a4f-4dd6-8be0-e615d233185b" - }, - "name": { - "description": "The name of the series.", - "type": "string", - "example": "Sword of Truth" - }, - "items": { - "description": "The items in the series. Each library item's media's metadata will have a `series` attribute, a `Series Sequence`, which is the matching series.", - "type": "array", - "items": {} - } - } - } - } - } - } - ] - } - ] - } - } - } - }, - "404": { - "description": "Author not found.", - "content": { - "text/html": { - "schema": { - "type": "string", - "example": "Not found" - } - } - } - } - } - }, - "patch": { - "operationId": "updateAuthorById", - "summary": "Update a single author by ID on server. This endpoint will merge two authors if the new author name matches another author in the database.", - "tags": [ - "Authors" - ], - "parameters": [ - { - "name": "id", - "in": "path", - "description": "Author ID", - "required": true, - "schema": { - "type": "string", - "description": "The ID of the author.", - "format": "uuid", - "example": "e4bb1afb-4a4f-4dd6-8be0-e615d233185b" - } - }, - { - "name": "asin", - "in": "query", - "description": "The Audible Identifier (ASIN).", - "required": false, - "schema": { - "type": "string", - "description": "The Audible identifier (ASIN) of the author. Will be null if unknown. Not the Amazon identifier.", - "nullable": true, - "example": "B000APZOQA" - } - }, - { - "name": "name", - "in": "query", - "description": "The new name of the author.", - "required": false, - "schema": { - "description": "The name of the author.", - "type": "string", - "example": "Terry Goodkind" - } - }, - { - "name": "description", - "in": "query", - "description": "The new description of the author.", - "required": false, - "schema": { - "type": "string", - "nullable": true, - "example": "Terry Goodkind is a" - } - }, - { - "name": "imagePath", - "in": "query", - "description": "The new absolute path for the author image.", - "required": false, - "schema": { - "type": "string", - "nullable": true, - "example": "/metadata/authors/aut_z3leimgybl7uf3y4ab.jpg" - } - } - ], - "responses": { - "200": { - "description": "updateAuthorById OK", - "content": { - "application/json": { - "schema": { - "allOf": [ - { - "description": "An author object which includes a description and image path.", - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "The ID of the author.", - "format": "uuid", - "example": "e4bb1afb-4a4f-4dd6-8be0-e615d233185b" - }, - "asin": { - "type": "string", - "description": "The Audible identifier (ASIN) of the author. Will be null if unknown. Not the Amazon identifier.", - "nullable": true, - "example": "B000APZOQA" - }, - "name": { - "description": "The name of the author.", - "type": "string", - "example": "Terry Goodkind" - }, - "description": { - "description": "A description of the author. Will be null if there is none.", - "type": "string", - "nullable": true, - "example": "Terry Goodkind is a #1 New York Times Bestselling Author and creator of the critically acclaimed masterwork,\n‘The Sword of Truth’. He has written 30+ major, bestselling novels, has been published in more than 20\nlanguages world-wide, and has sold more than 26 Million books. ‘The Sword of Truth’ is a revered literary\ntour de force, comprised of 17 volumes, borne from over 25 years of dedicated writing. Terry Goodkind's\nbrilliant books are character-driven stories, with a focus on the complexity of the human psyche. Goodkind\nhas an uncanny grasp for crafting compelling stories about people like you and me, trapped in terrifying\nsituations.\n" - }, - "imagePath": { - "description": "The absolute path for the author image located in the `metadata/` directory. Will be null if there is no image.", - "type": "string", - "nullable": true, - "example": "/metadata/authors/aut_bxxbyjiptmgb56yzoz.jpg" - }, - "addedAt": { - "type": "integer", - "description": "The time (in ms since POSIX epoch) when added to the server.", - "example": 1633522963509 - }, - "updatedAt": { - "type": "integer", - "description": "The time (in ms since POSIX epoch) when last updated.", - "example": 1633522963509 - } - } - }, - { - "description": "Whether the author was updated without errors. Will not exist if author was merged.", - "type": "boolean", - "nullable": true - }, - { - "type": "object", - "properties": { - "merged": { - "description": "Will only exist and be `true` if the author was merged with another author", - "type": "boolean", - "nullable": true - } - } - } - ] - } - } - } - }, - "404": { - "description": "Author not found.", - "content": { - "text/html": { - "schema": { - "type": "string", - "example": "Not found" - } - } - } - } - } - }, - "delete": { - "operationId": "deleteAuthorById", - "summary": "Delete a single author by ID on server and remove author from all books.", - "tags": [ - "Authors" - ], - "parameters": [ - { - "name": "id", - "in": "path", - "description": "Author ID", - "required": true, - "schema": { - "type": "string", - "description": "The ID of the author.", - "format": "uuid", - "example": "e4bb1afb-4a4f-4dd6-8be0-e615d233185b" - } - } - ], - "responses": { - "200": { - "$ref": "#/components/responses/ok200" - }, - "404": { - "description": "Author not found.", - "content": { - "text/html": { - "schema": { - "type": "string", - "example": "Not found" - } - } - } - } - } - } - }, - "/api/authors/{id}/image": { - "post": { - "operationId": "setAuthorImageById", - "summary": "Set an author image using a provided URL.", - "tags": [ - "Authors" - ], - "parameters": [ - { - "name": "id", - "in": "path", - "description": "Author ID", - "required": true, - "schema": { - "type": "string", - "description": "The ID of the author.", - "format": "uuid", - "example": "e4bb1afb-4a4f-4dd6-8be0-e615d233185b" - } - }, - { - "name": "url", - "in": "query", - "description": "The URL of the image to add to the server", - "required": true, - "schema": { - "type": "string", - "format": "uri", - "example": "https://images-na.ssl-images-amazon.com/images/I/51NoQTm33OL.__01_SX120_CR0,0,120,120__.jpg" - } - } - ], - "responses": { - "200": { - "description": "setAuthorImageById OK", - "content": { - "application/json": { - "schema": { - "oneOf": [ - { - "description": "An author object which includes a description and image path.", - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "The ID of the author.", - "format": "uuid", - "example": "e4bb1afb-4a4f-4dd6-8be0-e615d233185b" - }, - "asin": { - "type": "string", - "description": "The Audible identifier (ASIN) of the author. Will be null if unknown. Not the Amazon identifier.", - "nullable": true, - "example": "B000APZOQA" - }, - "name": { - "description": "The name of the author.", - "type": "string", - "example": "Terry Goodkind" - }, - "description": { - "description": "A description of the author. Will be null if there is none.", - "type": "string", - "nullable": true, - "example": "Terry Goodkind is a #1 New York Times Bestselling Author and creator of the critically acclaimed masterwork,\n‘The Sword of Truth’. He has written 30+ major, bestselling novels, has been published in more than 20\nlanguages world-wide, and has sold more than 26 Million books. ‘The Sword of Truth’ is a revered literary\ntour de force, comprised of 17 volumes, borne from over 25 years of dedicated writing. Terry Goodkind's\nbrilliant books are character-driven stories, with a focus on the complexity of the human psyche. Goodkind\nhas an uncanny grasp for crafting compelling stories about people like you and me, trapped in terrifying\nsituations.\n" - }, - "imagePath": { - "description": "The absolute path for the author image located in the `metadata/` directory. Will be null if there is no image.", - "type": "string", - "nullable": true, - "example": "/metadata/authors/aut_bxxbyjiptmgb56yzoz.jpg" - }, - "addedAt": { - "type": "integer", - "description": "The time (in ms since POSIX epoch) when added to the server.", - "example": 1633522963509 - }, - "updatedAt": { - "type": "integer", - "description": "The time (in ms since POSIX epoch) when last updated.", - "example": 1633522963509 - } - } - } - ] - } - } - } - }, - "404": { - "description": "Author not found.", - "content": { - "text/html": { - "schema": { - "type": "string", - "example": "Not found" - } - } - } - } - } - }, - "delete": { - "operationId": "deleteAuthorImageById", - "summary": "Delete an author image from the server and remove the image from the database.", - "tags": [ - "Authors" - ], - "parameters": [ - { - "name": "id", - "in": "path", - "description": "Author ID", - "required": true, - "schema": { - "type": "string", - "description": "The ID of the author.", - "format": "uuid", - "example": "e4bb1afb-4a4f-4dd6-8be0-e615d233185b" - } - } - ], - "responses": { - "200": { - "$ref": "#/components/responses/ok200" - }, - "404": { - "description": "Author not found.", - "content": { - "text/html": { - "schema": { - "type": "string", - "example": "Not found" - } - } - } - } - } - }, - "patch": { - "operationId": "getAuthorImageById", - "summary": "Return the author image by author ID.", - "tags": [ - "Authors" - ], - "parameters": [ - { - "name": "id", - "in": "path", - "description": "Author ID", - "required": true, - "schema": { - "type": "string", - "description": "The ID of the author.", - "format": "uuid", - "example": "e4bb1afb-4a4f-4dd6-8be0-e615d233185b" - } - }, - { - "name": "width", - "in": "query", - "description": "The requested width of image in pixels.", - "schema": { - "type": "integer", - "default": 400, - "example": 400 - }, - "example": 400 - }, - { - "name": "height", - "in": "query", - "description": "The requested height of image in pixels. If `null`, the height is scaled to maintain aspect ratio based on the requested width.", - "schema": { - "type": "integer", - "nullable": true, - "default": null, - "example": 600 - }, - "examples": { - "scaleHeight": { - "summary": "Scale height with width", - "value": null - }, - "fixedHeight": { - "summary": "Force height of image", - "value": 600 - } - } - }, - { - "name": "format", - "in": "query", - "description": "The requested output format.", - "schema": { - "type": "string", - "default": "jpeg", - "example": "webp" - } - }, - { - "name": "raw", - "in": "query", - "description": "Return the raw image without scaling if true.", - "schema": { - "type": "boolean", - "default": false - } - } - ], - "responses": { - "200": { - "description": "getAuthorImageById OK", - "content": { - "image/*": { - "schema": { - "type": "string", - "format": "binary" - } - } - } - }, - "404": { - "description": "Author not found.", - "content": { - "text/html": { - "schema": { - "type": "string", - "example": "Not found" - } - } - } - } - } - } - }, - "/api/authors/{id}/match": { - "post": { - "operationId": "matchAuthorById", - "summary": "Match the author against Audible using quick match. Quick match updates the author's description and image (if no image already existed) with information from audible. Either `asin` or `q` must be provided, with `asin` taking priority if both are provided.", - "tags": [ - "Authors" - ], - "parameters": [ - { - "name": "id", - "in": "path", - "description": "Author ID", - "required": true, - "schema": { - "type": "string", - "description": "The ID of the author.", - "format": "uuid", - "example": "e4bb1afb-4a4f-4dd6-8be0-e615d233185b" - } - }, - { - "name": "asin", - "in": "query", - "description": "The Audible Identifier (ASIN).", - "required": false, - "schema": { - "type": "string", - "description": "The Audible identifier (ASIN) of the author. Will be null if unknown. Not the Amazon identifier.", - "nullable": true, - "example": "B000APZOQA" - } - }, - { - "name": "q", - "in": "query", - "description": "The name of the author to use for searching.", - "required": false, - "schema": { - "type": "string", - "example": "Terry Goodkind" - } - } - ], - "responses": { - "200": { - "description": "matchAuthorById OK", - "content": { - "application/json": { - "schema": { - "allOf": [ - { - "description": "An author object which includes a description and image path.", - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "The ID of the author.", - "format": "uuid", - "example": "e4bb1afb-4a4f-4dd6-8be0-e615d233185b" - }, - "asin": { - "type": "string", - "description": "The Audible identifier (ASIN) of the author. Will be null if unknown. Not the Amazon identifier.", - "nullable": true, - "example": "B000APZOQA" - }, - "name": { - "description": "The name of the author.", - "type": "string", - "example": "Terry Goodkind" - }, - "description": { - "description": "A description of the author. Will be null if there is none.", - "type": "string", - "nullable": true, - "example": "Terry Goodkind is a #1 New York Times Bestselling Author and creator of the critically acclaimed masterwork,\n‘The Sword of Truth’. He has written 30+ major, bestselling novels, has been published in more than 20\nlanguages world-wide, and has sold more than 26 Million books. ‘The Sword of Truth’ is a revered literary\ntour de force, comprised of 17 volumes, borne from over 25 years of dedicated writing. Terry Goodkind's\nbrilliant books are character-driven stories, with a focus on the complexity of the human psyche. Goodkind\nhas an uncanny grasp for crafting compelling stories about people like you and me, trapped in terrifying\nsituations.\n" - }, - "imagePath": { - "description": "The absolute path for the author image located in the `metadata/` directory. Will be null if there is no image.", - "type": "string", - "nullable": true, - "example": "/metadata/authors/aut_bxxbyjiptmgb56yzoz.jpg" - }, - "addedAt": { - "type": "integer", - "description": "The time (in ms since POSIX epoch) when added to the server.", - "example": 1633522963509 - }, - "updatedAt": { - "type": "integer", - "description": "The time (in ms since POSIX epoch) when last updated.", - "example": 1633522963509 - } - } - }, - { - "description": "Whether the author was updated without errors. Will not exist if author was merged.", - "type": "boolean", - "nullable": true - } - ] - } - } - } - }, - "404": { - "description": "Author not found.", - "content": { - "text/html": { - "schema": { - "type": "string", - "example": "Not found" - } - } - } - } - } - } - }, "/api/libraries": { "get": { "operationId": "getLibraries", "summary": "Get all libraries on server", + "description": "Get all libraries on server.", "tags": [ "Libraries" ], @@ -881,133 +50,46 @@ "post": { "operationId": "createLibrary", "summary": "Create a new library on server", + "description": "Create a new library on server.", "tags": [ "Libraries" ], - "parameters": [ - { - "name": "name", - "in": "query", - "description": "The name of the library.", - "required": true, - "schema": { - "type": "string", - "example": "My Audiobooks" - } - }, - { - "name": "folders", - "in": "query", - "description": "The folders of the library. Only specify the fullPath.", - "required": true, - "schema": { - "type": "array", - "items": { + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { "type": "object", - "description": "Folder used in library", "properties": { - "id": { - "type": "string", - "description": "The ID of the folder.", - "format": "uuid", - "example": "e4bb1afb-4a4f-4dd6-8be0-e615d233185b" + "name": { + "description": "The name of the library." }, - "fullPath": { - "description": "The path on the server for the folder. (Read Only)", - "type": "string", - "example": "/podcasts" + "folders": { + "description": "The folders of the library. Only specify the fullPath." }, - "libraryId": { - "type": "string", - "description": "The ID of the library.", - "format": "uuid", - "example": "e4bb1afb-4a4f-4dd6-8be0-e615d233185b" + "displayOrder": { + "description": "The display order of the library. Must be >= 1." }, - "addedAt": { - "type": "integer", - "description": "The time (in ms since POSIX epoch) when added to the server.", - "example": 1633522963509 + "icon": { + "description": "The icon of the library. See Library Icons for a list of possible icons." + }, + "mediaType": { + "description": "The type of media that the library contains. Must be `book` or `podcast`." + }, + "provider": { + "description": "Preferred metadata provider for the library. See Metadata Providers for a list of possible providers." + }, + "settings": { + "description": "The settings for the library." } } } } - }, - { - "name": "icon", - "in": "query", - "description": "The icon of the library. See Library Icons for a list of possible icons.", - "required": false, - "schema": { - "type": "string", - "example": "audiobookshelf" - } - }, - { - "name": "mediaType", - "in": "query", - "description": "The type of media that the library contains. Must be `book` or `podcast`.", - "required": false, - "schema": { - "type": "string", - "example": "book" - } - }, - { - "name": "provider", - "in": "query", - "description": "Preferred metadata provider for the library. See Metadata Providers for a list of possible providers.", - "required": false, - "schema": { - "type": "string", - "example": "audible" - } - }, - { - "name": "settings", - "in": "query", - "description": "The settings for the library.", - "required": false, - "schema": { - "description": "The settings for the library.", - "allOf": [ - { - "type": "object", - "properties": { - "coverAspectRatio": { - "description": "Whether the library should use square book covers. Must be 0 (for false) or 1 (for true).", - "type": "integer", - "example": 1 - }, - "disableWatcher": { - "description": "Whether to disable the folder watcher for the library.", - "type": "boolean", - "example": false - }, - "skipMatchingMediaWithAsin": { - "description": "Whether to skip matching books that already have an ASIN.", - "type": "boolean", - "example": false - }, - "skipMatchingMediaWithIsbn": { - "description": "Whether to skip matching books that already have an ISBN.", - "type": "boolean", - "example": false - }, - "autoScanCronExpression": { - "description": "The cron expression for when to automatically scan the library folders. If null, automatic scanning will be disabled.", - "type": "string", - "nullable": true, - "example": "0 0 0 * * *" - } - } - } - ] - } } - ], + }, "responses": { "200": { - "description": "createLibrary OK", + "description": "Library found.", "content": { "application/json": { "schema": { @@ -1060,6 +142,954 @@ } } } + }, + "404": { + "description": "Library not found.", + "content": { + "text/html": { + "schema": { + "type": "string", + "example": "Library not found." + } + } + } + } + } + } + }, + "/api/libraries/{id}": { + "parameters": [ + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + { + "type": "string", + "description": "The ID of the library.", + "format": "uuid", + "example": "e4bb1afb-4a4f-4dd6-8be0-e615d233185b" + } + ], + "get": { + "operationId": "getLibraryById", + "summary": "Get a single library by ID on server", + "description": "Get a single library by ID on server.", + "tags": [ + "Libraries" + ], + "responses": { + "200": { + "description": "Library found.", + "content": { + "application/json": { + "schema": { + "description": "A library object which includes either books or podcasts.", + "type": "object", + "properties": { + "id": { + "$ref": "#/components/schemas/libraryId" + }, + "name": { + "$ref": "#/components/schemas/libraryName" + }, + "folders": { + "description": "The folders that belong to the library.", + "type": "array", + "items": { + "$ref": "./Folder.yaml#/components/schemas/folder" + } + }, + "displayOrder": { + "description": "Display position of the library in the list of libraries. Must be >= 1.", + "type": "integer", + "example": 1 + }, + "icon": { + "description": "The selected icon for the library. See Library Icons for a list of possible icons.", + "type": "string", + "example": "audiobookshelf" + }, + "mediaType": { + "description": "The type of media that the library contains. Will be `book` or `podcast`. (Read Only)", + "type": "string", + "example": "book" + }, + "provider": { + "description": "Preferred metadata provider for the library. See Metadata Providers for a list of possible providers.", + "type": "string", + "example": "audible" + }, + "settings": { + "$ref": "#/components/schemas/librarySettings" + }, + "createdAt": { + "$ref": "../schemas.yaml#/components/schemas/createdAt" + }, + "lastUpdate": { + "$ref": "../schemas.yaml#/components/schemas/updatedAt" + } + } + } + } + } + }, + "404": { + "description": "Library not found.", + "content": { + "text/html": { + "schema": { + "type": "string", + "example": "Library not found." + } + } + } + } + } + }, + "patch": { + "operationId": "updateLibraryById", + "summary": "Update a single library by ID on server", + "description": "Update a single library by ID on server.", + "tags": [ + "Libraries" + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "description": "The name of the library." + }, + "folders": { + "description": "The folders of the library. Only specify the fullPath." + }, + "displayOrder": { + "description": "The display order of the library. Must be >= 1." + }, + "icon": { + "description": "The icon of the library. See Library Icons for a list of possible icons." + }, + "mediaType": { + "description": "The type of media that the library contains. Must be `book` or `podcast`." + }, + "provider": { + "description": "Preferred metadata provider for the library. See Metadata Providers for a list of possible providers." + }, + "settings": { + "description": "The settings for the library." + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Library found.", + "content": { + "application/json": { + "schema": { + "description": "A library object which includes either books or podcasts.", + "type": "object", + "properties": { + "id": { + "$ref": "#/components/schemas/libraryId" + }, + "name": { + "$ref": "#/components/schemas/libraryName" + }, + "folders": { + "description": "The folders that belong to the library.", + "type": "array", + "items": { + "$ref": "./Folder.yaml#/components/schemas/folder" + } + }, + "displayOrder": { + "description": "Display position of the library in the list of libraries. Must be >= 1.", + "type": "integer", + "example": 1 + }, + "icon": { + "description": "The selected icon for the library. See Library Icons for a list of possible icons.", + "type": "string", + "example": "audiobookshelf" + }, + "mediaType": { + "description": "The type of media that the library contains. Will be `book` or `podcast`. (Read Only)", + "type": "string", + "example": "book" + }, + "provider": { + "description": "Preferred metadata provider for the library. See Metadata Providers for a list of possible providers.", + "type": "string", + "example": "audible" + }, + "settings": { + "$ref": "#/components/schemas/librarySettings" + }, + "createdAt": { + "$ref": "../schemas.yaml#/components/schemas/createdAt" + }, + "lastUpdate": { + "$ref": "../schemas.yaml#/components/schemas/updatedAt" + } + } + } + } + } + }, + "404": { + "description": "Library not found.", + "content": { + "text/html": { + "schema": { + "type": "string", + "example": "Library not found." + } + } + } + } + } + }, + "delete": { + "operationId": "deleteLibraryById", + "summary": "Delete a single library by ID on server", + "description": "Delete a single library by ID on server and return the deleted object.", + "tags": [ + "Libraries" + ], + "responses": { + "200": { + "description": "Library found.", + "content": { + "application/json": { + "schema": { + "description": "A library object which includes either books or podcasts.", + "type": "object", + "properties": { + "id": { + "$ref": "#/components/schemas/libraryId" + }, + "name": { + "$ref": "#/components/schemas/libraryName" + }, + "folders": { + "description": "The folders that belong to the library.", + "type": "array", + "items": { + "$ref": "./Folder.yaml#/components/schemas/folder" + } + }, + "displayOrder": { + "description": "Display position of the library in the list of libraries. Must be >= 1.", + "type": "integer", + "example": 1 + }, + "icon": { + "description": "The selected icon for the library. See Library Icons for a list of possible icons.", + "type": "string", + "example": "audiobookshelf" + }, + "mediaType": { + "description": "The type of media that the library contains. Will be `book` or `podcast`. (Read Only)", + "type": "string", + "example": "book" + }, + "provider": { + "description": "Preferred metadata provider for the library. See Metadata Providers for a list of possible providers.", + "type": "string", + "example": "audible" + }, + "settings": { + "$ref": "#/components/schemas/librarySettings" + }, + "createdAt": { + "$ref": "../schemas.yaml#/components/schemas/createdAt" + }, + "lastUpdate": { + "$ref": "../schemas.yaml#/components/schemas/updatedAt" + } + } + } + } + } + }, + "404": { + "description": "Library not found.", + "content": { + "text/html": { + "schema": { + "type": "string", + "example": "Library not found." + } + } + } + } + } + } + }, + "/api/authors/{id}": { + "get": { + "parameters": [ + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + { + "type": "string", + "description": "The ID of the author.", + "format": "uuid", + "example": "e4bb1afb-4a4f-4dd6-8be0-e615d233185b" + } + ], + "operationId": "getAuthorById", + "summary": "Get an author by ID", + "description": "Get an author by ID. The author's books and series can be included in the response.", + "tags": [ + "Authors" + ], + "requestBody": { + "name": "library", + "in": "requestBody", + "description": "The ID of the library to to include filter included items from.", + "schema": { + "type": "string", + "description": "The ID of the library.", + "format": "uuid", + "example": "e4bb1afb-4a4f-4dd6-8be0-e615d233185b" + } + }, + "responses": { + "200": { + "description": "getAuthorById OK", + "content": { + "application/json": { + "schema": { + "summary": "An author object which includes a description and image path.", + "description": "An author object which includes a description and image path. The library items and series associated with the author are optionally included.", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of the author.", + "format": "uuid", + "example": "e4bb1afb-4a4f-4dd6-8be0-e615d233185b" + }, + "asin": { + "type": "string", + "description": "The Audible identifier (ASIN) of the author. Will be null if unknown. Not the Amazon identifier.", + "nullable": true, + "example": "B000APZOQA" + }, + "name": { + "description": "The name of the author.", + "type": "string", + "example": "Terry Goodkind" + }, + "description": { + "description": "A description of the author. Will be null if there is none.", + "type": "string", + "nullable": true, + "example": "Terry Goodkind is a #1 New York Times Bestselling Author and creator of the critically acclaimed masterwork,\n‘The Sword of Truth’. He has written 30+ major, bestselling novels, has been published in more than 20\nlanguages world-wide, and has sold more than 26 Million books. ‘The Sword of Truth’ is a revered literary\ntour de force, comprised of 17 volumes, borne from over 25 years of dedicated writing. Terry Goodkind's\nbrilliant books are character-driven stories, with a focus on the complexity of the human psyche. Goodkind\nhas an uncanny grasp for crafting compelling stories about people like you and me, trapped in terrifying\nsituations.\n" + }, + "imagePath": { + "description": "The absolute path for the author image located in the `metadata/` directory. Will be null if there is no image.", + "type": "string", + "nullable": true, + "example": "/metadata/authors/aut_bxxbyjiptmgb56yzoz.jpg" + }, + "addedAt": { + "type": "integer", + "description": "The time (in ms since POSIX epoch) when added to the server.", + "example": 1633522963509 + }, + "updatedAt": { + "type": "integer", + "description": "The time (in ms since POSIX epoch) when last updated.", + "example": 1633522963509 + }, + "libraryItems": { + "description": "The items associated with the author", + "type": "array", + "items": { + "type": "object", + "description": "A single item on the server, like a book or podcast. Minified media format.", + "allOf": [ + { + "$ref": "#/components/schemas/libraryItemBase" + }, + { + "type": "object", + "properties": { + "media": { + "$ref": "./mediaTypes/media.yaml#/components/schemas/mediaMinified" + } + } + } + ] + } + }, + "series": { + "description": "The series associated with the author", + "type": "array", + "items": { + "type": "object", + "description": "Series and the included library items that an author has written.", + "properties": { + "id": { + "type": "string", + "description": "The ID of the series.", + "format": "uuid", + "example": "e4bb1afb-4a4f-4dd6-8be0-e615d233185b" + }, + "name": { + "description": "The name of the series.", + "type": "string", + "example": "Sword of Truth" + }, + "items": { + "description": "The items in the series. Each library item's media's metadata will have a `series` attribute, a `Series Sequence`, which is the matching series.", + "type": "array", + "items": { + "ref": "../LibraryItem.yaml#/components/schemas/libraryItemMinified" + } + } + } + } + } + } + } + } + } + }, + "404": { + "description": "Author not found.", + "content": { + "text/html": { + "schema": { + "type": "string", + "example": "Author not found." + } + } + } + } + } + }, + "patch": { + "operationId": "updateAuthorById", + "summary": "Update an author by ID", + "description": "Update an author by ID. The author's name and description can be updated. This endpoint will merge two authors if the new author name matches another author name in the database.", + "tags": [ + "Authors" + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "name": "asin", + "in": "requestBody", + "description": "The Audible Identifier (ASIN).", + "schema": { + "type": "string", + "description": "The Audible identifier (ASIN) of the author. Will be null if unknown. Not the Amazon identifier.", + "nullable": true, + "example": "B000APZOQA" + } + } + } + } + }, + "responses": { + "200": { + "description": "updateAuthorById OK", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "description": "An author object which includes a description and image path. The library items and series associated with the author are optionally included.", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of the author.", + "format": "uuid", + "example": "e4bb1afb-4a4f-4dd6-8be0-e615d233185b" + }, + "asin": { + "type": "string", + "description": "The Audible identifier (ASIN) of the author. Will be null if unknown. Not the Amazon identifier.", + "nullable": true, + "example": "B000APZOQA" + }, + "name": { + "description": "The name of the author.", + "type": "string", + "example": "Terry Goodkind" + }, + "description": { + "description": "A description of the author. Will be null if there is none.", + "type": "string", + "nullable": true, + "example": "Terry Goodkind is a #1 New York Times Bestselling Author and creator of the critically acclaimed masterwork,\n‘The Sword of Truth’. He has written 30+ major, bestselling novels, has been published in more than 20\nlanguages world-wide, and has sold more than 26 Million books. ‘The Sword of Truth’ is a revered literary\ntour de force, comprised of 17 volumes, borne from over 25 years of dedicated writing. Terry Goodkind's\nbrilliant books are character-driven stories, with a focus on the complexity of the human psyche. Goodkind\nhas an uncanny grasp for crafting compelling stories about people like you and me, trapped in terrifying\nsituations.\n" + }, + "imagePath": { + "description": "The absolute path for the author image located in the `metadata/` directory. Will be null if there is no image.", + "type": "string", + "nullable": true, + "example": "/metadata/authors/aut_bxxbyjiptmgb56yzoz.jpg" + }, + "addedAt": { + "type": "integer", + "description": "The time (in ms since POSIX epoch) when added to the server.", + "example": 1633522963509 + }, + "updatedAt": { + "type": "integer", + "description": "The time (in ms since POSIX epoch) when last updated.", + "example": 1633522963509 + }, + "libraryItems": { + "description": "The items associated with the author", + "type": "array" + }, + "series": { + "description": "The series associated with the author", + "type": "array", + "items": { + "type": "object", + "description": "Series and the included library items that an author has written.", + "properties": { + "id": { + "type": "string", + "description": "The ID of the series.", + "format": "uuid", + "example": "e4bb1afb-4a4f-4dd6-8be0-e615d233185b" + }, + "name": { + "description": "The name of the series.", + "type": "string", + "example": "Sword of Truth" + }, + "items": { + "description": "The items in the series. Each library item's media's metadata will have a `series` attribute, a `Series Sequence`, which is the matching series.", + "type": "array", + "items": {} + } + } + } + } + } + }, + { + "description": "Whether the author was updated without errors. Will not exist if author was merged.", + "type": "boolean", + "nullable": true + }, + { + "description": "Whether the author was merged with another author. Will not exist if author was updated.", + "type": "boolean", + "nullable": true + } + ] + } + } + } + }, + "404": { + "description": "Author not found.", + "content": { + "text/html": { + "schema": { + "type": "string", + "example": "Author not found." + } + } + } + } + } + }, + "delete": { + "operationId": "deleteAuthorById", + "summary": "Delete an author by ID", + "description": "Delete an author by ID. This will remove the author from all books.", + "tags": [ + "Authors" + ], + "responses": { + "200": { + "description": "deleteAuthorById OK", + "content": { + "text/plain": { + "schema": { + "type": "string", + "example": "Author deleted." + } + } + } + }, + "404": { + "description": "Author not found.", + "content": { + "text/html": { + "schema": { + "type": "string", + "example": "Author not found." + } + } + } + } + } + } + }, + "/api/authors/{id}/image": { + "get": { + "parameters": [ + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + { + "type": "string", + "description": "The ID of the author.", + "format": "uuid", + "example": "e4bb1afb-4a4f-4dd6-8be0-e615d233185b" + } + ], + "operationId": "getAuthorImageById", + "summary": "Get an author image by author ID", + "description": "Get an author image by author ID. The image will be returned in the requested format and size.", + "tags": [ + "Authors" + ], + "requestBody": { + "name": "raw", + "in": "requestBody", + "description": "Return the raw image without scaling if true.", + "schema": { + "type": "boolean", + "default": false + } + }, + "responses": { + "200": { + "description": "getAuthorImageById OK", + "content": { + "image/webp": { + "schema": { + "type": "string", + "format": "binary" + } + }, + "image/jpeg": { + "schema": { + "type": "string", + "format": "binary" + } + }, + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Author not found.", + "content": { + "text/html": { + "schema": { + "type": "string", + "example": "Author not found." + } + } + } + } + } + }, + "post": { + "operationId": "addAuthorImageById", + "summary": "Add an author image to the server", + "description": "Add an author image to the server. The image will be downloaded from the provided URL and stored on the server.", + "tags": [ + "Authors" + ], + "requestBody": { + "name": "url", + "in": "requestBody", + "description": "The URL of the image to add to the server", + "required": true, + "schema": { + "type": "string", + "format": "uri", + "example": "https://images-na.ssl-images-amazon.com/images/I/51NoQTm33OL.__01_SX120_CR0,0,120,120__.jpg" + } + }, + "responses": { + "200": { + "description": "addAuthorImageById OK", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Author not found.", + "content": { + "text/html": { + "schema": { + "type": "string", + "example": "Author not found." + } + } + } + } + } + }, + "patch": { + "operationId": "updateAuthorImageById", + "summary": "Update an author image by author ID", + "description": "Update an author image by author ID. The image will be resized if the width, height, or format is provided.", + "tags": [ + "Authors" + ], + "requestBody": { + "name": "raw", + "in": "requestBody", + "description": "Return the raw image without scaling if true.", + "schema": { + "type": "boolean", + "default": false + } + }, + "responses": { + "200": { + "description": "updateAuthorImageById OK", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Author not found.", + "content": { + "text/html": { + "schema": { + "type": "string", + "example": "Author not found." + } + } + } + } + } + }, + "delete": { + "parameters": [ + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + { + "type": "string", + "description": "The ID of the author.", + "format": "uuid", + "example": "e4bb1afb-4a4f-4dd6-8be0-e615d233185b" + } + ], + "operationId": "deleteAuthorImageById", + "summary": "Delete an author image by author ID", + "description": "Delete an author image by author ID. This will remove the image from the server and the database.", + "tags": [ + "Authors" + ], + "responses": { + "200": { + "description": "deleteAuthorImageById OK" + }, + "404": { + "description": "Author not found.", + "content": { + "text/html": { + "schema": { + "type": "string", + "example": "Author not found." + } + } + } + } + } + } + }, + "/api/authors/{id}/match": { + "post": { + "parameters": [ + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + { + "type": "string", + "description": "The ID of the author.", + "format": "uuid", + "example": "e4bb1afb-4a4f-4dd6-8be0-e615d233185b" + } + ], + "operationId": "matchAuthorById", + "summary": "Match the author against Audible using quick match", + "description": "Match the author against Audible using quick match. Quick match updates the author's description and image (if no image already existed) with information from audible. Either `asin` or `q` must be provided, with `asin` taking priority if both are provided.", + "tags": [ + "Authors" + ], + "requestBody": { + "name": "q", + "in": "requestBody", + "description": "The name of the author to use for searching.", + "schema": { + "type": "string", + "example": "Terry Goodkind" + } + }, + "responses": { + "200": { + "description": "matchAuthorById OK", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "description": "An author object which includes a description and image path. The library items and series associated with the author are optionally included.", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of the author.", + "format": "uuid", + "example": "e4bb1afb-4a4f-4dd6-8be0-e615d233185b" + }, + "asin": { + "type": "string", + "description": "The Audible identifier (ASIN) of the author. Will be null if unknown. Not the Amazon identifier.", + "nullable": true, + "example": "B000APZOQA" + }, + "name": { + "description": "The name of the author.", + "type": "string", + "example": "Terry Goodkind" + }, + "description": { + "description": "A description of the author. Will be null if there is none.", + "type": "string", + "nullable": true, + "example": "Terry Goodkind is a #1 New York Times Bestselling Author and creator of the critically acclaimed masterwork,\n‘The Sword of Truth’. He has written 30+ major, bestselling novels, has been published in more than 20\nlanguages world-wide, and has sold more than 26 Million books. ‘The Sword of Truth’ is a revered literary\ntour de force, comprised of 17 volumes, borne from over 25 years of dedicated writing. Terry Goodkind's\nbrilliant books are character-driven stories, with a focus on the complexity of the human psyche. Goodkind\nhas an uncanny grasp for crafting compelling stories about people like you and me, trapped in terrifying\nsituations.\n" + }, + "imagePath": { + "description": "The absolute path for the author image located in the `metadata/` directory. Will be null if there is no image.", + "type": "string", + "nullable": true, + "example": "/metadata/authors/aut_bxxbyjiptmgb56yzoz.jpg" + }, + "addedAt": { + "type": "integer", + "description": "The time (in ms since POSIX epoch) when added to the server.", + "example": 1633522963509 + }, + "updatedAt": { + "type": "integer", + "description": "The time (in ms since POSIX epoch) when last updated.", + "example": 1633522963509 + }, + "libraryItems": { + "description": "The items associated with the author", + "type": "array" + }, + "series": { + "description": "The series associated with the author", + "type": "array", + "items": { + "type": "object", + "description": "Series and the included library items that an author has written.", + "properties": { + "id": { + "type": "string", + "description": "The ID of the series.", + "format": "uuid", + "example": "e4bb1afb-4a4f-4dd6-8be0-e615d233185b" + }, + "name": { + "description": "The name of the series.", + "type": "string", + "example": "Sword of Truth" + }, + "items": { + "description": "The items in the series. Each library item's media's metadata will have a `series` attribute, a `Series Sequence`, which is the matching series.", + "type": "array", + "items": {} + } + } + } + } + } + }, + { + "description": "Whether the author was updated without errors. Will not exist if author was merged.", + "type": "boolean", + "nullable": true + } + ] + } + } + } + }, + "404": { + "description": "Author not found.", + "content": { + "text/html": { + "schema": { + "type": "string", + "example": "Author not found." + } + } + } } } }