add some features
This commit is contained in:
@@ -11,6 +11,87 @@ import { configCache } from '../services/cacheService.js';
|
||||
|
||||
const router = Router();
|
||||
|
||||
/**
|
||||
* @openapi
|
||||
* /api/v1/config/image-rules:
|
||||
* get:
|
||||
* summary: Get image validation rules
|
||||
* tags:
|
||||
* - Configuration
|
||||
* security:
|
||||
* - bearerAuth: []
|
||||
* - cookieAuth: []
|
||||
* responses:
|
||||
* 200:
|
||||
* description: Image rules configuration
|
||||
* 404:
|
||||
* description: Image rules not found
|
||||
* put:
|
||||
* summary: Update image validation rules
|
||||
* tags:
|
||||
* - Configuration
|
||||
* security:
|
||||
* - bearerAuth: []
|
||||
* - cookieAuth: []
|
||||
* requestBody:
|
||||
* required: true
|
||||
* content:
|
||||
* application/json:
|
||||
* schema:
|
||||
* type: object
|
||||
* required:
|
||||
* - name
|
||||
* - allowedMimeTypes
|
||||
* - maxFileSizeBytes
|
||||
* - maxWidthPx
|
||||
* - maxHeightPx
|
||||
* - jpegQuality
|
||||
* - oversizeBehavior
|
||||
* - maxAttachmentsPerField
|
||||
* properties:
|
||||
* name:
|
||||
* type: string
|
||||
* allowedMimeTypes:
|
||||
* type: array
|
||||
* items:
|
||||
* type: string
|
||||
* maxFileSizeBytes:
|
||||
* type: integer
|
||||
* maxWidthPx:
|
||||
* type: integer
|
||||
* maxHeightPx:
|
||||
* type: integer
|
||||
* jpegQuality:
|
||||
* type: integer
|
||||
* minimum: 1
|
||||
* maximum: 100
|
||||
* oversizeBehavior:
|
||||
* type: string
|
||||
* enum: [auto_optimize, warn_then_optimize, block]
|
||||
* maxAttachmentsPerField:
|
||||
* type: integer
|
||||
* responses:
|
||||
* 200:
|
||||
* description: Image rules updated
|
||||
* 400:
|
||||
* description: Invalid input
|
||||
* 404:
|
||||
* description: Image rules not found
|
||||
* /api/v1/config/export:
|
||||
* get:
|
||||
* summary: Get export profile configuration
|
||||
* tags:
|
||||
* - Configuration
|
||||
* security:
|
||||
* - bearerAuth: []
|
||||
* - cookieAuth: []
|
||||
* responses:
|
||||
* 200:
|
||||
* description: Export profile configuration
|
||||
* 404:
|
||||
* description: Export profile not found
|
||||
*/
|
||||
|
||||
/*
|
||||
* Image-rules validation is shared between server and admin frontend. The server
|
||||
* acts as the final authority while the client validates proactively to give the
|
||||
|
||||
Reference in New Issue
Block a user