mirror of
https://github.com/C9Glax/tranga.git
synced 2025-02-23 15:50:13 +01:00
API v2
This commit is contained in:
parent
0ab2ae03ce
commit
7e5fa6ce41
@ -10,7 +10,7 @@ using Tranga.NotificationConnectors;
|
|||||||
|
|
||||||
namespace Tranga;
|
namespace Tranga;
|
||||||
|
|
||||||
public class Server : GlobalBase
|
public partial class Server : GlobalBase
|
||||||
{
|
{
|
||||||
private readonly HttpListener _listener = new ();
|
private readonly HttpListener _listener = new ();
|
||||||
private readonly Tranga _parent;
|
private readonly Tranga _parent;
|
||||||
@ -68,6 +68,12 @@ public class Server : GlobalBase
|
|||||||
if(request.Url!.LocalPath.Contains("favicon"))
|
if(request.Url!.LocalPath.Contains("favicon"))
|
||||||
SendResponse(HttpStatusCode.NoContent, response);
|
SendResponse(HttpStatusCode.NoContent, response);
|
||||||
|
|
||||||
|
if (Regex.IsMatch(request.Url.LocalPath, ""))
|
||||||
|
{
|
||||||
|
HandleRequestV2(context);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
switch (request.HttpMethod)
|
switch (request.HttpMethod)
|
||||||
{
|
{
|
||||||
case "GET":
|
case "GET":
|
||||||
|
80
Tranga/ServerV2.cs
Normal file
80
Tranga/ServerV2.cs
Normal file
@ -0,0 +1,80 @@
|
|||||||
|
using System.Net;
|
||||||
|
using System.Text;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
|
namespace Tranga;
|
||||||
|
|
||||||
|
public partial class Server
|
||||||
|
{
|
||||||
|
private void HandleRequestV2(HttpListenerContext context)
|
||||||
|
{
|
||||||
|
HttpListenerRequest request = context.Request;
|
||||||
|
HttpListenerResponse response = context.Response;
|
||||||
|
string path = Regex.Match(request.Url!.LocalPath, @"[A-z0-9]+(\/[A-z0-9]+)*").Value;
|
||||||
|
|
||||||
|
Dictionary<string, string> requestVariables = GetRequestVariables(request.Url!.Query); //Variables in the URI
|
||||||
|
Dictionary<string, string> requestBody = GetRequestBody(request); //Variables in the JSON body
|
||||||
|
Dictionary<string, string> requestParams = requestVariables.UnionBy(requestBody, v => v.Key)
|
||||||
|
.ToDictionary(kv => kv.Key, kv => kv.Value); //The actual variable used for the API
|
||||||
|
|
||||||
|
|
||||||
|
switch (request.HttpMethod)
|
||||||
|
{
|
||||||
|
case "GET":
|
||||||
|
HandleGetV2(path, response, requestParams);
|
||||||
|
break;
|
||||||
|
case "POST":
|
||||||
|
HandlePostV2(path, response, requestParams);
|
||||||
|
break;
|
||||||
|
case "DELETE":
|
||||||
|
HandleDeleteV2(path, response, requestParams);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
SendResponse(HttpStatusCode.MethodNotAllowed, response);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private Dictionary<string, string> GetRequestBody(HttpListenerRequest request)
|
||||||
|
{
|
||||||
|
if (!request.HasEntityBody)
|
||||||
|
{
|
||||||
|
Log("No request body");
|
||||||
|
return new Dictionary<string, string>();
|
||||||
|
}
|
||||||
|
Stream body = request.InputStream;
|
||||||
|
Encoding encoding = request.ContentEncoding;
|
||||||
|
using StreamReader streamReader = new (body, encoding);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Dictionary<string, string> requestBody =
|
||||||
|
JsonConvert.DeserializeObject<Dictionary<string, string>>(streamReader.ReadToEnd())
|
||||||
|
?? new();
|
||||||
|
return requestBody;
|
||||||
|
}
|
||||||
|
catch (JsonException e)
|
||||||
|
{
|
||||||
|
Log(e.Message);
|
||||||
|
}
|
||||||
|
return new Dictionary<string, string>();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void HandleGetV2(string path, HttpListenerResponse response,
|
||||||
|
Dictionary<string, string> requestParameters)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException("v2 not implemented yet");
|
||||||
|
}
|
||||||
|
|
||||||
|
private void HandlePostV2(string path, HttpListenerResponse response,
|
||||||
|
Dictionary<string, string> requestParameters)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException("v2 not implemented yet");
|
||||||
|
}
|
||||||
|
|
||||||
|
private void HandleDeleteV2(string path, HttpListenerResponse response,
|
||||||
|
Dictionary<string, string> requestParameters)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException("v2 not implemented yet");
|
||||||
|
}
|
||||||
|
}
|
895
docs/API_Calls_v2.md
Normal file
895
docs/API_Calls_v2.md
Normal file
@ -0,0 +1,895 @@
|
|||||||
|
<span id="top"></span>
|
||||||
|
# Tranga API Calls v2
|
||||||
|
This document outlines all different HTTP API calls that Tranga accepts.
|
||||||
|
Tranga expects specific HTTP methods for its calls and therefore careful attention must be paid when making them.
|
||||||
|
|
||||||
|
`apiUri` refers to your `http(s)://TRANGA.FRONTEND.URI/api`.
|
||||||
|
|
||||||
|
Parameters are included in the HTTP request URI and/or the request body.
|
||||||
|
The request Body is in JSON key-value-pair format, with all values as strings.
|
||||||
|
Tranga responses are always in the JSON format within the Response Body.
|
||||||
|
|
||||||
|
Parameters in *italics* are optional
|
||||||
|
|
||||||
|
<!-- ### <sub></sub> `` -->
|
||||||
|
<!-- ### <sub></sub> `` -->
|
||||||
|
<!-- ### <sub></sub> `` -->
|
||||||
|
|
||||||
|
### Quick Entry
|
||||||
|
|
||||||
|
* [Connectors](#connectors-suptopsup)
|
||||||
|
* [Manga](#manga-suptopsup)
|
||||||
|
* [Jobs](#jobs-suptopsup)
|
||||||
|
* [Settings](#settings-suptopsup)
|
||||||
|
* [Library Connectors](#library-connectors-suptopsup)
|
||||||
|
* [Notification Connectors](#notification-connectors-suptopsup)
|
||||||
|
* [Miscellaneous](#miscellaneous-suptopsup)
|
||||||
|
|
||||||
|
## Connectors <sup>[^top](#top)</sup>
|
||||||
|
|
||||||
|
### <sub></sub> `/v2/Connector/Types`
|
||||||
|
|
||||||
|
Returns available Manga Connectors (Scanlation sites)
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Returns</summary>
|
||||||
|
List of strings with Names.
|
||||||
|
</details>
|
||||||
|
|
||||||
|
### <sub></sub> `/v2/Connector/<ConnectorName>/GetManga`
|
||||||
|
|
||||||
|
Returns the Manga from the specified Manga Connector.
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Request</summary>
|
||||||
|
|
||||||
|
`ConnectorName` is returned in the response of [GET /v2/Connector/Types](#/v2/Connector)
|
||||||
|
|
||||||
|
Use either `title` or `url` Parameter.
|
||||||
|
|
||||||
|
| Parameter | Value |
|
||||||
|
|-----------|-------------------------------------------------|
|
||||||
|
| title | Search Term |
|
||||||
|
| url | Direct link (URL) to the Manga on the used Site |
|
||||||
|
</details>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Returns</summary>
|
||||||
|
|
||||||
|
List of [Manga](Types.md/#Manga)
|
||||||
|
|
||||||
|
| StatusCode | Meaning |
|
||||||
|
|------------|--------------------------|
|
||||||
|
| 400 | Connector does not exist |
|
||||||
|
| 404 | URL/Connector Mismatch |
|
||||||
|
</details>
|
||||||
|
|
||||||
|
## Manga <sup>[^top](#top)</sup>
|
||||||
|
|
||||||
|
### <sub></sub> `/v2/Manga/<internalId>`
|
||||||
|
|
||||||
|
Returns the specified Manga.
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Request</summary>
|
||||||
|
|
||||||
|
`internalId` is returned in the response of
|
||||||
|
* [GET /v2/Connector/*ConnectorName*/GetManga](#subsub-v2connectorconnectornamegetmanga)
|
||||||
|
* [GET /v2/Jobs](#subsub-v2jobs)
|
||||||
|
* [GET /v2/Jobs/Running](#subsub-v2jobsrunning)
|
||||||
|
* [GET /v2/Jobs/Waiting](#subsub-v2jobswaiting)
|
||||||
|
* [GET /v2/Jobs/Monitoring](#subsub-v2jobsmonitoring)
|
||||||
|
* [GET /v2/Jobs/*jobId*](#subsub-v2jobs)
|
||||||
|
</details>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Returns</summary>
|
||||||
|
|
||||||
|
[Manga](Types.md/#manga)
|
||||||
|
|
||||||
|
| StatusCode | Meaning |
|
||||||
|
|------------|--------------------------------------------|
|
||||||
|
| 404 | Manga with `internalId` could not be found |
|
||||||
|
</details>
|
||||||
|
|
||||||
|
### <sub></sub> `/v2/Manga/<internalId>`
|
||||||
|
|
||||||
|
Deletes all associated Jobs for the specified Manga
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Request</summary>
|
||||||
|
|
||||||
|
`internalId` is returned in the response of
|
||||||
|
* [GET /v2/Connector/*ConnectorName*/GetManga](#subsub-v2connectorconnectornamegetmanga)
|
||||||
|
* [GET /v2/Jobs](#subsub-v2jobs)
|
||||||
|
* [GET /v2/Jobs/Running](#subsub-v2jobsrunning)
|
||||||
|
* [GET /v2/Jobs/Waiting](#subsub-v2jobswaiting)
|
||||||
|
* [GET /v2/Jobs/Monitoring](#subsub-v2jobsmonitoring)
|
||||||
|
* [GET /v2/Jobs/*jobId*](#subsub-v2jobs)
|
||||||
|
</details>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Returns</summary>
|
||||||
|
|
||||||
|
| StatusCode | Meaning |
|
||||||
|
|------------|--------------------------------------------|
|
||||||
|
| 200 | Jobs were deleted |
|
||||||
|
| 404 | Manga with `internalId` could not be found |
|
||||||
|
</details>
|
||||||
|
|
||||||
|
### <sub></sub> `/v2/Manga/<internalId>/Cover`
|
||||||
|
|
||||||
|
Returns the URL for the Cover of the specified Manga.
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Request</summary>
|
||||||
|
|
||||||
|
`internalId` is returned in the response of
|
||||||
|
* [GET /v2/Connector/*ConnectorName*/GetManga](#subsub-v2connectorconnectornamegetmanga)
|
||||||
|
* [GET /v2/Jobs](#subsub-v2jobs)
|
||||||
|
* [GET /v2/Jobs/Running](#subsub-v2jobsrunning)
|
||||||
|
* [GET /v2/Jobs/Waiting](#subsub-v2jobswaiting)
|
||||||
|
* [GET /v2/Jobs/Monitoring](#subsub-v2jobsmonitoring)
|
||||||
|
* [GET /v2/Jobs/*jobId*](#subsub-v2jobs)
|
||||||
|
</details>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Returns</summary>
|
||||||
|
|
||||||
|
String with the url.
|
||||||
|
|
||||||
|
| StatusCode | Meaning |
|
||||||
|
|------------|--------------------------------------------|
|
||||||
|
| 404 | Manga with `internalId` could not be found |
|
||||||
|
</details>
|
||||||
|
|
||||||
|
### <sub></sub> `/v2/Manga/<internalId>/Chapters`
|
||||||
|
|
||||||
|
Returns the Chapter-list for the specified Manga.
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Request</summary>
|
||||||
|
|
||||||
|
`internalId` is returned in the response of
|
||||||
|
* [GET /v2/Connector/*ConnectorName*/GetManga](#subsub-v2connectorconnectornamegetmanga)
|
||||||
|
* [GET /v2/Jobs](#subsub-v2jobs)
|
||||||
|
* [GET /v2/Jobs/Running](#subsub-v2jobsrunning)
|
||||||
|
* [GET /v2/Jobs/Waiting](#subsub-v2jobswaiting)
|
||||||
|
* [GET /v2/Jobs/Monitoring](#subsub-v2jobsmonitoring)
|
||||||
|
* [GET /v2/Jobs/*jobId*](#subsub-v2jobs)
|
||||||
|
</details>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Returns</summary>
|
||||||
|
|
||||||
|
List of [Chapters](Types.md/#chapter)
|
||||||
|
|
||||||
|
| StatusCode | Meaning |
|
||||||
|
|------------|--------------------------------------------|
|
||||||
|
| 404 | Manga with `internalId` could not be found |
|
||||||
|
</details>
|
||||||
|
|
||||||
|
## Jobs <sup>[^top](#top)</sup>
|
||||||
|
|
||||||
|
### <sub></sub> `/v2/Jobs`
|
||||||
|
|
||||||
|
Returns all configured Jobs.
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Returns</summary>
|
||||||
|
|
||||||
|
List of [Jobs](Types.md#job)
|
||||||
|
</details>
|
||||||
|
|
||||||
|
### <sub></sub> `/v2/Jobs/Running`
|
||||||
|
|
||||||
|
Returns all Running Jobs.
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Returns</summary>
|
||||||
|
|
||||||
|
List of [Jobs](Types.md#job)
|
||||||
|
</details>
|
||||||
|
|
||||||
|
### <sub></sub> `/v2/Jobs/Waiting`
|
||||||
|
|
||||||
|
Returns all Waiting Jobs.
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Returns</summary>
|
||||||
|
|
||||||
|
List of [Jobs](Types.md#job)
|
||||||
|
</details>
|
||||||
|
|
||||||
|
### <sub></sub> `/v2/Jobs/Monitoring`
|
||||||
|
|
||||||
|
Returns all Monitoring Jobs.
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Returns</summary>
|
||||||
|
|
||||||
|
List of [Jobs](Types.md#job)
|
||||||
|
</details>
|
||||||
|
|
||||||
|
### <sub></sub> `/v2/Jobs/Create/Monitor/<internalId>`
|
||||||
|
|
||||||
|
Creates a Monitoring-Job for the specified Manga at the specified Interval.
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Request</summary>
|
||||||
|
|
||||||
|
`internalId` is returned in the response of
|
||||||
|
* [GET /v2/Connector/*ConnectorName*/GetManga](#subsub-v2connectorconnectornamegetmanga)
|
||||||
|
* [GET /v2/Jobs](#subsub-v2jobs)
|
||||||
|
* [GET /v2/Jobs/Running](#subsub-v2jobsrunning)
|
||||||
|
* [GET /v2/Jobs/Waiting](#subsub-v2jobswaiting)
|
||||||
|
* [GET /v2/Jobs/Monitoring](#subsub-v2jobsmonitoring)
|
||||||
|
* [GET /v2/Jobs/*jobId*](#subsub-v2jobs)
|
||||||
|
|
||||||
|
| Parameter | Value |
|
||||||
|
|-----------|--------------------------------------------------------|
|
||||||
|
| interval | Interval at which the Job is re-run in HH:MM:SS format |
|
||||||
|
</details>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Returns</summary>
|
||||||
|
|
||||||
|
[Job](Types.md/#job)
|
||||||
|
|
||||||
|
| StatusCode | Meaning |
|
||||||
|
|------------|--------------------------------------------|
|
||||||
|
| 404 | Manga with `internalId` could not be found |
|
||||||
|
| 500 | Error parsing interval |
|
||||||
|
</details>
|
||||||
|
|
||||||
|
### <sub></sub> `/v2/Jobs/Create/DownloadNewChapters/<internalId>`
|
||||||
|
|
||||||
|
Creates a Job to check for new Chapters and Download new ones of the specified Manga.
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Request</summary>
|
||||||
|
|
||||||
|
`internalId` is returned in the response of
|
||||||
|
* [GET /v2/Connector/*ConnectorName*/GetManga](#subsub-v2connectorconnectornamegetmanga)
|
||||||
|
* [GET /v2/Jobs](#subsub-v2jobs)
|
||||||
|
* [GET /v2/Jobs/Running](#subsub-v2jobsrunning)
|
||||||
|
* [GET /v2/Jobs/Waiting](#subsub-v2jobswaiting)
|
||||||
|
* [GET /v2/Jobs/Monitoring](#subsub-v2jobsmonitoring)
|
||||||
|
* [GET /v2/Jobs/*jobId*](#subsub-v2jobs)
|
||||||
|
</details>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Returns</summary>
|
||||||
|
|
||||||
|
[Job](Types.md/#job)
|
||||||
|
|
||||||
|
| StatusCode | Meaning |
|
||||||
|
|------------|--------------------------------------------|
|
||||||
|
| 404 | Manga with `internalId` could not be found |
|
||||||
|
</details>
|
||||||
|
|
||||||
|
### <sub></sub> `/v2/Jobs/Create/UpdateMetadata`
|
||||||
|
|
||||||
|
Creates a Job to update the Metadata of all Manga.
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Returns</summary>
|
||||||
|
|
||||||
|
[Job](Types.md/#job)
|
||||||
|
</details>
|
||||||
|
|
||||||
|
### <sub></sub> `/v2/Jobs/Create/UpdateMetadata/<internalId>`
|
||||||
|
|
||||||
|
Updates the Metadata of the specified Manga.
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Request</summary>
|
||||||
|
|
||||||
|
`internalId` is returned in the response of
|
||||||
|
* [GET /v2/Connector/*ConnectorName*/GetManga](#subsub-v2connectorconnectornamegetmanga)
|
||||||
|
* [GET /v2/Jobs](#subsub-v2jobs)
|
||||||
|
* [GET /v2/Jobs/Running](#subsub-v2jobsrunning)
|
||||||
|
* [GET /v2/Jobs/Waiting](#subsub-v2jobswaiting)
|
||||||
|
* [GET /v2/Jobs/Monitoring](#subsub-v2jobsmonitoring)
|
||||||
|
* [GET /v2/Jobs/*jobId*](#subsub-v2jobs)
|
||||||
|
</details>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Returns</summary>
|
||||||
|
|
||||||
|
[Job](Types.md/#job)
|
||||||
|
|
||||||
|
| StatusCode | Meaning |
|
||||||
|
|------------|--------------------------------------------|
|
||||||
|
| 404 | Manga with `internalId` could not be found |
|
||||||
|
</details>
|
||||||
|
|
||||||
|
### <sub></sub> `/v2/Job/<jobId>`
|
||||||
|
|
||||||
|
Returns the specified Job.
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Request</summary>
|
||||||
|
|
||||||
|
`jobId` is returned in the response of
|
||||||
|
|
||||||
|
* [GET /v2/Jobs](#subsub-v2jobs)
|
||||||
|
* [GET /v2/Jobs/Running](#subsub-v2jobsrunning)
|
||||||
|
* [GET /v2/Jobs/Waiting](#subsub-v2jobswaiting)
|
||||||
|
* [GET /v2/Jobs/Monitoring](#subsub-v2jobsmonitoring)
|
||||||
|
</details>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Returns</summary>
|
||||||
|
|
||||||
|
[Job](Types.md/#job)
|
||||||
|
|
||||||
|
| StatusCode | Meaning |
|
||||||
|
|------------|---------------------------------------|
|
||||||
|
| 404 | Manga with `jobId` could not be found |
|
||||||
|
</details>
|
||||||
|
|
||||||
|
### <sub></sub> `/v2/Job/<jobId>`
|
||||||
|
|
||||||
|
Deletes the specified Job and all descendants.
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Request</summary>
|
||||||
|
|
||||||
|
`jobId` is returned in the response of
|
||||||
|
* [GET /v2/Jobs](#subsub-v2jobs)
|
||||||
|
* [GET /v2/Jobs/Running](#subsub-v2jobsrunning)
|
||||||
|
* [GET /v2/Jobs/Waiting](#subsub-v2jobswaiting)
|
||||||
|
* [GET /v2/Jobs/Monitoring](#subsub-v2jobsmonitoring)
|
||||||
|
</details>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Returns</summary>
|
||||||
|
|
||||||
|
| StatusCode | Meaning |
|
||||||
|
|------------|---------------------------------------|
|
||||||
|
| 200 | Job deleted |
|
||||||
|
| 404 | Manga with `jobId` could not be found |
|
||||||
|
</details>
|
||||||
|
|
||||||
|
### <sub></sub> `/v2/Job/<jobId>/Progress`
|
||||||
|
|
||||||
|
Returns the progress the of the specified Job.
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Request</summary>
|
||||||
|
|
||||||
|
`jobId` is returned in the response of
|
||||||
|
* [GET /v2/Jobs](#subsub-v2jobs)
|
||||||
|
* [GET /v2/Jobs/Running](#subsub-v2jobsrunning)
|
||||||
|
* [GET /v2/Jobs/Waiting](#subsub-v2jobswaiting)
|
||||||
|
* [GET /v2/Jobs/Monitoring](#subsub-v2jobsmonitoring)
|
||||||
|
</details>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Returns</summary>
|
||||||
|
|
||||||
|
[ProgressToken](Types.md#progresstoken)
|
||||||
|
|
||||||
|
| StatusCode | Meaning |
|
||||||
|
|------------|---------------------------------------|
|
||||||
|
| 404 | Manga with `jobId` could not be found |
|
||||||
|
</details>
|
||||||
|
|
||||||
|
### <sub></sub> `/v2/Job/<jobId>/StartNow`
|
||||||
|
|
||||||
|
Starts the specified Job.
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Request</summary>
|
||||||
|
|
||||||
|
`jobId` is returned in the response of
|
||||||
|
* [GET /v2/Jobs](#subsub-v2jobs)
|
||||||
|
* [GET /v2/Jobs/Running](#subsub-v2jobsrunning)
|
||||||
|
* [GET /v2/Jobs/Waiting](#subsub-v2jobswaiting)
|
||||||
|
* [GET /v2/Jobs/Monitoring](#subsub-v2jobsmonitoring)
|
||||||
|
</details>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Returns</summary>
|
||||||
|
|
||||||
|
| StatusCode | Meaning |
|
||||||
|
|------------|---------------------------------------|
|
||||||
|
| 200 | Job started |
|
||||||
|
| 404 | Manga with `jobId` could not be found |
|
||||||
|
</details>
|
||||||
|
|
||||||
|
### <sub></sub> `/v2/Job/<jobId>/Cancel`
|
||||||
|
|
||||||
|
Cancels the specified Job, or dequeues it.
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Request</summary>
|
||||||
|
|
||||||
|
`jobId` is returned in the response of
|
||||||
|
* [GET /v2/Jobs](#subsub-v2jobs)
|
||||||
|
* [GET /v2/Jobs/Running](#subsub-v2jobsrunning)
|
||||||
|
* [GET /v2/Jobs/Waiting](#subsub-v2jobswaiting)
|
||||||
|
* [GET /v2/Jobs/Monitoring](#subsub-v2jobsmonitoring)
|
||||||
|
</details>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Returns</summary>
|
||||||
|
|
||||||
|
| StatusCode | Meaning |
|
||||||
|
|------------|---------------------------------------|
|
||||||
|
| 200 | Job cancelled |
|
||||||
|
| 404 | Manga with `jobId` could not be found |
|
||||||
|
</details>
|
||||||
|
|
||||||
|
## Settings <sup>[^top](#top)</sup>
|
||||||
|
|
||||||
|
### <sub></sub> `/v2/Settings`
|
||||||
|
|
||||||
|
Returns the `settings.json` file.
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Returns</summary>
|
||||||
|
|
||||||
|
[Settings](Types.md/#settings)
|
||||||
|
</details>
|
||||||
|
|
||||||
|
### <sub></sub> `/v2/Settings/UserAgent`
|
||||||
|
|
||||||
|
Returns the current User Agent used for Requests.
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Returns</summary>
|
||||||
|
|
||||||
|
[UserAgent](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/User-Agent)
|
||||||
|
</details>
|
||||||
|
|
||||||
|
### <sub></sub> `/v2/Settings/UserAgent`
|
||||||
|
|
||||||
|
Sets the User Agent. If left empty, User Agent is reset to default.
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Request</summary>
|
||||||
|
|
||||||
|
| Parameter | Value |
|
||||||
|
|-----------|----------------------------------------------------------------------------------------|
|
||||||
|
| value | New [UserAgent](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/User-Agent) |
|
||||||
|
</details>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Returns</summary>
|
||||||
|
</details>
|
||||||
|
|
||||||
|
### <sub></sub> `/v2/Settings/RateLimit/Types`
|
||||||
|
|
||||||
|
Returns the configurable Rate-Limits.
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Returns</summary>
|
||||||
|
|
||||||
|
List of Rate-Limit-Names.
|
||||||
|
</details>
|
||||||
|
|
||||||
|
### <sub></sub> `/v2/Settings/RateLimit`
|
||||||
|
|
||||||
|
Returns the current configuration of Rate-Limits for Requests.
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Returns</summary>
|
||||||
|
|
||||||
|
Dictionary of `Rate-Limits` and `Requests per Minute`
|
||||||
|
</details>
|
||||||
|
|
||||||
|
### <sub></sub> `/v2/Settings/RateLimit`
|
||||||
|
|
||||||
|
Sets the Rate-Limits for all Requests. If left empty, resets to default Rate-Limits.
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Request</summary>
|
||||||
|
|
||||||
|
For each Rate-Limit set as follows:
|
||||||
|
|
||||||
|
| Parameter | Value |
|
||||||
|
|---------------------------------------|---------------------|
|
||||||
|
| [Type](#/v2/Settings/RateLimit/Types) | Requests per Minute |
|
||||||
|
|
||||||
|
`Type` is returned by [GET /v2/Settings/RateLimit/Types](#/v2/Settings/RateLimit/Types)
|
||||||
|
</details>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Returns</summary>
|
||||||
|
|
||||||
|
| StatusCode | Meaning |
|
||||||
|
|------------|--------------------------------|
|
||||||
|
| 404 | Rate-Limit-Name does not exist |
|
||||||
|
</details>
|
||||||
|
|
||||||
|
### <sub></sub> `/v2/Settings/RateLimit/<Type>`
|
||||||
|
|
||||||
|
Returns the current Rate-Limit for the Request-Type.
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Request</summary>
|
||||||
|
|
||||||
|
`Type` is returned by [GET /v2/Settings/RateLimit/Types](#/v2/Settings/RateLimit/Types)
|
||||||
|
</details>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Returns</summary>
|
||||||
|
|
||||||
|
Integer with Requests per Minute.
|
||||||
|
</details>
|
||||||
|
|
||||||
|
### <sub></sub> `/v2/Settings/RateLimit/<Type>`
|
||||||
|
|
||||||
|
Sets the Rate-Limit for the Request-Type in Requests per Minute.
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Request</summary>
|
||||||
|
|
||||||
|
`Type` is returned by [GET /v2/Settings/RateLimit/Types](#/v2/Settings/RateLimit/Types)
|
||||||
|
|
||||||
|
| Parameter | Value |
|
||||||
|
|-----------|---------------------|
|
||||||
|
| value | Requests per Minute |
|
||||||
|
</details>
|
||||||
|
<details>
|
||||||
|
<summary>Returns</summary>
|
||||||
|
|
||||||
|
| StatusCode | Meaning |
|
||||||
|
|------------|--------------------------------|
|
||||||
|
| 404 | Rate-Limit-Name does not exist |
|
||||||
|
| 500 | Parsing Error |
|
||||||
|
</details>
|
||||||
|
|
||||||
|
### <sub></sub> `/v2/Settings/AprilFoolsMode`
|
||||||
|
|
||||||
|
Returns the current state of the April-Fools-Mode setting.
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Returns</summary>
|
||||||
|
|
||||||
|
Boolean
|
||||||
|
</details>
|
||||||
|
|
||||||
|
### <sub></sub> `/v2/Settings/ApriFoolsMode`
|
||||||
|
|
||||||
|
Enables/Disables April-Fools-Mode.
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Request</summary>
|
||||||
|
|
||||||
|
| Parameter | Value |
|
||||||
|
|-----------|------------|
|
||||||
|
| value | true/false |
|
||||||
|
</details>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Returns</summary>
|
||||||
|
|
||||||
|
| StatusCode | Meaning |
|
||||||
|
|------------|--------------------------------|
|
||||||
|
| 404 | Rate-Limit-Name does not exist |
|
||||||
|
| 500 | Parsing Error |
|
||||||
|
</details>
|
||||||
|
|
||||||
|
### <sub></sub> `/v2/Settings/DownloadLocation`
|
||||||
|
|
||||||
|
Updates the default Download-Location.
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Request</summary>
|
||||||
|
|
||||||
|
| Parameter | Value |
|
||||||
|
|-------------|------------------|
|
||||||
|
| location | New Folder-Path |
|
||||||
|
| *moveFiles* | __*true*__/false |
|
||||||
|
</details>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Returns</summary>
|
||||||
|
|
||||||
|
|
||||||
|
| StatusCode | Meaning |
|
||||||
|
|------------|--------------------------|
|
||||||
|
| 200 | Successfully changed |
|
||||||
|
| 500 | Files could not be moved |
|
||||||
|
</details>
|
||||||
|
|
||||||
|
## Library Connectors <sup>[^top](#top)</sup>
|
||||||
|
|
||||||
|
### <sub></sub> `/v2/LibraryConnector`
|
||||||
|
|
||||||
|
Returns the configured Library-Connectors.
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Returns</summary>
|
||||||
|
|
||||||
|
List of [LibraryConnectors](Types.md#libraryconnector)
|
||||||
|
</details>
|
||||||
|
|
||||||
|
### <sub></sub> `/v2/LibraryConnector/Types`
|
||||||
|
|
||||||
|
Returns the available Library-Connector types.
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Returns</summary>
|
||||||
|
|
||||||
|
List of String of Names.
|
||||||
|
</details>
|
||||||
|
|
||||||
|
### <sub></sub> `/v2/LibraryConnector/<Type>`
|
||||||
|
|
||||||
|
Returns the Library-Connector for the specified Type.
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Request</summary>
|
||||||
|
|
||||||
|
`Type` is returned by [GET /v2/LibraryConnector/Types](#/v2/LibraryConnector/Types)
|
||||||
|
</details>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Returns</summary>
|
||||||
|
|
||||||
|
[LibraryConnector](Types.md#libraryconnector)
|
||||||
|
|
||||||
|
| StatusCode | Meaning |
|
||||||
|
|------------|---------------------------------------|
|
||||||
|
| 404 | Library Connector Type does not exist |
|
||||||
|
</details>
|
||||||
|
|
||||||
|
### <sub></sub> `/v2/LibraryConnector/<Type>`
|
||||||
|
|
||||||
|
Creates a Library-Connector of the specified Type.
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Request</summary>
|
||||||
|
|
||||||
|
`Type` is returned by [GET /v2/LibraryConnector/Types](#/v2/LibraryConnector/Types)
|
||||||
|
|
||||||
|
| Parameter | Value |
|
||||||
|
|-------------|--------------------|
|
||||||
|
| URL | URL of the Library |
|
||||||
|
|
||||||
|
#### Type specific Parameters (must be included for each)
|
||||||
|
* Komga
|
||||||
|
|
||||||
|
| Parameter | Value |
|
||||||
|
|-----------|-------------------------------------------------------------------------------------------------------------------|
|
||||||
|
| auth | [Base64 encoded Basic-Authentication-String](https://datatracker.ietf.org/doc/html/rfc7617) (`username:password`) |
|
||||||
|
|
||||||
|
* Kavita
|
||||||
|
|
||||||
|
| Parameter | Value |
|
||||||
|
|-----------|-----------------|
|
||||||
|
| username | Kavita Username |
|
||||||
|
| password | Kavita Password |
|
||||||
|
</details>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Returns</summary>
|
||||||
|
|
||||||
|
[LibraryConnector](Types.md#libraryconnector)
|
||||||
|
|
||||||
|
| StatusCode | Meaning |
|
||||||
|
|------------|----------------------------------|
|
||||||
|
| 404 | Library Connector does not exist |
|
||||||
|
| 500 | Parsing Error |
|
||||||
|
</details>
|
||||||
|
|
||||||
|
### <sub></sub> `/v2/LibraryConnector/<Type>/Test`
|
||||||
|
|
||||||
|
Tests a Library-Connector of the specified Type.
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Request</summary>
|
||||||
|
|
||||||
|
`Type` is returned by [GET /v2/LibraryConnector/Types](#/v2/LibraryConnector/Types)
|
||||||
|
|
||||||
|
| Parameter | Value |
|
||||||
|
|-------------|--------------------|
|
||||||
|
| URL | URL of the Library |
|
||||||
|
|
||||||
|
#### Type specific Parameters (must be included for each)
|
||||||
|
* Komga
|
||||||
|
|
||||||
|
| Parameter | Value |
|
||||||
|
|-----------|-------------------------------------------------------------------------------------------------------------------|
|
||||||
|
| auth | [Base64 encoded Basic-Authentication-String](https://datatracker.ietf.org/doc/html/rfc7617) (`username:password`) |
|
||||||
|
|
||||||
|
* Kavita
|
||||||
|
|
||||||
|
| Parameter | Value |
|
||||||
|
|-----------|-----------------|
|
||||||
|
| username | Kavita Username |
|
||||||
|
| password | Kavita Password |
|
||||||
|
</details>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Returns</summary>
|
||||||
|
|
||||||
|
| StatusCode | Meaning |
|
||||||
|
|------------|---------------------------------------|
|
||||||
|
| 200 | Test successful |
|
||||||
|
| 404 | Library Connector Type does not exist |
|
||||||
|
| 408 | Test failed |
|
||||||
|
| 500 | Parsing Error |
|
||||||
|
</details>
|
||||||
|
|
||||||
|
### <sub></sub> `/v2/LibraryConnector/<Type>`
|
||||||
|
|
||||||
|
Deletes the Library-Connector of the specified Type.
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Request</summary>
|
||||||
|
|
||||||
|
`Type` is returned by [GET /v2/LibraryConnector/Types](#/v2/LibraryConnector/Types)
|
||||||
|
</details>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Returns</summary>
|
||||||
|
|
||||||
|
| StatusCode | Meaning |
|
||||||
|
|------------|---------------------------------------|
|
||||||
|
| 200 | Deleted |
|
||||||
|
| 404 | Library Connector Type does not exist |
|
||||||
|
</details>
|
||||||
|
|
||||||
|
## Notification Connectors <sup>[^top](#top)</sup>
|
||||||
|
|
||||||
|
### <sub></sub> `/v2/NotificationConnector`
|
||||||
|
|
||||||
|
Returns the configured Notification-Connectors.
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Returns</summary>
|
||||||
|
|
||||||
|
List of [NotificationConnectors](Types.md#notificationconnector)
|
||||||
|
</details>
|
||||||
|
|
||||||
|
### <sub></sub> `/v2/NotificationConnector/Types`
|
||||||
|
|
||||||
|
Returns the available Notification-Connectors.
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Returns</summary>
|
||||||
|
|
||||||
|
List of String of Names.
|
||||||
|
</details>
|
||||||
|
|
||||||
|
### <sub></sub> `/v2/NotificationConnector/<Type>`
|
||||||
|
|
||||||
|
Returns the configured Notification-Connector of the specified Type.
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Returns</summary>
|
||||||
|
|
||||||
|
[Notification Connector](Types.md#notificationconnector)
|
||||||
|
|
||||||
|
| StatusCode | Meaning |
|
||||||
|
|------------|---------------------------------------|
|
||||||
|
| 404 | Library Connector Type does not exist |
|
||||||
|
</details>
|
||||||
|
|
||||||
|
### <sub></sub> `/v2/NotificationConnector/<Type>`
|
||||||
|
|
||||||
|
Creates a Notification-Connector of the specified Type.
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Request</summary>
|
||||||
|
|
||||||
|
`Type` is returned by [GET /v2/NotificationConnector/Types](#/v2/NotificationConnector/Types)
|
||||||
|
|
||||||
|
#### Type specific Parameters (must be included for each)
|
||||||
|
* Gotify
|
||||||
|
|
||||||
|
| Parameter | Value |
|
||||||
|
|-----------|---------------------------------------|
|
||||||
|
| url | URL of the Gotify Instance |
|
||||||
|
| appToken | AppToken of the configured Gotify App |
|
||||||
|
|
||||||
|
* LunaSea
|
||||||
|
|
||||||
|
| Parameter | Value |
|
||||||
|
|-----------|-----------------|
|
||||||
|
| webhook | LunaSea Webhook |
|
||||||
|
|
||||||
|
* Nty
|
||||||
|
|
||||||
|
| Parameter | Value |
|
||||||
|
|-----------|--------------------------|
|
||||||
|
| url | URL of the Ntfy Instance |
|
||||||
|
| auth | Auth-String |
|
||||||
|
</details>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Returns</summary>
|
||||||
|
|
||||||
|
[NotificationConnector](Types.md#notificationconnector)
|
||||||
|
|
||||||
|
| StatusCode | Meaning |
|
||||||
|
|------------|--------------------------------------------|
|
||||||
|
| 404 | Notification Connector Type does not exist |
|
||||||
|
| 500 | Parsing Error |
|
||||||
|
</details>
|
||||||
|
|
||||||
|
### <sub></sub> `/v2/NotificationConnector/<Type>/Test`
|
||||||
|
|
||||||
|
Tests a Notification-Connector of the specified Type.
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Request</summary>
|
||||||
|
|
||||||
|
`Type` is returned by [GET /v2/NotificationConnector/Types](#/v2/NotificationConnector/Types)
|
||||||
|
|
||||||
|
#### Type specific Parameters (must be included for each)
|
||||||
|
* Gotify
|
||||||
|
|
||||||
|
| Parameter | Value |
|
||||||
|
|-----------|---------------------------------------|
|
||||||
|
| url | URL of the Gotify Instance |
|
||||||
|
| appToken | AppToken of the configured Gotify App |
|
||||||
|
|
||||||
|
* LunaSea
|
||||||
|
|
||||||
|
| Parameter | Value |
|
||||||
|
|-----------|-----------------|
|
||||||
|
| webhook | LunaSea Webhook |
|
||||||
|
|
||||||
|
* Ntfy
|
||||||
|
|
||||||
|
| Parameter | Value |
|
||||||
|
|-----------|--------------------------|
|
||||||
|
| url | URL of the Ntfy Instance |
|
||||||
|
| auth | Auth-String |
|
||||||
|
</details>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Returns</summary>
|
||||||
|
|
||||||
|
| StatusCode | Meaning |
|
||||||
|
|------------|--------------------------------------------|
|
||||||
|
| 200 | Test successful |
|
||||||
|
| 404 | Notification Connector Type does not exist |
|
||||||
|
| 408 | Test failed |
|
||||||
|
| 500 | Parsing Error |
|
||||||
|
</details>
|
||||||
|
|
||||||
|
### <sub></sub> `/v2/NotificationConnector/<Type>`
|
||||||
|
|
||||||
|
Deletes the Notification-Connector of the specified Type.
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Request</summary>
|
||||||
|
|
||||||
|
`Type` is returned by [GET /v2/NotificationConnector/Types](#/v2/NotificationConnector/Types)
|
||||||
|
</details>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Returns</summary>
|
||||||
|
|
||||||
|
| StatusCode | Meaning |
|
||||||
|
|------------|--------------------------------------------|
|
||||||
|
| 200 | Deleted |
|
||||||
|
| 404 | Notification Connector Type does not exist |
|
||||||
|
</details>
|
||||||
|
|
||||||
|
## Miscellaneous <sup>[^top](#top)</sup>
|
||||||
|
|
||||||
|
### <sub></sub> `/v2/LogFile`
|
||||||
|
|
||||||
|
Returns the current log-file.
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Returns</summary>
|
||||||
|
|
||||||
|
The Logfile as Stream.
|
||||||
|
</details>
|
||||||
|
|
||||||
|
### <sub></sub> `/v2/Ping`
|
||||||
|
|
||||||
|
Pong!
|
||||||
|
|
||||||
|
### <sub></sub> `/v2/Ping`
|
||||||
|
|
||||||
|
Pong!
|
41
docs/Types.md
Normal file
41
docs/Types.md
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
## Manga
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Chapter
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Job
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## ProgressToken
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Settings
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## LibraryConnector
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## NotificationConnector
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
}
|
||||||
|
```
|
Loading…
x
Reference in New Issue
Block a user