Просмотр исходного кода

Merge remote-tracking branch 'origin/master' into support/use-pnpm

Yuki Takei 1 год назад
Родитель
Сommit
75bc0deaf9
44 измененных файлов с 472 добавлено и 624 удалено
  1. 28 0
      apps/app/bin/swagger-jsdoc/definition-apiv1.js
  2. 93 0
      apps/app/bin/swagger-jsdoc/definition-apiv3.js
  3. 15 0
      apps/app/bin/swagger-jsdoc/generate-spec-apiv1.sh
  4. 14 0
      apps/app/bin/swagger-jsdoc/generate-spec-apiv3.sh
  5. 0 37
      apps/app/config/swagger-definition.js
  6. 8 6
      apps/app/package.json
  7. 1 1
      apps/app/src/features/callout/services/callout.ts
  8. 0 0
      apps/app/src/server/models/openapi/error-v3.ts
  9. 79 0
      apps/app/src/server/models/openapi/page.ts
  10. 39 0
      apps/app/src/server/models/openapi/revision.ts
  11. 1 7
      apps/app/src/server/routes/apiv3/admin-home.js
  12. 0 6
      apps/app/src/server/routes/apiv3/app-settings.js
  13. 1 8
      apps/app/src/server/routes/apiv3/attachment.js
  14. 0 6
      apps/app/src/server/routes/apiv3/bookmarks.js
  15. 0 6
      apps/app/src/server/routes/apiv3/customize-setting.js
  16. 0 6
      apps/app/src/server/routes/apiv3/export.js
  17. 0 6
      apps/app/src/server/routes/apiv3/healthcheck.ts
  18. 0 6
      apps/app/src/server/routes/apiv3/import.js
  19. 0 6
      apps/app/src/server/routes/apiv3/markdown-setting.js
  20. 1 7
      apps/app/src/server/routes/apiv3/mongo.js
  21. 0 6
      apps/app/src/server/routes/apiv3/notification-setting.js
  22. 4 83
      apps/app/src/server/routes/apiv3/page/index.ts
  23. 0 87
      apps/app/src/server/routes/apiv3/pages/index.js
  24. 11 17
      apps/app/src/server/routes/apiv3/personal-setting.js
  25. 0 45
      apps/app/src/server/routes/apiv3/revisions.js
  26. 3 8
      apps/app/src/server/routes/apiv3/search.js
  27. 26 32
      apps/app/src/server/routes/apiv3/security-settings/index.js
  28. 1 7
      apps/app/src/server/routes/apiv3/share-links.js
  29. 0 6
      apps/app/src/server/routes/apiv3/slack-integration-legacy-settings.js
  30. 13 19
      apps/app/src/server/routes/apiv3/slack-integration-settings.js
  31. 0 5
      apps/app/src/server/routes/apiv3/statistics.js
  32. 1 7
      apps/app/src/server/routes/apiv3/user-group-relation.js
  33. 14 20
      apps/app/src/server/routes/apiv3/user-group.js
  34. 14 20
      apps/app/src/server/routes/apiv3/users.js
  35. 1 1
      apps/app/src/server/routes/attachment/api.js
  36. 4 4
      apps/app/src/server/routes/comment.js
  37. 1 66
      apps/app/src/server/routes/page.js
  38. 1 1
      apps/app/src/server/routes/search.ts
  39. 2 0
      apps/app/src/services/renderer/renderer.tsx
  40. 15 16
      packages/remark-growi-directive/src/mdast-util-growi-directive/lib/index.js
  41. 15 15
      packages/remark-growi-directive/src/micromark-extension-growi-directive/lib/directive-leaf.js
  42. 17 17
      packages/remark-growi-directive/src/micromark-extension-growi-directive/lib/directive-text.js
  43. 19 19
      packages/remark-growi-directive/src/micromark-extension-growi-directive/lib/html.js
  44. 30 15
      pnpm-lock.yaml

+ 28 - 0
apps/app/bin/swagger-jsdoc/definition-apiv1.js

@@ -0,0 +1,28 @@
+const pkg = require('../../package.json');
+
+module.exports = {
+  openapi: '3.0.1',
+  info: {
+    title: 'GROWI REST API v1',
+    version: pkg.version,
+  },
+  servers: [
+    {
+      url: 'https://demo.growi.org/_api',
+    },
+  ],
+  security: [
+    {
+      api_key: [],
+    },
+  ],
+  components: {
+    securitySchemes: {
+      api_key: {
+        type: 'apiKey',
+        name: 'access_token',
+        in: 'query',
+      },
+    },
+  },
+};

+ 93 - 0
apps/app/bin/swagger-jsdoc/definition-apiv3.js

@@ -0,0 +1,93 @@
+const pkg = require('../../package.json');
+
+module.exports = {
+  openapi: '3.0.1',
+  info: {
+    title: 'GROWI REST API v3',
+    version: pkg.version,
+  },
+  servers: [
+    {
+      url: 'https://demo.growi.org/_api/v3',
+    },
+  ],
+  security: [
+    {
+      api_key: [],
+    },
+  ],
+  components: {
+    securitySchemes: {
+      api_key: {
+        type: 'apiKey',
+        name: 'access_token',
+        in: 'query',
+      },
+    },
+  },
+  'x-tagGroups': [
+    {
+      name: 'User API',
+      tags: [
+        'Attachment',
+        'Bookmarks',
+        'Page',
+        'Pages',
+        'Revisions',
+        'ShareLinks',
+        'Users',
+        '',
+        '',
+      ],
+    },
+    {
+      name: 'User Personal Settings API',
+      tags: [
+        'GeneralSetting',
+        'EditorSetting',
+        'InAppNotificationSettings',
+        '',
+        '',
+        '',
+        '',
+        '',
+      ],
+    },
+    {
+      name: 'System Management API',
+      tags: [
+        'Home',
+        'AppSettings',
+        'SecuritySetting',
+        'MarkDownSetting',
+        'CustomizeSetting',
+        'Import',
+        'Export',
+        'MongoDB',
+        'NotificationSetting',
+        'SlackIntegrationSettings',
+        'SlackIntegrationSettings (with proxy)',
+        'SlackIntegrationSettings (without proxy)',
+        'SlackIntegrationLegacySetting',
+        'ShareLink Management',
+        'UserGroupRelations',
+        'UserGroups',
+        'Users Management',
+        'FullTextSearch Management',
+      ],
+    },
+    {
+      name: 'Public API',
+      tags: [
+        'Healthcheck',
+        'Statistics',
+        '',
+        '',
+        '',
+        '',
+        '',
+        '',
+      ],
+    },
+  ],
+};

+ 15 - 0
apps/app/bin/swagger-jsdoc/generate-spec-apiv1.sh

@@ -0,0 +1,15 @@
+# USAGE:
+#   cd apps/app && sh bin/swagger-jsdoc/generate-spec-apiv1.sh
+#   APP_PATH=/path/to/apps/app sh bin/swagger-jsdoc/generate-spec-apiv1.sh
+#   APP_PATH=/path/to/apps/app OUT=/path/to/output sh bin/swagger-jsdoc/generate-spec-apiv1.sh
+
+APP_PATH=${APP_PATH:-"."}
+
+OUT=${OUT:-"${APP_PATH}/tmp/openapi-spec-apiv1.json"}
+
+swagger-jsdoc \
+  -o "${OUT}" \
+  -d "${APP_PATH}/bin/swagger-jsdoc/definition-apiv1.js" \
+  "${APP_PATH}/src/server/routes/*.{js,ts}" \
+  "${APP_PATH}/src/server/routes/attachment/**/*.{js,ts}" \
+  "${APP_PATH}/src/server/models/openapi/**/*.{js,ts}"

+ 14 - 0
apps/app/bin/swagger-jsdoc/generate-spec-apiv3.sh

@@ -0,0 +1,14 @@
+# USAGE:
+#   cd apps/app && sh bin/swagger-jsdoc/generate-spec-apiv3.sh
+#   APP_PATH=/path/to/apps/app sh bin/swagger-jsdoc/generate-spec-apiv3.sh
+#   APP_PATH=/path/to/apps/app OUT=/path/to/output sh bin/swagger-jsdoc/generate-spec-apiv3.sh
+
+APP_PATH=${APP_PATH:-"."}
+
+OUT=${OUT:-"${APP_PATH}/tmp/openapi-spec-apiv3.json"}
+
+swagger-jsdoc \
+  -o "${OUT}" \
+  -d "${APP_PATH}/bin/swagger-jsdoc/definition-apiv3.js" \
+  "${APP_PATH}/src/server/routes/apiv3/**/*.{js,ts}" \
+  "${APP_PATH}/src/server/models/openapi/**/*.{js,ts}"

+ 0 - 37
apps/app/config/swagger-definition.js

@@ -1,37 +0,0 @@
-const pkg = require('../package.json');
-
-const apiVersion = process.env.API_VERSION || '3';
-const basePath = (apiVersion === '1' ? '/_api' : `/_api/v${apiVersion}`);
-
-module.exports = {
-  openapi: '3.0.1',
-  info: {
-    title: `GROWI REST API v${apiVersion}`,
-    version: pkg.version,
-  },
-  servers: [
-    {
-      url: 'https://demo.growi.org{basePath}',
-      variables: {
-        basePath: {
-          default: basePath,
-          description: 'base path',
-        },
-      },
-    },
-  ],
-  security: [
-    {
-      api_key: [],
-    },
-  ],
-  components: {
-    securitySchemes: {
-      api_key: {
-        type: 'apiKey',
-        name: 'access_token',
-        in: 'query',
-      },
-    },
-  },
-};

+ 8 - 6
apps/app/package.json

@@ -30,9 +30,11 @@
     "lint:typecheck": "npx -y tspc",
     "lint:eslint": "eslint --quiet \"**/*.{js,jsx,ts,tsx}\"",
     "lint:styles": "stylelint \"src/**/*.scss\"",
-    "lint:swagger2openapi": "node node_modules/swagger2openapi/oas-validate tmp/swagger.json",
+    "lint:swagger2openapi:apiv3": "node node_modules/swagger2openapi/oas-validate tmp/openapi-spec-apiv3.json",
+    "lint:swagger2openapi:apiv1": "node node_modules/swagger2openapi/oas-validate tmp/openapi-spec-apiv1.json",
     "lint": "run-p lint:*",
-    "prelint:swagger2openapi": "pnpm run openapi:v3",
+    "prelint:swagger2openapi:apiv3": "pnpm run swagger2openapi:apiv3",
+    "prelint:swagger2openapi:apiv1": "pnpm run swagger2openapi:apiv1",
     "test": "run-p test:*",
     "test:jest": "cross-env NODE_ENV=test TS_NODE_PROJECT=test/integration/tsconfig.json jest",
     "test:vitest": "vitest run --coverage",
@@ -41,9 +43,8 @@
     "previtest:run:integ": "vitest run -c test-with-vite/download-mongo-binary/vitest.config.ts test-with-vite/download-mongo-binary",
     "//// misc": "",
     "console": "cross-env NODE_ENV=development pnpm run ts-node --experimental-repl-await src/server/console.js",
-    "swagger-jsdoc": "swagger-jsdoc -o tmp/swagger.json -d config/swagger-definition.js",
-    "openapi:v3": "cross-env API_VERSION=3 pnpm run swagger-jsdoc -- \"src/server/routes/apiv3/**/*.js\" \"src/server/models/**/*.js\"",
-    "openapi:v1": "cross-env API_VERSION=1 pnpm run swagger-jsdoc -- \"src/server/*/*.js\" \"src/server/models/**/*.js\"",
+    "swagger2openapi:apiv3": "sh bin/swagger-jsdoc/generate-spec-apiv3.sh",
+    "swagger2openapi:apiv1": "sh bin/swagger-jsdoc/generate-spec-apiv1.sh",
     "ts-node": "node -r ts-node/register/transpile-only -r tsconfig-paths/register -r dotenv-flow/config",
     "version:patch": "pnpm version patch",
     "version:prerelease": "pnpm version prerelease --preid=RC",
@@ -194,6 +195,7 @@
     "rehype-slug": "^6.0.0",
     "rehype-toc": "^3.0.2",
     "remark-breaks": "^4.0.0",
+    "remark-directive": "^3.0.0",
     "remark-emoji": "^5.0.0",
     "remark-frontmatter": "^5.0.0",
     "remark-gfm": "^4.0.0",
@@ -206,7 +208,7 @@
     "stream-to-promise": "^3.0.0",
     "string-width": "=4.2.2",
     "superjson": "^1.9.1",
-    "swagger-jsdoc": "^6.1.0",
+    "swagger-jsdoc": "^6.2.8",
     "swr": "^2.2.2",
     "throttle-debounce": "^5.0.0",
     "uid-safe": "^2.1.5",

+ 1 - 1
apps/app/src/features/callout/services/callout.ts

@@ -11,7 +11,7 @@ export const remarkPlugin: Plugin = () => {
         const data = node.data ?? (node.data = {});
         data.hName = 'callout';
         data.hProperties = {
-          name: node.name,
+          name: node.name.toLocaleLowerCase(),
         };
       }
     });

+ 0 - 0
apps/app/src/server/models/vo/error-v3.js → apps/app/src/server/models/openapi/error-v3.ts


+ 79 - 0
apps/app/src/server/models/openapi/page.ts

@@ -0,0 +1,79 @@
+/**
+ * @swagger
+ *
+ *  components:
+ *    schemas:
+ *      Page:
+ *        description: Page
+ *        type: object
+ *        properties:
+ *          _id:
+ *            type: string
+ *            description: page ID
+ *            example: 5e07345972560e001761fa63
+ *          __v:
+ *            type: number
+ *            description: DB record version
+ *            example: 0
+ *          commentCount:
+ *            type: number
+ *            description: count of comments
+ *            example: 3
+ *          createdAt:
+ *            type: string
+ *            description: date created at
+ *            example: 2010-01-01T00:00:00.000Z
+ *          creator:
+ *            $ref: '#/components/schemas/User'
+ *          extended:
+ *            type: object
+ *            description: extend data
+ *            example: {}
+ *          grant:
+ *            type: number
+ *            description: grant
+ *            example: 1
+ *          grantedUsers:
+ *            type: array
+ *            description: granted users
+ *            items:
+ *              type: string
+ *              description: user ID
+ *            example: ["5ae5fccfc5577b0004dbd8ab"]
+ *          lastUpdateUser:
+ *            $ref: '#/components/schemas/User'
+ *          liker:
+ *            type: array
+ *            description: granted users
+ *            items:
+ *              type: string
+ *              description: user ID
+ *            example: []
+ *          path:
+ *            type: string
+ *            description: page path
+ *            example: /
+ *          revision:
+ *            type: string
+ *            description: page revision
+ *          seenUsers:
+ *            type: array
+ *            description: granted users
+ *            items:
+ *              type: string
+ *              description: user ID
+ *            example: ["5ae5fccfc5577b0004dbd8ab"]
+ *          status:
+ *            type: string
+ *            description: status
+ *            enum:
+ *              - 'wip'
+ *              - 'published'
+ *              - 'deleted'
+ *              - 'deprecated'
+ *            example: published
+ *          updatedAt:
+ *            type: string
+ *            description: date updated at
+ *            example: 2010-01-01T00:00:00.000Z
+ */

+ 39 - 0
apps/app/src/server/models/openapi/revision.ts

@@ -0,0 +1,39 @@
+/**
+ * @swagger
+ *
+ *  components:
+ *    schemas:
+ *      Revision:
+ *        description: Revision
+ *        type: object
+ *        properties:
+ *          _id:
+ *            type: string
+ *            description: revision ID
+ *            example: 5e0734e472560e001761fa68
+ *          __v:
+ *            type: number
+ *            description: DB record version
+ *            example: 0
+ *          author:
+ *            $ref: '#/components/schemas/User/properties/_id'
+ *          body:
+ *            type: string
+ *            description: content body
+ *            example: |
+ *              # test
+ *
+ *              test
+ *          format:
+ *            type: string
+ *            description: format
+ *            example: markdown
+ *          path:
+ *            type: string
+ *            description: path
+ *            example: /user/alice/test
+ *          createdAt:
+ *            type: string
+ *            description: date created at
+ *            example: 2010-01-01T00:00:00.000Z
+ */

+ 1 - 7
apps/app/src/server/routes/apiv3/admin-home.js

@@ -4,12 +4,6 @@ const express = require('express');
 
 const router = express.Router();
 
-/**
- * @swagger
- *  tags:
- *    name: adminHome
- */
-
 /**
  * @swagger
  *
@@ -47,7 +41,7 @@ module.exports = (crowi) => {
    *
    *    /admin-home/:
    *      get:
-   *        tags: [AdminHome]
+   *        tags: [Admin]
    *        operationId: getAdminHome
    *        summary: /admin-home
    *        description: Get adminHome parameters

+ 0 - 6
apps/app/src/server/routes/apiv3/app-settings.js

@@ -17,12 +17,6 @@ const express = require('express');
 
 const router = express.Router();
 
-/**
- * @swagger
- *  tags:
- *    name: AppSettings
- */
-
 /**
  * @swagger
  *

+ 1 - 8
apps/app/src/server/routes/apiv3/attachment.js

@@ -24,13 +24,6 @@ const {
 } = require('express-validator');
 
 
-/**
- * @swagger
- *  tags:
- *    name: Attachment
- */
-
-
 /**
  * @swagger
  *
@@ -231,7 +224,7 @@ module.exports = (crowi) => {
    *
    *    /attachment:
    *      post:
-   *        tags: [Attachment, CrowiCompatibles]
+   *        tags: [Attachment]
    *        operationId: addAttachment
    *        summary: /attachment
    *        description: Add attachment to the page

+ 0 - 6
apps/app/src/server/routes/apiv3/bookmarks.js

@@ -17,12 +17,6 @@ const { body, query, param } = require('express-validator');
 
 const router = express.Router();
 
-/**
- * @swagger
- *  tags:
- *    name: Bookmarks
- */
-
 /**
  * @swagger
  *

+ 0 - 6
apps/app/src/server/routes/apiv3/customize-setting.js

@@ -21,12 +21,6 @@ const logger = loggerFactory('growi:routes:apiv3:customize-setting');
 const router = express.Router();
 
 
-/**
- * @swagger
- *  tags:
- *    name: CustomizeSetting
- */
-
 /**
  * @swagger
  *

+ 0 - 6
apps/app/src/server/routes/apiv3/export.js

@@ -13,12 +13,6 @@ const { param } = require('express-validator');
 
 const router = express.Router();
 
-/**
- * @swagger
- *  tags:
- *    name: Export
- */
-
 /**
  * @swagger
  *

+ 0 - 6
apps/app/src/server/routes/apiv3/healthcheck.ts

@@ -13,12 +13,6 @@ const logger = loggerFactory('growi:routes:apiv3:healthcheck');
 
 const router = express.Router();
 
-/**
- * @swagger
- *  tags:
- *    name: Healthcheck
- */
-
 /**
  * @swagger
  *

+ 0 - 6
apps/app/src/server/routes/apiv3/import.js

@@ -17,12 +17,6 @@ const multer = require('multer');
 
 const router = express.Router();
 
-/**
- * @swagger
- *  tags:
- *    name: Import
- */
-
 /**
  * @swagger
  *

+ 0 - 6
apps/app/src/server/routes/apiv3/markdown-setting.js

@@ -32,12 +32,6 @@ const validator = {
 };
 
 
-/**
- * @swagger
- *  tags:
- *    name: MarkDownSetting
- */
-
 /**
  * @swagger
  *

+ 1 - 7
apps/app/src/server/routes/apiv3/mongo.js

@@ -7,12 +7,6 @@ const mongoose = require('mongoose');
 
 const router = express.Router();
 
-/**
- * @swagger
- *  tags:
- *    name: Mongo
- */
-
 module.exports = (crowi) => {
   const loginRequiredStrictly = require('../../middlewares/login-required')(crowi);
   const adminRequired = require('../../middlewares/admin-required')(crowi);
@@ -22,7 +16,7 @@ module.exports = (crowi) => {
    *
    *  /mongo/collections:
    *    get:
-   *      tags: [Mongo]
+   *      tags: [MongoDB]
    *      operationId: getMongoCollections
    *      summary: /mongo/collections
    *      description: get mongodb collections names

+ 0 - 6
apps/app/src/server/routes/apiv3/notification-setting.js

@@ -41,12 +41,6 @@ const validator = {
   ],
 };
 
-/**
- * @swagger
- *  tags:
- *    name: NotificationSetting
- */
-
 /**
  * @swagger
  *

+ 4 - 83
apps/app/src/server/routes/apiv3/page/index.ts

@@ -46,91 +46,12 @@ const { body, query, param } = require('express-validator');
 
 const router = express.Router();
 
-/**
- * @swagger
- *  tags:
- *    name: Page
- */
 
 /**
  * @swagger
  *
- *  components:
- *    schemas:
- *      Page:
- *        description: Page
- *        type: object
- *        properties:
- *          _id:
- *            type: string
- *            description: page ID
- *            example: 5e07345972560e001761fa63
- *          __v:
- *            type: number
- *            description: DB record version
- *            example: 0
- *          commentCount:
- *            type: number
- *            description: count of comments
- *            example: 3
- *          createdAt:
- *            type: string
- *            description: date created at
- *            example: 2010-01-01T00:00:00.000Z
- *          creator:
- *            $ref: '#/components/schemas/User'
- *          extended:
- *            type: object
- *            description: extend data
- *            example: {}
- *          grant:
- *            type: number
- *            description: grant
- *            example: 1
- *          grantedUsers:
- *            type: array
- *            description: granted users
- *            items:
- *              type: string
- *              description: user ID
- *            example: ["5ae5fccfc5577b0004dbd8ab"]
- *          lastUpdateUser:
- *            $ref: '#/components/schemas/User'
- *          liker:
- *            type: array
- *            description: granted users
- *            items:
- *              type: string
- *              description: user ID
- *            example: []
- *          path:
- *            type: string
- *            description: page path
- *            example: /
- *          revision:
- *            type: string
- *            description: page revision
- *          seenUsers:
- *            type: array
- *            description: granted users
- *            items:
- *              type: string
- *              description: user ID
- *            example: ["5ae5fccfc5577b0004dbd8ab"]
- *          status:
- *            type: string
- *            description: status
- *            enum:
- *              - 'wip'
- *              - 'published'
- *              - 'deleted'
- *              - 'deprecated'
- *            example: published
- *          updatedAt:
- *            type: string
- *            description: date updated at
- *            example: 2010-01-01T00:00:00.000Z
- *
+ * components:
+ *   schemas:
  *      LikeParams:
  *        description: LikeParams
  *        type: object
@@ -744,9 +665,9 @@ module.exports = (crowi) => {
   /**
   * @swagger
   *
-  *    /pages/export:
+  *    /page/export:
   *      get:
-  *        tags: [Export]
+  *        tags: [Page]
   *        description: return page's markdown
   *        responses:
   *          200:

+ 0 - 87
apps/app/src/server/routes/apiv3/pages/index.js

@@ -27,12 +27,6 @@ const router = express.Router();
 const LIMIT_FOR_LIST = 10;
 const LIMIT_FOR_MULTIPLE_PAGE_OP = 20;
 
-/**
- * @swagger
- *  tags:
- *    name: Pages
- */
-
 /**
  * @swagger
  *
@@ -63,87 +57,6 @@ const LIMIT_FOR_MULTIPLE_PAGE_OP = 20;
  *            example: 3
  */
 
-/**
- * @swagger
- *
- *  components:
- *    schemas:
- *      Page:
- *        description: Page
- *        type: object
- *        properties:
- *          _id:
- *            type: string
- *            description: page ID
- *            example: 5e07345972560e001761fa63
- *          __v:
- *            type: number
- *            description: DB record version
- *            example: 0
- *          commentCount:
- *            type: number
- *            description: count of comments
- *            example: 3
- *          createdAt:
- *            type: string
- *            description: date created at
- *            example: 2010-01-01T00:00:00.000Z
- *          creator:
- *            $ref: '#/components/schemas/User'
- *          extended:
- *            type: object
- *            description: extend data
- *            example: {}
- *          grant:
- *            type: number
- *            description: grant
- *            example: 1
- *          grantedUsers:
- *            type: array
- *            description: granted users
- *            items:
- *              type: string
- *              description: user ID
- *            example: ["5ae5fccfc5577b0004dbd8ab"]
- *          lastUpdateUser:
- *            $ref: '#/components/schemas/User'
- *          liker:
- *            type: array
- *            description: granted users
- *            items:
- *              type: string
- *              description: user ID
- *            example: []
- *          path:
- *            type: string
- *            description: page path
- *            example: /Sandbox/Math
- *          revision:
- *            type: string
- *            description: revision ID
- *            example: ["5ae5fccfc5577b0004dbd8ab"]
- *          seenUsers:
- *            type: array
- *            description: granted users
- *            items:
- *              type: string
- *              description: user ID
- *            example: ["5ae5fccfc5577b0004dbd8ab"]
- *          status:
- *            type: string
- *            description: status
- *            enum:
- *              - 'wip'
- *              - 'published'
- *              - 'deleted'
- *              - 'deprecated'
- *            example: published
- *          updatedAt:
- *            type: string
- *            description: date updated at
- *            example: 2010-01-01T00:00:00.000Z
- */
-
 module.exports = (crowi) => {
   const accessTokenParser = require('../../../middlewares/access-token-parser')(crowi);
   const loginRequired = require('../../../middlewares/login-required')(crowi, true);

+ 11 - 17
apps/app/src/server/routes/apiv3/personal-setting.js

@@ -21,12 +21,6 @@ const passport = require('passport');
 
 const router = express.Router();
 
-/**
- * @swagger
- *  tags:
- *    name: PersonalSetting
- */
-
 /**
  * @swagger
  *
@@ -136,7 +130,7 @@ module.exports = (crowi) => {
    *
    *    /personal-setting:
    *      get:
-   *        tags: [PersonalSetting]
+   *        tags: [GeneralSetting]
    *        operationId: getPersonalSetting
    *        summary: /personal-setting
    *        description: Get personal parameters
@@ -175,7 +169,7 @@ module.exports = (crowi) => {
    *
    *    /personal-setting/is-password-set:
    *      get:
-   *        tags: [PersonalSetting]
+   *        tags: [GeneralSetting]
    *        operationId: getIsPasswordSet
    *        summary: /personal-setting
    *        description: Get whether a password has been set
@@ -210,7 +204,7 @@ module.exports = (crowi) => {
    *
    *    /personal-setting:
    *      put:
-   *        tags: [PersonalSetting]
+   *        tags: [GeneralSetting]
    *        operationId: updatePersonalSetting
    *        summary: /personal-setting
    *        description: Update personal setting
@@ -267,7 +261,7 @@ module.exports = (crowi) => {
    *
    *    /personal-setting/image-type:
    *      put:
-   *        tags: [PersonalSetting]
+   *        tags: [GeneralSetting]
    *        operationId: putUserImageType
    *        summary: /personal-setting/image-type
    *        description: Update user image type
@@ -304,7 +298,7 @@ module.exports = (crowi) => {
    *
    *    /personal-setting/external-accounts:
    *      get:
-   *        tags: [PersonalSetting]
+   *        tags: [GeneralSetting]
    *        operationId: getExternalAccounts
    *        summary: /personal-setting/external-accounts
    *        description: Get external accounts that linked current user
@@ -338,7 +332,7 @@ module.exports = (crowi) => {
    *
    *    /personal-setting/password:
    *      put:
-   *        tags: [PersonalSetting]
+   *        tags: [GeneralSetting]
    *        operationId: putUserPassword
    *        summary: /personal-setting/password
    *        description: Update user password
@@ -386,7 +380,7 @@ module.exports = (crowi) => {
    *
    *    /personal-setting/api-token:
    *      put:
-   *        tags: [PersonalSetting]
+   *        tags: [GeneralSetting]
    *        operationId: putUserApiToken
    *        summary: /personal-setting/api-token
    *        description: Update user api token
@@ -424,7 +418,7 @@ module.exports = (crowi) => {
    *
    *    /personal-setting/associate-ldap:
    *      put:
-   *        tags: [PersonalSetting]
+   *        tags: [GeneralSetting]
    *        operationId: associateLdapAccount
    *        summary: /personal-setting/associate-ldap
    *        description: associate Ldap account
@@ -476,7 +470,7 @@ module.exports = (crowi) => {
    *
    *    /personal-setting/disassociate-ldap:
    *      put:
-   *        tags: [PersonalSetting]
+   *        tags: [GeneralSetting]
    *        operationId: disassociateLdapAccount
    *        summary: /personal-setting/disassociate-ldap
    *        description: disassociate Ldap account
@@ -609,7 +603,7 @@ module.exports = (crowi) => {
    *
    *    /personal-setting/in-app-notification-settings:
    *      put:
-   *        tags: [in-app-notification-settings]
+   *        tags: [InAppNotificationSettings]
    *        operationId: putInAppNotificationSettings
    *        summary: personal-setting/in-app-notification-settings
    *        description: Put InAppNotificationSettings
@@ -653,7 +647,7 @@ module.exports = (crowi) => {
    *
    *    /personal-setting/in-app-notification-settings:
    *      get:
-   *        tags: [in-app-notification-settings]
+   *        tags: [InAppNotificationSettings]
    *        operationId: getInAppNotificationSettings
    *        summary: personal-setting/in-app-notification-settings
    *        description: Get InAppNotificationSettings

+ 0 - 45
apps/app/src/server/routes/apiv3/revisions.js

@@ -17,51 +17,6 @@ const router = express.Router();
 
 const MIGRATION_FILE_NAME = '20211227060705-revision-path-to-page-id-schema-migration--fixed-7549';
 
-/**
- * @swagger
- *  tags:
- *    name: Revisions
- */
-
-/**
- * @swagger
- *
- *  components:
- *    schemas:
- *      Revision:
- *        description: Revision
- *        type: object
- *        properties:
- *          _id:
- *            type: string
- *            description: revision ID
- *            example: 5e0734e472560e001761fa68
- *          __v:
- *            type: number
- *            description: DB record version
- *            example: 0
- *          author:
- *            $ref: '#/components/schemas/User/properties/_id'
- *          body:
- *            type: string
- *            description: content body
- *            example: |
- *              # test
- *
- *              test
- *          format:
- *            type: string
- *            description: format
- *            example: markdown
- *          path:
- *            type: string
- *            description: path
- *            example: /user/alice/test
- *          createdAt:
- *            type: string
- *            description: date created at
- *            example: 2010-01-01T00:00:00.000Z
- */
 module.exports = (crowi) => {
   const certifySharedPage = require('../../middlewares/certify-shared-page')(crowi);
   const accessTokenParser = require('../../middlewares/access-token-parser')(crowi);

+ 3 - 8
apps/app/src/server/routes/apiv3/search.js

@@ -16,11 +16,6 @@ const router = express.Router();
 
 const noCache = require('nocache');
 
-/**
- * @swagger
- *  tags:
- *    name: Search
- */
 module.exports = (crowi) => {
   const accessTokenParser = require('../../middlewares/access-token-parser')(crowi);
   const loginRequired = require('../../middlewares/login-required')(crowi);
@@ -34,7 +29,7 @@ module.exports = (crowi) => {
    *
    *  /search/indices:
    *    get:
-   *      tags: [Search]
+   *      tags: [FullTextSearch Management]
    *      summary: /search/indices
    *      description: Get current status of indices
    *      responses:
@@ -68,7 +63,7 @@ module.exports = (crowi) => {
    *
    *  /search/connection:
    *    get:
-   *      tags: [Search]
+   *      tags: [FullTextSearch Management]
    *      summary: /search/connection
    *      description: Reconnect to Elasticsearch
    *      responses:
@@ -103,7 +98,7 @@ module.exports = (crowi) => {
    *
    *  /search/indices:
    *    put:
-   *      tags: [Search]
+   *      tags: [FullTextSearch Management]
    *      summary: /search/indices
    *      description: Operate indices
    *      requestBody:

+ 26 - 32
apps/app/src/server/routes/apiv3/security-settings/index.js

@@ -108,12 +108,6 @@ const validator = {
   ],
 };
 
-/**
- * @swagger
- *  tags:
- *    name: SecuritySetting
- */
-
 
 /**
  * @swagger
@@ -333,9 +327,9 @@ module.exports = (crowi) => {
   /**
    * @swagger
    *
-   *    /_api/v3/security-setting/:
+   *    /security-setting/:
    *      get:
-   *        tags: [SecuritySetting, apiv3]
+   *        tags: [SecuritySetting]
    *        description: Get security paramators
    *        responses:
    *          200:
@@ -461,9 +455,9 @@ module.exports = (crowi) => {
   /**
    * @swagger
    *
-   *    /_api/v3/security-setting/authentication/enabled:
+   *    /security-setting/authentication/enabled:
    *      put:
-   *        tags: [SecuritySetting, apiv3]
+   *        tags: [SecuritySetting]
    *        description: Update authentication isEnabled
    *        requestBody:
    *          required: true
@@ -576,9 +570,9 @@ module.exports = (crowi) => {
   /**
    * @swagger
    *
-   *    /_api/v3/security-setting/authentication:
+   *    /security-setting/authentication:
    *      get:
-   *        tags: [SecuritySetting, apiv3]
+   *        tags: [SecuritySetting]
    *        description: Get setup strategies for passport
    *        responses:
    *          200:
@@ -604,9 +598,9 @@ module.exports = (crowi) => {
   /**
    * @swagger
    *
-   *    /_api/v3/security-setting/general-setting:
+   *    /security-setting/general-setting:
    *      put:
-   *        tags: [SecuritySetting, apiv3]
+   *        tags: [SecuritySetting]
    *        description: Update GeneralSetting
    *        requestBody:
    *          required: true
@@ -690,9 +684,9 @@ module.exports = (crowi) => {
   /**
    * @swagger
    *
-   *    /_api/v3/security-setting/share-link-setting:
+   *    /security-setting/share-link-setting:
    *      put:
-   *        tags: [SecuritySetting, apiv3]
+   *        tags: [SecuritySetting]
    *        description: Update ShareLink Setting
    *        requestBody:
    *          required: true
@@ -733,9 +727,9 @@ module.exports = (crowi) => {
   /**
    * @swagger
    *
-   *    /_api/v3/security-setting/all-share-links:
+   *    /security-setting/all-share-links:
    *      get:
-   *        tags: [ShareLinkSettings, apiv3]
+   *        tags: [SecuritySetting]
    *        description: Get All ShareLinks at Share Link Setting
    *        responses:
    *          200:
@@ -776,9 +770,9 @@ module.exports = (crowi) => {
   /**
    * @swagger
    *
-   *    /_api/v3/security-setting/all-share-links:
+   *    /security-setting/all-share-links:
    *      delete:
-   *        tags: [ShareLinkSettings, apiv3]
+   *        tags: [SecuritySetting]
    *        description: Delete All ShareLinks at Share Link Setting
    *        responses:
    *          200:
@@ -801,9 +795,9 @@ module.exports = (crowi) => {
   /**
    * @swagger
    *
-   *    /_api/v3/security-setting/local-setting:
+   *    /security-setting/local-setting:
    *      put:
-   *        tags: [LocalSetting, apiv3]
+   *        tags: [SecuritySetting]
    *        description: Update LocalSetting
    *        requestBody:
    *          required: true
@@ -853,9 +847,9 @@ module.exports = (crowi) => {
   /**
    * @swagger
    *
-   *    /_api/v3/security-setting/ldap:
+   *    /security-setting/ldap:
    *      put:
-   *        tags: [SecuritySetting, apiv3]
+   *        tags: [SecuritySetting]
    *        description: Update LDAP setting
    *        requestBody:
    *          required: true
@@ -918,9 +912,9 @@ module.exports = (crowi) => {
   /**
    * @swagger
    *
-   *    /_api/v3/security-setting/saml:
+   *    /security-setting/saml:
    *      put:
-   *        tags: [SecuritySetting, apiv3]
+   *        tags: [SecuritySetting]
    *        description: Update SAML setting
    *        requestBody:
    *          required: true
@@ -1011,9 +1005,9 @@ module.exports = (crowi) => {
   /**
    * @swagger
    *
-   *    /_api/v3/security-setting/oidc:
+   *    /security-setting/oidc:
    *      put:
-   *        tags: [SecuritySetting, apiv3]
+   *        tags: [SecuritySetting]
    *        description: Update OpenID Connect setting
    *        requestBody:
    *          required: true
@@ -1088,9 +1082,9 @@ module.exports = (crowi) => {
   /**
    * @swagger
    *
-   *    /_api/v3/security-setting/google-oauth:
+   *    /security-setting/google-oauth:
    *      put:
-   *        tags: [SecuritySetting, apiv3]
+   *        tags: [SecuritySetting]
    *        description: Update google OAuth
    *        requestBody:
    *          required: true
@@ -1136,9 +1130,9 @@ module.exports = (crowi) => {
   /**
    * @swagger
    *
-   *    /_api/v3/security-setting/github-oauth:
+   *    /security-setting/github-oauth:
    *      put:
-   *        tags: [SecuritySetting, apiv3]
+   *        tags: [SecuritySetting]
    *        description: Update github OAuth
    *        requestBody:
    *          required: true

+ 1 - 7
apps/app/src/server/routes/apiv3/share-links.js

@@ -20,12 +20,6 @@ const validator = {};
 
 const today = new Date();
 
-/**
- * @swagger
- *  tags:
- *    name: ShareLink
- */
-
 module.exports = (crowi) => {
   const loginRequired = require('../../middlewares/login-required')(crowi);
   const adminRequired = require('../../middlewares/admin-required')(crowi);
@@ -212,7 +206,7 @@ module.exports = (crowi) => {
   *
   *    /share-links/all:
   *      delete:
-  *        tags: [ShareLinks]
+  *        tags: [ShareLink Management]
   *        description: delete all share links
   *        responses:
   *          200:

+ 0 - 6
apps/app/src/server/routes/apiv3/slack-integration-legacy-settings.js

@@ -22,12 +22,6 @@ const validator = {
   ],
 };
 
-/**
- * @swagger
- *  tags:
- *    name: SlackIntegrationLegacySetting
- */
-
 /**
  * @swagger
  *

+ 13 - 19
apps/app/src/server/routes/apiv3/slack-integration-settings.js

@@ -25,12 +25,6 @@ const logger = loggerFactory('growi:routes:apiv3:slack-integration-settings');
 const router = express.Router();
 
 
-/**
- * @swagger
- *  tags:
- *    name: SlackIntegrationSettings
- */
-
 /**
  * @swagger
  *
@@ -166,9 +160,9 @@ module.exports = (crowi) => {
    *
    *    /slack-integration-settings/:
    *      get:
-   *        tags: [SlackBotSettingParams]
+   *        tags: [SlackIntegrationSettings]
    *        operationId: getSlackBotSettingParams
-   *        summary: get /slack-integration
+   *        summary: /slack-integration
    *        description: Get current settings and connection statuses.
    *        responses:
    *          200:
@@ -295,7 +289,7 @@ module.exports = (crowi) => {
    *
    *    /slack-integration-settings/bot-type/:
    *      put:
-   *        tags: [botType]
+   *        tags: [SlackIntegrationSettings]
    *        operationId: putBotType
    *        summary: /slack-integration/bot-type
    *        description: Put botType setting.
@@ -334,7 +328,7 @@ module.exports = (crowi) => {
    *
    *    /slack-integration/bot-type/:
    *      delete:
-   *        tags: [botType]
+   *        tags: [SlackIntegrationSettings]
    *        operationId: deleteBotType
    *        summary: /slack-integration/bot-type
    *        description: Delete botType setting.
@@ -365,7 +359,7 @@ module.exports = (crowi) => {
    *
    *    /slack-integration-settings/without-proxy/update-settings/:
    *      put:
-   *        tags: [UpdateWithoutProxySettings]
+   *        tags: [SlackIntegrationSettings (without proxy)]
    *        operationId: putWithoutProxySettings
    *        summary: update customBotWithoutProxy settings
    *        description: Update customBotWithoutProxy setting.
@@ -405,7 +399,7 @@ module.exports = (crowi) => {
    *
    *    /slack-integration-settings/without-proxy/update-permissions/:
    *      put:
-   *        tags: [UpdateWithoutProxyPermissions]
+   *        tags: [SlackIntegrationSettings (without proxy)]
    *        operationId: putWithoutProxyPermissions
    *        summary: update customBotWithoutProxy permissions
    *        description: Update customBotWithoutProxy permissions.
@@ -448,7 +442,7 @@ module.exports = (crowi) => {
    *
    *    /slack-integration-settings/slack-app-integrations:
    *      post:
-   *        tags: [SlackIntegration]
+   *        tags: [SlackIntegrationSettings (with proxy)]
    *        operationId: putSlackAppIntegrations
    *        summary: /slack-integration
    *        description: Generate SlackAppIntegrations
@@ -498,7 +492,7 @@ module.exports = (crowi) => {
    *
    *    /slack-integration-settings/slack-app-integrations/:id:
    *      delete:
-   *        tags: [SlackIntegration]
+   *        tags: [SlackIntegrationSettings (with proxy)]
    *        operationId: deleteAccessTokens
    *        summary: delete accessTokens
    *        description: Delete accessTokens
@@ -556,7 +550,7 @@ module.exports = (crowi) => {
    *
    *    /slack-integration-settings/slack-app-integrations/:id/makeprimary:
    *      put:
-   *        tags: [SlackIntegration]
+   *        tags: [SlackIntegrationSettings (with proxy)]
    *        operationId: makePrimary
    *        summary: /slack-integration
    *        description: Make SlackAppTokens primary
@@ -603,7 +597,7 @@ module.exports = (crowi) => {
    *
    *    /slack-integration-settings/slack-app-integrations/:id/regenerate-tokens:
    *      put:
-   *        tags: [SlackIntegration]
+   *        tags: [SlackIntegrationSettings (with proxy)]
    *        operationId: putRegenerateTokens
    *        summary: /slack-integration
    *        description: Regenerate SlackAppTokens
@@ -636,7 +630,7 @@ module.exports = (crowi) => {
    *
    *    /slack-integration-settings/slack-app-integrations/:id/permissions:
    *      put:
-   *        tags: [SlackIntegration]
+   *        tags: [SlackIntegrationSettings (with proxy)]
    *        operationId: putSupportedCommands
    *        summary: /slack-integration-settings/:id/permissions
    *        description: update supported commands
@@ -695,7 +689,7 @@ module.exports = (crowi) => {
    *
    *    /slack-integration-settings/slack-app-integrations/:id/relation-test:
    *      post:
-   *        tags: [botType]
+   *        tags: [SlackIntegrationSettings (with proxy)]
    *        operationId: postRelationTest
    *        summary: Test relation
    *        description: Delete botType setting.
@@ -766,7 +760,7 @@ module.exports = (crowi) => {
    *
    *    /slack-integration-settings/without-proxy/test:
    *      post:
-   *        tags: [botType]
+   *        tags: [SlackIntegrationSettings (without proxy)]
    *        operationId: postTest
    *        summary: test the connection
    *        description: Test the connection with slack work space.

+ 0 - 5
apps/app/src/server/routes/apiv3/statistics.js

@@ -17,11 +17,6 @@ const USER_STATUS_MASTER = {
 };
 
 
-/**
- * @swagger
- *  tags:
- *    name: Statistics
- */
 module.exports = (crowi) => {
 
   const models = crowi.models;

+ 1 - 7
apps/app/src/server/routes/apiv3/user-group-relation.js

@@ -13,12 +13,6 @@ const router = express.Router();
 
 const validator = {};
 
-/**
- * @swagger
- *  tags:
- *    name: UserGroupRelation
- */
-
 module.exports = (crowi) => {
   const loginRequiredStrictly = require('../../middlewares/login-required')(crowi);
   const adminRequired = require('../../middlewares/admin-required')(crowi);
@@ -33,7 +27,7 @@ module.exports = (crowi) => {
    *  paths:
    *    /user-group-relations:
    *      get:
-   *        tags: [UserGroupRelation]
+   *        tags: [UserGroupRelations]
    *        operationId: listUserGroupRelations
    *        summary: /user-group-relations
    *        description: Gets the user group relations

+ 14 - 20
apps/app/src/server/routes/apiv3/user-group.js

@@ -24,12 +24,6 @@ const logger = loggerFactory('growi:routes:apiv3:user-group'); // eslint-disable
 const router = express.Router();
 
 
-/**
- * @swagger
- *  tags:
- *    name: UserGroup
- */
-
 module.exports = (crowi) => {
   const loginRequiredStrictly = require('../../middlewares/login-required')(crowi);
   const adminRequired = require('../../middlewares/admin-required')(crowi);
@@ -94,7 +88,7 @@ module.exports = (crowi) => {
    *  paths:
    *    /user-groups:
    *      get:
-   *        tags: [UserGroup]
+   *        tags: [UserGroups]
    *        operationId: getUserGroup
    *        summary: /user-groups
    *        description: Get usergroups
@@ -137,7 +131,7 @@ module.exports = (crowi) => {
    *  paths:
    *    /ancestors:
    *      get:
-   *        tags: [UserGroup]
+   *        tags: [UserGroups]
    *        operationId: getAncestorUserGroups
    *        summary: /ancestors
    *        description: Get ancestor user groups.
@@ -200,7 +194,7 @@ module.exports = (crowi) => {
    *  paths:
    *    /user-groups:
    *      post:
-   *        tags: [UserGroup]
+   *        tags: [UserGroups]
    *        operationId: createUserGroup
    *        summary: /user-groups
    *        description: Adds userGroup
@@ -250,7 +244,7 @@ module.exports = (crowi) => {
    *  paths:
    *    /selectable-parent-groups:
    *      get:
-   *        tags: [UserGroup]
+   *        tags: [UserGroups]
    *        operationId: getSelectableParentGroups
    *        summary: /selectable-parent-groups
    *        description: Get selectable parent UserGroups
@@ -299,7 +293,7 @@ module.exports = (crowi) => {
    *  paths:
    *    /selectable-child-groups:
    *      get:
-   *        tags: [UserGroup]
+   *        tags: [UserGroups]
    *        operationId: getSelectableChildGroups
    *        summary: /selectable-child-groups
    *        description: Get selectable child UserGroups
@@ -351,7 +345,7 @@ module.exports = (crowi) => {
    *  paths:
    *    /user-groups/{id}:
    *      get:
-   *        tags: [UserGroup]
+   *        tags: [UserGroups]
    *        operationId: getUserGroupFromGroupId
    *        summary: /user-groups/{id}
    *        description: Get UserGroup from Group ID
@@ -393,7 +387,7 @@ module.exports = (crowi) => {
    *  paths:
    *    /user-groups/{id}:
    *      delete:
-   *        tags: [UserGroup]
+   *        tags: [UserGroups]
    *        operationId: deleteUserGroup
    *        summary: /user-groups/{id}
    *        description: Deletes userGroup
@@ -457,7 +451,7 @@ module.exports = (crowi) => {
    *  paths:
    *    /user-groups/{id}:
    *      put:
-   *        tags: [UserGroup]
+   *        tags: [UserGroups]
    *        operationId: updateUserGroups
    *        summary: /user-groups/{id}
    *        description: Update userGroup
@@ -507,7 +501,7 @@ module.exports = (crowi) => {
    *  paths:
    *    /user-groups/{id}/users:
    *      get:
-   *        tags: [UserGroup]
+   *        tags: [UserGroups]
    *        operationId: getUsersUserGroups
    *        summary: /user-groups/{id}/users
    *        description: Get users related to the userGroup
@@ -558,7 +552,7 @@ module.exports = (crowi) => {
    *  paths:
    *    /user-groups/{id}/unrelated-users:
    *      get:
-   *        tags: [UserGroup]
+   *        tags: [UserGroups]
    *        operationId: getUnrelatedUsersUserGroups
    *        summary: /user-groups/{id}/unrelated-users
    *        description: Get users unrelated to the userGroup
@@ -619,7 +613,7 @@ module.exports = (crowi) => {
    *  paths:
    *    /user-groups/{id}/users:
    *      post:
-   *        tags: [UserGroup]
+   *        tags: [UserGroups]
    *        operationId: addUserUserGroups
    *        summary: /user-groups/{id}/users
    *        description: Add a user to the userGroup
@@ -686,7 +680,7 @@ module.exports = (crowi) => {
    *  paths:
    *    /user-groups/{id}/users:
    *      delete:
-   *        tags: [UserGroup]
+   *        tags: [UserGroups]
    *        operationId: deleteUsersUserGroups
    *        summary: /user-groups/{id}/users
    *        description: remove a user from the userGroup
@@ -738,7 +732,7 @@ module.exports = (crowi) => {
    *  paths:
    *    /user-groups/{id}/user-group-relations:
    *      get:
-   *        tags: [UserGroup]
+   *        tags: [UserGroups]
    *        operationId: getUserGroupRelationsUserGroups
    *        summary: /user-groups/{id}/user-group-relations
    *        description: Get the user group relations for the userGroup
@@ -785,7 +779,7 @@ module.exports = (crowi) => {
    *  paths:
    *    /user-groups/{id}/pages:
    *      get:
-   *        tags: [UserGroup]
+   *        tags: [UserGroups]
    *        operationId: getPagesUserGroups
    *        summary: /user-groups/{id}/pages
    *        description: Get closed pages for the userGroup

+ 14 - 20
apps/app/src/server/routes/apiv3/users.js

@@ -30,12 +30,6 @@ const PAGE_ITEMS = 50;
 
 const validator = {};
 
-/**
- * @swagger
- *  tags:
- *    name: Users
- */
-
 /**
  * @swagger
  *
@@ -408,7 +402,7 @@ module.exports = (crowi) => {
    *  paths:
    *    /users/invite:
    *      post:
-   *        tags: [Users]
+   *        tags: [Users Management]
    *        operationId: inviteUser
    *        summary: /users/invite
    *        description: Create new users and send Emails
@@ -476,7 +470,7 @@ module.exports = (crowi) => {
    *  paths:
    *    /users/{id}/grant-admin:
    *      put:
-   *        tags: [Users]
+   *        tags: [Users Management]
    *        operationId: grantAdminUser
    *        summary: /users/{id}/grant-admin
    *        description: Grant user admin
@@ -523,7 +517,7 @@ module.exports = (crowi) => {
    *  paths:
    *    /users/{id}/revoke-admin:
    *      put:
-   *        tags: [Users]
+   *        tags: [Users Management]
    *        operationId: revokeAdminUser
    *        summary: /users/{id}/revoke-admin
    *        description: Revoke user admin
@@ -570,7 +564,7 @@ module.exports = (crowi) => {
    *  paths:
    *    /users/{id}/grant-read-only:
    *      put:
-   *        tags: [Users]
+   *        tags: [Users Management]
    *        operationId: ReadOnly
    *        summary: /users/{id}/grant-read-only
    *        description: Grant user read only access
@@ -622,7 +616,7 @@ module.exports = (crowi) => {
    *  paths:
    *    /users/{id}/revoke-read-only:
    *      put:
-   *        tags: [Users]
+   *        tags: [Users Management]
    *        operationId: revokeReadOnly
    *        summary: /users/{id}/revoke-read-only
    *        description: Revoke user read only access
@@ -674,7 +668,7 @@ module.exports = (crowi) => {
    *  paths:
    *    /users/{id}/activate:
    *      put:
-   *        tags: [Users]
+   *        tags: [Users Management]
    *        operationId: activateUser
    *        summary: /users/{id}/activate
    *        description: Activate user
@@ -728,7 +722,7 @@ module.exports = (crowi) => {
    *  paths:
    *    /users/{id}/deactivate:
    *      put:
-   *        tags: [Users]
+   *        tags: [Users Management]
    *        operationId: deactivateUser
    *        summary: /users/{id}/deactivate
    *        description: Deactivate user
@@ -775,7 +769,7 @@ module.exports = (crowi) => {
    *  paths:
    *    /users/{id}/remove:
    *      delete:
-   *        tags: [Users]
+   *        tags: [Users Management]
    *        operationId: removeUser
    *        summary: /users/{id}/remove
    *        description: Delete user
@@ -835,7 +829,7 @@ module.exports = (crowi) => {
    *  paths:
    *    /users/external-accounts:
    *      get:
-   *        tags: [Users]
+   *        tags: [Users Management]
    *        operationId: listExternalAccountsUsers
    *        summary: /users/external-accounts
    *        description: Get external-account
@@ -868,7 +862,7 @@ module.exports = (crowi) => {
    *  paths:
    *    /users/external-accounts/{id}/remove:
    *      delete:
-   *        tags: [Users]
+   *        tags: [Users Management]
    *        operationId: removeExternalAccountUser
    *        summary: /users/external-accounts/{id}/remove
    *        description: Delete ExternalAccount
@@ -911,7 +905,7 @@ module.exports = (crowi) => {
    *  paths:
    *    /users/update.imageUrlCache:
    *      put:
-   *        tags: [Users]
+   *        tags: [Users Management]
    *        operationId: update.imageUrlCache
    *        summary: /users/update.imageUrlCache
    *        description: update imageUrlCache
@@ -963,7 +957,7 @@ module.exports = (crowi) => {
    *  paths:
    *    /users/reset-password:
    *      put:
-   *        tags: [Users]
+   *        tags: [Users Management]
    *        operationId: resetPassword
    *        summary: /users/reset-password
    *        description: update imageUrlCache
@@ -1004,7 +998,7 @@ module.exports = (crowi) => {
    *  paths:
    *    /users/reset-password-email:
    *      put:
-   *        tags: [Users]
+   *        tags: [Users Management]
    *        operationId: resetPasswordEmail
    *        summary: /users/reset-password-email
    *        description: send new password email
@@ -1051,7 +1045,7 @@ module.exports = (crowi) => {
    *  paths:
    *    /users/send-invitation-email:
    *      put:
-   *        tags: [Users]
+   *        tags: [Users Management]
    *        operationId: sendInvitationEmail
    *        summary: /users/send-invitation-email
    *        description: send invitation email

+ 1 - 1
apps/app/src/server/routes/attachment/api.js

@@ -275,7 +275,7 @@ export const routesFactory = (crowi) => {
    *
    *    /attachments.remove:
    *      post:
-   *        tags: [Attachments, CrowiCompatibles]
+   *        tags: [Attachments]
    *        operationId: removeAttachment
    *        summary: /attachments.remove
    *        description: Remove attachment

+ 4 - 4
apps/app/src/server/routes/comment.js

@@ -79,7 +79,7 @@ module.exports = function(crowi, app) {
    *
    *    /comments.get:
    *      get:
-   *        tags: [Comments, CrowiCompatibles]
+   *        tags: [Comments]
    *        operationId: getComments
    *        summary: /comments.get
    *        description: Get comments of the page of the revision
@@ -176,7 +176,7 @@ module.exports = function(crowi, app) {
    *
    *    /comments.add:
    *      post:
-   *        tags: [Comments, CrowiCompatibles]
+   *        tags: [Comments]
    *        operationId: addComment
    *        summary: /comments.add
    *        description: Post comment for the page
@@ -319,7 +319,7 @@ module.exports = function(crowi, app) {
    *
    *    /comments.update:
    *      post:
-   *        tags: [Comments, CrowiCompatibles]
+   *        tags: [Comments]
    *        operationId: updateComment
    *        summary: /comments.update
    *        description: Update comment dody
@@ -422,7 +422,7 @@ module.exports = function(crowi, app) {
    *
    *    /comments.remove:
    *      post:
-   *        tags: [Comments, CrowiCompatibles]
+   *        tags: [Comments]
    *        operationId: removeComment
    *        summary: /comments.remove
    *        description: Remove specified comment

+ 1 - 66
apps/app/src/server/routes/page.js

@@ -19,71 +19,6 @@ import UpdatePost from '../models/update-post';
  *
  *  components:
  *    schemas:
- *      Page:
- *        description: Page
- *        type: object
- *        properties:
- *          _id:
- *            type: string
- *            description: page ID
- *            example: 5e07345972560e001761fa63
- *          __v:
- *            type: number
- *            description: DB record version
- *            example: 0
- *          commentCount:
- *            type: number
- *            description: count of comments
- *            example: 3
- *          createdAt:
- *            type: string
- *            description: date created at
- *            example: 2010-01-01T00:00:00.000Z
- *          creator:
- *            $ref: '#/components/schemas/User'
- *          extended:
- *            type: object
- *            description: extend data
- *            example: {}
- *          grant:
- *            type: number
- *            description: grant
- *            example: 1
- *          grantedUsers:
- *            type: array
- *            description: granted users
- *            items:
- *              type: string
- *              description: user ID
- *            example: ["5ae5fccfc5577b0004dbd8ab"]
- *          lastUpdateUser:
- *            $ref: '#/components/schemas/User'
- *          liker:
- *            type: array
- *            description: granted users
- *            items:
- *              type: string
- *              description: user ID
- *            example: []
- *          path:
- *            type: string
- *            description: page path
- *            example: /
- *          revision:
- *            $ref: '#/components/schemas/Revision'
- *          status:
- *            type: string
- *            description: status
- *            enum:
- *              - 'wip'
- *              - 'published'
- *              - 'deleted'
- *              - 'deprecated'
- *            example: published
- *          updatedAt:
- *            type: string
- *            description: date updated at
- *            example: 2010-01-01T00:00:00.000Z
  *
  *      UpdatePost:
  *        description: UpdatePost
@@ -256,7 +191,7 @@ module.exports = function(crowi, app) {
    *
    *    /pages.updatePost:
    *      get:
-   *        tags: [Pages, CrowiCompatibles]
+   *        tags: [Pages]
    *        operationId: getUpdatePostPage
    *        summary: /pages.updatePost
    *        description: Get UpdatePost setting list

+ 1 - 1
apps/app/src/server/routes/search.ts

@@ -46,7 +46,7 @@ module.exports = function(crowi, app) {
    *
    *   /search:
    *     get:
-   *       tags: [Search, CrowiCompatibles]
+   *       tags: [Search]
    *       operationId: searchPages
    *       summary: /search
    *       description: Search pages

+ 2 - 0
apps/app/src/services/renderer/renderer.tsx

@@ -5,6 +5,7 @@ import raw from 'rehype-raw';
 import sanitize from 'rehype-sanitize';
 import slug from 'rehype-slug';
 import breaks from 'remark-breaks';
+import remarkDirective from 'remark-directive';
 import emoji from 'remark-emoji';
 import remarkFrontmatter from 'remark-frontmatter';
 import gfm from 'remark-gfm';
@@ -99,6 +100,7 @@ export const generateCommonOptions = (pagePath: string|undefined): RendererOptio
       emoji,
       pukiwikiLikeLinker,
       growiDirective,
+      remarkDirective,
       remarkFrontmatter,
       codeBlock.remarkPlugin,
     ],

+ 15 - 16
packages/remark-growi-directive/src/mdast-util-growi-directive/lib/index.js

@@ -37,25 +37,24 @@ export function directiveFromMarkdown() {
   return {
     canContainEols: [DirectiveType.Text],
     enter: {
-      directiveLeaf: enterLeaf,
-      directiveLeafAttributes: enterAttributes,
+      directiveGrowiLeaf: enterLeaf,
+      directiveGrowiLeafAttributes: enterAttributes,
 
-      directiveText: enterText,
-      directiveTextAttributes: enterAttributes,
+      directiveGrowiText: enterText,
+      directiveGrowiTextAttributes: enterAttributes,
     },
     exit: {
-      directiveLeaf: exit,
-      directiveLeafAttributeName: exitAttributeName,
-      directiveLeafAttributeValue: exitAttributeValue,
-      directiveLeafAttributes: exitAttributes,
-      directiveLeafName: exitName,
-
-      directiveText: exit,
-      directiveTextAttributeName: exitAttributeName,
-      directiveTextAttributeValue: exitAttributeValue,
-      directiveTextAttributes: exitAttributes,
-      directiveTextName: exitName,
-
+      directiveGrowiLeaf: exit,
+      directiveGrowiLeafAttributeName: exitAttributeName,
+      directiveGrowiLeafAttributeValue: exitAttributeValue,
+      directiveGrowiLeafAttributes: exitAttributes,
+      directiveGrowiLeafName: exitName,
+
+      directiveGrowiText: exit,
+      directiveGrowiTextAttributeName: exitAttributeName,
+      directiveGrowiTextAttributeValue: exitAttributeValue,
+      directiveGrowiTextAttributes: exitAttributes,
+      directiveGrowiTextName: exitName,
     },
   };
 }

+ 15 - 15
packages/remark-growi-directive/src/micromark-extension-growi-directive/lib/directive-leaf.js

@@ -62,9 +62,9 @@ function tokenizeDirectiveLeaf(effects, ok, nok) {
   /** @type {State} */
   function start(code) {
     assert(code === codes.dollarSign, 'expected `$`');
-    effects.enter('directiveLeaf');
+    effects.enter('directiveGrowiLeaf');
     effects.consume(code);
-    return factoryName.call(self, effects, afterName, nok, 'directiveLeafName');
+    return factoryName.call(self, effects, afterName, nok, 'directiveGrowiLeafName');
   }
 
   /** @type {State} */
@@ -92,7 +92,7 @@ function tokenizeDirectiveLeaf(effects, ok, nok) {
   /** @type {State} */
   function end(code) {
     if (code === codes.eof || markdownLineEnding(code)) {
-      effects.exit('directiveLeaf');
+      effects.exit('directiveGrowiLeaf');
       return ok(code);
     }
 
@@ -107,9 +107,9 @@ function tokenizeLabel(effects, ok, nok) {
     effects,
     ok,
     nok,
-    'directiveLeafLabel',
-    'directiveLeafLabelMarker',
-    'directiveLeafLabelString',
+    'directiveGrowiLeafLabel',
+    'directiveGrowiLeafLabelMarker',
+    'directiveGrowiLeafLabelString',
     true,
   );
 }
@@ -121,15 +121,15 @@ function tokenizeAttributes(effects, ok, nok) {
     effects,
     ok,
     nok,
-    'directiveLeafAttributes',
-    'directiveLeafAttributesMarker',
-    'directiveLeafAttribute',
-    'directiveLeafAttributeName',
-    'directiveLeafAttributeInitializerMarker',
-    'directiveLeafAttributeValueLiteral',
-    'directiveLeafAttributeValue',
-    'directiveLeafAttributeValueMarker',
-    'directiveLeafAttributeValueData',
+    'directiveGrowiLeafAttributes',
+    'directiveGrowiLeafAttributesMarker',
+    'directiveGrowiLeafAttribute',
+    'directiveGrowiLeafAttributeName',
+    'directiveGrowiLeafAttributeInitializerMarker',
+    'directiveGrowiLeafAttributeValueLiteral',
+    'directiveGrowiLeafAttributeValue',
+    'directiveGrowiLeafAttributeValueMarker',
+    'directiveGrowiLeafAttributeValueData',
     true,
   );
 }

+ 17 - 17
packages/remark-growi-directive/src/micromark-extension-growi-directive/lib/directive-text.js

@@ -41,11 +41,11 @@ function tokenizeDirectiveText(effects, ok, nok) {
   function start(code) {
     assert(code === codes.dollarSign, 'expected `$`');
     assert(previous.call(self, self.previous), 'expected correct previous');
-    effects.enter('directiveText');
-    effects.enter('directiveTextMarker');
+    effects.enter('directiveGrowiText');
+    effects.enter('directiveGrowiTextMarker');
     effects.consume(code);
-    effects.exit('directiveTextMarker');
-    return factoryName.call(self, effects, afterName, nok, 'directiveTextName');
+    effects.exit('directiveGrowiTextMarker');
+    return factoryName.call(self, effects, afterName, nok, 'directiveGrowiTextName');
   }
 
   /** @type {State} */
@@ -67,7 +67,7 @@ function tokenizeDirectiveText(effects, ok, nok) {
 
   /** @type {State} */
   function afterAttributes(code) {
-    effects.exit('directiveText');
+    effects.exit('directiveGrowiText');
     return ok(code);
   }
 }
@@ -79,9 +79,9 @@ function tokenizeLabel(effects, ok, nok) {
     effects,
     ok,
     nok,
-    'directiveTextLabel',
-    'directiveTextLabelMarker',
-    'directiveTextLabelString',
+    'directiveGrowiTextLabel',
+    'directiveGrowiTextLabelMarker',
+    'directiveGrowiTextLabelString',
   );
 }
 
@@ -92,14 +92,14 @@ function tokenizeAttributes(effects, ok, nok) {
     effects,
     ok,
     nok,
-    'directiveTextAttributes',
-    'directiveTextAttributesMarker',
-    'directiveTextAttribute',
-    'directiveTextAttributeName',
-    'directiveTextAttributeInitializerMarker',
-    'directiveTextAttributeValueLiteral',
-    'directiveTextAttributeValue',
-    'directiveTextAttributeValueMarker',
-    'directiveTextAttributeValueData',
+    'directiveGrowiTextAttributes',
+    'directiveGrowiTextAttributesMarker',
+    'directiveGrowiTextAttribute',
+    'directiveGrowiTextAttributeName',
+    'directiveGrowiTextAttributeInitializerMarker',
+    'directiveGrowiTextAttributeValueLiteral',
+    'directiveGrowiTextAttributeValue',
+    'directiveGrowiTextAttributeValueMarker',
+    'directiveGrowiTextAttributeValueData',
   );
 }

+ 19 - 19
packages/remark-growi-directive/src/micromark-extension-growi-directive/lib/html.js

@@ -35,32 +35,32 @@ export function directiveHtml(options = {}) {
   return {
     enter: {
 
-      directiveLeaf() {
+      directiveGrowiLeaf() {
         return enter.call(this, DirectiveType.Leaf);
       },
-      directiveLeafAttributes: enterAttributes,
-      directiveLeafLabel: enterLabel,
+      directiveGrowiLeafAttributes: enterAttributes,
+      directiveGrowiLeafLabel: enterLabel,
 
-      directiveText() {
+      directiveGrowiText() {
         return enter.call(this, DirectiveType.Text);
       },
-      directiveTextAttributes: enterAttributes,
-      directiveTextLabel: enterLabel,
+      directiveGrowiTextAttributes: enterAttributes,
+      directiveGrowiTextLabel: enterLabel,
     },
     exit: {
-      directiveLeaf: exit,
-      directiveLeafAttributeName: exitAttributeName,
-      directiveLeafAttributeValue: exitAttributeValue,
-      directiveLeafAttributes: exitAttributes,
-      directiveLeafLabel: exitLabel,
-      directiveLeafName: exitName,
-
-      directiveText: exit,
-      directiveTextAttributeName: exitAttributeName,
-      directiveTextAttributeValue: exitAttributeValue,
-      directiveTextAttributes: exitAttributes,
-      directiveTextLabel: exitLabel,
-      directiveTextName: exitName,
+      directiveGrowiLeaf: exit,
+      directiveGrowiLeafAttributeName: exitAttributeName,
+      directiveGrowiLeafAttributeValue: exitAttributeValue,
+      directiveGrowiLeafAttributes: exitAttributes,
+      directiveGrowiLeafLabel: exitLabel,
+      directiveGrowiLeafName: exitName,
+
+      directiveGrowiText: exit,
+      directiveGrowiTextAttributeName: exitAttributeName,
+      directiveGrowiTextAttributeValue: exitAttributeValue,
+      directiveGrowiTextAttributes: exitAttributes,
+      directiveGrowiTextLabel: exitLabel,
+      directiveGrowiTextName: exitName,
     },
   };
 

+ 30 - 15
pnpm-lock.yaml

@@ -595,6 +595,9 @@ importers:
       remark-breaks:
         specifier: ^4.0.0
         version: 4.0.0
+      remark-directive:
+        specifier: ^3.0.0
+        version: 3.0.0
       remark-emoji:
         specifier: ^5.0.0
         version: 5.0.1
@@ -632,7 +635,7 @@ importers:
         specifier: ^1.9.1
         version: 1.13.3
       swagger-jsdoc:
-        specifier: ^6.1.0
+        specifier: ^6.2.8
         version: 6.2.8(openapi-types@12.1.3)
       swr:
         specifier: ^2.2.2
@@ -8933,6 +8936,9 @@ packages:
   micromark-core-commonmark@2.0.1:
     resolution: {integrity: sha512-CUQyKr1e///ZODyD1U3xit6zXwy1a8q2a1S1HKtIlmgvurrEpaw/Y9y6KSIbF8P59cn/NjzHyO+Q2fAyYLQrAA==}
 
+  micromark-extension-directive@3.0.2:
+    resolution: {integrity: sha512-wjcXHgk+PPdmvR58Le9d7zQYWy+vKEU9Se44p2CrCDPiLr2FMyiT4Fyb5UFKFC66wGB3kPlgD7q3TnoqPS7SZA==}
+
   micromark-extension-frontmatter@2.0.0:
     resolution: {integrity: sha512-C4AkuM3dA58cgZha7zVnuVxBhDsbttIMiytjgsM2XbHAB2faRVaHRle40558FBN+DJcrLNCoqG5mlrpdU4cRtg==}
 
@@ -10585,6 +10591,9 @@ packages:
   remark-breaks@4.0.0:
     resolution: {integrity: sha512-IjEjJOkH4FuJvHZVIW0QCDWxcG96kCq7An/KVH2NfJe6rKZU2AsHeB3OEjPNRxi4QC34Xdx7I2KGYn6IpT7gxQ==}
 
+  remark-directive@3.0.0:
+    resolution: {integrity: sha512-l1UyWJ6Eg1VPU7Hm/9tt0zKtReJQNOA4+iDMAxTyZNWnJnFlbS/7zhiel/rogTLQ2vMYwDzSJa4BiVNqGlqIMA==}
+
   remark-emoji@5.0.1:
     resolution: {integrity: sha512-QCqTSvcZ65Ym+P+VyBKd4JfJfh7icMl7cIOGVmPMzWkDtdD8pQ0nQG7yxGolVIiMzSx90EZ7SwNiVpYpfTxn7w==}
     engines: {node: '>=18'}
@@ -12644,11 +12653,6 @@ packages:
     resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==}
     engines: {node: '>=10'}
 
-  z-schema@5.0.5:
-    resolution: {integrity: sha512-D7eujBWkLa3p2sIpJA0d1pr7es+a7m0vFAnZLlCEKq/Ij2k0MLi9Br2UPxoxdYystm5K1yeBGzub0FlYUEWj2Q==}
-    engines: {node: '>=8.0.0'}
-    hasBin: true
-
   z-schema@5.0.6:
     resolution: {integrity: sha512-+XR1GhnWklYdfr8YaZv/iu+vY+ux7V5DS5zH1DQf6bO5ufrt/5cgNhVO5qyhsjFXvsqQb/f08DWE9b6uPscyAg==}
     engines: {node: '>=8.0.0'}
@@ -12716,7 +12720,7 @@ snapshots:
       '@jsdevtools/ono': 7.1.3
       call-me-maybe: 1.0.2
       openapi-types: 12.1.3
-      z-schema: 5.0.5
+      z-schema: 5.0.6
 
   '@aws-crypto/crc32@3.0.0':
     dependencies:
@@ -22594,6 +22598,16 @@ snapshots:
       micromark-util-symbol: 2.0.0
       micromark-util-types: 2.0.0
 
+  micromark-extension-directive@3.0.2:
+    dependencies:
+      devlop: 1.1.0
+      micromark-factory-space: 2.0.0
+      micromark-factory-whitespace: 2.0.0
+      micromark-util-character: 2.1.0
+      micromark-util-symbol: 2.0.0
+      micromark-util-types: 2.0.0
+      parse-entities: 4.0.1
+
   micromark-extension-frontmatter@2.0.0:
     dependencies:
       fault: 2.0.1
@@ -24554,6 +24568,15 @@ snapshots:
       mdast-util-newline-to-break: 2.0.0
       unified: 11.0.5
 
+  remark-directive@3.0.0:
+    dependencies:
+      '@types/mdast': 4.0.4
+      mdast-util-directive: 3.0.0
+      micromark-extension-directive: 3.0.2
+      unified: 11.0.5
+    transitivePeerDependencies:
+      - supports-color
+
   remark-emoji@5.0.1:
     dependencies:
       '@types/mdast': 4.0.4
@@ -26966,14 +26989,6 @@ snapshots:
 
   yocto-queue@0.1.0: {}
 
-  z-schema@5.0.5:
-    dependencies:
-      lodash.get: 4.4.2
-      lodash.isequal: 4.5.0
-      validator: 13.7.0
-    optionalDependencies:
-      commander: 9.5.0
-
   z-schema@5.0.6:
     dependencies:
       lodash.get: 4.4.2