From 33936c883f6fc5032770811385a9f8a3b1e6b759 Mon Sep 17 00:00:00 2001 From: Atsushi Nakatsugawa Date: Thu, 26 Dec 2024 21:02:39 +0900 Subject: [PATCH] support(jsdoc): add swagger document to installer.ts --- .../app/bin/swagger-jsdoc/definition-apiv3.js | 1 + apps/app/src/server/routes/apiv3/installer.ts | 42 +++++++++++++++++++ 2 files changed, 43 insertions(+) diff --git a/apps/app/bin/swagger-jsdoc/definition-apiv3.js b/apps/app/bin/swagger-jsdoc/definition-apiv3.js index 097d706d94c..ce5dcc054b8 100644 --- a/apps/app/bin/swagger-jsdoc/definition-apiv3.js +++ b/apps/app/bin/swagger-jsdoc/definition-apiv3.js @@ -81,6 +81,7 @@ module.exports = { 'UserGroups', 'Users Management', 'FullTextSearch Management', + 'Install', ], }, { diff --git a/apps/app/src/server/routes/apiv3/installer.ts b/apps/app/src/server/routes/apiv3/installer.ts index b2a3d64eb81..5a64278652a 100644 --- a/apps/app/src/server/routes/apiv3/installer.ts +++ b/apps/app/src/server/routes/apiv3/installer.ts @@ -29,6 +29,48 @@ module.exports = (crowi: Crowi): Router => { const minPasswordLength = configManager.getConfig('crowi', 'app:minPasswordLength'); + /** + * @swagger + * + * /installer: + * post: + * tags: [Install] + * security: [] + * operationId: Install + * summary: /installer + * description: Install GROWI + * requestBody: + * required: true + * content: + * application/json: + * schema: + * type: object + * properties: + * registerForm: + * type: object + * properties: + * name: + * type: string + * username: + * type: string + * email: + * type: string + * password: + * type: string + * app:globalLang: + * type: string + * default: en_US + * responses: + * 200: + * description: import settings params + * content: + * application/json: + * schema: + * properties: + * message: + * type: string + * example: Installation completed (Logged in as an admin user) + */ // eslint-disable-next-line max-len router.post('/', registerRules(minPasswordLength), registerValidation, addActivity, async(req: FormRequest, res: ApiV3Response) => { const appService = crowi.appService;