From de7a00ab86b28bb8aa33029c8ead0545875e6cd2 Mon Sep 17 00:00:00 2001 From: Alexey Kasyanchuk Date: Thu, 8 Jun 2023 03:03:12 +0300 Subject: [PATCH] more commands to api documentation --- docs/API.md | 74 +++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 63 insertions(+), 11 deletions(-) diff --git a/docs/API.md b/docs/API.md index e4adfcd..b0d855b 100644 --- a/docs/API.md +++ b/docs/API.md @@ -48,26 +48,78 @@ example of request: "index": 0, "limit": 10, "orderBy": "order_field", - "orderDesc": "DESC" + "orderDesc": "DESC", + "safeSearch": false } } ``` -fields: -* text (string) - torrent search name -* navigation (object) [optional] - object with navigation params -* * index (int) [optional] - stating of torrent index of navigation -* * limit (int) [optional] [default: 10] - max number of results on page -* * orderBy (text) [optional] - field which is using for order results -* * orderDesc (enum [DESC, ASC]) [optional] - sort direction of the field +| Field | Type | Optional | Default Value | Description | +| ----- | ---- | -------- | ------------- | ----------- | +| text | string | ❎ | | torrent search name | +| navigation | object (Navigation) | ✅ | | object with navigation params | +|       index | int | ✅ | 0 | stating of torrent index of navigation | +|       limit | int | ✅ | 10 | max number of results on page | +|       orderBy | text | ✅ | | field which is using for order results | +|       orderDesc | enum [**DESC, ASC**] | ✅ | ASC | sort direction of the field | +|       safeSearch | bool | ✅ | true | disable/enable safe search for torrents | +|       type | string | ✅ | | type of content for search | +|       size | object (Interval) | ✅ | | size of torrent | +|            min | uint64 | ✅ | | minumum size of the torrent | +|            max | uint64 | ✅ | | maximum size of the torrent | +|       files | object (Interval) | ✅ | | files on the torrent | +|            min | int | ✅ | | minumum size of the torrent | +|            max | int | ✅ | | maximum size of the torrent | -#### Reading queue +### Reading queue -As said before after each request and periodicly you need to read queue for additional messaged +As said before after each request and periodicly you need to read queue for additional messages. endpoint (GET REQUEST): ``` https://localhost:8095/api/queue ``` -after executing of search **/api/searchTorrent** request **additional result of search will be in queue**! \ No newline at end of file +after executing of search **/api/searchTorrent** request **additional result of search will be in queue**! + +### Search of the torrent by files + +endpoint (GET REQUEST): +``` +https://localhost:8095/api/searchFiles?text=TorrentWithFileName&navigation={} +``` + +| Field | Type | Optional | Default Value | Description | +| ----- | ---- | -------- | ------------- | ----------- | +| text | string | ❎ | | torrent search name | +| navigation | object (Navigation) | ✅ | | object with navigation params | +|       index | int | ✅ | 0 | stating of torrent index of navigation | +|       limit | int | ✅ | 10 | max number of results on page | +|       orderBy | text | ✅ | | field which is using for order results | +|       orderDesc | enum [**DESC, ASC**] | ✅ | ASC | sort direction of the field | +|       safeSearch | bool | ✅ | true | disable/enable safe search for torrents | + +### Recheck trackers info for the torrent + +endpoint (GET REQUEST): +``` +https://localhost:8095/api/checkTrackers?hash=29ebe63feb8be91b6dcff02bacc562d9a99ea864 +``` + +| Field | Type | Optional | Default Value | Description | +| ----- | ---- | -------- | ------------- | ----------- | +| hash | string | ❎ | | torrent hash to refresh token | + +### Top torrents + +endpoint (GET REQUEST): +``` +https://localhost:8095/api/topTorrents?type=video&navigation={"hours":"week"} +``` + +| Field | Type | Optional | Default Value | Description | +| ----- | ---- | -------- | ------------- | ----------- | +| type | string | ❎ | | type of category for top of the torrents | +| navigation | object (Navigation) | ✅ | | object with navigation params (check /api/searchTorrent for mo details) | +|       time | enum [hours, week, month] | ✅ | | time for the top +