definition-apiv3.js 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. const pkg = require('../../package.json');
  2. module.exports = {
  3. openapi: '3.0.1',
  4. info: {
  5. title: 'GROWI REST API v3',
  6. version: pkg.version,
  7. },
  8. servers: [
  9. {
  10. url: '{server}/_api/v3',
  11. variables: {
  12. server: {
  13. default: 'https://demo.growi.org',
  14. description:
  15. 'The base URL for the GROWI API except for the version path (/_api/v3). This can be set to your GROWI instance URL.',
  16. },
  17. },
  18. },
  19. {
  20. url: 'https://demo.growi.org/_api/v3',
  21. },
  22. ],
  23. security: [
  24. {
  25. bearer: [],
  26. accessTokenInQuery: [],
  27. },
  28. ],
  29. components: {
  30. securitySchemes: {
  31. bearer: {
  32. type: 'http',
  33. scheme: 'bearer',
  34. description: 'Access token generated by each GROWI users',
  35. },
  36. accessTokenInQuery: {
  37. type: 'apiKey',
  38. name: 'access_token',
  39. in: 'query',
  40. description: 'Access token generated by each GROWI users',
  41. },
  42. cookieAuth: {
  43. type: 'apiKey',
  44. in: 'cookie',
  45. name: 'connect.sid',
  46. },
  47. transferHeaderAuth: {
  48. type: 'apiKey',
  49. in: 'header',
  50. name: 'x-growi-transfer-key',
  51. },
  52. },
  53. parameters: {
  54. MimeTypePathParam: {
  55. name: 'mimeType',
  56. in: 'path',
  57. required: true,
  58. description:
  59. 'Configurable MIME type (e.g., image/png, application/pdf)',
  60. schema: {
  61. type: 'string',
  62. enum: [
  63. 'image/jpeg',
  64. 'image/png',
  65. 'image/gif',
  66. 'image/webp',
  67. 'image/bmp',
  68. 'image/tiff',
  69. 'image/x-icon',
  70. 'application/pdf',
  71. 'text/plain',
  72. 'video/mp4',
  73. 'video/webm',
  74. 'video/ogg',
  75. 'audio/mpeg',
  76. 'audio/ogg',
  77. 'audio/wav',
  78. 'text/html',
  79. 'text/javascript',
  80. 'application/javascript',
  81. 'image/svg+xml',
  82. 'application/xml',
  83. 'application/json',
  84. 'application/x-sh',
  85. 'application/x-msdownload',
  86. 'application/octet-stream',
  87. 'application/msword',
  88. 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
  89. 'application/vnd.ms-excel',
  90. 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
  91. 'application/vnd.ms-powerpoint',
  92. 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
  93. 'application/zip',
  94. 'application/x-rar-compressed',
  95. 'text/csv',
  96. ],
  97. },
  98. },
  99. },
  100. },
  101. 'x-tagGroups': [
  102. {
  103. name: 'User API',
  104. tags: [
  105. 'Attachment',
  106. 'Bookmarks',
  107. 'BookmarkFolders',
  108. 'Page',
  109. 'Pages',
  110. 'PageListing',
  111. 'Revisions',
  112. 'ShareLinks',
  113. 'Users',
  114. 'UserUISettings',
  115. ],
  116. },
  117. {
  118. name: 'User Personal Settings API',
  119. tags: ['GeneralSetting', 'EditorSetting', 'InAppNotificationSettings'],
  120. },
  121. {
  122. name: 'System Management API',
  123. tags: [
  124. 'Home',
  125. 'Activity',
  126. 'AdminHome',
  127. 'AppSettings',
  128. 'ExternalUserGroups',
  129. 'SecuritySetting',
  130. 'MarkDownSetting',
  131. 'CustomizeSetting',
  132. 'Import',
  133. 'Export',
  134. 'GROWI to GROWI Transfer',
  135. 'MongoDB',
  136. 'NotificationSetting',
  137. 'Plugins',
  138. 'SlackIntegration',
  139. 'SlackIntegrationSettings',
  140. 'SlackIntegrationSettings (with proxy)',
  141. 'SlackIntegrationSettings (without proxy)',
  142. 'SlackIntegrationLegacySetting',
  143. 'ShareLink Management',
  144. 'Templates',
  145. 'Staff',
  146. 'UserGroupRelations',
  147. 'UserGroups',
  148. 'Users Management',
  149. 'FullTextSearch Management',
  150. 'Install',
  151. ],
  152. },
  153. {
  154. name: 'Public API',
  155. tags: ['Healthcheck', 'Statistics', '', '', '', '', '', ''],
  156. },
  157. ],
  158. };