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:
@@ -15,6 +15,30 @@ function getFirstRadarrInstance() {
|
||||
return instances[0];
|
||||
}
|
||||
|
||||
/**
|
||||
* @openapi
|
||||
* /api/radarr/queue:
|
||||
* get:
|
||||
* tags: [Radarr]
|
||||
* summary: Get Radarr queue
|
||||
* description: Proxy to Radarr's queue endpoint. Requires authentication and CSRF token.
|
||||
* security:
|
||||
* - CookieAuth: []
|
||||
* - CsrfToken: []
|
||||
* responses:
|
||||
* '200':
|
||||
* description: Queue data from Radarr
|
||||
* content:
|
||||
* application/json:
|
||||
* schema:
|
||||
* type: object
|
||||
* '500':
|
||||
* description: Proxy error
|
||||
* content:
|
||||
* application/json:
|
||||
* schema:
|
||||
* $ref: '#/components/schemas/ErrorResponse'
|
||||
*/
|
||||
router.use(requireAuth);
|
||||
|
||||
// Get queue
|
||||
@@ -29,6 +53,30 @@ router.get('/queue', async (req, res) => {
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* @openapi
|
||||
* /api/radarr/history:
|
||||
* get:
|
||||
* tags: [Radarr]
|
||||
* summary: Get Radarr history
|
||||
* description: Proxy to Radarr's history endpoint. Requires authentication.
|
||||
* security:
|
||||
* - CookieAuth: []
|
||||
* parameters:
|
||||
* - name: pageSize
|
||||
* in: query
|
||||
* schema:
|
||||
* type: integer
|
||||
* default: 50
|
||||
* description: Number of records per page
|
||||
* responses:
|
||||
* '200':
|
||||
* description: History data from Radarr
|
||||
* content:
|
||||
* application/json:
|
||||
* schema:
|
||||
* type: object
|
||||
*/
|
||||
// Get history
|
||||
router.get('/history', async (req, res) => {
|
||||
try {
|
||||
@@ -66,6 +114,36 @@ router.get('/movies', async (req, res) => {
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* @openapi
|
||||
* /api/radarr/notifications/sofarr-webhook:
|
||||
* post:
|
||||
* tags: [Radarr]
|
||||
* summary: Configure Sofarr webhook
|
||||
* description: One-click setup for Sofarr webhook notification in Radarr. Requires authentication and CSRF token.
|
||||
* security:
|
||||
* - CookieAuth: []
|
||||
* - CsrfToken: []
|
||||
* responses:
|
||||
* '200':
|
||||
* description: Configured notification
|
||||
* content:
|
||||
* application/json:
|
||||
* schema:
|
||||
* type: object
|
||||
* '400':
|
||||
* description: Missing configuration
|
||||
* content:
|
||||
* application/json:
|
||||
* schema:
|
||||
* $ref: '#/components/schemas/ErrorResponse'
|
||||
* '503':
|
||||
* description: Radarr not configured
|
||||
* content:
|
||||
* application/json:
|
||||
* schema:
|
||||
* $ref: '#/components/schemas/ErrorResponse'
|
||||
*/
|
||||
// Notification proxy routes (Phase 3)
|
||||
// GET /api/radarr/notifications - list all notifications
|
||||
router.get('/notifications', async (req, res) => {
|
||||
|
||||
Reference in New Issue
Block a user