add some features

This commit is contained in:
2026-04-22 21:37:07 +02:00
parent bdd06105dd
commit c10e259ae8
20 changed files with 2101 additions and 1030 deletions
+106
View File
@@ -15,6 +15,112 @@ import { templateCache } from '../services/cacheService.js';
const router = Router();
/**
* @openapi
* /api/v1/templates:
* get:
* summary: List templates
* tags:
* - Templates
* security:
* - bearerAuth: []
* - cookieAuth: []
* parameters:
* - name: include
* in: query
* required: false
* schema:
* type: string
* enum: [definitions]
* responses:
* 200:
* description: List of templates
* /api/v1/templates/{templateCode}:
* get:
* summary: Get active template
* tags:
* - Templates
* security:
* - bearerAuth: []
* - cookieAuth: []
* parameters:
* - name: templateCode
* in: path
* required: true
* schema:
* type: string
* responses:
* 200:
* description: Active template details
* 404:
* description: Template not found
* /api/v1/templates/{templateCode}/versions:
* get:
* summary: List template versions
* tags:
* - Templates
* security:
* - bearerAuth: []
* - cookieAuth: []
* parameters:
* - name: templateCode
* in: path
* required: true
* schema:
* type: string
* responses:
* 200:
* description: List of template versions
* /api/v1/templates/{templateCode}/versions/{versionNumber}:
* get:
* summary: Get specific template version
* tags:
* - Templates
* security:
* - bearerAuth: []
* - cookieAuth: []
* parameters:
* - name: templateCode
* in: path
* required: true
* schema:
* type: string
* - name: versionNumber
* in: path
* required: true
* schema:
* type: integer
* responses:
* 200:
* description: Template version details
* 404:
* description: Template version not found
* /api/v1/templates/{templateCode}/versions/{versionNumber}/publish:
* put:
* summary: Publish template version
* tags:
* - Templates
* security:
* - bearerAuth: []
* - cookieAuth: []
* parameters:
* - name: templateCode
* in: path
* required: true
* schema:
* type: string
* - name: versionNumber
* in: path
* required: true
* schema:
* type: integer
* responses:
* 200:
* description: Template version published
* 404:
* description: Template version not found
*/
router.get(
'/',
asyncHandler(async (req, res) => {