Updated docs for notifier/service-royalroad-chapters
Linked build commit: 377587a043
This commit is contained in:
1 parent
b7ebe91a6a
commit
8a1c62fa83
2 files changed
+467
No files matched your search
@@ -0,0 +1,167 @@
|
|||||||
|
# royalroad
|
||||||
|
|
||||||
|
Base URL: `https://notifier.gansejunge.com/internal/royalroad`
|
||||||
|
|
||||||
|
### `POST /feed/add`
|
||||||
|
|
||||||
|
**Add Feed**
|
||||||
|
|
||||||
|
| Name | In | Type | Required |
|
||||||
|
|---|---|---|---|
|
||||||
|
| `X-User-Id` | header | integer | yes |
|
||||||
|
|
||||||
|
**Request body:**
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "royalroad",
|
||||||
|
"rss_feed_url": "string",
|
||||||
|
"custom_name": "string"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
**Example:**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
curl -X POST 'https://notifier.gansejunge.com/internal/royalroad/feed/add' \
|
||||||
|
-H 'X-API-Key: <api_key>' \
|
||||||
|
-H 'Content-Type: application/json' \
|
||||||
|
-d '{"type": "royalroad", "rss_feed_url": "string", "custom_name": "string"}'
|
||||||
|
```
|
||||||
|
|
||||||
|
**Responses:**
|
||||||
|
|
||||||
|
- `200`: Successful Response
|
||||||
|
- `422`: Validation Error
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"detail": [
|
||||||
|
{
|
||||||
|
"loc": [
|
||||||
|
"string"
|
||||||
|
],
|
||||||
|
"msg": "string",
|
||||||
|
"type": "string",
|
||||||
|
"input": null,
|
||||||
|
"ctx": {}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### `POST /feed/delete`
|
||||||
|
|
||||||
|
**Delete Feed**
|
||||||
|
|
||||||
|
| Name | In | Type | Required |
|
||||||
|
|---|---|---|---|
|
||||||
|
| `X-User-Id` | header | integer | yes |
|
||||||
|
|
||||||
|
**Request body:**
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "royalroad",
|
||||||
|
"rss_feed_url": "string",
|
||||||
|
"custom_name": "string"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
**Example:**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
curl -X POST 'https://notifier.gansejunge.com/internal/royalroad/feed/delete' \
|
||||||
|
-H 'X-API-Key: <api_key>' \
|
||||||
|
-H 'Content-Type: application/json' \
|
||||||
|
-d '{"type": "royalroad", "rss_feed_url": "string", "custom_name": "string"}'
|
||||||
|
```
|
||||||
|
|
||||||
|
**Responses:**
|
||||||
|
|
||||||
|
- `200`: Successful Response
|
||||||
|
- `422`: Validation Error
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"detail": [
|
||||||
|
{
|
||||||
|
"loc": [
|
||||||
|
"string"
|
||||||
|
],
|
||||||
|
"msg": "string",
|
||||||
|
"type": "string",
|
||||||
|
"input": null,
|
||||||
|
"ctx": {}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### `GET /feed/list`
|
||||||
|
|
||||||
|
**List Subscribed Feeds**
|
||||||
|
|
||||||
|
| Name | In | Type | Required |
|
||||||
|
|---|---|---|---|
|
||||||
|
| `X-User-Id` | header | integer | yes |
|
||||||
|
|
||||||
|
**Example:**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
curl -X GET 'https://notifier.gansejunge.com/internal/royalroad/feed/list' \
|
||||||
|
-H 'X-API-Key: <api_key>'
|
||||||
|
```
|
||||||
|
|
||||||
|
**Responses:**
|
||||||
|
|
||||||
|
- `200`: Successful Response
|
||||||
|
- `422`: Validation Error
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"detail": [
|
||||||
|
{
|
||||||
|
"loc": [
|
||||||
|
"string"
|
||||||
|
],
|
||||||
|
"msg": "string",
|
||||||
|
"type": "string",
|
||||||
|
"input": null,
|
||||||
|
"ctx": {}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### `POST /update/{rss_feed_type}`
|
||||||
|
|
||||||
|
**Update Rss Feeds**
|
||||||
|
|
||||||
|
| Name | In | Type | Required |
|
||||||
|
|---|---|---|---|
|
||||||
|
| `rss_feed_type` | path | string | yes |
|
||||||
|
|
||||||
|
**Example:**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
curl -X POST 'https://notifier.gansejunge.com/internal/royalroad/update/<rss_feed_type>' \
|
||||||
|
-H 'X-API-Key: <api_key>'
|
||||||
|
```
|
||||||
|
|
||||||
|
**Responses:**
|
||||||
|
|
||||||
|
- `200`: Successful Response
|
||||||
|
- `422`: Validation Error
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"detail": [
|
||||||
|
{
|
||||||
|
"loc": [
|
||||||
|
"string"
|
||||||
|
],
|
||||||
|
"msg": "string",
|
||||||
|
"type": "string",
|
||||||
|
"input": null,
|
||||||
|
"ctx": {}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
@@ -0,0 +1,300 @@
|
|||||||
|
{
|
||||||
|
"openapi": "3.1.0",
|
||||||
|
"info": {
|
||||||
|
"title": "royalroad",
|
||||||
|
"version": "0.1.0"
|
||||||
|
},
|
||||||
|
"paths": {
|
||||||
|
"/update/{rss_feed_type}": {
|
||||||
|
"post": {
|
||||||
|
"summary": "Update Rss Feeds",
|
||||||
|
"operationId": "update_rss_feeds_update__rss_feed_type__post",
|
||||||
|
"security": [
|
||||||
|
{
|
||||||
|
"HTTPBearer": []
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "rss_feed_type",
|
||||||
|
"in": "path",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/components/schemas/FeedEntryType"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"description": "Successful Response",
|
||||||
|
"content": {
|
||||||
|
"application/json": {
|
||||||
|
"schema": {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"422": {
|
||||||
|
"description": "Validation Error",
|
||||||
|
"content": {
|
||||||
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/components/schemas/HTTPValidationError"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"/feed/add": {
|
||||||
|
"post": {
|
||||||
|
"summary": "Add Feed",
|
||||||
|
"operationId": "add_feed_feed_add_post",
|
||||||
|
"security": [
|
||||||
|
{
|
||||||
|
"HTTPBearer": []
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "X-User-Id",
|
||||||
|
"in": "header",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"type": "integer",
|
||||||
|
"exclusiveMinimum": 0,
|
||||||
|
"title": "X-User-Id"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"requestBody": {
|
||||||
|
"required": true,
|
||||||
|
"content": {
|
||||||
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/components/schemas/FeedEntry"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"description": "Successful Response",
|
||||||
|
"content": {
|
||||||
|
"application/json": {
|
||||||
|
"schema": {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"422": {
|
||||||
|
"description": "Validation Error",
|
||||||
|
"content": {
|
||||||
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/components/schemas/HTTPValidationError"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"/feed/delete": {
|
||||||
|
"post": {
|
||||||
|
"summary": "Delete Feed",
|
||||||
|
"operationId": "delete_feed_feed_delete_post",
|
||||||
|
"security": [
|
||||||
|
{
|
||||||
|
"HTTPBearer": []
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "X-User-Id",
|
||||||
|
"in": "header",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"type": "integer",
|
||||||
|
"exclusiveMinimum": 0,
|
||||||
|
"title": "X-User-Id"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"requestBody": {
|
||||||
|
"required": true,
|
||||||
|
"content": {
|
||||||
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/components/schemas/FeedEntry"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"description": "Successful Response",
|
||||||
|
"content": {
|
||||||
|
"application/json": {
|
||||||
|
"schema": {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"422": {
|
||||||
|
"description": "Validation Error",
|
||||||
|
"content": {
|
||||||
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/components/schemas/HTTPValidationError"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"/feed/list": {
|
||||||
|
"get": {
|
||||||
|
"summary": "List Subscribed Feeds",
|
||||||
|
"operationId": "list_subscribed_feeds_feed_list_get",
|
||||||
|
"security": [
|
||||||
|
{
|
||||||
|
"HTTPBearer": []
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "X-User-Id",
|
||||||
|
"in": "header",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"type": "integer",
|
||||||
|
"exclusiveMinimum": 0,
|
||||||
|
"title": "X-User-Id"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"description": "Successful Response",
|
||||||
|
"content": {
|
||||||
|
"application/json": {
|
||||||
|
"schema": {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"422": {
|
||||||
|
"description": "Validation Error",
|
||||||
|
"content": {
|
||||||
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/components/schemas/HTTPValidationError"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"components": {
|
||||||
|
"schemas": {
|
||||||
|
"FeedEntry": {
|
||||||
|
"properties": {
|
||||||
|
"type": {
|
||||||
|
"$ref": "#/components/schemas/FeedEntryType"
|
||||||
|
},
|
||||||
|
"rss_feed_url": {
|
||||||
|
"type": "string",
|
||||||
|
"maxLength": 512,
|
||||||
|
"title": "Rss Feed Url"
|
||||||
|
},
|
||||||
|
"custom_name": {
|
||||||
|
"anyOf": [
|
||||||
|
{
|
||||||
|
"type": "string",
|
||||||
|
"maxLength": 255
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "null"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"title": "Custom Name"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"type": "object",
|
||||||
|
"required": [
|
||||||
|
"type",
|
||||||
|
"rss_feed_url"
|
||||||
|
],
|
||||||
|
"title": "FeedEntry"
|
||||||
|
},
|
||||||
|
"FeedEntryType": {
|
||||||
|
"type": "string",
|
||||||
|
"enum": [
|
||||||
|
"royalroad",
|
||||||
|
"gitea"
|
||||||
|
],
|
||||||
|
"title": "FeedEntryType"
|
||||||
|
},
|
||||||
|
"HTTPValidationError": {
|
||||||
|
"properties": {
|
||||||
|
"detail": {
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/components/schemas/ValidationError"
|
||||||
|
},
|
||||||
|
"type": "array",
|
||||||
|
"title": "Detail"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"type": "object",
|
||||||
|
"title": "HTTPValidationError"
|
||||||
|
},
|
||||||
|
"ValidationError": {
|
||||||
|
"properties": {
|
||||||
|
"loc": {
|
||||||
|
"items": {
|
||||||
|
"anyOf": [
|
||||||
|
{
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "integer"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"type": "array",
|
||||||
|
"title": "Location"
|
||||||
|
},
|
||||||
|
"msg": {
|
||||||
|
"type": "string",
|
||||||
|
"title": "Message"
|
||||||
|
},
|
||||||
|
"type": {
|
||||||
|
"type": "string",
|
||||||
|
"title": "Error Type"
|
||||||
|
},
|
||||||
|
"input": {
|
||||||
|
"title": "Input"
|
||||||
|
},
|
||||||
|
"ctx": {
|
||||||
|
"type": "object",
|
||||||
|
"title": "Context"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"type": "object",
|
||||||
|
"required": [
|
||||||
|
"loc",
|
||||||
|
"msg",
|
||||||
|
"type"
|
||||||
|
],
|
||||||
|
"title": "ValidationError"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"securitySchemes": {
|
||||||
|
"HTTPBearer": {
|
||||||
|
"type": "http",
|
||||||
|
"scheme": "bearer"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in new issue
Block a user