@strapi/plugin-documentation 5.12.0 → 5.12.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (303) hide show
  1. package/dist/admin/{chunks/Settings-Cpj-uI9B.js → components/SettingsForm.js} +7 -52
  2. package/dist/admin/components/SettingsForm.js.map +1 -0
  3. package/dist/admin/{chunks/Settings-DyLMOJEx.mjs → components/SettingsForm.mjs} +7 -52
  4. package/dist/admin/components/SettingsForm.mjs.map +1 -0
  5. package/dist/admin/constants.js +47 -0
  6. package/dist/admin/constants.js.map +1 -0
  7. package/dist/admin/constants.mjs +45 -0
  8. package/dist/admin/constants.mjs.map +1 -0
  9. package/dist/admin/index.js +93 -3
  10. package/dist/admin/index.js.map +1 -1
  11. package/dist/admin/index.mjs +94 -2
  12. package/dist/admin/index.mjs.map +1 -1
  13. package/dist/admin/{chunks/App-DC2H8bJ5.js → pages/App.js} +8 -8
  14. package/dist/admin/pages/App.js.map +1 -0
  15. package/dist/admin/{chunks/App-D6yQIQar.mjs → pages/App.mjs} +4 -4
  16. package/dist/admin/pages/App.mjs.map +1 -0
  17. package/dist/admin/pages/Settings.js +54 -0
  18. package/dist/admin/pages/Settings.js.map +1 -0
  19. package/dist/admin/pages/Settings.mjs +52 -0
  20. package/dist/admin/pages/Settings.mjs.map +1 -0
  21. package/dist/admin/pluginId.js +6 -0
  22. package/dist/admin/pluginId.js.map +1 -0
  23. package/dist/admin/pluginId.mjs +4 -0
  24. package/dist/admin/pluginId.mjs.map +1 -0
  25. package/dist/admin/{chunks/getTrad-AvLNMP3V.js → services/api.js} +1 -5
  26. package/dist/admin/services/api.js.map +1 -0
  27. package/dist/admin/{chunks/getTrad-D9juLfq6.mjs → services/api.mjs} +2 -5
  28. package/dist/admin/services/api.mjs.map +1 -0
  29. package/dist/admin/{chunks/ar-Dix6VU4a.js → translations/ar.json.js} +2 -2
  30. package/dist/admin/translations/ar.json.js.map +1 -0
  31. package/dist/admin/{chunks/ar-Bu09tPI1.mjs → translations/ar.json.mjs} +1 -1
  32. package/dist/admin/translations/ar.json.mjs.map +1 -0
  33. package/dist/admin/{chunks/cs-C6k-mH5i.js → translations/cs.json.js} +2 -2
  34. package/dist/admin/translations/cs.json.js.map +1 -0
  35. package/dist/admin/{chunks/cs-tf-UeGst.mjs → translations/cs.json.mjs} +1 -1
  36. package/dist/admin/translations/cs.json.mjs.map +1 -0
  37. package/dist/admin/{chunks/de-DYskRe8j.js → translations/de.json.js} +2 -2
  38. package/dist/admin/translations/de.json.js.map +1 -0
  39. package/dist/admin/{chunks/de-CMhqnPQP.mjs → translations/de.json.mjs} +1 -1
  40. package/dist/admin/translations/de.json.mjs.map +1 -0
  41. package/dist/admin/{chunks/dk-BYJqzR_M.js → translations/dk.json.js} +2 -2
  42. package/dist/admin/translations/dk.json.js.map +1 -0
  43. package/dist/admin/{chunks/dk-BmQOOeIc.mjs → translations/dk.json.mjs} +1 -1
  44. package/dist/admin/translations/dk.json.mjs.map +1 -0
  45. package/dist/admin/{chunks/en-B90IBmYB.js → translations/en.json.js} +2 -2
  46. package/dist/admin/translations/en.json.js.map +1 -0
  47. package/dist/admin/{chunks/en-Cx8yPuig.mjs → translations/en.json.mjs} +1 -1
  48. package/dist/admin/translations/en.json.mjs.map +1 -0
  49. package/dist/admin/{chunks/es-5WsjlhIl.js → translations/es.json.js} +2 -2
  50. package/dist/admin/translations/es.json.js.map +1 -0
  51. package/dist/admin/{chunks/es-DAdgO3Ey.mjs → translations/es.json.mjs} +1 -1
  52. package/dist/admin/translations/es.json.mjs.map +1 -0
  53. package/dist/admin/{chunks/fr-C-vHEudQ.js → translations/fr.json.js} +2 -2
  54. package/dist/admin/translations/fr.json.js.map +1 -0
  55. package/dist/admin/{chunks/fr-B5fjFqKX.mjs → translations/fr.json.mjs} +1 -1
  56. package/dist/admin/translations/fr.json.mjs.map +1 -0
  57. package/dist/admin/{chunks/id-BKiCYOdS.js → translations/id.json.js} +2 -2
  58. package/dist/admin/translations/id.json.js.map +1 -0
  59. package/dist/admin/{chunks/id-CLApXj97.mjs → translations/id.json.mjs} +1 -1
  60. package/dist/admin/translations/id.json.mjs.map +1 -0
  61. package/dist/admin/{chunks/it-B7SnHLP2.js → translations/it.json.js} +2 -2
  62. package/dist/admin/translations/it.json.js.map +1 -0
  63. package/dist/admin/{chunks/it-C7GcWYBa.mjs → translations/it.json.mjs} +1 -1
  64. package/dist/admin/translations/it.json.mjs.map +1 -0
  65. package/dist/admin/{chunks/ko-CjOasZmz.js → translations/ko.json.js} +2 -2
  66. package/dist/admin/translations/ko.json.js.map +1 -0
  67. package/dist/admin/{chunks/ko-DZvks90a.mjs → translations/ko.json.mjs} +1 -1
  68. package/dist/admin/translations/ko.json.mjs.map +1 -0
  69. package/dist/admin/{chunks/ms-C2TEZHkD.js → translations/ms.json.js} +2 -2
  70. package/dist/admin/translations/ms.json.js.map +1 -0
  71. package/dist/admin/{chunks/ms-Df9gDB9M.mjs → translations/ms.json.mjs} +1 -1
  72. package/dist/admin/translations/ms.json.mjs.map +1 -0
  73. package/dist/admin/{chunks/nl-CLp2dhr9.js → translations/nl.json.js} +2 -2
  74. package/dist/admin/translations/nl.json.js.map +1 -0
  75. package/dist/admin/{chunks/nl-BlmTMaTL.mjs → translations/nl.json.mjs} +1 -1
  76. package/dist/admin/translations/nl.json.mjs.map +1 -0
  77. package/dist/admin/{chunks/pl-C8WRO2pt.js → translations/pl.json.js} +2 -2
  78. package/dist/admin/translations/pl.json.js.map +1 -0
  79. package/dist/admin/{chunks/pl-5iT3b9r4.mjs → translations/pl.json.mjs} +1 -1
  80. package/dist/admin/translations/pl.json.mjs.map +1 -0
  81. package/dist/admin/{chunks/pt-BR-Ds-dLXzD.js → translations/pt-BR.json.js} +2 -2
  82. package/dist/admin/translations/pt-BR.json.js.map +1 -0
  83. package/dist/admin/{chunks/pt-BR-De5jokla.mjs → translations/pt-BR.json.mjs} +1 -1
  84. package/dist/admin/translations/pt-BR.json.mjs.map +1 -0
  85. package/dist/admin/{chunks/pt-DL-rrjA1.js → translations/pt.json.js} +2 -2
  86. package/dist/admin/translations/pt.json.js.map +1 -0
  87. package/dist/admin/{chunks/pt-BK5YbXpM.mjs → translations/pt.json.mjs} +1 -1
  88. package/dist/admin/translations/pt.json.mjs.map +1 -0
  89. package/dist/admin/{chunks/ru-Cqv4k9my.js → translations/ru.json.js} +2 -2
  90. package/dist/admin/translations/ru.json.js.map +1 -0
  91. package/dist/admin/{chunks/ru-C_16WuLP.mjs → translations/ru.json.mjs} +1 -1
  92. package/dist/admin/translations/ru.json.mjs.map +1 -0
  93. package/dist/admin/{chunks/sk-D6l_EMOT.js → translations/sk.json.js} +2 -2
  94. package/dist/admin/translations/sk.json.js.map +1 -0
  95. package/dist/admin/{chunks/sk-B7RadPe4.mjs → translations/sk.json.mjs} +1 -1
  96. package/dist/admin/translations/sk.json.mjs.map +1 -0
  97. package/dist/admin/{chunks/sv-Xg5gbVO9.js → translations/sv.json.js} +2 -2
  98. package/dist/admin/translations/sv.json.js.map +1 -0
  99. package/dist/admin/{chunks/sv-DK5DOsrV.mjs → translations/sv.json.mjs} +1 -1
  100. package/dist/admin/translations/sv.json.mjs.map +1 -0
  101. package/dist/admin/{chunks/th-Pci1U3n6.js → translations/th.json.js} +2 -2
  102. package/dist/admin/translations/th.json.js.map +1 -0
  103. package/dist/admin/{chunks/th-DNiRgKQH.mjs → translations/th.json.mjs} +1 -1
  104. package/dist/admin/translations/th.json.mjs.map +1 -0
  105. package/dist/admin/{chunks/tr-CBlxk5Of.js → translations/tr.json.js} +2 -2
  106. package/dist/admin/translations/tr.json.js.map +1 -0
  107. package/dist/admin/{chunks/tr-CWX4cUiB.mjs → translations/tr.json.mjs} +1 -1
  108. package/dist/admin/translations/tr.json.mjs.map +1 -0
  109. package/dist/admin/{chunks/uk-BkF_x68T.js → translations/uk.json.js} +2 -2
  110. package/dist/admin/translations/uk.json.js.map +1 -0
  111. package/dist/admin/{chunks/uk-CWOtQQic.mjs → translations/uk.json.mjs} +1 -1
  112. package/dist/admin/translations/uk.json.mjs.map +1 -0
  113. package/dist/admin/{chunks/vi-CAG7iDHR.js → translations/vi.json.js} +2 -2
  114. package/dist/admin/translations/vi.json.js.map +1 -0
  115. package/dist/admin/{chunks/vi-geadDLtq.mjs → translations/vi.json.mjs} +1 -1
  116. package/dist/admin/translations/vi.json.mjs.map +1 -0
  117. package/dist/admin/{chunks/zh-Hans-CtXQdJhw.js → translations/zh-Hans.json.js} +2 -2
  118. package/dist/admin/translations/zh-Hans.json.js.map +1 -0
  119. package/dist/admin/{chunks/zh-Hans-fcRf-TLx.mjs → translations/zh-Hans.json.mjs} +1 -1
  120. package/dist/admin/translations/zh-Hans.json.mjs.map +1 -0
  121. package/dist/admin/{chunks/zh-rKHsKNA3.js → translations/zh.json.js} +2 -2
  122. package/dist/admin/translations/zh.json.js.map +1 -0
  123. package/dist/admin/{chunks/zh-E4LX--2j.mjs → translations/zh.json.mjs} +1 -1
  124. package/dist/admin/translations/zh.json.mjs.map +1 -0
  125. package/dist/admin/utils/baseQuery.js +8 -0
  126. package/dist/admin/utils/baseQuery.js.map +1 -0
  127. package/dist/admin/utils/baseQuery.mjs +6 -0
  128. package/dist/admin/utils/baseQuery.mjs.map +1 -0
  129. package/dist/admin/utils/getTrad.js +8 -0
  130. package/dist/admin/utils/getTrad.js.map +1 -0
  131. package/dist/admin/utils/getTrad.mjs +6 -0
  132. package/dist/admin/utils/getTrad.mjs.map +1 -0
  133. package/dist/admin/utils/prefixPluginTranslations.js +11 -0
  134. package/dist/admin/utils/prefixPluginTranslations.js.map +1 -0
  135. package/dist/admin/utils/prefixPluginTranslations.mjs +9 -0
  136. package/dist/admin/utils/prefixPluginTranslations.mjs.map +1 -0
  137. package/dist/server/bootstrap.js +57 -0
  138. package/dist/server/bootstrap.js.map +1 -0
  139. package/dist/server/bootstrap.mjs +55 -0
  140. package/dist/server/bootstrap.mjs.map +1 -0
  141. package/dist/server/config/default-plugin-config.js +88 -0
  142. package/dist/server/config/default-plugin-config.js.map +1 -0
  143. package/dist/server/config/default-plugin-config.mjs +86 -0
  144. package/dist/server/config/default-plugin-config.mjs.map +1 -0
  145. package/dist/server/config/index.js +10 -0
  146. package/dist/server/config/index.js.map +1 -0
  147. package/dist/server/config/index.mjs +8 -0
  148. package/dist/server/config/index.mjs.map +1 -0
  149. package/dist/server/controllers/documentation.js +185 -0
  150. package/dist/server/controllers/documentation.js.map +1 -0
  151. package/dist/server/controllers/documentation.mjs +181 -0
  152. package/dist/server/controllers/documentation.mjs.map +1 -0
  153. package/dist/server/controllers/index.js +10 -0
  154. package/dist/server/controllers/index.js.map +1 -0
  155. package/dist/server/controllers/index.mjs +8 -0
  156. package/dist/server/controllers/index.mjs.map +1 -0
  157. package/dist/server/index.js +12 -1586
  158. package/dist/server/index.js.map +1 -1
  159. package/dist/server/index.mjs +6 -1561
  160. package/dist/server/index.mjs.map +1 -1
  161. package/dist/server/middlewares/documentation.js +27 -0
  162. package/dist/server/middlewares/documentation.js.map +1 -0
  163. package/dist/server/middlewares/documentation.mjs +25 -0
  164. package/dist/server/middlewares/documentation.mjs.map +1 -0
  165. package/dist/server/middlewares/restrict-access.js +23 -0
  166. package/dist/server/middlewares/restrict-access.js.map +1 -0
  167. package/dist/server/middlewares/restrict-access.mjs +21 -0
  168. package/dist/server/middlewares/restrict-access.mjs.map +1 -0
  169. package/dist/server/{chunks/index--0fU1WeK.js → public/index.html.js} +2 -2
  170. package/dist/server/public/index.html.js.map +1 -0
  171. package/dist/server/{chunks/index-Dz3orHaf.mjs → public/index.html.mjs} +1 -1
  172. package/dist/server/public/index.html.mjs.map +1 -0
  173. package/dist/server/{chunks/login-CMPqkCFT.js → public/login.html.js} +2 -2
  174. package/dist/server/public/login.html.js.map +1 -0
  175. package/dist/server/{chunks/login-CYdORE5u.mjs → public/login.html.mjs} +1 -1
  176. package/dist/server/public/login.html.mjs.map +1 -0
  177. package/dist/server/register.js +12 -0
  178. package/dist/server/register.js.map +1 -0
  179. package/dist/server/register.mjs +10 -0
  180. package/dist/server/register.mjs.map +1 -0
  181. package/dist/server/routes/index.js +106 -0
  182. package/dist/server/routes/index.js.map +1 -0
  183. package/dist/server/routes/index.mjs +104 -0
  184. package/dist/server/routes/index.mjs.map +1 -0
  185. package/dist/server/services/documentation.js +182 -0
  186. package/dist/server/services/documentation.js.map +1 -0
  187. package/dist/server/services/documentation.mjs +180 -0
  188. package/dist/server/services/documentation.mjs.map +1 -0
  189. package/dist/server/services/helpers/build-api-endpoint-path.js +162 -0
  190. package/dist/server/services/helpers/build-api-endpoint-path.js.map +1 -0
  191. package/dist/server/services/helpers/build-api-endpoint-path.mjs +141 -0
  192. package/dist/server/services/helpers/build-api-endpoint-path.mjs.map +1 -0
  193. package/dist/server/services/helpers/build-component-schema.js +167 -0
  194. package/dist/server/services/helpers/build-component-schema.js.map +1 -0
  195. package/dist/server/services/helpers/build-component-schema.mjs +165 -0
  196. package/dist/server/services/helpers/build-component-schema.mjs.map +1 -0
  197. package/dist/server/services/helpers/utils/clean-schema-attributes.js +301 -0
  198. package/dist/server/services/helpers/utils/clean-schema-attributes.js.map +1 -0
  199. package/dist/server/services/helpers/utils/clean-schema-attributes.mjs +299 -0
  200. package/dist/server/services/helpers/utils/clean-schema-attributes.mjs.map +1 -0
  201. package/dist/server/services/helpers/utils/get-api-responses.js +88 -0
  202. package/dist/server/services/helpers/utils/get-api-responses.js.map +1 -0
  203. package/dist/server/services/helpers/utils/get-api-responses.mjs +86 -0
  204. package/dist/server/services/helpers/utils/get-api-responses.mjs.map +1 -0
  205. package/dist/server/services/helpers/utils/get-schema-data.js +43 -0
  206. package/dist/server/services/helpers/utils/get-schema-data.js.map +1 -0
  207. package/dist/server/services/helpers/utils/get-schema-data.mjs +41 -0
  208. package/dist/server/services/helpers/utils/get-schema-data.mjs.map +1 -0
  209. package/dist/server/services/helpers/utils/loop-content-type-names.js +40 -0
  210. package/dist/server/services/helpers/utils/loop-content-type-names.js.map +1 -0
  211. package/dist/server/services/helpers/utils/loop-content-type-names.mjs +38 -0
  212. package/dist/server/services/helpers/utils/loop-content-type-names.mjs.map +1 -0
  213. package/dist/server/services/helpers/utils/pascal-case.js +10 -0
  214. package/dist/server/services/helpers/utils/pascal-case.js.map +1 -0
  215. package/dist/server/services/helpers/utils/pascal-case.mjs +8 -0
  216. package/dist/server/services/helpers/utils/pascal-case.mjs.map +1 -0
  217. package/dist/server/services/helpers/utils/query-params.js +109 -0
  218. package/dist/server/services/helpers/utils/query-params.js.map +1 -0
  219. package/dist/server/services/helpers/utils/query-params.mjs +107 -0
  220. package/dist/server/services/helpers/utils/query-params.mjs.map +1 -0
  221. package/dist/server/services/helpers/utils/routes.js +11 -0
  222. package/dist/server/services/helpers/utils/routes.js.map +1 -0
  223. package/dist/server/services/helpers/utils/routes.mjs +9 -0
  224. package/dist/server/services/helpers/utils/routes.mjs.map +1 -0
  225. package/dist/server/services/index.js +13 -0
  226. package/dist/server/services/index.js.map +1 -0
  227. package/dist/server/services/index.mjs +11 -0
  228. package/dist/server/services/index.mjs.map +1 -0
  229. package/dist/server/services/override.js +45 -0
  230. package/dist/server/services/override.js.map +1 -0
  231. package/dist/server/services/override.mjs +43 -0
  232. package/dist/server/services/override.mjs.map +1 -0
  233. package/dist/server/services/utils/get-plugins-that-need-documentation.js +24 -0
  234. package/dist/server/services/utils/get-plugins-that-need-documentation.js.map +1 -0
  235. package/dist/server/services/utils/get-plugins-that-need-documentation.mjs +22 -0
  236. package/dist/server/services/utils/get-plugins-that-need-documentation.mjs.map +1 -0
  237. package/dist/server/utils.js +10 -0
  238. package/dist/server/utils.js.map +1 -0
  239. package/dist/server/utils.mjs +8 -0
  240. package/dist/server/utils.mjs.map +1 -0
  241. package/package.json +6 -6
  242. package/dist/admin/chunks/App-D6yQIQar.mjs.map +0 -1
  243. package/dist/admin/chunks/App-DC2H8bJ5.js.map +0 -1
  244. package/dist/admin/chunks/Settings-Cpj-uI9B.js.map +0 -1
  245. package/dist/admin/chunks/Settings-DyLMOJEx.mjs.map +0 -1
  246. package/dist/admin/chunks/ar-Bu09tPI1.mjs.map +0 -1
  247. package/dist/admin/chunks/ar-Dix6VU4a.js.map +0 -1
  248. package/dist/admin/chunks/cs-C6k-mH5i.js.map +0 -1
  249. package/dist/admin/chunks/cs-tf-UeGst.mjs.map +0 -1
  250. package/dist/admin/chunks/de-CMhqnPQP.mjs.map +0 -1
  251. package/dist/admin/chunks/de-DYskRe8j.js.map +0 -1
  252. package/dist/admin/chunks/dk-BYJqzR_M.js.map +0 -1
  253. package/dist/admin/chunks/dk-BmQOOeIc.mjs.map +0 -1
  254. package/dist/admin/chunks/en-B90IBmYB.js.map +0 -1
  255. package/dist/admin/chunks/en-Cx8yPuig.mjs.map +0 -1
  256. package/dist/admin/chunks/es-5WsjlhIl.js.map +0 -1
  257. package/dist/admin/chunks/es-DAdgO3Ey.mjs.map +0 -1
  258. package/dist/admin/chunks/fr-B5fjFqKX.mjs.map +0 -1
  259. package/dist/admin/chunks/fr-C-vHEudQ.js.map +0 -1
  260. package/dist/admin/chunks/getTrad-AvLNMP3V.js.map +0 -1
  261. package/dist/admin/chunks/getTrad-D9juLfq6.mjs.map +0 -1
  262. package/dist/admin/chunks/id-BKiCYOdS.js.map +0 -1
  263. package/dist/admin/chunks/id-CLApXj97.mjs.map +0 -1
  264. package/dist/admin/chunks/index-BHy3RKs2.mjs +0 -144
  265. package/dist/admin/chunks/index-BHy3RKs2.mjs.map +0 -1
  266. package/dist/admin/chunks/index-BSW-EfNW.js +0 -148
  267. package/dist/admin/chunks/index-BSW-EfNW.js.map +0 -1
  268. package/dist/admin/chunks/it-B7SnHLP2.js.map +0 -1
  269. package/dist/admin/chunks/it-C7GcWYBa.mjs.map +0 -1
  270. package/dist/admin/chunks/ko-CjOasZmz.js.map +0 -1
  271. package/dist/admin/chunks/ko-DZvks90a.mjs.map +0 -1
  272. package/dist/admin/chunks/ms-C2TEZHkD.js.map +0 -1
  273. package/dist/admin/chunks/ms-Df9gDB9M.mjs.map +0 -1
  274. package/dist/admin/chunks/nl-BlmTMaTL.mjs.map +0 -1
  275. package/dist/admin/chunks/nl-CLp2dhr9.js.map +0 -1
  276. package/dist/admin/chunks/pl-5iT3b9r4.mjs.map +0 -1
  277. package/dist/admin/chunks/pl-C8WRO2pt.js.map +0 -1
  278. package/dist/admin/chunks/pt-BK5YbXpM.mjs.map +0 -1
  279. package/dist/admin/chunks/pt-BR-De5jokla.mjs.map +0 -1
  280. package/dist/admin/chunks/pt-BR-Ds-dLXzD.js.map +0 -1
  281. package/dist/admin/chunks/pt-DL-rrjA1.js.map +0 -1
  282. package/dist/admin/chunks/ru-C_16WuLP.mjs.map +0 -1
  283. package/dist/admin/chunks/ru-Cqv4k9my.js.map +0 -1
  284. package/dist/admin/chunks/sk-B7RadPe4.mjs.map +0 -1
  285. package/dist/admin/chunks/sk-D6l_EMOT.js.map +0 -1
  286. package/dist/admin/chunks/sv-DK5DOsrV.mjs.map +0 -1
  287. package/dist/admin/chunks/sv-Xg5gbVO9.js.map +0 -1
  288. package/dist/admin/chunks/th-DNiRgKQH.mjs.map +0 -1
  289. package/dist/admin/chunks/th-Pci1U3n6.js.map +0 -1
  290. package/dist/admin/chunks/tr-CBlxk5Of.js.map +0 -1
  291. package/dist/admin/chunks/tr-CWX4cUiB.mjs.map +0 -1
  292. package/dist/admin/chunks/uk-BkF_x68T.js.map +0 -1
  293. package/dist/admin/chunks/uk-CWOtQQic.mjs.map +0 -1
  294. package/dist/admin/chunks/vi-CAG7iDHR.js.map +0 -1
  295. package/dist/admin/chunks/vi-geadDLtq.mjs.map +0 -1
  296. package/dist/admin/chunks/zh-E4LX--2j.mjs.map +0 -1
  297. package/dist/admin/chunks/zh-Hans-CtXQdJhw.js.map +0 -1
  298. package/dist/admin/chunks/zh-Hans-fcRf-TLx.mjs.map +0 -1
  299. package/dist/admin/chunks/zh-rKHsKNA3.js.map +0 -1
  300. package/dist/server/chunks/index--0fU1WeK.js.map +0 -1
  301. package/dist/server/chunks/index-Dz3orHaf.mjs.map +0 -1
  302. package/dist/server/chunks/login-CMPqkCFT.js.map +0 -1
  303. package/dist/server/chunks/login-CYdORE5u.mjs.map +0 -1
@@ -1,1593 +1,19 @@
1
1
  'use strict';
2
2
 
3
- var path = require('path');
4
- var koaStatic = require('koa-static');
5
- var swaggerUi = require('swagger-ui-dist');
6
- var fs = require('fs-extra');
7
- var immer = require('immer');
8
- var _ = require('lodash');
9
- var pathToRegexp = require('path-to-regexp');
10
- var bcrypt = require('bcryptjs');
11
- var utils = require('@strapi/utils');
12
-
13
- function _interopNamespaceDefault(e) {
14
- var n = Object.create(null);
15
- if (e) {
16
- Object.keys(e).forEach(function (k) {
17
- if (k !== 'default') {
18
- var d = Object.getOwnPropertyDescriptor(e, k);
19
- Object.defineProperty(n, k, d.get ? d : {
20
- enumerable: true,
21
- get: function () { return e[k]; }
22
- });
23
- }
24
- });
25
- }
26
- n.default = e;
27
- return Object.freeze(n);
28
- }
29
-
30
- var pathToRegexp__namespace = /*#__PURE__*/_interopNamespaceDefault(pathToRegexp);
31
-
32
- const getService = (name, { strapi } = {
33
- strapi: global.strapi
34
- })=>{
35
- return strapi.plugin('documentation').service(name);
36
- };
37
-
38
- // Add permissions
39
- const RBAC_ACTIONS = [
40
- {
41
- section: 'plugins',
42
- displayName: 'Access the Documentation',
43
- uid: 'read',
44
- pluginName: 'documentation'
45
- },
46
- {
47
- section: 'plugins',
48
- displayName: 'Update and delete',
49
- uid: 'settings.update',
50
- pluginName: 'documentation'
51
- },
52
- {
53
- section: 'plugins',
54
- displayName: 'Regenerate',
55
- uid: 'settings.regenerate',
56
- pluginName: 'documentation'
57
- },
58
- {
59
- section: 'settings',
60
- displayName: 'Access the documentation settings page',
61
- uid: 'settings.read',
62
- pluginName: 'documentation',
63
- category: 'documentation'
64
- }
65
- ];
66
- async function bootstrap({ strapi }) {
67
- await strapi.service('admin::permission').actionProvider.registerMany(RBAC_ACTIONS);
68
- const pluginStore = strapi.store({
69
- environment: '',
70
- type: 'plugin',
71
- name: 'documentation'
72
- });
73
- const config = await pluginStore.get({
74
- key: 'config'
75
- });
76
- if (!config) {
77
- pluginStore.set({
78
- key: 'config',
79
- value: {
80
- restrictedAccess: false
81
- }
82
- });
83
- }
84
- if (process.env.NODE_ENV !== 'production') {
85
- await getService('documentation').generateFullDoc();
86
- }
87
- }
88
-
89
- const addDocumentMiddlewares = async ({ strapi })=>{
90
- strapi.server.routes([
91
- {
92
- method: 'GET',
93
- path: '/plugins/documentation/(.*)',
94
- async handler (ctx, next) {
95
- ctx.url = path.basename(ctx.url);
96
- return koaStatic(swaggerUi.getAbsoluteFSPath(), {
97
- maxage: 86400000,
98
- defer: true
99
- })(ctx, next);
100
- },
101
- config: {
102
- auth: false
103
- }
104
- }
105
- ]);
106
- };
107
-
108
- async function register({ strapi }) {
109
- await addDocumentMiddlewares({
110
- strapi
111
- });
112
- }
113
-
114
- const pascalCase = (string)=>{
115
- return _.upperFirst(_.camelCase(string));
116
- };
117
-
118
- const params = [
119
- {
120
- name: 'sort',
121
- in: 'query',
122
- description: 'Sort by attributes ascending (asc) or descending (desc)',
123
- deprecated: false,
124
- required: false,
125
- schema: {
126
- type: 'string'
127
- }
128
- },
129
- {
130
- name: 'pagination[withCount]',
131
- in: 'query',
132
- description: 'Return page/pageSize (default: true)',
133
- deprecated: false,
134
- required: false,
135
- schema: {
136
- type: 'boolean'
137
- }
138
- },
139
- {
140
- name: 'pagination[page]',
141
- in: 'query',
142
- description: 'Page number (default: 0)',
143
- deprecated: false,
144
- required: false,
145
- schema: {
146
- type: 'integer'
147
- }
148
- },
149
- {
150
- name: 'pagination[pageSize]',
151
- in: 'query',
152
- description: 'Page size (default: 25)',
153
- deprecated: false,
154
- required: false,
155
- schema: {
156
- type: 'integer'
157
- }
158
- },
159
- {
160
- name: 'pagination[start]',
161
- in: 'query',
162
- description: 'Offset value (default: 0)',
163
- deprecated: false,
164
- required: false,
165
- schema: {
166
- type: 'integer'
167
- }
168
- },
169
- {
170
- name: 'pagination[limit]',
171
- in: 'query',
172
- description: 'Number of entities to return (default: 25)',
173
- deprecated: false,
174
- required: false,
175
- schema: {
176
- type: 'integer'
177
- }
178
- },
179
- {
180
- name: 'fields',
181
- in: 'query',
182
- description: 'Fields to return (ex: title,author)',
183
- deprecated: false,
184
- required: false,
185
- schema: {
186
- type: 'string'
187
- }
188
- },
189
- {
190
- name: 'populate',
191
- in: 'query',
192
- description: 'Relations to return',
193
- deprecated: false,
194
- required: false,
195
- schema: {
196
- type: 'string'
197
- }
198
- },
199
- {
200
- name: 'filters',
201
- in: 'query',
202
- description: 'Filters to apply',
203
- deprecated: false,
204
- required: false,
205
- schema: {
206
- type: 'object',
207
- additionalProperties: true
208
- },
209
- style: 'deepObject'
210
- },
211
- {
212
- name: 'locale',
213
- in: 'query',
214
- description: 'Locale to apply',
215
- deprecated: false,
216
- required: false,
217
- schema: {
218
- type: 'string'
219
- }
220
- }
221
- ];
222
-
223
- /**
224
- * @description A reusable loop for building api endpoint paths and component schemas
225
- */ const loopContentTypeNames = (api, callback)=>{
226
- let result = {};
227
- for (const contentTypeName of api.ctNames){
228
- // Get the attributes found on the api's contentType
229
- const uid = `${api.getter}::${api.name}.${contentTypeName}`;
230
- const { attributes, info: contentTypeInfo, kind } = strapi.contentType(uid);
231
- // Get the routes for the current api
232
- const routeInfo = api.getter === 'plugin' ? strapi.plugin(api.name).routes['content-api'] : strapi.api(api.name).routes[contentTypeName];
233
- // Continue to next iteration if routeInfo is undefined
234
- if (!routeInfo) {
235
- continue;
236
- }
237
- // Uppercase the first letter of the api name
238
- const apiName = _.upperFirst(api.name);
239
- // Create a unique name if the api name and contentType name don't match
240
- const uniqueName = api.name === contentTypeName ? apiName : `${apiName} - ${_.upperFirst(contentTypeName)}`;
241
- const apiInfo = {
242
- ...api,
243
- routeInfo,
244
- attributes,
245
- uniqueName,
246
- contentTypeInfo,
247
- kind
248
- };
249
- result = {
250
- ...result,
251
- ...callback(apiInfo)
252
- };
253
- }
254
- return result;
255
- };
256
-
257
- /**
258
- * @description - Builds the Swagger response object for a given api
259
- */ const getApiResponse = ({ uniqueName, route, isListOfEntities = false })=>{
260
- const getSchema = ()=>{
261
- if (route.method === 'DELETE') {
262
- return {
263
- type: 'integer',
264
- format: 'int64'
265
- };
266
- }
267
- if (isListOfEntities) {
268
- return {
269
- $ref: `#/components/schemas/${pascalCase(uniqueName)}ListResponse`
270
- };
271
- }
272
- return {
273
- $ref: `#/components/schemas/${pascalCase(uniqueName)}Response`
274
- };
275
- };
276
- const schema = getSchema();
277
- return {
278
- 200: {
279
- description: 'OK',
280
- content: {
281
- 'application/json': {
282
- schema
283
- }
284
- }
285
- },
286
- 400: {
287
- description: 'Bad Request',
288
- content: {
289
- 'application/json': {
290
- schema: {
291
- $ref: '#/components/schemas/Error'
292
- }
293
- }
294
- }
295
- },
296
- 401: {
297
- description: 'Unauthorized',
298
- content: {
299
- 'application/json': {
300
- schema: {
301
- $ref: '#/components/schemas/Error'
302
- }
303
- }
304
- }
305
- },
306
- 403: {
307
- description: 'Forbidden',
308
- content: {
309
- 'application/json': {
310
- schema: {
311
- $ref: '#/components/schemas/Error'
312
- }
313
- }
314
- }
315
- },
316
- 404: {
317
- description: 'Not Found',
318
- content: {
319
- 'application/json': {
320
- schema: {
321
- $ref: '#/components/schemas/Error'
322
- }
323
- }
324
- }
325
- },
326
- 500: {
327
- description: 'Internal Server Error',
328
- content: {
329
- 'application/json': {
330
- schema: {
331
- $ref: '#/components/schemas/Error'
332
- }
333
- }
334
- }
335
- }
336
- };
337
- };
338
-
339
- const hasFindMethod = (handler)=>{
340
- if (typeof handler === 'string') {
341
- return handler.split('.').pop() === 'find';
342
- }
343
- return false;
344
- };
345
-
346
- /**
347
- * @description Parses a route with ':variable'
348
- *
349
- * @param {string} routePath - The route's path property
350
- * @returns {string}
351
- */ const parsePathWithVariables = (routePath)=>{
352
- const { tokens } = pathToRegexp__namespace.parse(routePath);
353
- return tokens.map((token)=>{
354
- switch(token.type){
355
- case 'text':
356
- return token.value;
357
- case 'param':
358
- return `{${token.name}}`;
359
- case 'wildcard':
360
- return `{${token.name}}`;
361
- case 'group':
362
- // Handle group tokens by mapping them within the same function context
363
- return `(${parsePathWithVariables(token.tokens.map((t)=>t).join(''))})`;
364
- default:
365
- throw new Error(`Unknown token type: ${token.type}`);
366
- }
367
- }).join('');
368
- };
369
- /**
370
- * @description Builds the required object for a path parameter
371
- *
372
- * @param {string} routePath - The route's path property
373
- *
374
- * @returns {object } Swagger path params object
375
- */ const getPathParams = (routePath)=>{
376
- const { tokens } = pathToRegexp__namespace.parse(routePath);
377
- return tokens.reduce((acc, param)=>{
378
- // Skip non-parameter tokens
379
- if (param.type !== 'param') {
380
- return acc;
381
- }
382
- acc.push({
383
- name: `${param.name}`,
384
- in: 'path',
385
- description: '',
386
- deprecated: false,
387
- required: true,
388
- schema: {
389
- type: 'number'
390
- }
391
- });
392
- return acc;
393
- }, []);
394
- };
395
- const getPathWithPrefix = (prefix, route)=>{
396
- // When the prefix is set on the routes and
397
- // the current route is not trying to remove it
398
- if (prefix && !_.has(route.config, 'prefix')) {
399
- // Add the prefix to the path
400
- return prefix.concat(route.path);
401
- }
402
- // Otherwise just return path
403
- return route.path;
404
- };
405
- /**
406
- * @description Gets all paths based on routes
407
- *
408
- * @param {object} apiInfo
409
- * @property {object} apiInfo.routeInfo - The api routes object
410
- * @property {string} apiInfo.uniqueName - Content type name | Api name + Content type name
411
- * @property {object} apiInfo.contentTypeInfo - The info object found on content type schemas
412
- *
413
- * @returns {object}
414
- */ const getPaths = ({ routeInfo, uniqueName, contentTypeInfo, kind })=>{
415
- // Get the routes for the current content type
416
- const contentTypeRoutes = routeInfo.routes.filter((route)=>{
417
- return route.path.includes(contentTypeInfo.pluralName) || route.path.includes(contentTypeInfo.singularName);
418
- });
419
- const paths = contentTypeRoutes.reduce((acc, route)=>{
420
- // TODO: Find a more reliable way to determine list of entities vs a single entity
421
- const isListOfEntities = hasFindMethod(route.handler);
422
- const methodVerb = route.method.toLowerCase();
423
- const hasPathParams = route.path.includes('/:');
424
- const pathWithPrefix = getPathWithPrefix(routeInfo.prefix, route);
425
- const routePath = hasPathParams ? parsePathWithVariables(pathWithPrefix) : pathWithPrefix;
426
- const responses = getApiResponse({
427
- uniqueName,
428
- route,
429
- isListOfEntities: kind !== 'singleType' && isListOfEntities
430
- });
431
- const swaggerConfig = {
432
- responses,
433
- tags: [
434
- _.upperFirst(uniqueName)
435
- ],
436
- parameters: [],
437
- operationId: `${methodVerb}${routePath}`
438
- };
439
- if (isListOfEntities) {
440
- swaggerConfig.parameters?.push(...params);
441
- }
442
- if (hasPathParams) {
443
- const pathParams = getPathParams(route.path);
444
- swaggerConfig.parameters?.push(...pathParams);
445
- }
446
- if ([
447
- 'post',
448
- 'put'
449
- ].includes(methodVerb)) {
450
- const refName = 'Request';
451
- const requestBody = {
452
- required: true,
453
- content: {
454
- 'application/json': {
455
- schema: {
456
- $ref: `#/components/schemas/${pascalCase(uniqueName)}${refName}`
457
- }
458
- }
459
- }
460
- };
461
- swaggerConfig.requestBody = requestBody;
462
- }
463
- _.set(acc, `${routePath}.${methodVerb}`, swaggerConfig);
464
- return acc;
465
- }, {});
466
- return paths;
467
- };
468
- /**
469
- * @description - Builds the Swagger paths object for each api
470
- */ const buildApiEndpointPath = (api)=>{
471
- // A reusable loop for building paths and component schemas
472
- // Uses the api param to build a new set of params for each content type
473
- // Passes these new params to the function provided
474
- return loopContentTypeNames(api, getPaths);
475
- };
476
-
477
- /**
478
- * @description Determines the format of the data response
479
- *
480
- * @param {boolean} isListOfEntities - Checks for a multiple entities
481
- * @param {object} attributes - The attributes found on a contentType
482
-
483
- * @returns object | array of attributes
484
- */ var getSchemaData = ((isListOfEntities, attributes)=>{
485
- if (isListOfEntities) {
486
- return {
487
- type: 'array',
488
- items: {
489
- type: 'object',
490
- properties: {
491
- id: {
492
- type: 'number'
493
- },
494
- documentId: {
495
- type: 'string'
496
- },
497
- ...attributes
498
- }
499
- }
500
- };
501
- }
502
- return {
503
- type: 'object',
504
- properties: {
505
- id: {
506
- type: 'number'
507
- },
508
- documentId: {
509
- type: 'string'
510
- },
511
- ...attributes
512
- }
513
- };
514
- });
515
-
516
- /**
517
- * @description - Convert attribute component names to OpenAPI component names
518
- *
519
- * @returns OpenAPI component name
520
- */ const convertComponentName = (component, isRef = false)=>{
521
- const cleanComponentName = `${pascalCase(component)}Component`;
522
- if (isRef) {
523
- return `#/components/schemas/${cleanComponentName}`;
524
- }
525
- return cleanComponentName;
526
- };
527
- /**
528
- * @description - Converts types found on attributes to OpenAPI acceptable data types
529
- *
530
- * @returns Attributes using OpenAPI acceptable data types
531
- */ const cleanSchemaAttributes = (attributes, { typeMap = new Map(), isRequest = false, didAddStrapiComponentsToSchemas })=>{
532
- const schemaAttributes = {};
533
- for (const prop of Object.keys(attributes)){
534
- const attribute = attributes[prop];
535
- switch(attribute.type){
536
- case 'password':
537
- {
538
- if (!isRequest) {
539
- break;
540
- }
541
- schemaAttributes[prop] = {
542
- type: 'string',
543
- format: 'password',
544
- example: '*******'
545
- };
546
- break;
547
- }
548
- case 'email':
549
- {
550
- schemaAttributes[prop] = {
551
- type: 'string',
552
- format: 'email'
553
- };
554
- break;
555
- }
556
- case 'string':
557
- case 'text':
558
- case 'richtext':
559
- {
560
- schemaAttributes[prop] = {
561
- type: 'string'
562
- };
563
- break;
564
- }
565
- case 'timestamp':
566
- {
567
- schemaAttributes[prop] = {
568
- type: 'string',
569
- format: 'timestamp',
570
- example: Date.now()
571
- };
572
- break;
573
- }
574
- case 'time':
575
- {
576
- schemaAttributes[prop] = {
577
- type: 'string',
578
- format: 'time',
579
- example: '12:54.000'
580
- };
581
- break;
582
- }
583
- case 'date':
584
- {
585
- schemaAttributes[prop] = {
586
- type: 'string',
587
- format: 'date'
588
- };
589
- break;
590
- }
591
- case 'datetime':
592
- {
593
- schemaAttributes[prop] = {
594
- type: 'string',
595
- format: 'date-time'
596
- };
597
- break;
598
- }
599
- case 'boolean':
600
- {
601
- schemaAttributes[prop] = {
602
- type: 'boolean'
603
- };
604
- break;
605
- }
606
- case 'enumeration':
607
- {
608
- schemaAttributes[prop] = {
609
- type: 'string',
610
- enum: [
611
- ...attribute.enum
612
- ]
613
- };
614
- break;
615
- }
616
- case 'decimal':
617
- case 'float':
618
- {
619
- schemaAttributes[prop] = {
620
- type: 'number',
621
- format: 'float'
622
- };
623
- break;
624
- }
625
- case 'integer':
626
- {
627
- schemaAttributes[prop] = {
628
- type: 'integer'
629
- };
630
- break;
631
- }
632
- case 'biginteger':
633
- {
634
- schemaAttributes[prop] = {
635
- type: 'string',
636
- pattern: '^\\d*$',
637
- example: '123456789'
638
- };
639
- break;
640
- }
641
- case 'json':
642
- case 'blocks':
643
- {
644
- schemaAttributes[prop] = {};
645
- break;
646
- }
647
- case 'uid':
648
- {
649
- schemaAttributes[prop] = {
650
- type: 'string'
651
- };
652
- break;
653
- }
654
- case 'component':
655
- {
656
- const componentAttributes = strapi.components[attribute.component].attributes;
657
- const rawComponentSchema = {
658
- type: 'object',
659
- properties: {
660
- ...isRequest ? {} : {
661
- id: {
662
- type: 'number'
663
- }
664
- },
665
- ...cleanSchemaAttributes(componentAttributes, {
666
- typeMap,
667
- isRequest,
668
- didAddStrapiComponentsToSchemas
669
- })
670
- }
671
- };
672
- const refComponentSchema = {
673
- $ref: convertComponentName(attribute.component, true)
674
- };
675
- const componentExists = didAddStrapiComponentsToSchemas(convertComponentName(attribute.component), rawComponentSchema);
676
- const finalComponentSchema = componentExists ? refComponentSchema : rawComponentSchema;
677
- if (attribute.repeatable) {
678
- schemaAttributes[prop] = {
679
- type: 'array',
680
- items: finalComponentSchema
681
- };
682
- } else {
683
- schemaAttributes[prop] = finalComponentSchema;
684
- }
685
- break;
686
- }
687
- case 'dynamiczone':
688
- {
689
- const components = attribute.components.map((component)=>{
690
- const componentAttributes = strapi.components[component].attributes;
691
- const rawComponentSchema = {
692
- type: 'object',
693
- properties: {
694
- ...isRequest ? {} : {
695
- id: {
696
- type: 'number'
697
- }
698
- },
699
- __component: {
700
- type: 'string',
701
- enum: [
702
- component
703
- ]
704
- },
705
- ...cleanSchemaAttributes(componentAttributes, {
706
- typeMap,
707
- isRequest,
708
- didAddStrapiComponentsToSchemas
709
- })
710
- }
711
- };
712
- const refComponentSchema = {
713
- $ref: convertComponentName(component, true)
714
- };
715
- const componentExists = didAddStrapiComponentsToSchemas(convertComponentName(component), rawComponentSchema);
716
- const finalComponentSchema = componentExists ? refComponentSchema : rawComponentSchema;
717
- return finalComponentSchema;
718
- });
719
- let discriminator;
720
- if (components.every((component)=>Object.hasOwn(component, '$ref'))) {
721
- discriminator = {
722
- propertyName: '__component',
723
- mapping: attribute.components.reduce((acc, component)=>{
724
- acc[component] = convertComponentName(component, true);
725
- return acc;
726
- }, {})
727
- };
728
- }
729
- schemaAttributes[prop] = {
730
- type: 'array',
731
- items: {
732
- anyOf: components
733
- },
734
- discriminator
735
- };
736
- break;
737
- }
738
- case 'media':
739
- {
740
- const imageAttributes = strapi.contentType('plugin::upload.file').attributes;
741
- const isListOfEntities = attribute.multiple ?? false;
742
- if (isRequest) {
743
- const oneOfType = {
744
- oneOf: [
745
- {
746
- type: 'integer'
747
- },
748
- {
749
- type: 'string'
750
- }
751
- ],
752
- example: 'string or id'
753
- };
754
- schemaAttributes[prop] = isListOfEntities ? {
755
- type: 'array',
756
- items: oneOfType
757
- } : oneOfType;
758
- break;
759
- }
760
- schemaAttributes[prop] = getSchemaData(isListOfEntities, cleanSchemaAttributes(imageAttributes, {
761
- typeMap,
762
- didAddStrapiComponentsToSchemas
763
- }));
764
- break;
765
- }
766
- case 'relation':
767
- {
768
- const isListOfEntities = attribute.relation.includes('ToMany');
769
- if (isRequest) {
770
- const oneOfType = {
771
- oneOf: [
772
- {
773
- type: 'integer'
774
- },
775
- {
776
- type: 'string'
777
- }
778
- ],
779
- example: 'string or id'
780
- };
781
- schemaAttributes[prop] = isListOfEntities ? {
782
- type: 'array',
783
- items: oneOfType
784
- } : oneOfType;
785
- break;
786
- }
787
- if (!('target' in attribute) || !attribute.target || typeMap.has(attribute.target)) {
788
- schemaAttributes[prop] = getSchemaData(isListOfEntities, {});
789
- break;
790
- }
791
- typeMap.set(attribute.target, true);
792
- const targetAttributes = strapi.contentType(attribute.target).attributes;
793
- schemaAttributes[prop] = getSchemaData(isListOfEntities, cleanSchemaAttributes(targetAttributes, {
794
- typeMap,
795
- isRequest,
796
- didAddStrapiComponentsToSchemas
797
- }));
798
- break;
799
- }
800
- default:
801
- {
802
- // @ts-expect-error - This is a catch all for any other types
803
- throw new Error(`Invalid type ${attribute.type} while generating open api schema.`);
804
- }
805
- }
806
- }
807
- return schemaAttributes;
808
- };
809
-
810
- const getRequiredAttributes = (allAttributes)=>{
811
- const requiredAttributes = [];
812
- for(const key in allAttributes){
813
- if (allAttributes[key].required) {
814
- requiredAttributes.push(key);
815
- }
816
- }
817
- return requiredAttributes;
818
- };
819
- /**
820
- * @description Get all open api schema objects for a given content type
821
- *
822
- * @param {object} apiInfo
823
- * @property {string} apiInfo.uniqueName - Api name | Api name + Content type name
824
- * @property {object} apiInfo.attributes - Attributes on content type
825
- * @property {object} apiInfo.routeInfo - The routes for the api
826
- *
827
- * @returns {object} Open API schemas
828
- */ const getAllSchemasForContentType = ({ routeInfo, attributes, uniqueName })=>{
829
- // Store response and request schemas in an object
830
- let strapiComponentSchemas = {};
831
- const schemas = {};
832
- const typeName = pascalCase(uniqueName);
833
- // adds a ComponentSchema to the Schemas so it can be used as Ref
834
- const didAddStrapiComponentsToSchemas = (schemaName, schema)=>{
835
- if (!Object.keys(schema) || !Object.keys(schema.properties)) return false;
836
- // Add the Strapi components to the schema
837
- strapiComponentSchemas = {
838
- ...strapiComponentSchemas,
839
- [schemaName]: schema
840
- };
841
- return true;
842
- };
843
- // Get all the route methods
844
- const routeMethods = routeInfo.routes.map((route)=>route.method);
845
- const attributesToOmit = [
846
- 'createdAt',
847
- 'updatedAt',
848
- 'publishedAt',
849
- 'publishedBy',
850
- 'updatedBy',
851
- 'createdBy'
852
- ];
853
- const attributesForRequest = _.omit(attributes, attributesToOmit);
854
- // Get a list of required attribute names
855
- const requiredRequestAttributes = getRequiredAttributes(attributesForRequest);
856
- // Build the request schemas when the route has POST or PUT methods
857
- if (routeMethods.includes('POST') || routeMethods.includes('PUT')) {
858
- // Build localization requests schemas
859
- // Build the request schema
860
- Object.assign(schemas, {
861
- [`${typeName}Request`]: {
862
- type: 'object',
863
- required: [
864
- 'data'
865
- ],
866
- properties: {
867
- data: {
868
- ...requiredRequestAttributes.length && {
869
- required: requiredRequestAttributes
870
- },
871
- type: 'object',
872
- properties: cleanSchemaAttributes(attributesForRequest, {
873
- isRequest: true,
874
- didAddStrapiComponentsToSchemas
875
- })
876
- }
877
- }
878
- }
879
- });
880
- }
881
- // Check for routes that need to return a list
882
- const hasListOfEntities = routeInfo.routes.filter((route)=>hasFindMethod(route.handler)).length;
883
- if (hasListOfEntities) {
884
- // Build the list response schema
885
- Object.assign(schemas, {
886
- [`${typeName}ListResponse`]: {
887
- type: 'object',
888
- properties: {
889
- data: {
890
- type: 'array',
891
- items: {
892
- $ref: `#/components/schemas/${typeName}`
893
- }
894
- },
895
- meta: {
896
- type: 'object',
897
- properties: {
898
- pagination: {
899
- type: 'object',
900
- properties: {
901
- page: {
902
- type: 'integer'
903
- },
904
- pageSize: {
905
- type: 'integer',
906
- minimum: 25
907
- },
908
- pageCount: {
909
- type: 'integer',
910
- maximum: 1
911
- },
912
- total: {
913
- type: 'integer'
914
- }
915
- }
916
- }
917
- }
918
- }
919
- }
920
- }
921
- });
922
- }
923
- const requiredAttributes = getRequiredAttributes(attributes);
924
- // Build the response schema
925
- Object.assign(schemas, {
926
- [`${typeName}`]: {
927
- type: 'object',
928
- ...requiredAttributes.length && {
929
- required: requiredAttributes
930
- },
931
- properties: {
932
- id: {
933
- type: 'number'
934
- },
935
- documentId: {
936
- type: 'string'
937
- },
938
- ...cleanSchemaAttributes(attributes, {
939
- didAddStrapiComponentsToSchemas
940
- })
941
- }
942
- },
943
- [`${typeName}Response`]: {
944
- type: 'object',
945
- properties: {
946
- data: {
947
- $ref: `#/components/schemas/${typeName}`
948
- },
949
- meta: {
950
- type: 'object'
951
- }
952
- }
953
- }
954
- });
955
- return {
956
- ...schemas,
957
- ...strapiComponentSchemas
958
- };
959
- };
960
- const buildComponentSchema = (api)=>{
961
- // A reusable loop for building paths and component schemas
962
- // Uses the api param to build a new set of params for each content type
963
- // Passes these new params to the function provided
964
- return loopContentTypeNames(api, getAllSchemasForContentType);
965
- };
966
-
967
- const getPluginsThatNeedDocumentation = (config)=>{
968
- // Default plugins that need documentation generated
969
- const defaultPlugins = [
970
- 'upload',
971
- 'users-permissions'
972
- ];
973
- // User specified plugins that need documentation generated
974
- const userPluginsConfig = config['x-strapi-config'].plugins;
975
- if (userPluginsConfig === null) {
976
- // The user hasn't specified any plugins to document, use the defaults
977
- return defaultPlugins;
978
- }
979
- if (userPluginsConfig.length) {
980
- // The user has specified certain plugins to document, use them
981
- return userPluginsConfig;
982
- }
983
- // The user has specified that no plugins should be documented
984
- return [];
985
- };
986
-
987
- const createService$1 = ({ strapi })=>{
988
- const config = strapi.config.get('plugin::documentation');
989
- const pluginsThatNeedDocumentation = getPluginsThatNeedDocumentation(config);
990
- const overrideService = getService('override');
991
- return {
992
- getDocumentationVersion () {
993
- return config.info.version;
994
- },
995
- getFullDocumentationPath () {
996
- return path.join(strapi.dirs.app.extensions, 'documentation', 'documentation');
997
- },
998
- getDocumentationVersions () {
999
- return fs.readdirSync(this.getFullDocumentationPath()).map((version)=>{
1000
- try {
1001
- const filePath = path.resolve(this.getFullDocumentationPath(), version, 'full_documentation.json');
1002
- const doc = JSON.parse(fs.readFileSync(filePath).toString());
1003
- const generatedDate = doc.info['x-generation-date'];
1004
- return {
1005
- version,
1006
- generatedDate,
1007
- url: ''
1008
- };
1009
- } catch (err) {
1010
- return null;
1011
- }
1012
- }).filter((x)=>x);
1013
- },
1014
- /**
1015
- * Returns settings stored in core-store
1016
- */ async getDocumentationAccess () {
1017
- const { restrictedAccess } = await strapi.store({
1018
- environment: '',
1019
- type: 'plugin',
1020
- name: 'documentation',
1021
- key: 'config'
1022
- }).get();
1023
- return {
1024
- restrictedAccess
1025
- };
1026
- },
1027
- getApiDocumentationPath (api) {
1028
- if (api.getter === 'plugin') {
1029
- return path.join(strapi.dirs.app.extensions, api.name, 'documentation');
1030
- }
1031
- return path.join(strapi.dirs.app.api, api.name, 'documentation');
1032
- },
1033
- async deleteDocumentation (version) {
1034
- const apis = this.getPluginAndApiInfo();
1035
- for (const api of apis){
1036
- await fs.remove(path.join(this.getApiDocumentationPath(api), version));
1037
- }
1038
- await fs.remove(path.join(this.getFullDocumentationPath(), version));
1039
- },
1040
- getPluginAndApiInfo () {
1041
- const pluginsToDocument = pluginsThatNeedDocumentation.map((plugin)=>{
1042
- return {
1043
- name: plugin,
1044
- getter: 'plugin',
1045
- ctNames: Object.keys(strapi.plugin(plugin).contentTypes)
1046
- };
1047
- });
1048
- const apisToDocument = Object.keys(strapi.apis).map((api)=>{
1049
- return {
1050
- name: api,
1051
- getter: 'api',
1052
- ctNames: Object.keys(strapi.api(api).contentTypes)
1053
- };
1054
- });
1055
- return [
1056
- ...apisToDocument,
1057
- ...pluginsToDocument
1058
- ];
1059
- },
1060
- /**
1061
- * @description - Creates the Swagger json files
1062
- */ async generateFullDoc (versionOpt) {
1063
- const version = versionOpt ?? this.getDocumentationVersion();
1064
- const apis = this.getPluginAndApiInfo();
1065
- const apisThatNeedGeneratedDocumentation = apis.filter(({ name })=>!overrideService.isEnabled(name));
1066
- // Initialize the generated documentation with defaults
1067
- const generatedDocumentation = await immer.produce(config, async (draft)=>{
1068
- if (draft.servers?.length === 0) {
1069
- // When no servers found set the defaults
1070
- const serverUrl = strapi.config.get('server.absoluteUrl');
1071
- const apiPath = strapi.config.get('api.rest.prefix');
1072
- draft.servers = [
1073
- {
1074
- url: `${serverUrl}${apiPath}`,
1075
- description: 'Development server'
1076
- }
1077
- ];
1078
- }
1079
- if (!draft.components) {
1080
- draft.components = {};
1081
- }
1082
- // Set the generated date
1083
- draft.info['x-generation-date'] = new Date().toISOString();
1084
- // Set the plugins that need documentation
1085
- draft['x-strapi-config'].plugins = pluginsThatNeedDocumentation;
1086
- // Delete the mutateDocumentation key from the config so it doesn't end up in the spec
1087
- delete draft['x-strapi-config'].mutateDocumentation;
1088
- // Generate the documentation for each api and update the generatedDocumentation
1089
- for (const api of apisThatNeedGeneratedDocumentation){
1090
- const newApiPath = buildApiEndpointPath(api);
1091
- const generatedSchemas = buildComponentSchema(api);
1092
- if (generatedSchemas) {
1093
- draft.components.schemas = {
1094
- ...draft.components.schemas,
1095
- ...generatedSchemas
1096
- };
1097
- }
1098
- if (newApiPath) {
1099
- draft.paths = {
1100
- ...draft.paths,
1101
- ...newApiPath
1102
- };
1103
- }
1104
- }
1105
- // When overrides are present update the generatedDocumentation
1106
- if (overrideService.registeredOverrides.length > 0) {
1107
- overrideService.registeredOverrides.forEach((override)=>{
1108
- // Only run the overrrides when no override version is provided,
1109
- // or when the generated documentation version matches the override version
1110
- if (!override?.info?.version || override.info.version === version) {
1111
- if (override.tags) {
1112
- // Merge override tags with the generated tags
1113
- draft.tags = draft.tags || [];
1114
- draft.tags.push(...override.tags);
1115
- }
1116
- if (override.paths) {
1117
- // Merge override paths with the generated paths
1118
- // The override will add a new path or replace the value of an existing path
1119
- draft.paths = {
1120
- ...draft.paths,
1121
- ...override.paths
1122
- };
1123
- }
1124
- if (override.components) {
1125
- const keys = Object.keys(override.components);
1126
- keys.forEach((overrideKey)=>{
1127
- draft.components = draft.components || {};
1128
- const overrideValue = override.components?.[overrideKey];
1129
- const originalValue = draft.components?.[overrideKey];
1130
- Object.assign(draft.components, {
1131
- [overrideKey]: {
1132
- ...originalValue,
1133
- ...overrideValue
1134
- }
1135
- });
1136
- });
1137
- }
1138
- }
1139
- });
1140
- }
1141
- });
1142
- // Escape hatch, allow the user to provide a mutateDocumentation function that can alter any part of
1143
- // the generated documentation before it is written to the file system
1144
- const userMutatesDocumentation = config['x-strapi-config'].mutateDocumentation;
1145
- const finalDocumentation = userMutatesDocumentation ? immer.produce(generatedDocumentation, userMutatesDocumentation) : generatedDocumentation;
1146
- // Get the file path for the final documentation
1147
- const fullDocJsonPath = path.join(this.getFullDocumentationPath(), version, 'full_documentation.json');
1148
- // Write the documentation to the file system
1149
- await fs.ensureFile(fullDocJsonPath);
1150
- await fs.writeJson(fullDocJsonPath, finalDocumentation, {
1151
- spaces: 2
1152
- });
1153
- }
1154
- };
1155
- };
1156
-
1157
- const createService = ({ strapi })=>{
1158
- const registeredOverrides = [];
1159
- const excludedFromGeneration = [];
1160
- return {
1161
- registeredOverrides,
1162
- excludedFromGeneration,
1163
- /**
1164
- *
1165
- * @param {(string | string[])} api - The name of the api or and array of apis to exclude from generation
1166
- */ excludeFromGeneration (api) {
1167
- if (Array.isArray(api)) {
1168
- excludedFromGeneration.push(...api);
1169
- return;
1170
- }
1171
- excludedFromGeneration.push(api);
1172
- },
1173
- isEnabled (name) {
1174
- return excludedFromGeneration.includes(name);
1175
- },
1176
- registerOverride (override, opts) {
1177
- const { pluginOrigin, excludeFromGeneration = [] } = opts ?? {};
1178
- const pluginsThatNeedDocumentation = getPluginsThatNeedDocumentation(strapi.config.get('plugin::documentation'));
1179
- // Don't apply the override if the plugin is not in the list of plugins that need documentation
1180
- if (pluginOrigin && !pluginsThatNeedDocumentation.includes(pluginOrigin)) return;
1181
- if (excludeFromGeneration.length) {
1182
- this.excludeFromGeneration(excludeFromGeneration);
1183
- }
1184
- let overrideToRegister = override;
1185
- // Parse yaml if we receive a string
1186
- if (typeof override === 'string') {
1187
- // eslint-disable-next-line @typescript-eslint/no-var-requires
1188
- overrideToRegister = require('yaml').parse(overrideToRegister);
1189
- }
1190
- // receive an object we can register it directly
1191
- registeredOverrides.push(overrideToRegister);
1192
- }
1193
- };
1194
- };
1195
-
1196
- // import type { Common } from '@strapi/types';
1197
- var services = {
1198
- documentation: createService$1,
1199
- override: createService
1200
- };
1201
-
1202
- var restrictAccess = (async (ctx, next)=>{
1203
- const pluginStore = strapi.store({
1204
- type: 'plugin',
1205
- name: 'documentation'
1206
- });
1207
- const config = await pluginStore.get({
1208
- key: 'config'
1209
- });
1210
- if (!config.restrictedAccess) {
1211
- return next();
1212
- }
1213
- if (!ctx.session || !ctx.session.documentation || !ctx.session.documentation.logged) {
1214
- const querystring = ctx.querystring ? `?${ctx.querystring}` : '';
1215
- return ctx.redirect(`${strapi.config.server.url}/documentation/login${querystring}`);
1216
- }
1217
- // Execute the action.
1218
- return next();
1219
- });
1220
-
1221
- var routes = [
1222
- {
1223
- method: 'GET',
1224
- path: '/',
1225
- handler: 'documentation.index',
1226
- config: {
1227
- auth: false,
1228
- middlewares: [
1229
- restrictAccess
1230
- ]
1231
- }
1232
- },
1233
- {
1234
- method: 'GET',
1235
- path: '/v:major(\\d+).:minor(\\d+).:patch(\\d+)',
1236
- handler: 'documentation.index',
1237
- config: {
1238
- auth: false,
1239
- middlewares: [
1240
- restrictAccess
1241
- ]
1242
- }
1243
- },
1244
- {
1245
- method: 'GET',
1246
- path: '/login',
1247
- handler: 'documentation.loginView',
1248
- config: {
1249
- auth: false
1250
- }
1251
- },
1252
- {
1253
- method: 'POST',
1254
- path: '/login',
1255
- handler: 'documentation.login',
1256
- config: {
1257
- auth: false
1258
- }
1259
- },
1260
- {
1261
- method: 'GET',
1262
- path: '/getInfos',
1263
- handler: 'documentation.getInfos',
1264
- config: {
1265
- policies: [
1266
- {
1267
- name: 'admin::hasPermissions',
1268
- config: {
1269
- actions: [
1270
- 'plugin::documentation.read'
1271
- ]
1272
- }
1273
- }
1274
- ]
1275
- }
1276
- },
1277
- {
1278
- method: 'POST',
1279
- path: '/regenerateDoc',
1280
- handler: 'documentation.regenerateDoc',
1281
- config: {
1282
- policies: [
1283
- {
1284
- name: 'admin::hasPermissions',
1285
- config: {
1286
- actions: [
1287
- 'plugin::documentation.settings.regenerate'
1288
- ]
1289
- }
1290
- }
1291
- ]
1292
- }
1293
- },
1294
- {
1295
- method: 'PUT',
1296
- path: '/updateSettings',
1297
- handler: 'documentation.updateSettings',
1298
- config: {
1299
- policies: [
1300
- {
1301
- name: 'admin::hasPermissions',
1302
- config: {
1303
- actions: [
1304
- 'plugin::documentation.settings.update'
1305
- ]
1306
- }
1307
- }
1308
- ]
1309
- }
1310
- },
1311
- {
1312
- method: 'DELETE',
1313
- path: '/deleteDoc/:version',
1314
- handler: 'documentation.deleteDoc',
1315
- config: {
1316
- policies: []
1317
- }
1318
- }
1319
- ];
1320
-
1321
- const validation = {
1322
- validateSettings: utils.validateYupSchema(utils.yup.object().shape({
1323
- restrictedAccess: utils.yup.boolean(),
1324
- password: utils.yup.string().min(8).matches(/[a-z]/, '${path} must contain at least one lowercase character').matches(/[A-Z]/, '${path} must contain at least one uppercase character').matches(/\d/, '${path} must contain at least one number').when('restrictedAccess', (value, initSchema)=>{
1325
- return value ? initSchema.required('password is required') : initSchema;
1326
- })
1327
- }))
1328
- };
1329
- var documentation = {
1330
- async getInfos (ctx) {
1331
- try {
1332
- const docService = getService('documentation');
1333
- const docVersions = docService.getDocumentationVersions();
1334
- const documentationAccess = await docService.getDocumentationAccess();
1335
- ctx.send({
1336
- docVersions,
1337
- currentVersion: docService.getDocumentationVersion(),
1338
- prefix: '/documentation',
1339
- documentationAccess
1340
- });
1341
- } catch (err) {
1342
- strapi.log.error(err);
1343
- ctx.badRequest();
1344
- }
1345
- },
1346
- async index (ctx, next) {
1347
- try {
1348
- /**
1349
- * We don't expose the specs using koa-static or something else due to security reasons.
1350
- * That's why, we need to read the file localy and send the specs through it when we serve the Swagger UI.
1351
- */ const { major, minor, patch } = ctx.params;
1352
- const version = major && minor && patch ? `${major}.${minor}.${patch}` : getService('documentation').getDocumentationVersion();
1353
- const openAPISpecsPath = path.join(strapi.dirs.app.extensions, 'documentation', 'documentation', version, 'full_documentation.json');
1354
- try {
1355
- const documentation = fs.readFileSync(openAPISpecsPath, 'utf8');
1356
- const layout = (await Promise.resolve().then(function () { return require('./chunks/index--0fU1WeK.js'); })).default;
1357
- const filledLayout = _.template(layout)({
1358
- backendUrl: strapi.config.server.url,
1359
- spec: JSON.stringify(JSON.parse(documentation))
1360
- });
1361
- try {
1362
- const layoutPath = path.resolve(strapi.dirs.app.extensions, 'documentation', 'public', 'index.html');
1363
- await fs.ensureFile(layoutPath);
1364
- await fs.writeFile(layoutPath, filledLayout);
1365
- // Serve the file.
1366
- ctx.url = path.basename(`${ctx.url}/index.html`);
1367
- try {
1368
- const staticFolder = path.resolve(strapi.dirs.app.extensions, 'documentation', 'public');
1369
- return koaStatic(staticFolder)(ctx, next);
1370
- } catch (e) {
1371
- strapi.log.error(e);
1372
- }
1373
- } catch (e) {
1374
- strapi.log.error(e);
1375
- }
1376
- } catch (e) {
1377
- strapi.log.error(e);
1378
- }
1379
- } catch (e) {
1380
- strapi.log.error(e);
1381
- }
1382
- },
1383
- async loginView (ctx, next) {
1384
- // lazy require cheerio
1385
- // eslint-disable-next-line @typescript-eslint/no-var-requires
1386
- const cheerio = require('cheerio');
1387
- const { error } = ctx.query;
1388
- try {
1389
- const layout = (await Promise.resolve().then(function () { return require('./chunks/login-CMPqkCFT.js'); })).default;
1390
- const filledLayout = _.template(layout.toString())({
1391
- actionUrl: `${strapi.config.server.url}/documentation/login`
1392
- });
1393
- const $ = cheerio.load(filledLayout);
1394
- $('.error').text(_.isEmpty(error) ? '' : 'Wrong password...');
1395
- try {
1396
- const layoutPath = path.resolve(strapi.dirs.app.extensions, 'documentation', 'public', 'login.html');
1397
- await fs.ensureFile(layoutPath);
1398
- await fs.writeFile(layoutPath, $.html());
1399
- ctx.url = path.basename(`${ctx.url}/login.html`);
1400
- try {
1401
- const staticFolder = path.resolve(strapi.dirs.app.extensions, 'documentation', 'public');
1402
- return koaStatic(staticFolder)(ctx, next);
1403
- } catch (e) {
1404
- strapi.log.error(e);
1405
- }
1406
- } catch (e) {
1407
- strapi.log.error(e);
1408
- }
1409
- } catch (e) {
1410
- strapi.log.error(e);
1411
- }
1412
- },
1413
- async login (ctx) {
1414
- const { body: { password } } = ctx.request;
1415
- const { password: hash } = await strapi.store({
1416
- type: 'plugin',
1417
- name: 'documentation',
1418
- key: 'config'
1419
- }).get();
1420
- const isValid = await bcrypt.compare(password, hash);
1421
- let querystring = '?error=password';
1422
- if (isValid && ctx.session) {
1423
- ctx.session.documentation = {
1424
- logged: true
1425
- };
1426
- querystring = '';
1427
- }
1428
- ctx.redirect(`${strapi.config.server.url}/documentation${querystring}`);
1429
- },
1430
- async regenerateDoc (ctx) {
1431
- const { version } = ctx.request.body;
1432
- const service = getService('documentation');
1433
- const documentationVersions = service.getDocumentationVersions().map((el)=>el.version);
1434
- if (_.isEmpty(version)) {
1435
- return ctx.badRequest('Please provide a version.');
1436
- }
1437
- if (!documentationVersions.includes(version)) {
1438
- return ctx.badRequest('The version you are trying to generate does not exist.');
1439
- }
1440
- try {
1441
- strapi.reload.isWatching = false;
1442
- await service.generateFullDoc(version);
1443
- ctx.send({
1444
- ok: true
1445
- });
1446
- } finally{
1447
- strapi.reload.isWatching = true;
1448
- }
1449
- },
1450
- async deleteDoc (ctx) {
1451
- const { version } = ctx.params;
1452
- const service = getService('documentation');
1453
- const documentationVersions = service.getDocumentationVersions().map((el)=>el.version);
1454
- if (_.isEmpty(version)) {
1455
- return ctx.badRequest('Please provide a version.');
1456
- }
1457
- if (!documentationVersions.includes(version)) {
1458
- return ctx.badRequest('The version you are trying to delete does not exist.');
1459
- }
1460
- try {
1461
- strapi.reload.isWatching = false;
1462
- await service.deleteDocumentation(version);
1463
- ctx.send({
1464
- ok: true
1465
- });
1466
- } finally{
1467
- strapi.reload.isWatching = true;
1468
- }
1469
- },
1470
- async updateSettings (ctx) {
1471
- const pluginStore = strapi.store({
1472
- type: 'plugin',
1473
- name: 'documentation'
1474
- });
1475
- const data = await validation.validateSettings(ctx.request.body);
1476
- const config = {
1477
- restrictedAccess: Boolean(data.restrictedAccess)
1478
- };
1479
- if (data.password) {
1480
- config.password = await bcrypt.hash(data.password, 10);
1481
- }
1482
- await pluginStore.set({
1483
- key: 'config',
1484
- value: config
1485
- });
1486
- return ctx.send({
1487
- ok: true
1488
- });
1489
- }
1490
- };
1491
-
1492
- var controllers = {
1493
- documentation
1494
- };
1495
-
1496
- const defaultConfig = {
1497
- openapi: '3.0.0',
1498
- info: {
1499
- version: '1.0.0',
1500
- title: 'DOCUMENTATION',
1501
- description: '',
1502
- termsOfService: 'YOUR_TERMS_OF_SERVICE_URL',
1503
- contact: {
1504
- name: 'TEAM',
1505
- email: 'contact-email@something.io',
1506
- url: 'mywebsite.io'
1507
- },
1508
- license: {
1509
- name: 'Apache 2.0',
1510
- url: 'https://www.apache.org/licenses/LICENSE-2.0.html'
1511
- }
1512
- },
1513
- 'x-strapi-config': {
1514
- plugins: null,
1515
- mutateDocumentation: null
1516
- },
1517
- servers: [],
1518
- externalDocs: {
1519
- description: 'Find out more',
1520
- url: 'https://docs.strapi.io/developer-docs/latest/getting-started/introduction.html'
1521
- },
1522
- security: [
1523
- {
1524
- bearerAuth: []
1525
- }
1526
- ],
1527
- paths: {},
1528
- components: {
1529
- securitySchemes: {
1530
- bearerAuth: {
1531
- type: 'http',
1532
- scheme: 'bearer',
1533
- bearerFormat: 'JWT'
1534
- }
1535
- },
1536
- schemas: {
1537
- Error: {
1538
- type: 'object',
1539
- required: [
1540
- 'error'
1541
- ],
1542
- properties: {
1543
- data: {
1544
- nullable: true,
1545
- oneOf: [
1546
- {
1547
- type: 'object'
1548
- },
1549
- {
1550
- type: 'array',
1551
- items: {
1552
- type: 'object'
1553
- }
1554
- }
1555
- ]
1556
- },
1557
- error: {
1558
- type: 'object',
1559
- properties: {
1560
- status: {
1561
- type: 'integer'
1562
- },
1563
- name: {
1564
- type: 'string'
1565
- },
1566
- message: {
1567
- type: 'string'
1568
- },
1569
- details: {
1570
- type: 'object'
1571
- }
1572
- }
1573
- }
1574
- }
1575
- }
1576
- }
1577
- }
1578
- };
1579
-
1580
- const config = {
1581
- default: defaultConfig
1582
- };
3
+ var bootstrap = require('./bootstrap.js');
4
+ var register = require('./register.js');
5
+ var index$4 = require('./services/index.js');
6
+ var index$2 = require('./routes/index.js');
7
+ var index$3 = require('./controllers/index.js');
8
+ var index$1 = require('./config/index.js');
1583
9
 
1584
10
  var index = {
1585
- bootstrap,
1586
- config,
1587
- routes,
1588
- controllers,
1589
- register,
1590
- services
11
+ bootstrap: bootstrap.bootstrap,
12
+ config: index$1.config,
13
+ routes: index$2,
14
+ controllers: index$3,
15
+ register: register.register,
16
+ services: index$4
1591
17
  };
1592
18
 
1593
19
  module.exports = index;