@strapi/strapi 4.14.0-beta.0 → 4.14.1

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 (900) hide show
  1. package/README.md +25 -29
  2. package/bin/strapi.js +1 -1
  3. package/dist/Strapi.d.ts +102 -0
  4. package/dist/Strapi.js +544 -0
  5. package/dist/Strapi.js.map +1 -0
  6. package/dist/commands/actions/admin/create-user/action.d.ts +11 -0
  7. package/dist/commands/actions/admin/create-user/action.js +97 -0
  8. package/dist/commands/actions/admin/create-user/action.js.map +1 -0
  9. package/dist/commands/actions/admin/create-user/command.d.ts +6 -0
  10. package/dist/commands/actions/admin/create-user/command.js +19 -0
  11. package/dist/commands/actions/admin/create-user/command.js.map +1 -0
  12. package/dist/commands/actions/admin/reset-user-password/action.d.ts +9 -0
  13. package/dist/commands/actions/admin/reset-user-password/action.js +43 -0
  14. package/dist/commands/actions/admin/reset-user-password/action.js.map +1 -0
  15. package/dist/commands/actions/admin/reset-user-password/command.d.ts +6 -0
  16. package/dist/commands/actions/admin/reset-user-password/command.js +17 -0
  17. package/dist/commands/actions/admin/reset-user-password/command.js.map +1 -0
  18. package/dist/commands/actions/build-command/action.d.ts +9 -0
  19. package/dist/commands/actions/build-command/action.js +20 -0
  20. package/dist/commands/actions/build-command/action.js.map +1 -0
  21. package/dist/commands/actions/build-command/command.d.ts +6 -0
  22. package/dist/commands/actions/build-command/command.js +15 -0
  23. package/dist/commands/actions/build-command/command.js.map +1 -0
  24. package/dist/commands/actions/components/list/action.d.ts +2 -0
  25. package/dist/commands/actions/components/list/action.js +20 -0
  26. package/dist/commands/actions/components/list/action.js.map +1 -0
  27. package/dist/commands/actions/components/list/command.d.ts +6 -0
  28. package/dist/commands/actions/components/list/command.js +14 -0
  29. package/dist/commands/actions/components/list/command.js.map +1 -0
  30. package/dist/commands/actions/configuration/dump/action.d.ts +10 -0
  31. package/dist/commands/actions/configuration/dump/action.js +46 -0
  32. package/dist/commands/actions/configuration/dump/action.js.map +1 -0
  33. package/dist/commands/actions/configuration/dump/command.d.ts +6 -0
  34. package/dist/commands/actions/configuration/dump/command.js +17 -0
  35. package/dist/commands/actions/configuration/dump/command.js.map +1 -0
  36. package/dist/commands/actions/configuration/restore/action.d.ts +10 -0
  37. package/dist/commands/actions/configuration/restore/action.js +153 -0
  38. package/dist/commands/actions/configuration/restore/action.js.map +1 -0
  39. package/dist/commands/actions/configuration/restore/command.d.ts +6 -0
  40. package/dist/commands/actions/configuration/restore/command.js +17 -0
  41. package/dist/commands/actions/configuration/restore/command.js.map +1 -0
  42. package/dist/commands/actions/console/action.d.ts +5 -0
  43. package/dist/commands/actions/console/action.js +26 -0
  44. package/dist/commands/actions/console/action.js.map +1 -0
  45. package/dist/commands/actions/console/command.d.ts +6 -0
  46. package/dist/commands/actions/console/command.js +14 -0
  47. package/dist/commands/actions/console/command.js.map +1 -0
  48. package/dist/commands/actions/content-types/list/action.d.ts +2 -0
  49. package/dist/commands/actions/content-types/list/action.js +20 -0
  50. package/dist/commands/actions/content-types/list/action.js.map +1 -0
  51. package/dist/commands/actions/content-types/list/command.d.ts +6 -0
  52. package/dist/commands/actions/content-types/list/command.js +14 -0
  53. package/dist/commands/actions/content-types/list/command.js.map +1 -0
  54. package/dist/commands/actions/controllers/list/action.d.ts +2 -0
  55. package/dist/commands/actions/controllers/list/action.js +20 -0
  56. package/dist/commands/actions/controllers/list/action.js.map +1 -0
  57. package/dist/commands/actions/controllers/list/command.d.ts +6 -0
  58. package/dist/commands/actions/controllers/list/command.js +14 -0
  59. package/dist/commands/actions/controllers/list/command.js.map +1 -0
  60. package/dist/commands/actions/develop/action.d.ts +86 -0
  61. package/dist/commands/actions/develop/action.js +190 -0
  62. package/dist/commands/actions/develop/action.js.map +1 -0
  63. package/dist/commands/actions/develop/command.d.ts +6 -0
  64. package/dist/commands/actions/develop/command.js +19 -0
  65. package/dist/commands/actions/develop/command.js.map +1 -0
  66. package/dist/commands/actions/generate/command.d.ts +6 -0
  67. package/dist/commands/actions/generate/command.js +19 -0
  68. package/dist/commands/actions/generate/command.js.map +1 -0
  69. package/dist/commands/actions/hooks/list/action.d.ts +2 -0
  70. package/dist/commands/actions/hooks/list/action.js +20 -0
  71. package/dist/commands/actions/hooks/list/action.js.map +1 -0
  72. package/dist/commands/actions/hooks/list/command.d.ts +6 -0
  73. package/dist/commands/actions/hooks/list/command.js +14 -0
  74. package/dist/commands/actions/hooks/list/command.js.map +1 -0
  75. package/dist/commands/actions/install/action.d.ts +2 -0
  76. package/dist/commands/actions/install/action.js +49 -0
  77. package/dist/commands/actions/install/action.js.map +1 -0
  78. package/dist/commands/actions/install/command.d.ts +6 -0
  79. package/dist/commands/actions/install/command.js +14 -0
  80. package/dist/commands/actions/install/command.js.map +1 -0
  81. package/dist/commands/actions/middlewares/list/action.d.ts +2 -0
  82. package/dist/commands/actions/middlewares/list/action.js +20 -0
  83. package/dist/commands/actions/middlewares/list/action.js.map +1 -0
  84. package/dist/commands/actions/middlewares/list/command.d.ts +6 -0
  85. package/dist/commands/actions/middlewares/list/command.js +14 -0
  86. package/dist/commands/actions/middlewares/list/command.js.map +1 -0
  87. package/dist/commands/actions/new/action.d.ts +7 -0
  88. package/dist/commands/actions/new/action.js +12 -0
  89. package/dist/commands/actions/new/action.js.map +1 -0
  90. package/dist/commands/actions/new/command.d.ts +6 -0
  91. package/dist/commands/actions/new/command.js +35 -0
  92. package/dist/commands/actions/new/command.js.map +1 -0
  93. package/dist/commands/actions/plugin/build-command/action.d.ts +6 -0
  94. package/dist/commands/actions/plugin/build-command/action.js +105 -0
  95. package/dist/commands/actions/plugin/build-command/action.js.map +1 -0
  96. package/dist/commands/actions/plugin/build-command/command.d.ts +6 -0
  97. package/dist/commands/actions/plugin/build-command/command.js +17 -0
  98. package/dist/commands/actions/plugin/build-command/command.js.map +1 -0
  99. package/dist/commands/actions/policies/list/action.d.ts +2 -0
  100. package/dist/commands/actions/policies/list/action.js +20 -0
  101. package/dist/commands/actions/policies/list/action.js.map +1 -0
  102. package/dist/commands/actions/policies/list/command.d.ts +6 -0
  103. package/dist/commands/actions/policies/list/command.js +14 -0
  104. package/dist/commands/actions/policies/list/command.js.map +1 -0
  105. package/dist/commands/actions/report/action.d.ts +7 -0
  106. package/dist/commands/actions/report/action.js +32 -0
  107. package/dist/commands/actions/report/action.js.map +1 -0
  108. package/dist/commands/actions/report/command.d.ts +6 -0
  109. package/dist/commands/actions/report/command.js +17 -0
  110. package/dist/commands/actions/report/command.js.map +1 -0
  111. package/dist/commands/actions/routes/list/action.d.ts +2 -0
  112. package/dist/commands/actions/routes/list/action.js +26 -0
  113. package/dist/commands/actions/routes/list/action.js.map +1 -0
  114. package/dist/commands/actions/routes/list/command.d.ts +6 -0
  115. package/dist/commands/actions/routes/list/command.js +14 -0
  116. package/dist/commands/actions/routes/list/command.js.map +1 -0
  117. package/dist/commands/actions/services/list/action.d.ts +2 -0
  118. package/dist/commands/actions/services/list/action.js +20 -0
  119. package/dist/commands/actions/services/list/action.js.map +1 -0
  120. package/dist/commands/actions/services/list/command.d.ts +6 -0
  121. package/dist/commands/actions/services/list/command.js +14 -0
  122. package/dist/commands/actions/services/list/command.js.map +1 -0
  123. package/dist/commands/actions/start/action.d.ts +78 -0
  124. package/dist/commands/actions/start/action.js +22 -0
  125. package/dist/commands/actions/start/action.js.map +1 -0
  126. package/dist/commands/actions/start/command.d.ts +6 -0
  127. package/dist/commands/actions/start/command.js +14 -0
  128. package/dist/commands/actions/start/command.js.map +1 -0
  129. package/dist/commands/actions/telemetry/disable/action.d.ts +1 -0
  130. package/dist/commands/actions/telemetry/disable/action.js +83 -0
  131. package/dist/commands/actions/telemetry/disable/action.js.map +1 -0
  132. package/dist/commands/actions/telemetry/disable/command.d.ts +6 -0
  133. package/dist/commands/actions/telemetry/disable/command.js +14 -0
  134. package/dist/commands/actions/telemetry/disable/command.js.map +1 -0
  135. package/dist/commands/actions/telemetry/enable/action.d.ts +2 -0
  136. package/dist/commands/actions/telemetry/enable/action.js +103 -0
  137. package/dist/commands/actions/telemetry/enable/action.js.map +1 -0
  138. package/dist/commands/actions/telemetry/enable/command.d.ts +6 -0
  139. package/dist/commands/actions/telemetry/enable/command.js +14 -0
  140. package/dist/commands/actions/telemetry/enable/command.js.map +1 -0
  141. package/dist/commands/actions/templates/generate/action.d.ts +1 -0
  142. package/dist/commands/actions/templates/generate/action.js +85 -0
  143. package/dist/commands/actions/templates/generate/action.js.map +1 -0
  144. package/dist/commands/actions/templates/generate/command.d.ts +6 -0
  145. package/dist/commands/actions/templates/generate/command.js +14 -0
  146. package/dist/commands/actions/templates/generate/command.js.map +1 -0
  147. package/dist/commands/actions/ts/generate-types/action.d.ts +8 -0
  148. package/dist/commands/actions/ts/generate-types/action.js +28 -0
  149. package/dist/commands/actions/ts/generate-types/action.js.map +1 -0
  150. package/dist/commands/actions/ts/generate-types/command.d.ts +6 -0
  151. package/dist/commands/actions/ts/generate-types/command.js +18 -0
  152. package/dist/commands/actions/ts/generate-types/command.js.map +1 -0
  153. package/dist/commands/actions/uninstall/action.d.ts +5 -0
  154. package/dist/commands/actions/uninstall/action.js +67 -0
  155. package/dist/commands/actions/uninstall/action.js.map +1 -0
  156. package/dist/commands/actions/uninstall/command.d.ts +6 -0
  157. package/dist/commands/actions/uninstall/command.js +15 -0
  158. package/dist/commands/actions/uninstall/command.js.map +1 -0
  159. package/dist/commands/actions/version/command.d.ts +6 -0
  160. package/dist/commands/actions/version/command.js +19 -0
  161. package/dist/commands/actions/version/command.js.map +1 -0
  162. package/dist/commands/actions/watch-admin/action.d.ts +4 -0
  163. package/dist/commands/actions/watch-admin/action.js +36 -0
  164. package/dist/commands/actions/watch-admin/action.js.map +1 -0
  165. package/dist/commands/actions/watch-admin/command.d.ts +6 -0
  166. package/dist/commands/actions/watch-admin/command.js +15 -0
  167. package/dist/commands/actions/watch-admin/command.js.map +1 -0
  168. package/dist/commands/builders/admin.d.ts +8 -0
  169. package/dist/commands/builders/admin.js +52 -0
  170. package/dist/commands/builders/admin.js.map +1 -0
  171. package/dist/commands/builders/index.d.ts +3 -0
  172. package/dist/commands/builders/index.js +11 -0
  173. package/dist/commands/builders/index.js.map +1 -0
  174. package/dist/commands/builders/packages.d.ts +37 -0
  175. package/dist/commands/builders/packages.js +166 -0
  176. package/dist/commands/builders/packages.js.map +1 -0
  177. package/dist/commands/builders/tasks/dts.d.ts +13 -0
  178. package/dist/commands/builders/tasks/dts.js +143 -0
  179. package/dist/commands/builders/tasks/dts.js.map +1 -0
  180. package/dist/commands/builders/tasks/index.d.ts +14 -0
  181. package/dist/commands/builders/tasks/index.js +14 -0
  182. package/dist/commands/builders/tasks/index.js.map +1 -0
  183. package/dist/commands/builders/tasks/vite.d.ts +15 -0
  184. package/dist/commands/builders/tasks/vite.js +114 -0
  185. package/dist/commands/builders/tasks/vite.js.map +1 -0
  186. package/dist/commands/builders/typescript.d.ts +6 -0
  187. package/dist/commands/builders/typescript.js +29 -0
  188. package/dist/commands/builders/typescript.js.map +1 -0
  189. package/dist/commands/index.d.ts +34 -0
  190. package/dist/commands/index.js +100 -0
  191. package/dist/commands/index.js.map +1 -0
  192. package/dist/commands/types.d.ts +5 -0
  193. package/dist/commands/types.js +3 -0
  194. package/dist/commands/types.js.map +1 -0
  195. package/dist/commands/utils/commander.d.ts +35 -0
  196. package/dist/commands/utils/commander.js +138 -0
  197. package/dist/commands/utils/commander.js.map +1 -0
  198. package/dist/commands/utils/helpers.d.ts +50 -0
  199. package/dist/commands/utils/helpers.js +165 -0
  200. package/dist/commands/utils/helpers.js.map +1 -0
  201. package/dist/commands/utils/logger.d.ts +16 -0
  202. package/dist/commands/utils/logger.js +53 -0
  203. package/dist/commands/utils/logger.js.map +1 -0
  204. package/dist/commands/utils/pkg.d.ts +237 -0
  205. package/dist/commands/utils/pkg.js +316 -0
  206. package/dist/commands/utils/pkg.js.map +1 -0
  207. package/dist/compile.d.ts +9 -0
  208. package/dist/compile.js +20 -0
  209. package/dist/compile.js.map +1 -0
  210. package/dist/container.d.ts +2 -0
  211. package/dist/container.js +39 -0
  212. package/dist/container.js.map +1 -0
  213. package/dist/core/app-configuration/config-loader.d.ts +2 -0
  214. package/dist/core/app-configuration/config-loader.js +22 -0
  215. package/dist/core/app-configuration/config-loader.js.map +1 -0
  216. package/dist/core/app-configuration/index.d.ts +35 -0
  217. package/dist/core/app-configuration/index.js +54 -0
  218. package/dist/core/app-configuration/index.js.map +1 -0
  219. package/dist/core/app-configuration/load-config-file.d.ts +1 -0
  220. package/dist/core/app-configuration/load-config-file.js +49 -0
  221. package/dist/core/app-configuration/load-config-file.js.map +1 -0
  222. package/dist/core/bootstrap.d.ts +4 -0
  223. package/dist/core/bootstrap.js +27 -0
  224. package/dist/core/bootstrap.js.map +1 -0
  225. package/dist/core/domain/content-type/index.d.ts +8 -0
  226. package/dist/core/domain/content-type/index.js +117 -0
  227. package/dist/core/domain/content-type/index.js.map +1 -0
  228. package/dist/core/domain/content-type/validator.d.ts +21 -0
  229. package/dist/core/domain/content-type/validator.js +91 -0
  230. package/dist/core/domain/content-type/validator.js.map +1 -0
  231. package/dist/core/domain/module/index.d.ts +38 -0
  232. package/dist/core/domain/module/index.js +110 -0
  233. package/dist/core/domain/module/index.js.map +1 -0
  234. package/dist/core/domain/module/validation.d.ts +13 -0
  235. package/dist/core/domain/module/validation.js +29 -0
  236. package/dist/core/domain/module/validation.js.map +1 -0
  237. package/dist/core/loaders/admin.d.ts +2 -0
  238. package/dist/core/loaders/admin.js +18 -0
  239. package/dist/core/loaders/admin.js.map +1 -0
  240. package/dist/core/loaders/apis.d.ts +2 -0
  241. package/dist/core/loaders/apis.js +156 -0
  242. package/dist/core/loaders/apis.js.map +1 -0
  243. package/dist/core/loaders/components.d.ts +6 -0
  244. package/dist/core/loaders/components.js +37 -0
  245. package/dist/core/loaders/components.js.map +1 -0
  246. package/dist/core/loaders/index.d.ts +18 -0
  247. package/dist/core/loaders/index.js +26 -0
  248. package/dist/core/loaders/index.js.map +1 -0
  249. package/dist/core/loaders/middlewares.d.ts +2 -0
  250. package/dist/core/loaders/middlewares.js +34 -0
  251. package/dist/core/loaders/middlewares.js.map +1 -0
  252. package/dist/core/loaders/plugins/get-enabled-plugins.d.ts +4 -0
  253. package/dist/core/loaders/plugins/get-enabled-plugins.js +113 -0
  254. package/dist/core/loaders/plugins/get-enabled-plugins.js.map +1 -0
  255. package/dist/core/loaders/plugins/get-user-plugins-config.d.ts +6 -0
  256. package/dist/core/loaders/plugins/get-user-plugins-config.js +31 -0
  257. package/dist/core/loaders/plugins/get-user-plugins-config.js.map +1 -0
  258. package/dist/core/loaders/plugins/index.d.ts +2 -0
  259. package/dist/core/loaders/plugins/index.js +109 -0
  260. package/dist/core/loaders/plugins/index.js.map +1 -0
  261. package/dist/core/loaders/policies.d.ts +2 -0
  262. package/dist/core/loaders/policies.js +28 -0
  263. package/dist/core/loaders/policies.js.map +1 -0
  264. package/dist/core/loaders/sanitizers.d.ts +3 -0
  265. package/dist/core/loaders/sanitizers.js +6 -0
  266. package/dist/core/loaders/sanitizers.js.map +1 -0
  267. package/dist/core/loaders/src-index.d.ts +3 -0
  268. package/dist/core/loaders/src-index.js +37 -0
  269. package/dist/core/loaders/src-index.js.map +1 -0
  270. package/dist/core/loaders/validators.d.ts +3 -0
  271. package/dist/core/loaders/validators.js +6 -0
  272. package/dist/core/loaders/validators.js.map +1 -0
  273. package/dist/core/registries/apis.d.ts +7 -0
  274. package/dist/core/registries/apis.js +24 -0
  275. package/dist/core/registries/apis.js.map +1 -0
  276. package/dist/core/registries/config.d.ts +3 -0
  277. package/dist/core/registries/config.js +23 -0
  278. package/dist/core/registries/config.js.map +1 -0
  279. package/dist/core/registries/content-types.d.ts +32 -0
  280. package/dist/core/registries/content-types.js +70 -0
  281. package/dist/core/registries/content-types.js.map +1 -0
  282. package/dist/core/registries/controllers.d.ts +34 -0
  283. package/dist/core/registries/controllers.js +81 -0
  284. package/dist/core/registries/controllers.js.map +1 -0
  285. package/dist/core/registries/custom-fields.d.ts +7 -0
  286. package/dist/core/registries/custom-fields.js +74 -0
  287. package/dist/core/registries/custom-fields.js.map +1 -0
  288. package/dist/core/registries/hooks.d.ts +43 -0
  289. package/dist/core/registries/hooks.js +59 -0
  290. package/dist/core/registries/hooks.js.map +1 -0
  291. package/dist/core/registries/middlewares.d.ts +30 -0
  292. package/dist/core/registries/middlewares.js +62 -0
  293. package/dist/core/registries/middlewares.js.map +1 -0
  294. package/dist/core/registries/modules.d.ts +14 -0
  295. package/dist/core/registries/modules.js +40 -0
  296. package/dist/core/registries/modules.js.map +1 -0
  297. package/dist/core/registries/plugins.d.ts +8 -0
  298. package/dist/core/registries/plugins.js +24 -0
  299. package/dist/core/registries/plugins.js.map +1 -0
  300. package/dist/core/registries/policies.d.ts +33 -0
  301. package/dist/core/registries/policies.js +64 -0
  302. package/dist/core/registries/policies.js.map +1 -0
  303. package/dist/core/registries/sanitizers.d.ts +9 -0
  304. package/dist/core/registries/sanitizers.js +27 -0
  305. package/dist/core/registries/sanitizers.js.map +1 -0
  306. package/dist/core/registries/services.d.ts +34 -0
  307. package/dist/core/registries/services.js +82 -0
  308. package/dist/core/registries/services.js.map +1 -0
  309. package/dist/core/registries/validators.d.ts +9 -0
  310. package/dist/core/registries/validators.js +27 -0
  311. package/dist/core/registries/validators.js.map +1 -0
  312. package/dist/core/utils.d.ts +4 -0
  313. package/dist/core/utils.js +28 -0
  314. package/dist/core/utils.js.map +1 -0
  315. package/dist/core-api/controller/collection-type.d.ts +10 -0
  316. package/dist/core-api/controller/collection-type.js +95 -0
  317. package/dist/core-api/controller/collection-type.js.map +1 -0
  318. package/dist/core-api/controller/index.d.ts +5 -0
  319. package/dist/core-api/controller/index.js +50 -0
  320. package/dist/core-api/controller/index.js.map +1 -0
  321. package/dist/core-api/controller/single-type.d.ts +9 -0
  322. package/dist/core-api/controller/single-type.js +52 -0
  323. package/dist/core-api/controller/single-type.js.map +1 -0
  324. package/dist/core-api/controller/transform.d.ts +21 -0
  325. package/dist/core-api/controller/transform.js +86 -0
  326. package/dist/core-api/controller/transform.js.map +1 -0
  327. package/dist/core-api/routes/index.d.ts +23 -0
  328. package/dist/core-api/routes/index.js +68 -0
  329. package/dist/core-api/routes/index.js.map +1 -0
  330. package/dist/core-api/service/collection-type.d.ts +9 -0
  331. package/dist/core-api/service/collection-type.js +61 -0
  332. package/dist/core-api/service/collection-type.js.map +1 -0
  333. package/dist/core-api/service/get-fetch-params.d.ts +6 -0
  334. package/dist/core-api/service/get-fetch-params.js +16 -0
  335. package/dist/core-api/service/get-fetch-params.js.map +1 -0
  336. package/dist/core-api/service/index.d.ts +8 -0
  337. package/dist/core-api/service/index.js +18 -0
  338. package/dist/core-api/service/index.js.map +1 -0
  339. package/dist/core-api/service/pagination.d.ts +40 -0
  340. package/dist/core-api/service/pagination.js +97 -0
  341. package/dist/core-api/service/pagination.js.map +1 -0
  342. package/dist/core-api/service/single-type.d.ts +8 -0
  343. package/dist/core-api/service/single-type.js +57 -0
  344. package/dist/core-api/service/single-type.js.map +1 -0
  345. package/dist/ee/index.d.ts +19 -0
  346. package/dist/ee/index.js +185 -0
  347. package/dist/ee/index.js.map +1 -0
  348. package/dist/ee/license.d.ts +20 -0
  349. package/dist/ee/license.js +94 -0
  350. package/dist/ee/license.js.map +1 -0
  351. package/dist/factories.d.ts +12 -0
  352. package/dist/factories.js +70 -0
  353. package/dist/factories.js.map +1 -0
  354. package/dist/index.d.ts +5 -0
  355. package/dist/index.js +35 -0
  356. package/dist/index.js.map +1 -0
  357. package/dist/load/filepath-to-prop-path.d.ts +5 -0
  358. package/dist/load/filepath-to-prop-path.js +21 -0
  359. package/dist/load/filepath-to-prop-path.js.map +1 -0
  360. package/dist/load/glob.d.ts +6 -0
  361. package/dist/load/glob.js +20 -0
  362. package/dist/load/glob.js.map +1 -0
  363. package/dist/load/index.d.ts +2 -0
  364. package/dist/load/index.js +11 -0
  365. package/dist/load/index.js.map +1 -0
  366. package/dist/load/load-files.d.ts +9 -0
  367. package/dist/load/load-files.js +44 -0
  368. package/dist/load/load-files.js.map +1 -0
  369. package/dist/load/package-path.d.ts +5 -0
  370. package/dist/load/package-path.js +11 -0
  371. package/dist/load/package-path.js.map +1 -0
  372. package/dist/middlewares/body.d.ts +5 -0
  373. package/dist/middlewares/body.js +78 -0
  374. package/dist/middlewares/body.js.map +1 -0
  375. package/dist/middlewares/compression.d.ts +4 -0
  376. package/dist/middlewares/compression.js +10 -0
  377. package/dist/middlewares/compression.js.map +1 -0
  378. package/dist/middlewares/cors.d.ts +12 -0
  379. package/dist/middlewares/cors.js +54 -0
  380. package/dist/middlewares/cors.js.map +1 -0
  381. package/dist/middlewares/errors.d.ts +3 -0
  382. package/dist/middlewares/errors.js +35 -0
  383. package/dist/middlewares/errors.js.map +1 -0
  384. package/dist/middlewares/favicon.d.ts +4 -0
  385. package/dist/middlewares/favicon.js +30 -0
  386. package/dist/middlewares/favicon.js.map +1 -0
  387. package/dist/middlewares/index.d.ts +2 -0
  388. package/dist/middlewares/index.js +34 -0
  389. package/dist/middlewares/index.js.map +1 -0
  390. package/dist/middlewares/ip.d.ts +4 -0
  391. package/dist/middlewares/ip.js +10 -0
  392. package/dist/middlewares/ip.js.map +1 -0
  393. package/dist/middlewares/logger.d.ts +2 -0
  394. package/dist/middlewares/logger.js +13 -0
  395. package/dist/middlewares/logger.js.map +1 -0
  396. package/dist/middlewares/powered-by.d.ts +5 -0
  397. package/dist/middlewares/powered-by.js +15 -0
  398. package/dist/middlewares/powered-by.js.map +1 -0
  399. package/dist/middlewares/public/index.d.ts +2 -0
  400. package/dist/middlewares/public/index.js +112 -0
  401. package/dist/middlewares/public/index.js.map +1 -0
  402. package/dist/middlewares/public/serve-static.d.ts +3 -0
  403. package/dist/middlewares/public/serve-static.js +27 -0
  404. package/dist/middlewares/public/serve-static.js.map +1 -0
  405. package/dist/middlewares/query.d.ts +2 -0
  406. package/dist/middlewares/query.js +45 -0
  407. package/dist/middlewares/query.js.map +1 -0
  408. package/dist/middlewares/response-time.d.ts +2 -0
  409. package/dist/middlewares/response-time.js +13 -0
  410. package/dist/middlewares/response-time.js.map +1 -0
  411. package/dist/middlewares/responses.d.ts +5 -0
  412. package/dist/middlewares/responses.js +16 -0
  413. package/dist/middlewares/responses.js.map +1 -0
  414. package/dist/middlewares/security.d.ts +4 -0
  415. package/dist/middlewares/security.js +52 -0
  416. package/dist/middlewares/security.js.map +1 -0
  417. package/dist/middlewares/session.d.ts +3 -0
  418. package/dist/middlewares/session.js +30 -0
  419. package/dist/middlewares/session.js.map +1 -0
  420. package/dist/migrations/draft-publish.d.ts +8 -0
  421. package/dist/migrations/draft-publish.js +46 -0
  422. package/dist/migrations/draft-publish.js.map +1 -0
  423. package/dist/services/auth/index.d.ts +25 -0
  424. package/dist/services/auth/index.js +84 -0
  425. package/dist/services/auth/index.js.map +1 -0
  426. package/dist/services/content-api/index.d.ts +53 -0
  427. package/dist/services/content-api/index.js +62 -0
  428. package/dist/services/content-api/index.js.map +1 -0
  429. package/dist/services/content-api/permissions/engine.d.ts +4 -0
  430. package/dist/services/content-api/permissions/engine.js +8 -0
  431. package/dist/services/content-api/permissions/engine.js.map +1 -0
  432. package/dist/services/content-api/permissions/index.d.ts +51 -0
  433. package/dist/services/content-api/permissions/index.js +110 -0
  434. package/dist/services/content-api/permissions/index.js.map +1 -0
  435. package/dist/services/content-api/permissions/providers/action.d.ts +19 -0
  436. package/dist/services/content-api/permissions/providers/action.js +16 -0
  437. package/dist/services/content-api/permissions/providers/action.js.map +1 -0
  438. package/dist/services/content-api/permissions/providers/condition.d.ts +23 -0
  439. package/dist/services/content-api/permissions/providers/condition.js +16 -0
  440. package/dist/services/content-api/permissions/providers/condition.js.map +1 -0
  441. package/dist/services/content-api/permissions/providers/index.d.ts +2 -0
  442. package/dist/services/content-api/permissions/providers/index.js +11 -0
  443. package/dist/services/content-api/permissions/providers/index.js.map +1 -0
  444. package/dist/services/core-store.d.ts +52 -0
  445. package/dist/services/core-store.js +123 -0
  446. package/dist/services/core-store.js.map +1 -0
  447. package/dist/services/cron.d.ts +26 -0
  448. package/dist/services/cron.js +69 -0
  449. package/dist/services/cron.js.map +1 -0
  450. package/dist/services/custom-fields.d.ts +3 -0
  451. package/dist/services/custom-fields.js +11 -0
  452. package/dist/services/custom-fields.js.map +1 -0
  453. package/dist/services/entity-service/attributes/index.d.ts +5 -0
  454. package/dist/services/entity-service/attributes/index.js +26 -0
  455. package/dist/services/entity-service/attributes/index.js.map +1 -0
  456. package/dist/services/entity-service/attributes/transforms.d.ts +9 -0
  457. package/dist/services/entity-service/attributes/transforms.js +22 -0
  458. package/dist/services/entity-service/attributes/transforms.js.map +1 -0
  459. package/dist/services/entity-service/components.d.ts +22 -0
  460. package/dist/services/entity-service/components.js +381 -0
  461. package/dist/services/entity-service/components.js.map +1 -0
  462. package/dist/services/entity-service/index.d.ts +14 -0
  463. package/dist/services/entity-service/index.js +311 -0
  464. package/dist/services/entity-service/index.js.map +1 -0
  465. package/dist/services/entity-service/params.d.ts +7 -0
  466. package/dist/services/entity-service/params.js +9 -0
  467. package/dist/services/entity-service/params.js.map +1 -0
  468. package/dist/services/entity-validator/blocks-validator.d.ts +2 -0
  469. package/dist/services/entity-validator/blocks-validator.js +127 -0
  470. package/dist/services/entity-validator/blocks-validator.js.map +1 -0
  471. package/dist/services/entity-validator/index.d.ts +7 -0
  472. package/dist/services/entity-validator/index.js +332 -0
  473. package/dist/services/entity-validator/index.js.map +1 -0
  474. package/dist/services/entity-validator/validators.d.ts +36 -0
  475. package/dist/services/entity-validator/validators.js +149 -0
  476. package/dist/services/entity-validator/validators.js.map +1 -0
  477. package/dist/services/errors.d.ts +39 -0
  478. package/dist/services/errors.js +78 -0
  479. package/dist/services/errors.js.map +1 -0
  480. package/dist/services/event-hub.d.ts +18 -0
  481. package/dist/services/event-hub.js +77 -0
  482. package/dist/services/event-hub.js.map +1 -0
  483. package/dist/services/fs.d.ts +12 -0
  484. package/dist/services/fs.js +54 -0
  485. package/dist/services/fs.js.map +1 -0
  486. package/dist/services/metrics/admin-user-hash.d.ts +6 -0
  487. package/dist/services/metrics/admin-user-hash.js +19 -0
  488. package/dist/services/metrics/admin-user-hash.js.map +1 -0
  489. package/dist/services/metrics/index.d.ts +13 -0
  490. package/dist/services/metrics/index.js +53 -0
  491. package/dist/services/metrics/index.js.map +1 -0
  492. package/dist/services/metrics/is-truthy.d.ts +2 -0
  493. package/dist/services/metrics/is-truthy.js +11 -0
  494. package/dist/services/metrics/is-truthy.js.map +1 -0
  495. package/dist/services/metrics/middleware.d.ts +6 -0
  496. package/dist/services/metrics/middleware.js +28 -0
  497. package/dist/services/metrics/middleware.js.map +1 -0
  498. package/dist/services/metrics/rate-limiter.d.ts +6 -0
  499. package/dist/services/metrics/rate-limiter.js +21 -0
  500. package/dist/services/metrics/rate-limiter.js.map +1 -0
  501. package/dist/services/metrics/sender.d.ts +12 -0
  502. package/dist/services/metrics/sender.js +80 -0
  503. package/dist/services/metrics/sender.js.map +1 -0
  504. package/dist/services/request-context.d.ts +6 -0
  505. package/dist/services/request-context.js +14 -0
  506. package/dist/services/request-context.js.map +1 -0
  507. package/dist/services/server/admin-api.d.ts +10 -0
  508. package/dist/services/server/admin-api.js +13 -0
  509. package/dist/services/server/admin-api.js.map +1 -0
  510. package/dist/services/server/api.d.ts +14 -0
  511. package/dist/services/server/api.js +32 -0
  512. package/dist/services/server/api.js.map +1 -0
  513. package/dist/services/server/compose-endpoint.d.ts +6 -0
  514. package/dist/services/server/compose-endpoint.js +121 -0
  515. package/dist/services/server/compose-endpoint.js.map +1 -0
  516. package/dist/services/server/content-api.d.ts +10 -0
  517. package/dist/services/server/content-api.js +13 -0
  518. package/dist/services/server/content-api.js.map +1 -0
  519. package/dist/services/server/http-server.d.ts +9 -0
  520. package/dist/services/server/http-server.js +54 -0
  521. package/dist/services/server/http-server.js.map +1 -0
  522. package/dist/services/server/index.d.ts +3 -0
  523. package/dist/services/server/index.js +91 -0
  524. package/dist/services/server/index.js.map +1 -0
  525. package/dist/services/server/koa.d.ts +15 -0
  526. package/dist/services/server/koa.js +56 -0
  527. package/dist/services/server/koa.js.map +1 -0
  528. package/dist/services/server/middleware.d.ts +14 -0
  529. package/dist/services/server/middleware.js +103 -0
  530. package/dist/services/server/middleware.js.map +1 -0
  531. package/dist/services/server/policy.d.ts +3 -0
  532. package/dist/services/server/policy.js +21 -0
  533. package/dist/services/server/policy.js.map +1 -0
  534. package/dist/services/server/register-middlewares.d.ts +6 -0
  535. package/dist/services/server/register-middlewares.js +82 -0
  536. package/dist/services/server/register-middlewares.js.map +1 -0
  537. package/dist/services/server/register-routes.d.ts +6 -0
  538. package/dist/services/server/register-routes.js +94 -0
  539. package/dist/services/server/register-routes.js.map +1 -0
  540. package/dist/services/server/routing.d.ts +32 -0
  541. package/dist/services/server/routing.js +105 -0
  542. package/dist/services/server/routing.js.map +1 -0
  543. package/dist/services/utils/dynamic-zones.d.ts +2 -0
  544. package/dist/services/utils/dynamic-zones.js +13 -0
  545. package/dist/services/utils/dynamic-zones.js.map +1 -0
  546. package/dist/services/utils/upload-files.d.ts +7 -0
  547. package/dist/services/utils/upload-files.js +74 -0
  548. package/dist/services/utils/upload-files.js.map +1 -0
  549. package/dist/services/webhook-runner.d.ts +48 -0
  550. package/dist/services/webhook-runner.js +141 -0
  551. package/dist/services/webhook-runner.js.map +1 -0
  552. package/dist/services/webhook-store.d.ts +49 -0
  553. package/dist/services/webhook-store.js +106 -0
  554. package/dist/services/webhook-store.js.map +1 -0
  555. package/dist/services/worker-queue.d.ts +19 -0
  556. package/dist/services/worker-queue.js +64 -0
  557. package/dist/services/worker-queue.js.map +1 -0
  558. package/dist/utils/addSlash.d.ts +2 -0
  559. package/dist/utils/addSlash.js +15 -0
  560. package/dist/utils/addSlash.js.map +1 -0
  561. package/dist/utils/convert-custom-field-type.d.ts +3 -0
  562. package/dist/utils/convert-custom-field-type.js +20 -0
  563. package/dist/utils/convert-custom-field-type.js.map +1 -0
  564. package/dist/utils/cron.d.ts +7 -0
  565. package/dist/utils/cron.js +56 -0
  566. package/dist/utils/cron.js.map +1 -0
  567. package/dist/utils/ee.d.ts +2 -0
  568. package/dist/utils/ee.js +8 -0
  569. package/dist/utils/ee.js.map +1 -0
  570. package/dist/utils/fetch.d.ts +8 -0
  571. package/dist/utils/fetch.js +23 -0
  572. package/dist/utils/fetch.js.map +1 -0
  573. package/dist/utils/get-dirs.d.ts +9 -0
  574. package/dist/utils/get-dirs.js +30 -0
  575. package/dist/utils/get-dirs.js.map +1 -0
  576. package/dist/utils/index.d.ts +4 -0
  577. package/dist/utils/index.js +13 -0
  578. package/dist/utils/index.js.map +1 -0
  579. package/dist/utils/is-initialized.d.ts +5 -0
  580. package/dist/utils/is-initialized.js +21 -0
  581. package/dist/utils/is-initialized.js.map +1 -0
  582. package/dist/utils/lifecycles.d.ts +5 -0
  583. package/dist/utils/lifecycles.js +9 -0
  584. package/dist/utils/lifecycles.js.map +1 -0
  585. package/dist/utils/machine-id.d.ts +2 -0
  586. package/dist/utils/machine-id.js +15 -0
  587. package/dist/utils/machine-id.js.map +1 -0
  588. package/dist/utils/open-browser.d.ts +4 -0
  589. package/dist/utils/open-browser.js +13 -0
  590. package/dist/utils/open-browser.js.map +1 -0
  591. package/dist/utils/postinstall.d.ts +1 -0
  592. package/dist/utils/postinstall.js +32 -0
  593. package/dist/utils/postinstall.js.map +1 -0
  594. package/dist/utils/signals.d.ts +2 -0
  595. package/dist/utils/signals.js +20 -0
  596. package/dist/utils/signals.js.map +1 -0
  597. package/dist/utils/startup-logger.d.ts +10 -0
  598. package/dist/utils/startup-logger.js +68 -0
  599. package/dist/utils/startup-logger.js.map +1 -0
  600. package/dist/utils/update-notifier/index.d.ts +8 -0
  601. package/dist/utils/update-notifier/index.js +85 -0
  602. package/dist/utils/update-notifier/index.js.map +1 -0
  603. package/index.js +5 -0
  604. package/package.json +57 -25
  605. package/scripts/postinstall.js +7 -0
  606. package/.eslintignore +0 -2
  607. package/.eslintrc.js +0 -4
  608. package/ee/LICENSE.txt +0 -1
  609. package/ee/index.js +0 -213
  610. package/ee/license.js +0 -109
  611. package/lib/Strapi.js +0 -591
  612. package/lib/commands/actions/admin/create-user/action.js +0 -113
  613. package/lib/commands/actions/admin/create-user/command.js +0 -19
  614. package/lib/commands/actions/admin/reset-user-password/action.js +0 -52
  615. package/lib/commands/actions/admin/reset-user-password/command.js +0 -17
  616. package/lib/commands/actions/build-command/action.js +0 -18
  617. package/lib/commands/actions/build-command/command.js +0 -15
  618. package/lib/commands/actions/components/list/action.js +0 -23
  619. package/lib/commands/actions/components/list/command.js +0 -14
  620. package/lib/commands/actions/configuration/dump/action.js +0 -51
  621. package/lib/commands/actions/configuration/dump/command.js +0 -17
  622. package/lib/commands/actions/configuration/restore/action.js +0 -172
  623. package/lib/commands/actions/configuration/restore/command.js +0 -17
  624. package/lib/commands/actions/console/action.js +0 -27
  625. package/lib/commands/actions/console/command.js +0 -14
  626. package/lib/commands/actions/content-types/list/action.js +0 -23
  627. package/lib/commands/actions/content-types/list/command.js +0 -14
  628. package/lib/commands/actions/controllers/list/action.js +0 -23
  629. package/lib/commands/actions/controllers/list/command.js +0 -14
  630. package/lib/commands/actions/develop/action.js +0 -217
  631. package/lib/commands/actions/develop/command.js +0 -19
  632. package/lib/commands/actions/export/action.js +0 -184
  633. package/lib/commands/actions/export/command.js +0 -45
  634. package/lib/commands/actions/generate/command.js +0 -18
  635. package/lib/commands/actions/hooks/list/action.js +0 -23
  636. package/lib/commands/actions/hooks/list/command.js +0 -14
  637. package/lib/commands/actions/import/action.js +0 -181
  638. package/lib/commands/actions/import/command.js +0 -97
  639. package/lib/commands/actions/install/action.js +0 -48
  640. package/lib/commands/actions/install/command.js +0 -14
  641. package/lib/commands/actions/middlewares/list/action.js +0 -23
  642. package/lib/commands/actions/middlewares/list/command.js +0 -14
  643. package/lib/commands/actions/new/action.js +0 -13
  644. package/lib/commands/actions/new/command.js +0 -35
  645. package/lib/commands/actions/plugin/build-command/action.js +0 -137
  646. package/lib/commands/actions/plugin/build-command/command.js +0 -17
  647. package/lib/commands/actions/policies/list/action.js +0 -23
  648. package/lib/commands/actions/policies/list/command.js +0 -14
  649. package/lib/commands/actions/report/action.js +0 -35
  650. package/lib/commands/actions/report/command.js +0 -17
  651. package/lib/commands/actions/routes/list/action.js +0 -29
  652. package/lib/commands/actions/routes/list/command.js +0 -14
  653. package/lib/commands/actions/services/list/action.js +0 -23
  654. package/lib/commands/actions/services/list/command.js +0 -14
  655. package/lib/commands/actions/start/action.js +0 -25
  656. package/lib/commands/actions/start/command.js +0 -14
  657. package/lib/commands/actions/telemetry/disable/action.js +0 -88
  658. package/lib/commands/actions/telemetry/disable/command.js +0 -14
  659. package/lib/commands/actions/telemetry/enable/action.js +0 -104
  660. package/lib/commands/actions/telemetry/enable/command.js +0 -14
  661. package/lib/commands/actions/templates/generate/action.js +0 -96
  662. package/lib/commands/actions/templates/generate/command.js +0 -14
  663. package/lib/commands/actions/transfer/action.js +0 -200
  664. package/lib/commands/actions/transfer/command.js +0 -115
  665. package/lib/commands/actions/ts/generate-types/action.js +0 -29
  666. package/lib/commands/actions/ts/generate-types/command.js +0 -21
  667. package/lib/commands/actions/uninstall/action.js +0 -68
  668. package/lib/commands/actions/uninstall/command.js +0 -15
  669. package/lib/commands/actions/version/command.js +0 -19
  670. package/lib/commands/actions/watch-admin/action.js +0 -40
  671. package/lib/commands/actions/watch-admin/command.js +0 -15
  672. package/lib/commands/builders/admin.js +0 -57
  673. package/lib/commands/builders/index.js +0 -9
  674. package/lib/commands/builders/packages.js +0 -252
  675. package/lib/commands/builders/tasks/dts.js +0 -199
  676. package/lib/commands/builders/tasks/index.js +0 -29
  677. package/lib/commands/builders/tasks/vite.js +0 -144
  678. package/lib/commands/builders/typescript.js +0 -32
  679. package/lib/commands/index.js +0 -68
  680. package/lib/commands/utils/commander.js +0 -157
  681. package/lib/commands/utils/data-transfer.js +0 -427
  682. package/lib/commands/utils/helpers.js +0 -218
  683. package/lib/commands/utils/logger.js +0 -97
  684. package/lib/commands/utils/pkg.js +0 -421
  685. package/lib/compile.js +0 -20
  686. package/lib/container.js +0 -45
  687. package/lib/core/app-configuration/config-loader.js +0 -22
  688. package/lib/core/app-configuration/index.js +0 -61
  689. package/lib/core/app-configuration/load-config-file.js +0 -43
  690. package/lib/core/bootstrap.js +0 -33
  691. package/lib/core/domain/component/index.js +0 -24
  692. package/lib/core/domain/component/validator.js +0 -23
  693. package/lib/core/domain/content-type/index.js +0 -134
  694. package/lib/core/domain/content-type/validator.js +0 -105
  695. package/lib/core/domain/module/index.js +0 -108
  696. package/lib/core/domain/module/validation.js +0 -32
  697. package/lib/core/loaders/admin.js +0 -16
  698. package/lib/core/loaders/apis.js +0 -161
  699. package/lib/core/loaders/components.js +0 -42
  700. package/lib/core/loaders/index.js +0 -13
  701. package/lib/core/loaders/middlewares.js +0 -37
  702. package/lib/core/loaders/plugins/get-enabled-plugins.js +0 -151
  703. package/lib/core/loaders/plugins/get-user-plugins-config.js +0 -37
  704. package/lib/core/loaders/plugins/index.js +0 -121
  705. package/lib/core/loaders/policies.js +0 -29
  706. package/lib/core/loaders/sanitizers.js +0 -5
  707. package/lib/core/loaders/src-index.js +0 -39
  708. package/lib/core/loaders/validators.js +0 -5
  709. package/lib/core/registries/apis.js +0 -29
  710. package/lib/core/registries/config.js +0 -21
  711. package/lib/core/registries/content-types.js +0 -97
  712. package/lib/core/registries/controllers.d.ts +0 -7
  713. package/lib/core/registries/controllers.js +0 -114
  714. package/lib/core/registries/custom-fields.js +0 -89
  715. package/lib/core/registries/hooks.d.ts +0 -17
  716. package/lib/core/registries/hooks.js +0 -87
  717. package/lib/core/registries/middlewares.d.ts +0 -5
  718. package/lib/core/registries/middlewares.js +0 -89
  719. package/lib/core/registries/modules.js +0 -44
  720. package/lib/core/registries/plugins.js +0 -28
  721. package/lib/core/registries/policies.d.ts +0 -13
  722. package/lib/core/registries/policies.js +0 -89
  723. package/lib/core/registries/sanitizers.js +0 -26
  724. package/lib/core/registries/services.js +0 -114
  725. package/lib/core/registries/validators.js +0 -26
  726. package/lib/core/utils.js +0 -32
  727. package/lib/core-api/controller/collection-type.js +0 -115
  728. package/lib/core-api/controller/index.js +0 -63
  729. package/lib/core-api/controller/single-type.js +0 -65
  730. package/lib/core-api/controller/transform.js +0 -97
  731. package/lib/core-api/routes/index.js +0 -71
  732. package/lib/core-api/service/collection-type.js +0 -80
  733. package/lib/core-api/service/index.js +0 -45
  734. package/lib/core-api/service/pagination.js +0 -125
  735. package/lib/core-api/service/single-type.js +0 -72
  736. package/lib/factories.d.ts +0 -18
  737. package/lib/factories.js +0 -93
  738. package/lib/global.d.ts +0 -22
  739. package/lib/index.d.ts +0 -6
  740. package/lib/index.js +0 -8
  741. package/lib/load/filepath-to-prop-path.js +0 -22
  742. package/lib/load/glob.js +0 -15
  743. package/lib/load/index.js +0 -9
  744. package/lib/load/load-files.js +0 -58
  745. package/lib/load/package-path.js +0 -9
  746. package/lib/middlewares/body.js +0 -82
  747. package/lib/middlewares/compression.js +0 -8
  748. package/lib/middlewares/cors.js +0 -59
  749. package/lib/middlewares/errors.js +0 -40
  750. package/lib/middlewares/favicon.js +0 -32
  751. package/lib/middlewares/index.d.ts +0 -5
  752. package/lib/middlewares/index.js +0 -33
  753. package/lib/middlewares/ip.js +0 -8
  754. package/lib/middlewares/logger.js +0 -14
  755. package/lib/middlewares/powered-by.js +0 -20
  756. package/lib/middlewares/public/index.js +0 -94
  757. package/lib/middlewares/public/serve-static.js +0 -23
  758. package/lib/middlewares/query.js +0 -52
  759. package/lib/middlewares/response-time.js +0 -15
  760. package/lib/middlewares/responses.js +0 -19
  761. package/lib/middlewares/security.js +0 -57
  762. package/lib/middlewares/session.js +0 -30
  763. package/lib/migrations/draft-publish.js +0 -53
  764. package/lib/services/auth/index.js +0 -109
  765. package/lib/services/content-api/index.js +0 -74
  766. package/lib/services/content-api/permissions/engine.js +0 -5
  767. package/lib/services/content-api/permissions/index.js +0 -148
  768. package/lib/services/content-api/permissions/providers/action.js +0 -19
  769. package/lib/services/content-api/permissions/providers/condition.js +0 -19
  770. package/lib/services/content-api/permissions/providers/index.js +0 -9
  771. package/lib/services/core-store.js +0 -145
  772. package/lib/services/cron.js +0 -71
  773. package/lib/services/custom-fields.js +0 -11
  774. package/lib/services/entity-service/attributes/index.js +0 -31
  775. package/lib/services/entity-service/attributes/transforms.js +0 -20
  776. package/lib/services/entity-service/components.js +0 -497
  777. package/lib/services/entity-service/index.d.ts +0 -1
  778. package/lib/services/entity-service/index.js +0 -434
  779. package/lib/services/entity-service/params.js +0 -9
  780. package/lib/services/entity-service/types/index.d.ts +0 -228
  781. package/lib/services/entity-service/types/params/attributes.d.ts +0 -146
  782. package/lib/services/entity-service/types/params/data.d.ts +0 -4
  783. package/lib/services/entity-service/types/params/fields.d.ts +0 -74
  784. package/lib/services/entity-service/types/params/filters/index.d.ts +0 -90
  785. package/lib/services/entity-service/types/params/filters/operators.d.ts +0 -30
  786. package/lib/services/entity-service/types/params/index.d.ts +0 -79
  787. package/lib/services/entity-service/types/params/pagination.d.ts +0 -13
  788. package/lib/services/entity-service/types/params/populate.d.ts +0 -130
  789. package/lib/services/entity-service/types/params/publication-state.d.ts +0 -38
  790. package/lib/services/entity-service/types/params/search.d.ts +0 -1
  791. package/lib/services/entity-service/types/params/sort.d.ts +0 -106
  792. package/lib/services/entity-service/types/plugin.d.ts +0 -11
  793. package/lib/services/entity-service/types/result.d.ts +0 -205
  794. package/lib/services/entity-validator/index.js +0 -382
  795. package/lib/services/entity-validator/validators.js +0 -216
  796. package/lib/services/errors.js +0 -87
  797. package/lib/services/event-hub.js +0 -83
  798. package/lib/services/fs.js +0 -58
  799. package/lib/services/metrics/admin-user-hash.js +0 -21
  800. package/lib/services/metrics/index.js +0 -61
  801. package/lib/services/metrics/is-truthy.js +0 -9
  802. package/lib/services/metrics/middleware.js +0 -33
  803. package/lib/services/metrics/rate-limiter.js +0 -27
  804. package/lib/services/metrics/sender.js +0 -90
  805. package/lib/services/metrics/stringify-deep.js +0 -22
  806. package/lib/services/request-context.js +0 -17
  807. package/lib/services/server/admin-api.js +0 -14
  808. package/lib/services/server/api.js +0 -36
  809. package/lib/services/server/compose-endpoint.js +0 -141
  810. package/lib/services/server/content-api.js +0 -16
  811. package/lib/services/server/http-server.js +0 -64
  812. package/lib/services/server/index.js +0 -129
  813. package/lib/services/server/koa.js +0 -62
  814. package/lib/services/server/middleware.js +0 -132
  815. package/lib/services/server/policy.js +0 -32
  816. package/lib/services/server/register-middlewares.js +0 -109
  817. package/lib/services/server/register-routes.js +0 -105
  818. package/lib/services/server/routing.js +0 -105
  819. package/lib/services/utils/dynamic-zones.js +0 -13
  820. package/lib/services/utils/upload-files.js +0 -79
  821. package/lib/services/webhook-runner.js +0 -156
  822. package/lib/services/webhook-store.js +0 -120
  823. package/lib/services/worker-queue.js +0 -59
  824. package/lib/types/core/attributes/base.d.ts +0 -77
  825. package/lib/types/core/attributes/biginteger.d.ts +0 -15
  826. package/lib/types/core/attributes/boolean.d.ts +0 -14
  827. package/lib/types/core/attributes/common.d.ts +0 -77
  828. package/lib/types/core/attributes/component.d.ts +0 -36
  829. package/lib/types/core/attributes/date-time.d.ts +0 -16
  830. package/lib/types/core/attributes/date.d.ts +0 -13
  831. package/lib/types/core/attributes/decimal.d.ts +0 -15
  832. package/lib/types/core/attributes/dynamic-zone.d.ts +0 -29
  833. package/lib/types/core/attributes/email.d.ts +0 -14
  834. package/lib/types/core/attributes/enumeration.d.ts +0 -18
  835. package/lib/types/core/attributes/float.d.ts +0 -13
  836. package/lib/types/core/attributes/index.d.ts +0 -26
  837. package/lib/types/core/attributes/integer.d.ts +0 -15
  838. package/lib/types/core/attributes/json.d.ts +0 -11
  839. package/lib/types/core/attributes/media.d.ts +0 -42
  840. package/lib/types/core/attributes/password.d.ts +0 -15
  841. package/lib/types/core/attributes/relation.d.ts +0 -152
  842. package/lib/types/core/attributes/richtext.d.ts +0 -15
  843. package/lib/types/core/attributes/string.d.ts +0 -20
  844. package/lib/types/core/attributes/text.d.ts +0 -20
  845. package/lib/types/core/attributes/time.d.ts +0 -13
  846. package/lib/types/core/attributes/timestamp.d.ts +0 -15
  847. package/lib/types/core/attributes/uid.d.ts +0 -43
  848. package/lib/types/core/attributes/utils.d.ts +0 -143
  849. package/lib/types/core/commands/index.d.ts +0 -6
  850. package/lib/types/core/common/controller.d.ts +0 -8
  851. package/lib/types/core/common/index.d.ts +0 -16
  852. package/lib/types/core/common/schema.d.ts +0 -3
  853. package/lib/types/core/common/service.d.ts +0 -5
  854. package/lib/types/core/common/uid.d.ts +0 -58
  855. package/lib/types/core/index.d.ts +0 -9
  856. package/lib/types/core/namespace.d.ts +0 -99
  857. package/lib/types/core/plugins/index.d.ts +0 -16
  858. package/lib/types/core/registry.d.ts +0 -68
  859. package/lib/types/core/schemas/index.d.ts +0 -133
  860. package/lib/types/core/strapi/index.d.ts +0 -453
  861. package/lib/types/core/uid.d.ts +0 -167
  862. package/lib/types/core-api/controller.d.ts +0 -54
  863. package/lib/types/core-api/index.d.ts +0 -3
  864. package/lib/types/core-api/router.d.ts +0 -68
  865. package/lib/types/core-api/service.d.ts +0 -50
  866. package/lib/types/index.d.ts +0 -8
  867. package/lib/types/shared/entity-service.d.ts +0 -1
  868. package/lib/types/shared/index.d.ts +0 -3
  869. package/lib/types/shared/plugins.d.ts +0 -3
  870. package/lib/types/shared/registries.d.ts +0 -45
  871. package/lib/types/utils/array.d.ts +0 -25
  872. package/lib/types/utils/expression.d.ts +0 -91
  873. package/lib/types/utils/guard.d.ts +0 -27
  874. package/lib/types/utils/index.d.ts +0 -27
  875. package/lib/types/utils/object.d.ts +0 -63
  876. package/lib/types/utils/string.d.ts +0 -59
  877. package/lib/types/utils/tuple.d.ts +0 -13
  878. package/lib/utils/addSlash.js +0 -11
  879. package/lib/utils/convert-custom-field-type.js +0 -22
  880. package/lib/utils/cron.js +0 -56
  881. package/lib/utils/ee.js +0 -3
  882. package/lib/utils/fetch.js +0 -23
  883. package/lib/utils/get-dirs.js +0 -31
  884. package/lib/utils/index.js +0 -11
  885. package/lib/utils/is-initialized.js +0 -23
  886. package/lib/utils/lifecycles.js +0 -15
  887. package/lib/utils/machine-id.js +0 -14
  888. package/lib/utils/open-browser.js +0 -12
  889. package/lib/utils/run-checks.js +0 -22
  890. package/lib/utils/signals.js +0 -24
  891. package/lib/utils/startup-logger.js +0 -88
  892. package/lib/utils/success.js +0 -35
  893. package/lib/utils/update-notifier/index.js +0 -97
  894. package/lib/utils/url-from-segments.js +0 -12
  895. /package/{lib → dist}/middlewares/public/assets/images/group_people_1.png +0 -0
  896. /package/{lib → dist}/middlewares/public/assets/images/group_people_2.png +0 -0
  897. /package/{lib → dist}/middlewares/public/assets/images/group_people_3.png +0 -0
  898. /package/{lib → dist}/middlewares/public/assets/images/logo_login.png +0 -0
  899. /package/{lib → dist}/middlewares/public/index.html +0 -0
  900. /package/{ee/resources → resources}/key.pub +0 -0
package/ee/license.js DELETED
@@ -1,109 +0,0 @@
1
- 'use strict';
2
-
3
- const fs = require('fs');
4
- const { join } = require('path');
5
- const crypto = require('crypto');
6
-
7
- const machineId = require('../lib/utils/machine-id');
8
-
9
- const DEFAULT_FEATURES = {
10
- bronze: [],
11
- silver: [],
12
- gold: [
13
- { name: 'sso' },
14
- // Set a null retention duration to allow the user to override it
15
- // The default of 90 days is set in the audit logs service
16
- { name: 'audit-logs', options: { retentionDays: null } },
17
- { name: 'review-workflows' },
18
- ],
19
- };
20
-
21
- const publicKey = fs.readFileSync(join(__dirname, 'resources/key.pub'));
22
-
23
- class LicenseCheckError extends Error {
24
- constructor(message, shouldFallback = false) {
25
- super(message);
26
-
27
- this.shouldFallback = shouldFallback;
28
- }
29
- }
30
-
31
- const readLicense = (directory) => {
32
- try {
33
- const path = join(directory, 'license.txt');
34
- return fs.readFileSync(path).toString();
35
- } catch (error) {
36
- if (error.code !== 'ENOENT') {
37
- throw Error('License file not readable, review its format and access rules.');
38
- }
39
- }
40
- };
41
-
42
- const verifyLicense = (license) => {
43
- const [signature, base64Content] = Buffer.from(license, 'base64').toString().split('\n');
44
-
45
- if (!signature || !base64Content) {
46
- throw new Error('Invalid license.');
47
- }
48
-
49
- const stringifiedContent = Buffer.from(base64Content, 'base64').toString();
50
-
51
- const verify = crypto.createVerify('RSA-SHA256');
52
- verify.update(stringifiedContent);
53
- verify.end();
54
-
55
- const verified = verify.verify(publicKey, signature, 'base64');
56
-
57
- if (!verified) {
58
- throw new Error('Invalid license.');
59
- }
60
-
61
- const licenseInfo = JSON.parse(stringifiedContent);
62
-
63
- if (!licenseInfo.features) {
64
- licenseInfo.features = DEFAULT_FEATURES[licenseInfo.type];
65
- }
66
-
67
- Object.freeze(licenseInfo.features);
68
- return licenseInfo;
69
- };
70
-
71
- const throwError = () => {
72
- throw new LicenseCheckError('Could not proceed to the online validation of your license.', true);
73
- };
74
-
75
- const fetchLicense = async ({ strapi }, key, projectId) => {
76
- const response = await strapi
77
- .fetch(`https://license.strapi.io/api/licenses/validate`, {
78
- method: 'POST',
79
- headers: { 'Content-Type': 'application/json' },
80
- body: JSON.stringify({ key, projectId, deviceId: machineId() }),
81
- })
82
- .catch(throwError);
83
-
84
- const contentType = response.headers.get('Content-Type');
85
-
86
- if (contentType.includes('application/json')) {
87
- const { data, error } = await response.json();
88
-
89
- switch (response.status) {
90
- case 200:
91
- return data.license;
92
- case 400:
93
- throw new LicenseCheckError(error.message);
94
- case 404:
95
- throw new LicenseCheckError('The license used does not exists.');
96
- default:
97
- throwError();
98
- }
99
- } else {
100
- throwError();
101
- }
102
- };
103
-
104
- module.exports = Object.freeze({
105
- readLicense,
106
- verifyLicense,
107
- fetchLicense,
108
- LicenseCheckError,
109
- });
package/lib/Strapi.js DELETED
@@ -1,591 +0,0 @@
1
- 'use strict';
2
-
3
- const path = require('path');
4
- const _ = require('lodash');
5
- const { isFunction } = require('lodash/fp');
6
- const { createLogger } = require('@strapi/logger');
7
- const { Database } = require('@strapi/database');
8
- const { createAsyncParallelHook } = require('@strapi/utils').hooks;
9
-
10
- const loadConfiguration = require('./core/app-configuration');
11
-
12
- const { createContainer } = require('./container');
13
- const utils = require('./utils');
14
- const createStrapiFs = require('./services/fs');
15
- const createEventHub = require('./services/event-hub');
16
- const { createServer } = require('./services/server');
17
- const createWebhookRunner = require('./services/webhook-runner');
18
- const { webhookModel, createWebhookStore } = require('./services/webhook-store');
19
- const { createCoreStore, coreStoreModel } = require('./services/core-store');
20
- const createEntityService = require('./services/entity-service');
21
- const createCronService = require('./services/cron');
22
- const entityValidator = require('./services/entity-validator');
23
- const createTelemetry = require('./services/metrics');
24
- const requestContext = require('./services/request-context');
25
- const createAuth = require('./services/auth');
26
- const createCustomFields = require('./services/custom-fields');
27
- const createContentAPI = require('./services/content-api');
28
- const createUpdateNotifier = require('./utils/update-notifier');
29
- const createStartupLogger = require('./utils/startup-logger');
30
- const createStrapiFetch = require('./utils/fetch');
31
- const { LIFECYCLES } = require('./utils/lifecycles');
32
- const ee = require('./utils/ee');
33
- const contentTypesRegistry = require('./core/registries/content-types');
34
- const servicesRegistry = require('./core/registries/services');
35
- const policiesRegistry = require('./core/registries/policies');
36
- const middlewaresRegistry = require('./core/registries/middlewares');
37
- const hooksRegistry = require('./core/registries/hooks');
38
- const controllersRegistry = require('./core/registries/controllers');
39
- const modulesRegistry = require('./core/registries/modules');
40
- const pluginsRegistry = require('./core/registries/plugins');
41
- const customFieldsRegistry = require('./core/registries/custom-fields');
42
- const createConfigProvider = require('./core/registries/config');
43
- const apisRegistry = require('./core/registries/apis');
44
- const bootstrap = require('./core/bootstrap');
45
- const loaders = require('./core/loaders');
46
- const { destroyOnSignal } = require('./utils/signals');
47
- const getNumberOfDynamicZones = require('./services/utils/dynamic-zones');
48
- const sanitizersRegistry = require('./core/registries/sanitizers');
49
- const validatorsRegistry = require('./core/registries/validators');
50
- const convertCustomFieldType = require('./utils/convert-custom-field-type');
51
-
52
- // TODO: move somewhere else
53
- const draftAndPublishSync = require('./migrations/draft-publish');
54
-
55
- /**
56
- * Resolve the working directories based on the instance options.
57
- *
58
- * Behavior:
59
- * - `appDir` is the directory where Strapi will write every file (schemas, generated APIs, controllers or services)
60
- * - `distDir` is the directory where Strapi will read configurations, schemas and any compiled code
61
- *
62
- * Default values:
63
- * - If `appDir` is `undefined`, it'll be set to `process.cwd()`
64
- * - If `distDir` is `undefined`, it'll be set to `appDir`
65
- */
66
- const resolveWorkingDirectories = (opts) => {
67
- const cwd = process.cwd();
68
-
69
- const appDir = opts.appDir ? path.resolve(cwd, opts.appDir) : cwd;
70
- const distDir = opts.distDir ? path.resolve(cwd, opts.distDir) : appDir;
71
-
72
- return { app: appDir, dist: distDir };
73
- };
74
-
75
- /** @implements {import('@strapi/strapi').Strapi} */
76
- class Strapi {
77
- constructor(opts = {}) {
78
- destroyOnSignal(this);
79
-
80
- const rootDirs = resolveWorkingDirectories(opts);
81
-
82
- // Load the app configuration from the dist directory
83
- const appConfig = loadConfiguration({ appDir: rootDirs.app, distDir: rootDirs.dist }, opts);
84
-
85
- // Instantiate the Strapi container
86
- this.container = createContainer(this);
87
-
88
- // Register every Strapi registry in the container
89
- this.container.register('config', createConfigProvider(appConfig));
90
- this.container.register('content-types', contentTypesRegistry(this));
91
- this.container.register('services', servicesRegistry(this));
92
- this.container.register('policies', policiesRegistry(this));
93
- this.container.register('middlewares', middlewaresRegistry(this));
94
- this.container.register('hooks', hooksRegistry(this));
95
- this.container.register('controllers', controllersRegistry(this));
96
- this.container.register('modules', modulesRegistry(this));
97
- this.container.register('plugins', pluginsRegistry(this));
98
- this.container.register('custom-fields', customFieldsRegistry(this));
99
- this.container.register('apis', apisRegistry(this));
100
- this.container.register('auth', createAuth(this));
101
- this.container.register('content-api', createContentAPI(this));
102
- this.container.register('sanitizers', sanitizersRegistry(this));
103
- this.container.register('validators', validatorsRegistry(this));
104
-
105
- // Create a mapping of every useful directory (for the app, dist and static directories)
106
- this.dirs = utils.getDirs(rootDirs, { strapi: this });
107
-
108
- // Strapi state management variables
109
- this.isLoaded = false;
110
- this.reload = this.reload();
111
-
112
- // Instantiate the Koa app & the HTTP server
113
- this.server = createServer(this);
114
-
115
- // Strapi utils instantiation
116
- this.fs = createStrapiFs(this);
117
- this.eventHub = createEventHub();
118
- this.startupLogger = createStartupLogger(this);
119
- this.log = createLogger(this.config.get('logger', {}));
120
- this.cron = createCronService();
121
- this.telemetry = createTelemetry(this);
122
- this.requestContext = requestContext;
123
- this.customFields = createCustomFields(this);
124
- this.fetch = createStrapiFetch(this);
125
-
126
- createUpdateNotifier(this).notify();
127
-
128
- Object.defineProperty(this, 'EE', {
129
- get: () => {
130
- ee.init(this.dirs.app.root, this.log);
131
- return ee.isEE;
132
- },
133
- configurable: false,
134
- });
135
- }
136
-
137
- get config() {
138
- return this.container.get('config');
139
- }
140
-
141
- get services() {
142
- return this.container.get('services').getAll();
143
- }
144
-
145
- service(uid) {
146
- return this.container.get('services').get(uid);
147
- }
148
-
149
- get controllers() {
150
- return this.container.get('controllers').getAll();
151
- }
152
-
153
- controller(uid) {
154
- return this.container.get('controllers').get(uid);
155
- }
156
-
157
- get contentTypes() {
158
- return this.container.get('content-types').getAll();
159
- }
160
-
161
- contentType(name) {
162
- return this.container.get('content-types').get(name);
163
- }
164
-
165
- get policies() {
166
- return this.container.get('policies').getAll();
167
- }
168
-
169
- policy(name) {
170
- return this.container.get('policies').get(name);
171
- }
172
-
173
- get middlewares() {
174
- return this.container.get('middlewares').getAll();
175
- }
176
-
177
- middleware(name) {
178
- return this.container.get('middlewares').get(name);
179
- }
180
-
181
- get plugins() {
182
- return this.container.get('plugins').getAll();
183
- }
184
-
185
- plugin(name) {
186
- return this.container.get('plugins').get(name);
187
- }
188
-
189
- get hooks() {
190
- return this.container.get('hooks').getAll();
191
- }
192
-
193
- hook(name) {
194
- return this.container.get('hooks').get(name);
195
- }
196
-
197
- // api(name) {
198
- // return this.container.get('apis').get(name);
199
- // }
200
-
201
- get api() {
202
- return this.container.get('apis').getAll();
203
- }
204
-
205
- get auth() {
206
- return this.container.get('auth');
207
- }
208
-
209
- get contentAPI() {
210
- return this.container.get('content-api');
211
- }
212
-
213
- get sanitizers() {
214
- return this.container.get('sanitizers');
215
- }
216
-
217
- get validators() {
218
- return this.container.get('validators');
219
- }
220
-
221
- async start() {
222
- try {
223
- if (!this.isLoaded) {
224
- await this.load();
225
- }
226
-
227
- await this.listen();
228
-
229
- return this;
230
- } catch (error) {
231
- return this.stopWithError(error);
232
- }
233
- }
234
-
235
- async destroy() {
236
- await this.server.destroy();
237
- await this.runLifecyclesFunctions(LIFECYCLES.DESTROY);
238
-
239
- this.eventHub.destroy();
240
-
241
- if (_.has(this, 'db')) {
242
- await this.db.destroy();
243
- }
244
-
245
- this.telemetry.destroy();
246
- this.cron.destroy();
247
-
248
- process.removeAllListeners();
249
-
250
- delete global.strapi;
251
- }
252
-
253
- sendStartupTelemetry() {
254
- // Emit started event.
255
- // do not await to avoid slower startup
256
- // This event is anonymous
257
- this.telemetry.send('didStartServer', {
258
- groupProperties: {
259
- database: strapi.config.get('database.connection.client'),
260
- plugins: Object.keys(strapi.plugins),
261
- numberOfAllContentTypes: _.size(this.contentTypes), // TODO: V5: This event should be renamed numberOfContentTypes in V5 as the name is already taken to describe the number of content types using i18n.
262
- numberOfComponents: _.size(this.components),
263
- numberOfDynamicZones: getNumberOfDynamicZones(),
264
- environment: strapi.config.environment,
265
- // TODO: to add back
266
- // providers: this.config.installedProviders,
267
- },
268
- });
269
- }
270
-
271
- async openAdmin({ isInitialized }) {
272
- const shouldOpenAdmin =
273
- this.config.get('environment') === 'development' &&
274
- this.config.get('admin.autoOpen', true) !== false;
275
-
276
- if (shouldOpenAdmin && !isInitialized) {
277
- try {
278
- await utils.openBrowser(this.config);
279
- this.telemetry.send('didOpenTab');
280
- } catch (e) {
281
- this.telemetry.send('didNotOpenTab');
282
- }
283
- }
284
- }
285
-
286
- async postListen() {
287
- const isInitialized = await utils.isInitialized(this);
288
-
289
- this.startupLogger.logStartupMessage({ isInitialized });
290
-
291
- this.sendStartupTelemetry();
292
- this.openAdmin({ isInitialized });
293
- }
294
-
295
- /**
296
- * Add behaviors to the server
297
- */
298
- async listen() {
299
- return new Promise((resolve, reject) => {
300
- const onListen = async (error) => {
301
- if (error) {
302
- return reject(error);
303
- }
304
-
305
- try {
306
- await this.postListen();
307
-
308
- resolve();
309
- } catch (error) {
310
- reject(error);
311
- }
312
- };
313
-
314
- const listenSocket = this.config.get('server.socket');
315
-
316
- if (listenSocket) {
317
- this.server.listen(listenSocket, onListen);
318
- } else {
319
- const { host, port } = this.config.get('server');
320
-
321
- this.server.listen(port, host, onListen);
322
- }
323
- });
324
- }
325
-
326
- stopWithError(err, customMessage) {
327
- this.log.debug(`⛔️ Server wasn't able to start properly.`);
328
- if (customMessage) {
329
- this.log.error(customMessage);
330
- }
331
-
332
- this.log.error(err);
333
- return this.stop();
334
- }
335
-
336
- stop(exitCode = 1) {
337
- this.destroy();
338
-
339
- if (this.config.get('autoReload')) {
340
- process.send('stop');
341
- }
342
-
343
- // Kill process
344
- process.exit(exitCode);
345
- }
346
-
347
- async loadAdmin() {
348
- await loaders.loadAdmin(this);
349
- }
350
-
351
- async loadPlugins() {
352
- await loaders.loadPlugins(this);
353
- }
354
-
355
- async loadPolicies() {
356
- await loaders.loadPolicies(this);
357
- }
358
-
359
- async loadAPIs() {
360
- await loaders.loadAPIs(this);
361
- }
362
-
363
- async loadComponents() {
364
- this.components = await loaders.loadComponents(this);
365
- }
366
-
367
- async loadMiddlewares() {
368
- await loaders.loadMiddlewares(this);
369
- }
370
-
371
- async loadApp() {
372
- this.app = await loaders.loadSrcIndex(this);
373
- }
374
-
375
- async loadSanitizers() {
376
- await loaders.loadSanitizers(this);
377
- }
378
-
379
- async loadValidators() {
380
- await loaders.loadValidators(this);
381
- }
382
-
383
- registerInternalHooks() {
384
- this.container.get('hooks').set('strapi::content-types.beforeSync', createAsyncParallelHook());
385
- this.container.get('hooks').set('strapi::content-types.afterSync', createAsyncParallelHook());
386
-
387
- this.hook('strapi::content-types.beforeSync').register(draftAndPublishSync.disable);
388
- this.hook('strapi::content-types.afterSync').register(draftAndPublishSync.enable);
389
- }
390
-
391
- async register() {
392
- await Promise.all([
393
- this.loadApp(),
394
- this.loadSanitizers(),
395
- this.loadValidators(),
396
- this.loadPlugins(),
397
- this.loadAdmin(),
398
- this.loadAPIs(),
399
- this.loadComponents(),
400
- this.loadMiddlewares(),
401
- this.loadPolicies(),
402
- ]);
403
-
404
- await bootstrap({ strapi: this });
405
-
406
- // init webhook runner
407
- this.webhookRunner = createWebhookRunner({
408
- eventHub: this.eventHub,
409
- logger: this.log,
410
- configuration: this.config.get('server.webhooks', {}),
411
- fetch: this.fetch,
412
- });
413
-
414
- this.registerInternalHooks();
415
-
416
- this.telemetry.register();
417
-
418
- await this.runLifecyclesFunctions(LIFECYCLES.REGISTER);
419
- // NOTE: Swap type customField for underlying data type
420
- convertCustomFieldType(this);
421
-
422
- return this;
423
- }
424
-
425
- async bootstrap() {
426
- const contentTypes = [
427
- coreStoreModel,
428
- webhookModel,
429
- ...Object.values(strapi.contentTypes),
430
- ...Object.values(strapi.components),
431
- ];
432
-
433
- this.db = await Database.init({
434
- ...this.config.get('database'),
435
- models: Database.transformContentTypes(contentTypes),
436
- });
437
-
438
- this.store = createCoreStore({ db: this.db });
439
- this.webhookStore = createWebhookStore({ db: this.db });
440
-
441
- this.entityValidator = entityValidator;
442
- this.entityService = createEntityService({
443
- strapi: this,
444
- db: this.db,
445
- eventHub: this.eventHub,
446
- entityValidator: this.entityValidator,
447
- });
448
-
449
- if (strapi.config.get('server.cron.enabled', true)) {
450
- const cronTasks = this.config.get('server.cron.tasks', {});
451
- this.cron.add(cronTasks);
452
- }
453
-
454
- this.telemetry.bootstrap();
455
-
456
- let oldContentTypes;
457
- if (await this.db.getSchemaConnection().hasTable(coreStoreModel.collectionName)) {
458
- oldContentTypes = await this.store.get({
459
- type: 'strapi',
460
- name: 'content_types',
461
- key: 'schema',
462
- });
463
- }
464
-
465
- await this.hook('strapi::content-types.beforeSync').call({
466
- oldContentTypes,
467
- contentTypes: strapi.contentTypes,
468
- });
469
-
470
- await this.db.schema.sync();
471
-
472
- if (this.EE) {
473
- await ee.checkLicense({ strapi: this });
474
- }
475
-
476
- await this.hook('strapi::content-types.afterSync').call({
477
- oldContentTypes,
478
- contentTypes: strapi.contentTypes,
479
- });
480
-
481
- await this.store.set({
482
- type: 'strapi',
483
- name: 'content_types',
484
- key: 'schema',
485
- value: strapi.contentTypes,
486
- });
487
-
488
- await this.startWebhooks();
489
-
490
- await this.server.initMiddlewares();
491
- this.server.initRouting();
492
-
493
- await this.contentAPI.permissions.registerActions();
494
-
495
- await this.runLifecyclesFunctions(LIFECYCLES.BOOTSTRAP);
496
-
497
- this.cron.start();
498
-
499
- return this;
500
- }
501
-
502
- async load() {
503
- await this.register();
504
- await this.bootstrap();
505
-
506
- this.isLoaded = true;
507
-
508
- return this;
509
- }
510
-
511
- async startWebhooks() {
512
- const webhooks = await this.webhookStore.findWebhooks();
513
- webhooks.forEach((webhook) => this.webhookRunner.add(webhook));
514
- }
515
-
516
- reload() {
517
- const state = {
518
- shouldReload: 0,
519
- };
520
-
521
- const reload = function () {
522
- if (state.shouldReload > 0) {
523
- // Reset the reloading state
524
- state.shouldReload -= 1;
525
- reload.isReloading = false;
526
- return;
527
- }
528
-
529
- if (this.config.get('autoReload')) {
530
- process.send('reload');
531
- }
532
- };
533
-
534
- Object.defineProperty(reload, 'isWatching', {
535
- configurable: true,
536
- enumerable: true,
537
- set(value) {
538
- // Special state when the reloader is disabled temporarly (see GraphQL plugin example).
539
- if (state.isWatching === false && value === true) {
540
- state.shouldReload += 1;
541
- }
542
- state.isWatching = value;
543
- },
544
- get() {
545
- return state.isWatching;
546
- },
547
- });
548
-
549
- reload.isReloading = false;
550
- reload.isWatching = true;
551
-
552
- return reload;
553
- }
554
-
555
- async runLifecyclesFunctions(lifecycleName) {
556
- // plugins
557
- await this.container.get('modules')[lifecycleName]();
558
-
559
- // admin
560
- const adminLifecycleFunction = this.admin && this.admin[lifecycleName];
561
- if (isFunction(adminLifecycleFunction)) {
562
- await adminLifecycleFunction({ strapi: this });
563
- }
564
-
565
- // user
566
- const userLifecycleFunction = this.app && this.app[lifecycleName];
567
- if (isFunction(userLifecycleFunction)) {
568
- await userLifecycleFunction({ strapi: this });
569
- }
570
- }
571
-
572
- getModel(uid) {
573
- return this.contentTypes[uid] || this.components[uid];
574
- }
575
-
576
- /**
577
- * Binds queries with a specific model
578
- * @param {string} uid
579
- */
580
- query(uid) {
581
- return this.db.query(uid);
582
- }
583
- }
584
-
585
- module.exports = (options) => {
586
- const strapi = new Strapi(options);
587
- global.strapi = strapi;
588
- return strapi;
589
- };
590
-
591
- module.exports.Strapi = Strapi;