docs(swagger): add JSDoc @openapi for proxy routes
- Sonarr: queue, history, series, notifications CRUD, webhook setup - Radarr: queue, history, movies, notifications CRUD, webhook setup - SABnzbd: queue, history - Emby: sessions, users - Document that these are authenticated proxies to upstream services - Include notification proxy endpoints for webhook configuration
This commit is contained in:
@@ -5,9 +5,32 @@ const router = express.Router();
|
||||
const requireAuth = require('../middleware/requireAuth');
|
||||
const sanitizeError = require('../utils/sanitizeError');
|
||||
|
||||
/**
|
||||
* @openapi
|
||||
* /api/sabnzbd/queue:
|
||||
* get:
|
||||
* tags: [SABnzbd]
|
||||
* summary: Get SABnzbd queue
|
||||
* description: Proxy to SABnzbd's queue endpoint. Requires authentication.
|
||||
* security:
|
||||
* - CookieAuth: []
|
||||
* responses:
|
||||
* '200':
|
||||
* description: Queue data from SABnzbd
|
||||
* content:
|
||||
* application/json:
|
||||
* schema:
|
||||
* type: object
|
||||
* '500':
|
||||
* description: Proxy error
|
||||
* content:
|
||||
* application/json:
|
||||
* schema:
|
||||
* $ref: '#/components/schemas/ErrorResponse'
|
||||
*/
|
||||
router.use(requireAuth);
|
||||
|
||||
// Get current queue
|
||||
// GET /api/sabnzbd/queue
|
||||
router.get('/queue', async (req, res) => {
|
||||
try {
|
||||
const response = await axios.get(`${process.env.SABNZBD_URL}/api`, {
|
||||
@@ -23,7 +46,31 @@ router.get('/queue', async (req, res) => {
|
||||
}
|
||||
});
|
||||
|
||||
// Get history
|
||||
/**
|
||||
* @openapi
|
||||
* /api/sabnzbd/history:
|
||||
* get:
|
||||
* tags: [SABnzbd]
|
||||
* summary: Get SABnzbd history
|
||||
* description: Proxy to SABnzbd's history endpoint. Requires authentication.
|
||||
* security:
|
||||
* - CookieAuth: []
|
||||
* parameters:
|
||||
* - name: limit
|
||||
* in: query
|
||||
* schema:
|
||||
* type: integer
|
||||
* default: 50
|
||||
* description: Number of history records to return
|
||||
* responses:
|
||||
* '200':
|
||||
* description: History data from SABnzbd
|
||||
* content:
|
||||
* application/json:
|
||||
* schema:
|
||||
* type: object
|
||||
*/
|
||||
// GET /api/sabnzbd/history
|
||||
router.get('/history', async (req, res) => {
|
||||
try {
|
||||
const response = await axios.get(`${process.env.SABNZBD_URL}/api`, {
|
||||
|
||||
Reference in New Issue
Block a user