@strapi/core 0.0.0-experimental.19b15f2f555510eb5507d89fcaf5efa172002608 → 0.0.0-experimental.19d775295eb622de3e659110caf22fcd2cd5d10d

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.

Potentially problematic release.


This version of @strapi/core might be problematic. Click here for more details.

Files changed (861) hide show
  1. package/LICENSE +18 -3
  2. package/dist/Strapi.d.ts +52 -59
  3. package/dist/Strapi.d.ts.map +1 -1
  4. package/dist/Strapi.js +202 -215
  5. package/dist/Strapi.js.map +1 -1
  6. package/dist/Strapi.mjs +172 -205
  7. package/dist/Strapi.mjs.map +1 -1
  8. package/dist/compile.js.map +1 -1
  9. package/dist/compile.mjs.map +1 -1
  10. package/dist/configuration/config-loader.d.ts.map +1 -1
  11. package/dist/configuration/config-loader.js +10 -7
  12. package/dist/configuration/config-loader.js.map +1 -1
  13. package/dist/configuration/config-loader.mjs +10 -7
  14. package/dist/configuration/config-loader.mjs.map +1 -1
  15. package/dist/configuration/get-dirs.d.ts +10 -0
  16. package/dist/configuration/get-dirs.d.ts.map +1 -0
  17. package/dist/{utils → configuration}/get-dirs.js +3 -2
  18. package/dist/configuration/get-dirs.js.map +1 -0
  19. package/dist/{utils → configuration}/get-dirs.mjs +3 -2
  20. package/dist/configuration/get-dirs.mjs.map +1 -0
  21. package/dist/configuration/index.d.ts +4 -7
  22. package/dist/configuration/index.d.ts.map +1 -1
  23. package/dist/configuration/index.js +16 -9
  24. package/dist/configuration/index.js.map +1 -1
  25. package/dist/configuration/index.mjs +13 -7
  26. package/dist/configuration/index.mjs.map +1 -1
  27. package/dist/configuration/urls.js.map +1 -1
  28. package/dist/configuration/urls.mjs.map +1 -1
  29. package/dist/container.d.ts +2 -2
  30. package/dist/container.d.ts.map +1 -1
  31. package/dist/container.js.map +1 -1
  32. package/dist/container.mjs.map +1 -1
  33. package/dist/core-api/controller/collection-type.d.ts +3 -3
  34. package/dist/core-api/controller/collection-type.d.ts.map +1 -1
  35. package/dist/core-api/controller/collection-type.js +6 -3
  36. package/dist/core-api/controller/collection-type.js.map +1 -1
  37. package/dist/core-api/controller/collection-type.mjs +3 -0
  38. package/dist/core-api/controller/collection-type.mjs.map +1 -1
  39. package/dist/core-api/controller/index.d.ts +3 -3
  40. package/dist/core-api/controller/index.d.ts.map +1 -1
  41. package/dist/core-api/controller/index.js +7 -7
  42. package/dist/core-api/controller/index.js.map +1 -1
  43. package/dist/core-api/controller/index.mjs +6 -6
  44. package/dist/core-api/controller/index.mjs.map +1 -1
  45. package/dist/core-api/controller/single-type.d.ts +3 -3
  46. package/dist/core-api/controller/single-type.d.ts.map +1 -1
  47. package/dist/core-api/controller/single-type.js +3 -2
  48. package/dist/core-api/controller/single-type.js.map +1 -1
  49. package/dist/core-api/controller/single-type.mjs +1 -0
  50. package/dist/core-api/controller/single-type.mjs.map +1 -1
  51. package/dist/core-api/controller/transform.d.ts +2 -2
  52. package/dist/core-api/controller/transform.d.ts.map +1 -1
  53. package/dist/core-api/controller/transform.js +10 -13
  54. package/dist/core-api/controller/transform.js.map +1 -1
  55. package/dist/core-api/controller/transform.mjs +2 -5
  56. package/dist/core-api/controller/transform.mjs.map +1 -1
  57. package/dist/core-api/routes/index.d.ts.map +1 -1
  58. package/dist/core-api/routes/index.js.map +1 -1
  59. package/dist/core-api/routes/index.mjs.map +1 -1
  60. package/dist/core-api/service/collection-type.d.ts +11 -17
  61. package/dist/core-api/service/collection-type.d.ts.map +1 -1
  62. package/dist/core-api/service/collection-type.js +18 -7
  63. package/dist/core-api/service/collection-type.js.map +1 -1
  64. package/dist/core-api/service/collection-type.mjs +19 -8
  65. package/dist/core-api/service/collection-type.mjs.map +1 -1
  66. package/dist/core-api/service/core-service.js.map +1 -1
  67. package/dist/core-api/service/core-service.mjs.map +1 -1
  68. package/dist/core-api/service/index.d.ts +3 -3
  69. package/dist/core-api/service/index.d.ts.map +1 -1
  70. package/dist/core-api/service/index.js.map +1 -1
  71. package/dist/core-api/service/index.mjs.map +1 -1
  72. package/dist/core-api/service/pagination.d.ts +4 -11
  73. package/dist/core-api/service/pagination.d.ts.map +1 -1
  74. package/dist/core-api/service/pagination.js +18 -44
  75. package/dist/core-api/service/pagination.js.map +1 -1
  76. package/dist/core-api/service/pagination.mjs +16 -42
  77. package/dist/core-api/service/pagination.mjs.map +1 -1
  78. package/dist/core-api/service/single-type.d.ts +4 -4
  79. package/dist/core-api/service/single-type.d.ts.map +1 -1
  80. package/dist/core-api/service/single-type.js +10 -4
  81. package/dist/core-api/service/single-type.js.map +1 -1
  82. package/dist/core-api/service/single-type.mjs +10 -4
  83. package/dist/core-api/service/single-type.mjs.map +1 -1
  84. package/dist/domain/content-type/index.d.ts +1 -1
  85. package/dist/domain/content-type/index.d.ts.map +1 -1
  86. package/dist/domain/content-type/index.js +4 -4
  87. package/dist/domain/content-type/index.js.map +1 -1
  88. package/dist/domain/content-type/index.mjs.map +1 -1
  89. package/dist/domain/content-type/validator.js.map +1 -1
  90. package/dist/domain/content-type/validator.mjs.map +1 -1
  91. package/dist/domain/module/index.d.ts +24 -23
  92. package/dist/domain/module/index.d.ts.map +1 -1
  93. package/dist/domain/module/index.js +2 -1
  94. package/dist/domain/module/index.js.map +1 -1
  95. package/dist/domain/module/index.mjs +3 -2
  96. package/dist/domain/module/index.mjs.map +1 -1
  97. package/dist/domain/module/validation.js.map +1 -1
  98. package/dist/domain/module/validation.mjs.map +1 -1
  99. package/dist/ee/index.d.ts +4 -2
  100. package/dist/ee/index.d.ts.map +1 -1
  101. package/dist/ee/index.js +9 -4
  102. package/dist/ee/index.js.map +1 -1
  103. package/dist/ee/index.mjs +6 -1
  104. package/dist/ee/index.mjs.map +1 -1
  105. package/dist/ee/license.d.ts +2 -2
  106. package/dist/ee/license.d.ts.map +1 -1
  107. package/dist/ee/license.js +2 -1
  108. package/dist/ee/license.js.map +1 -1
  109. package/dist/ee/license.mjs +2 -1
  110. package/dist/ee/license.mjs.map +1 -1
  111. package/dist/factories.d.ts +10 -10
  112. package/dist/factories.d.ts.map +1 -1
  113. package/dist/factories.js +10 -6
  114. package/dist/factories.js.map +1 -1
  115. package/dist/factories.mjs +6 -2
  116. package/dist/factories.mjs.map +1 -1
  117. package/dist/index.d.ts +18 -2
  118. package/dist/index.d.ts.map +1 -1
  119. package/dist/index.js +25 -1
  120. package/dist/index.js.map +1 -1
  121. package/dist/index.mjs +27 -3
  122. package/dist/index.mjs.map +1 -1
  123. package/dist/loaders/admin.d.ts +2 -2
  124. package/dist/loaders/admin.d.ts.map +1 -1
  125. package/dist/loaders/admin.js +0 -1
  126. package/dist/loaders/admin.js.map +1 -1
  127. package/dist/loaders/admin.mjs +0 -1
  128. package/dist/loaders/admin.mjs.map +1 -1
  129. package/dist/loaders/apis.d.ts +2 -2
  130. package/dist/loaders/apis.d.ts.map +1 -1
  131. package/dist/loaders/apis.js +12 -12
  132. package/dist/loaders/apis.js.map +1 -1
  133. package/dist/loaders/apis.mjs +10 -10
  134. package/dist/loaders/apis.mjs.map +1 -1
  135. package/dist/loaders/components.d.ts +2 -2
  136. package/dist/loaders/components.d.ts.map +1 -1
  137. package/dist/loaders/components.js.map +1 -1
  138. package/dist/loaders/components.mjs.map +1 -1
  139. package/dist/loaders/index.d.ts +2 -2
  140. package/dist/loaders/index.d.ts.map +1 -1
  141. package/dist/loaders/index.js +0 -2
  142. package/dist/loaders/index.js.map +1 -1
  143. package/dist/loaders/index.mjs +0 -2
  144. package/dist/loaders/index.mjs.map +1 -1
  145. package/dist/loaders/middlewares.d.ts +2 -2
  146. package/dist/loaders/middlewares.d.ts.map +1 -1
  147. package/dist/loaders/middlewares.js.map +1 -1
  148. package/dist/loaders/middlewares.mjs.map +1 -1
  149. package/dist/loaders/plugins/get-enabled-plugins.d.ts +2 -2
  150. package/dist/loaders/plugins/get-enabled-plugins.d.ts.map +1 -1
  151. package/dist/loaders/plugins/get-enabled-plugins.js +47 -17
  152. package/dist/loaders/plugins/get-enabled-plugins.js.map +1 -1
  153. package/dist/loaders/plugins/get-enabled-plugins.mjs +17 -9
  154. package/dist/loaders/plugins/get-enabled-plugins.mjs.map +1 -1
  155. package/dist/loaders/plugins/get-user-plugins-config.js +2 -2
  156. package/dist/loaders/plugins/get-user-plugins-config.js.map +1 -1
  157. package/dist/loaders/plugins/get-user-plugins-config.mjs.map +1 -1
  158. package/dist/loaders/plugins/index.d.ts +2 -2
  159. package/dist/loaders/plugins/index.d.ts.map +1 -1
  160. package/dist/loaders/plugins/index.js +33 -7
  161. package/dist/loaders/plugins/index.js.map +1 -1
  162. package/dist/loaders/plugins/index.mjs +9 -1
  163. package/dist/loaders/plugins/index.mjs.map +1 -1
  164. package/dist/loaders/policies.d.ts +2 -2
  165. package/dist/loaders/policies.d.ts.map +1 -1
  166. package/dist/loaders/policies.js.map +1 -1
  167. package/dist/loaders/policies.mjs.map +1 -1
  168. package/dist/loaders/sanitizers.d.ts +2 -2
  169. package/dist/loaders/sanitizers.d.ts.map +1 -1
  170. package/dist/loaders/sanitizers.js.map +1 -1
  171. package/dist/loaders/sanitizers.mjs.map +1 -1
  172. package/dist/loaders/src-index.d.ts +2 -2
  173. package/dist/loaders/src-index.d.ts.map +1 -1
  174. package/dist/loaders/src-index.js.map +1 -1
  175. package/dist/loaders/src-index.mjs.map +1 -1
  176. package/dist/loaders/validators.d.ts +2 -2
  177. package/dist/loaders/validators.d.ts.map +1 -1
  178. package/dist/loaders/validators.js.map +1 -1
  179. package/dist/loaders/validators.mjs.map +1 -1
  180. package/dist/middlewares/body.d.ts +4 -4
  181. package/dist/middlewares/body.d.ts.map +1 -1
  182. package/dist/middlewares/body.js +6 -6
  183. package/dist/middlewares/body.js.map +1 -1
  184. package/dist/middlewares/body.mjs +4 -4
  185. package/dist/middlewares/body.mjs.map +1 -1
  186. package/dist/middlewares/compression.d.ts +2 -2
  187. package/dist/middlewares/compression.d.ts.map +1 -1
  188. package/dist/middlewares/compression.js.map +1 -1
  189. package/dist/middlewares/compression.mjs.map +1 -1
  190. package/dist/middlewares/cors.d.ts +2 -2
  191. package/dist/middlewares/cors.d.ts.map +1 -1
  192. package/dist/middlewares/cors.js +9 -7
  193. package/dist/middlewares/cors.js.map +1 -1
  194. package/dist/middlewares/cors.mjs +9 -7
  195. package/dist/middlewares/cors.mjs.map +1 -1
  196. package/dist/middlewares/errors.d.ts +2 -2
  197. package/dist/middlewares/errors.d.ts.map +1 -1
  198. package/dist/middlewares/errors.js.map +1 -1
  199. package/dist/middlewares/errors.mjs.map +1 -1
  200. package/dist/middlewares/favicon.d.ts +2 -2
  201. package/dist/middlewares/favicon.d.ts.map +1 -1
  202. package/dist/middlewares/favicon.js.map +1 -1
  203. package/dist/middlewares/favicon.mjs.map +1 -1
  204. package/dist/middlewares/index.d.ts +2 -2
  205. package/dist/middlewares/index.d.ts.map +1 -1
  206. package/dist/middlewares/index.js.map +1 -1
  207. package/dist/middlewares/index.mjs.map +1 -1
  208. package/dist/middlewares/ip.d.ts +2 -2
  209. package/dist/middlewares/ip.d.ts.map +1 -1
  210. package/dist/middlewares/ip.js.map +1 -1
  211. package/dist/middlewares/ip.mjs.map +1 -1
  212. package/dist/middlewares/logger.d.ts +2 -2
  213. package/dist/middlewares/logger.d.ts.map +1 -1
  214. package/dist/middlewares/logger.js.map +1 -1
  215. package/dist/middlewares/logger.mjs.map +1 -1
  216. package/dist/middlewares/powered-by.d.ts +2 -2
  217. package/dist/middlewares/powered-by.d.ts.map +1 -1
  218. package/dist/middlewares/powered-by.js.map +1 -1
  219. package/dist/middlewares/powered-by.mjs.map +1 -1
  220. package/dist/middlewares/public.d.ts +2 -2
  221. package/dist/middlewares/public.d.ts.map +1 -1
  222. package/dist/middlewares/public.js +3 -3
  223. package/dist/middlewares/public.js.map +1 -1
  224. package/dist/middlewares/public.mjs +1 -1
  225. package/dist/middlewares/public.mjs.map +1 -1
  226. package/dist/middlewares/query.d.ts +2 -2
  227. package/dist/middlewares/query.d.ts.map +1 -1
  228. package/dist/middlewares/query.js.map +1 -1
  229. package/dist/middlewares/query.mjs.map +1 -1
  230. package/dist/middlewares/response-time.d.ts +2 -2
  231. package/dist/middlewares/response-time.d.ts.map +1 -1
  232. package/dist/middlewares/response-time.js.map +1 -1
  233. package/dist/middlewares/response-time.mjs.map +1 -1
  234. package/dist/middlewares/responses.d.ts +3 -3
  235. package/dist/middlewares/responses.d.ts.map +1 -1
  236. package/dist/middlewares/responses.js +2 -2
  237. package/dist/middlewares/responses.js.map +1 -1
  238. package/dist/middlewares/responses.mjs.map +1 -1
  239. package/dist/middlewares/security.d.ts +2 -2
  240. package/dist/middlewares/security.d.ts.map +1 -1
  241. package/dist/middlewares/security.js +12 -5
  242. package/dist/middlewares/security.js.map +1 -1
  243. package/dist/middlewares/security.mjs +11 -4
  244. package/dist/middlewares/security.mjs.map +1 -1
  245. package/dist/middlewares/session.d.ts +2 -2
  246. package/dist/middlewares/session.d.ts.map +1 -1
  247. package/dist/middlewares/session.js +2 -2
  248. package/dist/middlewares/session.js.map +1 -1
  249. package/dist/middlewares/session.mjs.map +1 -1
  250. package/dist/migrations/database/5.0.0-discard-drafts.d.ts +33 -0
  251. package/dist/migrations/database/5.0.0-discard-drafts.d.ts.map +1 -0
  252. package/dist/migrations/database/5.0.0-discard-drafts.js +109 -0
  253. package/dist/migrations/database/5.0.0-discard-drafts.js.map +1 -0
  254. package/dist/migrations/database/5.0.0-discard-drafts.mjs +109 -0
  255. package/dist/migrations/database/5.0.0-discard-drafts.mjs.map +1 -0
  256. package/dist/migrations/draft-publish.d.ts +1 -1
  257. package/dist/migrations/draft-publish.d.ts.map +1 -1
  258. package/dist/migrations/draft-publish.js +14 -31
  259. package/dist/migrations/draft-publish.js.map +1 -1
  260. package/dist/migrations/draft-publish.mjs +15 -32
  261. package/dist/migrations/draft-publish.mjs.map +1 -1
  262. package/dist/migrations/i18n.d.ts +5 -0
  263. package/dist/migrations/i18n.d.ts.map +1 -0
  264. package/dist/migrations/i18n.js +54 -0
  265. package/dist/migrations/i18n.js.map +1 -0
  266. package/dist/migrations/i18n.mjs +54 -0
  267. package/dist/migrations/i18n.mjs.map +1 -0
  268. package/dist/migrations/index.d.ts +5 -0
  269. package/dist/migrations/index.d.ts.map +1 -0
  270. package/dist/migrations/index.js +15 -0
  271. package/dist/migrations/index.js.map +1 -0
  272. package/dist/migrations/index.mjs +15 -0
  273. package/dist/migrations/index.mjs.map +1 -0
  274. package/dist/providers/admin.d.ts +3 -0
  275. package/dist/providers/admin.d.ts.map +1 -0
  276. package/dist/providers/admin.js +20 -0
  277. package/dist/providers/admin.js.map +1 -0
  278. package/dist/providers/admin.mjs +21 -0
  279. package/dist/providers/admin.mjs.map +1 -0
  280. package/dist/providers/coreStore.d.ts +3 -0
  281. package/dist/providers/coreStore.d.ts.map +1 -0
  282. package/dist/providers/coreStore.js +11 -0
  283. package/dist/providers/coreStore.js.map +1 -0
  284. package/dist/providers/coreStore.mjs +12 -0
  285. package/dist/providers/coreStore.mjs.map +1 -0
  286. package/dist/providers/cron.d.ts +3 -0
  287. package/dist/providers/cron.d.ts.map +1 -0
  288. package/dist/providers/cron.js +20 -0
  289. package/dist/providers/cron.js.map +1 -0
  290. package/dist/providers/cron.mjs +21 -0
  291. package/dist/providers/cron.mjs.map +1 -0
  292. package/dist/providers/index.d.ts +3 -0
  293. package/dist/providers/index.d.ts.map +1 -0
  294. package/dist/providers/index.js +11 -0
  295. package/dist/providers/index.js.map +1 -0
  296. package/dist/providers/index.mjs +11 -0
  297. package/dist/providers/index.mjs.map +1 -0
  298. package/dist/providers/provider.d.ts +9 -0
  299. package/dist/providers/provider.d.ts.map +1 -0
  300. package/dist/providers/provider.js +5 -0
  301. package/dist/providers/provider.js.map +1 -0
  302. package/dist/providers/provider.mjs +5 -0
  303. package/dist/providers/provider.mjs.map +1 -0
  304. package/dist/providers/registries.d.ts +3 -0
  305. package/dist/providers/registries.d.ts.map +1 -0
  306. package/dist/providers/registries.js +35 -0
  307. package/dist/providers/registries.js.map +1 -0
  308. package/dist/providers/registries.mjs +36 -0
  309. package/dist/providers/registries.mjs.map +1 -0
  310. package/dist/providers/telemetry.d.ts +3 -0
  311. package/dist/providers/telemetry.d.ts.map +1 -0
  312. package/dist/providers/telemetry.js +19 -0
  313. package/dist/providers/telemetry.js.map +1 -0
  314. package/dist/providers/telemetry.mjs +20 -0
  315. package/dist/providers/telemetry.mjs.map +1 -0
  316. package/dist/providers/webhooks.d.ts +3 -0
  317. package/dist/providers/webhooks.d.ts.map +1 -0
  318. package/dist/providers/webhooks.js +30 -0
  319. package/dist/providers/webhooks.js.map +1 -0
  320. package/dist/providers/webhooks.mjs +31 -0
  321. package/dist/providers/webhooks.mjs.map +1 -0
  322. package/dist/registries/apis.d.ts +2 -2
  323. package/dist/registries/apis.d.ts.map +1 -1
  324. package/dist/registries/apis.js +2 -2
  325. package/dist/registries/apis.js.map +1 -1
  326. package/dist/registries/apis.mjs.map +1 -1
  327. package/dist/registries/components.d.ts +6 -6
  328. package/dist/registries/components.d.ts.map +1 -1
  329. package/dist/registries/components.js +2 -2
  330. package/dist/registries/components.js.map +1 -1
  331. package/dist/registries/components.mjs.map +1 -1
  332. package/dist/registries/content-types.d.ts +5 -5
  333. package/dist/registries/content-types.d.ts.map +1 -1
  334. package/dist/registries/content-types.js +3 -3
  335. package/dist/registries/content-types.js.map +1 -1
  336. package/dist/registries/content-types.mjs.map +1 -1
  337. package/dist/registries/controllers.d.ts +10 -10
  338. package/dist/registries/controllers.d.ts.map +1 -1
  339. package/dist/registries/controllers.js +3 -3
  340. package/dist/registries/controllers.js.map +1 -1
  341. package/dist/registries/controllers.mjs.map +1 -1
  342. package/dist/registries/custom-fields.d.ts +3 -3
  343. package/dist/registries/custom-fields.d.ts.map +1 -1
  344. package/dist/registries/custom-fields.js +4 -4
  345. package/dist/registries/custom-fields.js.map +1 -1
  346. package/dist/registries/custom-fields.mjs.map +1 -1
  347. package/dist/registries/hooks.js +2 -2
  348. package/dist/registries/hooks.js.map +1 -1
  349. package/dist/registries/hooks.mjs.map +1 -1
  350. package/dist/registries/index.d.ts +0 -1
  351. package/dist/registries/index.d.ts.map +1 -1
  352. package/dist/registries/middlewares.d.ts +6 -6
  353. package/dist/registries/middlewares.d.ts.map +1 -1
  354. package/dist/registries/middlewares.js +3 -3
  355. package/dist/registries/middlewares.js.map +1 -1
  356. package/dist/registries/middlewares.mjs.map +1 -1
  357. package/dist/registries/models.js.map +1 -1
  358. package/dist/registries/models.mjs.map +1 -1
  359. package/dist/registries/modules.d.ts +2 -2
  360. package/dist/registries/modules.d.ts.map +1 -1
  361. package/dist/registries/modules.js +3 -3
  362. package/dist/registries/modules.js.map +1 -1
  363. package/dist/registries/modules.mjs.map +1 -1
  364. package/dist/registries/namespace.js.map +1 -1
  365. package/dist/registries/namespace.mjs.map +1 -1
  366. package/dist/registries/plugins.d.ts +5 -5
  367. package/dist/registries/plugins.d.ts.map +1 -1
  368. package/dist/registries/plugins.js +2 -2
  369. package/dist/registries/plugins.js.map +1 -1
  370. package/dist/registries/plugins.mjs.map +1 -1
  371. package/dist/registries/policies.d.ts +22 -10
  372. package/dist/registries/policies.d.ts.map +1 -1
  373. package/dist/registries/policies.js +66 -20
  374. package/dist/registries/policies.js.map +1 -1
  375. package/dist/registries/policies.mjs +65 -19
  376. package/dist/registries/policies.mjs.map +1 -1
  377. package/dist/registries/sanitizers.js.map +1 -1
  378. package/dist/registries/sanitizers.mjs.map +1 -1
  379. package/dist/registries/services.d.ts +8 -8
  380. package/dist/registries/services.d.ts.map +1 -1
  381. package/dist/registries/services.js +3 -3
  382. package/dist/registries/services.js.map +1 -1
  383. package/dist/registries/services.mjs.map +1 -1
  384. package/dist/registries/validators.js.map +1 -1
  385. package/dist/registries/validators.mjs.map +1 -1
  386. package/dist/services/auth/index.d.ts +4 -4
  387. package/dist/services/auth/index.d.ts.map +1 -1
  388. package/dist/services/auth/index.js +3 -3
  389. package/dist/services/auth/index.js.map +1 -1
  390. package/dist/services/auth/index.mjs.map +1 -1
  391. package/dist/services/config.d.ts +3 -0
  392. package/dist/services/config.d.ts.map +1 -0
  393. package/dist/services/config.js +47 -0
  394. package/dist/services/config.js.map +1 -0
  395. package/dist/services/config.mjs +47 -0
  396. package/dist/services/config.mjs.map +1 -0
  397. package/dist/services/content-api/index.d.ts +31 -15
  398. package/dist/services/content-api/index.d.ts.map +1 -1
  399. package/dist/services/content-api/index.js +28 -2
  400. package/dist/services/content-api/index.js.map +1 -1
  401. package/dist/services/content-api/index.mjs +28 -2
  402. package/dist/services/content-api/index.mjs.map +1 -1
  403. package/dist/services/content-api/permissions/index.d.ts +13 -15
  404. package/dist/services/content-api/permissions/index.d.ts.map +1 -1
  405. package/dist/services/content-api/permissions/index.js +1 -1
  406. package/dist/services/content-api/permissions/index.js.map +1 -1
  407. package/dist/services/content-api/permissions/index.mjs +1 -1
  408. package/dist/services/content-api/permissions/index.mjs.map +1 -1
  409. package/dist/services/content-api/permissions/providers/action.d.ts +5 -6
  410. package/dist/services/content-api/permissions/providers/action.d.ts.map +1 -1
  411. package/dist/services/content-api/permissions/providers/action.js.map +1 -1
  412. package/dist/services/content-api/permissions/providers/action.mjs.map +1 -1
  413. package/dist/services/content-api/permissions/providers/condition.d.ts +5 -6
  414. package/dist/services/content-api/permissions/providers/condition.d.ts.map +1 -1
  415. package/dist/services/content-api/permissions/providers/condition.js.map +1 -1
  416. package/dist/services/content-api/permissions/providers/condition.mjs.map +1 -1
  417. package/dist/services/core-store.d.ts.map +1 -1
  418. package/dist/services/core-store.js +3 -3
  419. package/dist/services/core-store.js.map +1 -1
  420. package/dist/services/core-store.mjs.map +1 -1
  421. package/dist/services/cron.d.ts +5 -5
  422. package/dist/services/cron.d.ts.map +1 -1
  423. package/dist/services/cron.js +12 -8
  424. package/dist/services/cron.js.map +1 -1
  425. package/dist/services/cron.mjs +9 -5
  426. package/dist/services/cron.mjs.map +1 -1
  427. package/dist/services/custom-fields.d.ts +2 -2
  428. package/dist/services/custom-fields.d.ts.map +1 -1
  429. package/dist/services/custom-fields.js.map +1 -1
  430. package/dist/services/custom-fields.mjs.map +1 -1
  431. package/dist/services/document-service/attributes/index.d.ts +6 -0
  432. package/dist/services/document-service/attributes/index.d.ts.map +1 -0
  433. package/dist/services/{entity-service → document-service}/attributes/index.js +5 -5
  434. package/dist/services/document-service/attributes/index.js.map +1 -0
  435. package/dist/services/{entity-service → document-service}/attributes/index.mjs +5 -5
  436. package/dist/services/document-service/attributes/index.mjs.map +1 -0
  437. package/dist/services/document-service/attributes/transforms.d.ts +10 -0
  438. package/dist/services/document-service/attributes/transforms.d.ts.map +1 -0
  439. package/dist/services/{entity-service → document-service}/attributes/transforms.js +3 -3
  440. package/dist/services/document-service/attributes/transforms.js.map +1 -0
  441. package/dist/services/document-service/attributes/transforms.mjs.map +1 -0
  442. package/dist/services/document-service/common.d.ts +2 -2
  443. package/dist/services/document-service/common.d.ts.map +1 -1
  444. package/dist/services/document-service/common.js.map +1 -1
  445. package/dist/services/document-service/common.mjs.map +1 -1
  446. package/dist/services/document-service/components.d.ts +25 -1
  447. package/dist/services/document-service/components.d.ts.map +1 -1
  448. package/dist/services/{entity-service → document-service}/components.js +52 -148
  449. package/dist/services/document-service/components.js.map +1 -0
  450. package/dist/services/{entity-service → document-service}/components.mjs +42 -138
  451. package/dist/services/document-service/components.mjs.map +1 -0
  452. package/dist/services/document-service/draft-and-publish.d.ts +7 -7
  453. package/dist/services/document-service/draft-and-publish.d.ts.map +1 -1
  454. package/dist/services/document-service/draft-and-publish.js +16 -16
  455. package/dist/services/document-service/draft-and-publish.js.map +1 -1
  456. package/dist/services/document-service/draft-and-publish.mjs.map +1 -1
  457. package/dist/services/document-service/entries.d.ts +10 -0
  458. package/dist/services/document-service/entries.d.ts.map +1 -0
  459. package/dist/services/document-service/entries.js +95 -0
  460. package/dist/services/document-service/entries.js.map +1 -0
  461. package/dist/services/document-service/entries.mjs +95 -0
  462. package/dist/services/document-service/entries.mjs.map +1 -0
  463. package/dist/services/document-service/events.d.ts +25 -0
  464. package/dist/services/document-service/events.d.ts.map +1 -0
  465. package/dist/services/document-service/events.js +47 -0
  466. package/dist/services/document-service/events.js.map +1 -0
  467. package/dist/services/document-service/events.mjs +47 -0
  468. package/dist/services/document-service/events.mjs.map +1 -0
  469. package/dist/services/document-service/index.d.ts +3 -4
  470. package/dist/services/document-service/index.d.ts.map +1 -1
  471. package/dist/services/document-service/index.js +21 -7
  472. package/dist/services/document-service/index.js.map +1 -1
  473. package/dist/services/document-service/index.mjs +19 -5
  474. package/dist/services/document-service/index.mjs.map +1 -1
  475. package/dist/services/document-service/internationalization.d.ts +5 -5
  476. package/dist/services/document-service/internationalization.d.ts.map +1 -1
  477. package/dist/services/document-service/internationalization.js +21 -12
  478. package/dist/services/document-service/internationalization.js.map +1 -1
  479. package/dist/services/document-service/internationalization.mjs +14 -5
  480. package/dist/services/document-service/internationalization.mjs.map +1 -1
  481. package/dist/services/document-service/middlewares/errors.d.ts +6 -0
  482. package/dist/services/document-service/middlewares/errors.d.ts.map +1 -0
  483. package/dist/services/document-service/middlewares/errors.js +25 -0
  484. package/dist/services/document-service/middlewares/errors.js.map +1 -0
  485. package/dist/services/document-service/middlewares/errors.mjs +25 -0
  486. package/dist/services/document-service/middlewares/errors.mjs.map +1 -0
  487. package/dist/services/document-service/middlewares/index.d.ts +3 -0
  488. package/dist/services/document-service/middlewares/index.d.ts.map +1 -0
  489. package/dist/services/document-service/middlewares/middleware-manager.d.ts +10 -0
  490. package/dist/services/document-service/middlewares/middleware-manager.d.ts.map +1 -0
  491. package/dist/services/document-service/{middlewares.js → middlewares/middleware-manager.js} +9 -6
  492. package/dist/services/document-service/middlewares/middleware-manager.js.map +1 -0
  493. package/dist/services/document-service/{middlewares.mjs → middlewares/middleware-manager.mjs} +9 -6
  494. package/dist/services/document-service/middlewares/middleware-manager.mjs.map +1 -0
  495. package/dist/services/document-service/params.d.ts +3 -1
  496. package/dist/services/document-service/params.d.ts.map +1 -1
  497. package/dist/services/{entity-service → document-service}/params.js +2 -2
  498. package/dist/services/document-service/params.js.map +1 -0
  499. package/dist/services/document-service/params.mjs.map +1 -0
  500. package/dist/services/document-service/repository.d.ts.map +1 -1
  501. package/dist/services/document-service/repository.js +212 -184
  502. package/dist/services/document-service/repository.js.map +1 -1
  503. package/dist/services/document-service/repository.mjs +192 -164
  504. package/dist/services/document-service/repository.mjs.map +1 -1
  505. package/dist/services/document-service/transform/data.d.ts.map +1 -1
  506. package/dist/services/document-service/transform/data.js +4 -2
  507. package/dist/services/document-service/transform/data.js.map +1 -1
  508. package/dist/services/document-service/transform/data.mjs +4 -2
  509. package/dist/services/document-service/transform/data.mjs.map +1 -1
  510. package/dist/services/document-service/transform/fields.d.ts +2 -2
  511. package/dist/services/document-service/transform/fields.d.ts.map +1 -1
  512. package/dist/services/document-service/transform/fields.js.map +1 -1
  513. package/dist/services/document-service/transform/fields.mjs.map +1 -1
  514. package/dist/services/document-service/transform/id-map.d.ts +3 -3
  515. package/dist/services/document-service/transform/id-map.d.ts.map +1 -1
  516. package/dist/services/document-service/transform/id-map.js +15 -8
  517. package/dist/services/document-service/transform/id-map.js.map +1 -1
  518. package/dist/services/document-service/transform/id-map.mjs +16 -9
  519. package/dist/services/document-service/transform/id-map.mjs.map +1 -1
  520. package/dist/services/document-service/transform/id-transform.d.ts +2 -2
  521. package/dist/services/document-service/transform/id-transform.d.ts.map +1 -1
  522. package/dist/services/document-service/transform/id-transform.js +2 -2
  523. package/dist/services/document-service/transform/id-transform.js.map +1 -1
  524. package/dist/services/document-service/transform/id-transform.mjs.map +1 -1
  525. package/dist/services/document-service/transform/populate.d.ts +2 -2
  526. package/dist/services/document-service/transform/populate.d.ts.map +1 -1
  527. package/dist/services/document-service/transform/populate.js +1 -1
  528. package/dist/services/document-service/transform/populate.js.map +1 -1
  529. package/dist/services/document-service/transform/populate.mjs +1 -1
  530. package/dist/services/document-service/transform/populate.mjs.map +1 -1
  531. package/dist/services/document-service/transform/query.d.ts +5 -0
  532. package/dist/services/document-service/transform/query.d.ts.map +1 -0
  533. package/dist/services/document-service/transform/query.js +9 -0
  534. package/dist/services/document-service/transform/query.js.map +1 -0
  535. package/dist/services/document-service/transform/query.mjs +9 -0
  536. package/dist/services/document-service/transform/query.mjs.map +1 -0
  537. package/dist/services/document-service/transform/relations/extract/data-ids.d.ts +8 -7
  538. package/dist/services/document-service/transform/relations/extract/data-ids.d.ts.map +1 -1
  539. package/dist/services/document-service/transform/relations/extract/data-ids.js +51 -77
  540. package/dist/services/document-service/transform/relations/extract/data-ids.js.map +1 -1
  541. package/dist/services/document-service/transform/relations/extract/data-ids.mjs +51 -77
  542. package/dist/services/document-service/transform/relations/extract/data-ids.mjs.map +1 -1
  543. package/dist/services/document-service/transform/relations/transform/data-ids.d.ts +8 -4
  544. package/dist/services/document-service/transform/relations/transform/data-ids.d.ts.map +1 -1
  545. package/dist/services/document-service/transform/relations/transform/data-ids.js +69 -125
  546. package/dist/services/document-service/transform/relations/transform/data-ids.js.map +1 -1
  547. package/dist/services/document-service/transform/relations/transform/data-ids.mjs +69 -125
  548. package/dist/services/document-service/transform/relations/transform/data-ids.mjs.map +1 -1
  549. package/dist/services/document-service/transform/relations/transform/default-locale.d.ts +9 -0
  550. package/dist/services/document-service/transform/relations/transform/default-locale.d.ts.map +1 -0
  551. package/dist/services/document-service/transform/relations/transform/default-locale.js +32 -0
  552. package/dist/services/document-service/transform/relations/transform/default-locale.js.map +1 -0
  553. package/dist/services/document-service/transform/relations/transform/default-locale.mjs +32 -0
  554. package/dist/services/document-service/transform/relations/transform/default-locale.mjs.map +1 -0
  555. package/dist/services/document-service/transform/relations/utils/dp.d.ts +3 -3
  556. package/dist/services/document-service/transform/relations/utils/dp.d.ts.map +1 -1
  557. package/dist/services/document-service/transform/relations/utils/dp.js +10 -5
  558. package/dist/services/document-service/transform/relations/utils/dp.js.map +1 -1
  559. package/dist/services/document-service/transform/relations/utils/dp.mjs +9 -4
  560. package/dist/services/document-service/transform/relations/utils/dp.mjs.map +1 -1
  561. package/dist/services/document-service/transform/relations/utils/i18n.d.ts +6 -6
  562. package/dist/services/document-service/transform/relations/utils/i18n.d.ts.map +1 -1
  563. package/dist/services/document-service/transform/relations/utils/i18n.js +3 -9
  564. package/dist/services/document-service/transform/relations/utils/i18n.js.map +1 -1
  565. package/dist/services/document-service/transform/relations/utils/i18n.mjs +3 -9
  566. package/dist/services/document-service/transform/relations/utils/i18n.mjs.map +1 -1
  567. package/dist/services/document-service/transform/relations/utils/map-relation.d.ts +6 -0
  568. package/dist/services/document-service/transform/relations/utils/map-relation.d.ts.map +1 -0
  569. package/dist/services/document-service/transform/relations/utils/map-relation.js +84 -0
  570. package/dist/services/document-service/transform/relations/utils/map-relation.js.map +1 -0
  571. package/dist/services/document-service/transform/relations/utils/map-relation.mjs +84 -0
  572. package/dist/services/document-service/transform/relations/utils/map-relation.mjs.map +1 -0
  573. package/dist/services/document-service/transform/relations/utils/types.d.ts +6 -0
  574. package/dist/services/document-service/transform/relations/utils/types.d.ts.map +1 -1
  575. package/dist/services/document-service/transform/types.d.ts +3 -3
  576. package/dist/services/document-service/transform/types.d.ts.map +1 -1
  577. package/dist/services/document-service/utils/populate.d.ts +9 -2
  578. package/dist/services/document-service/utils/populate.d.ts.map +1 -1
  579. package/dist/services/document-service/utils/populate.js +12 -6
  580. package/dist/services/document-service/utils/populate.js.map +1 -1
  581. package/dist/services/document-service/utils/populate.mjs +12 -6
  582. package/dist/services/document-service/utils/populate.mjs.map +1 -1
  583. package/dist/services/document-service/utils/unidirectional-relations.d.ts +36 -0
  584. package/dist/services/document-service/utils/unidirectional-relations.d.ts.map +1 -0
  585. package/dist/services/document-service/utils/unidirectional-relations.js +68 -0
  586. package/dist/services/document-service/utils/unidirectional-relations.js.map +1 -0
  587. package/dist/services/document-service/utils/unidirectional-relations.mjs +68 -0
  588. package/dist/services/document-service/utils/unidirectional-relations.mjs.map +1 -0
  589. package/dist/services/entity-service/index.d.ts +4 -6
  590. package/dist/services/entity-service/index.d.ts.map +1 -1
  591. package/dist/services/entity-service/index.js +44 -203
  592. package/dist/services/entity-service/index.js.map +1 -1
  593. package/dist/services/entity-service/index.mjs +38 -197
  594. package/dist/services/entity-service/index.mjs.map +1 -1
  595. package/dist/services/entity-validator/blocks-validator.d.ts +1 -2
  596. package/dist/services/entity-validator/blocks-validator.d.ts.map +1 -1
  597. package/dist/services/entity-validator/blocks-validator.js +4 -3
  598. package/dist/services/entity-validator/blocks-validator.js.map +1 -1
  599. package/dist/services/entity-validator/blocks-validator.mjs +3 -3
  600. package/dist/services/entity-validator/blocks-validator.mjs.map +1 -1
  601. package/dist/services/entity-validator/index.d.ts +16 -2
  602. package/dist/services/entity-validator/index.d.ts.map +1 -1
  603. package/dist/services/entity-validator/index.js +197 -130
  604. package/dist/services/entity-validator/index.js.map +1 -1
  605. package/dist/services/entity-validator/index.mjs +192 -125
  606. package/dist/services/entity-validator/index.mjs.map +1 -1
  607. package/dist/services/entity-validator/validators.d.ts +36 -25
  608. package/dist/services/entity-validator/validators.d.ts.map +1 -1
  609. package/dist/services/entity-validator/validators.js +153 -33
  610. package/dist/services/entity-validator/validators.js.map +1 -1
  611. package/dist/services/entity-validator/validators.mjs +145 -25
  612. package/dist/services/entity-validator/validators.mjs.map +1 -1
  613. package/dist/services/errors.js.map +1 -1
  614. package/dist/services/errors.mjs.map +1 -1
  615. package/dist/services/event-hub.d.ts +1 -0
  616. package/dist/services/event-hub.d.ts.map +1 -1
  617. package/dist/services/event-hub.js +9 -4
  618. package/dist/services/event-hub.js.map +1 -1
  619. package/dist/services/event-hub.mjs +9 -4
  620. package/dist/services/event-hub.mjs.map +1 -1
  621. package/dist/services/features.d.ts +3 -3
  622. package/dist/services/features.d.ts.map +1 -1
  623. package/dist/services/features.js.map +1 -1
  624. package/dist/services/features.mjs.map +1 -1
  625. package/dist/services/fs.d.ts +2 -2
  626. package/dist/services/fs.d.ts.map +1 -1
  627. package/dist/services/fs.js.map +1 -1
  628. package/dist/services/fs.mjs.map +1 -1
  629. package/dist/services/metrics/admin-user-hash.d.ts +2 -2
  630. package/dist/services/metrics/admin-user-hash.d.ts.map +1 -1
  631. package/dist/services/metrics/admin-user-hash.js.map +1 -1
  632. package/dist/services/metrics/admin-user-hash.mjs.map +1 -1
  633. package/dist/services/metrics/index.d.ts +2 -2
  634. package/dist/services/metrics/index.d.ts.map +1 -1
  635. package/dist/services/metrics/index.js +1 -2
  636. package/dist/services/metrics/index.js.map +1 -1
  637. package/dist/services/metrics/index.mjs +1 -2
  638. package/dist/services/metrics/index.mjs.map +1 -1
  639. package/dist/services/metrics/is-truthy.js.map +1 -1
  640. package/dist/services/metrics/middleware.d.ts +2 -2
  641. package/dist/services/metrics/middleware.d.ts.map +1 -1
  642. package/dist/services/metrics/middleware.js +6 -4
  643. package/dist/services/metrics/middleware.js.map +1 -1
  644. package/dist/services/metrics/middleware.mjs +6 -4
  645. package/dist/services/metrics/middleware.mjs.map +1 -1
  646. package/dist/services/metrics/rate-limiter.d.ts.map +1 -1
  647. package/dist/services/metrics/rate-limiter.js +6 -3
  648. package/dist/services/metrics/rate-limiter.js.map +1 -1
  649. package/dist/services/metrics/rate-limiter.mjs +6 -3
  650. package/dist/services/metrics/rate-limiter.mjs.map +1 -1
  651. package/dist/services/metrics/sender.d.ts +3 -3
  652. package/dist/services/metrics/sender.d.ts.map +1 -1
  653. package/dist/services/metrics/sender.js.map +1 -1
  654. package/dist/services/metrics/sender.mjs.map +1 -1
  655. package/dist/services/query-params.d.ts +7 -0
  656. package/dist/services/query-params.d.ts.map +1 -0
  657. package/dist/services/query-params.js +12 -0
  658. package/dist/services/query-params.js.map +1 -0
  659. package/dist/services/query-params.mjs +13 -0
  660. package/dist/services/query-params.mjs.map +1 -0
  661. package/dist/services/reloader.d.ts +7 -0
  662. package/dist/services/reloader.d.ts.map +1 -0
  663. package/dist/services/reloader.js +36 -0
  664. package/dist/services/reloader.js.map +1 -0
  665. package/dist/services/reloader.mjs +36 -0
  666. package/dist/services/reloader.mjs.map +1 -0
  667. package/dist/services/request-context.js.map +1 -1
  668. package/dist/services/request-context.mjs.map +1 -1
  669. package/dist/services/server/admin-api.d.ts +3 -3
  670. package/dist/services/server/admin-api.d.ts.map +1 -1
  671. package/dist/services/server/admin-api.js.map +1 -1
  672. package/dist/services/server/admin-api.mjs.map +1 -1
  673. package/dist/services/server/api.d.ts +3 -3
  674. package/dist/services/server/api.d.ts.map +1 -1
  675. package/dist/services/server/api.js.map +1 -1
  676. package/dist/services/server/api.mjs.map +1 -1
  677. package/dist/services/server/compose-endpoint.d.ts +2 -2
  678. package/dist/services/server/compose-endpoint.d.ts.map +1 -1
  679. package/dist/services/server/compose-endpoint.js +8 -9
  680. package/dist/services/server/compose-endpoint.js.map +1 -1
  681. package/dist/services/server/compose-endpoint.mjs +2 -3
  682. package/dist/services/server/compose-endpoint.mjs.map +1 -1
  683. package/dist/services/server/content-api.d.ts +3 -3
  684. package/dist/services/server/content-api.d.ts.map +1 -1
  685. package/dist/services/server/content-api.js.map +1 -1
  686. package/dist/services/server/content-api.mjs.map +1 -1
  687. package/dist/services/server/http-server.d.ts +2 -2
  688. package/dist/services/server/http-server.d.ts.map +1 -1
  689. package/dist/services/server/http-server.js.map +1 -1
  690. package/dist/services/server/http-server.mjs.map +1 -1
  691. package/dist/services/server/index.d.ts +2 -2
  692. package/dist/services/server/index.d.ts.map +1 -1
  693. package/dist/services/server/index.js +2 -3
  694. package/dist/services/server/index.js.map +1 -1
  695. package/dist/services/server/index.mjs +2 -3
  696. package/dist/services/server/index.mjs.map +1 -1
  697. package/dist/services/server/koa.d.ts.map +1 -1
  698. package/dist/services/server/koa.js +4 -4
  699. package/dist/services/server/koa.js.map +1 -1
  700. package/dist/services/server/koa.mjs +1 -1
  701. package/dist/services/server/koa.mjs.map +1 -1
  702. package/dist/services/server/middleware.d.ts +4 -4
  703. package/dist/services/server/middleware.d.ts.map +1 -1
  704. package/dist/services/server/middleware.js +3 -3
  705. package/dist/services/server/middleware.js.map +1 -1
  706. package/dist/services/server/middleware.mjs.map +1 -1
  707. package/dist/services/server/policy.d.ts +3 -3
  708. package/dist/services/server/policy.d.ts.map +1 -1
  709. package/dist/services/server/policy.js +4 -4
  710. package/dist/services/server/policy.js.map +1 -1
  711. package/dist/services/server/policy.mjs +4 -4
  712. package/dist/services/server/policy.mjs.map +1 -1
  713. package/dist/services/server/register-middlewares.d.ts +2 -2
  714. package/dist/services/server/register-middlewares.d.ts.map +1 -1
  715. package/dist/services/server/register-middlewares.js.map +1 -1
  716. package/dist/services/server/register-middlewares.mjs.map +1 -1
  717. package/dist/services/server/register-routes.d.ts +2 -2
  718. package/dist/services/server/register-routes.d.ts.map +1 -1
  719. package/dist/services/server/register-routes.js +3 -3
  720. package/dist/services/server/register-routes.js.map +1 -1
  721. package/dist/services/server/register-routes.mjs +3 -3
  722. package/dist/services/server/register-routes.mjs.map +1 -1
  723. package/dist/services/server/routing.d.ts +5 -5
  724. package/dist/services/server/routing.d.ts.map +1 -1
  725. package/dist/services/server/routing.js +2 -2
  726. package/dist/services/server/routing.js.map +1 -1
  727. package/dist/services/server/routing.mjs.map +1 -1
  728. package/dist/services/utils/dynamic-zones.d.ts.map +1 -1
  729. package/dist/services/utils/dynamic-zones.js +7 -6
  730. package/dist/services/utils/dynamic-zones.js.map +1 -1
  731. package/dist/services/utils/dynamic-zones.mjs +2 -1
  732. package/dist/services/utils/dynamic-zones.mjs.map +1 -1
  733. package/dist/services/webhook-runner.d.ts +2 -1
  734. package/dist/services/webhook-runner.d.ts.map +1 -1
  735. package/dist/services/webhook-runner.js.map +1 -1
  736. package/dist/services/webhook-runner.mjs.map +1 -1
  737. package/dist/services/webhook-store.d.ts +2 -8
  738. package/dist/services/webhook-store.d.ts.map +1 -1
  739. package/dist/services/webhook-store.js +14 -8
  740. package/dist/services/webhook-store.js.map +1 -1
  741. package/dist/services/webhook-store.mjs +14 -8
  742. package/dist/services/webhook-store.mjs.map +1 -1
  743. package/dist/services/worker-queue.js.map +1 -1
  744. package/dist/services/worker-queue.mjs.map +1 -1
  745. package/dist/utils/convert-custom-field-type.d.ts +2 -2
  746. package/dist/utils/convert-custom-field-type.d.ts.map +1 -1
  747. package/dist/utils/convert-custom-field-type.js.map +1 -1
  748. package/dist/utils/convert-custom-field-type.mjs.map +1 -1
  749. package/dist/utils/cron.js +3 -3
  750. package/dist/utils/cron.js.map +1 -1
  751. package/dist/utils/cron.mjs.map +1 -1
  752. package/dist/utils/fetch.d.ts +3 -3
  753. package/dist/utils/fetch.d.ts.map +1 -1
  754. package/dist/utils/fetch.js +4 -3
  755. package/dist/utils/fetch.js.map +1 -1
  756. package/dist/utils/fetch.mjs +4 -3
  757. package/dist/utils/fetch.mjs.map +1 -1
  758. package/dist/utils/filepath-to-prop-path.d.ts +1 -1
  759. package/dist/utils/filepath-to-prop-path.d.ts.map +1 -1
  760. package/dist/utils/filepath-to-prop-path.js +27 -6
  761. package/dist/utils/filepath-to-prop-path.js.map +1 -1
  762. package/dist/utils/filepath-to-prop-path.mjs +25 -5
  763. package/dist/utils/filepath-to-prop-path.mjs.map +1 -1
  764. package/dist/utils/index.d.ts +2 -1
  765. package/dist/utils/index.d.ts.map +1 -1
  766. package/dist/utils/is-initialized.d.ts +2 -2
  767. package/dist/utils/is-initialized.d.ts.map +1 -1
  768. package/dist/utils/is-initialized.js +4 -4
  769. package/dist/utils/is-initialized.js.map +1 -1
  770. package/dist/utils/is-initialized.mjs +1 -1
  771. package/dist/utils/is-initialized.mjs.map +1 -1
  772. package/dist/utils/load-config-file.js.map +1 -1
  773. package/dist/utils/load-config-file.mjs.map +1 -1
  774. package/dist/utils/load-files.d.ts.map +1 -1
  775. package/dist/utils/load-files.js +1 -2
  776. package/dist/utils/load-files.js.map +1 -1
  777. package/dist/utils/load-files.mjs +1 -2
  778. package/dist/utils/load-files.mjs.map +1 -1
  779. package/dist/utils/open-browser.d.ts +2 -2
  780. package/dist/utils/open-browser.d.ts.map +1 -1
  781. package/dist/utils/open-browser.js.map +1 -1
  782. package/dist/utils/open-browser.mjs.map +1 -1
  783. package/dist/utils/resolve-working-dirs.d.ts +19 -0
  784. package/dist/utils/resolve-working-dirs.d.ts.map +1 -0
  785. package/dist/utils/resolve-working-dirs.js +13 -0
  786. package/dist/utils/resolve-working-dirs.js.map +1 -0
  787. package/dist/utils/resolve-working-dirs.mjs +11 -0
  788. package/dist/utils/resolve-working-dirs.mjs.map +1 -0
  789. package/dist/utils/signals.d.ts +2 -2
  790. package/dist/utils/signals.d.ts.map +1 -1
  791. package/dist/utils/signals.js.map +1 -1
  792. package/dist/utils/signals.mjs.map +1 -1
  793. package/dist/utils/startup-logger.d.ts +2 -2
  794. package/dist/utils/startup-logger.d.ts.map +1 -1
  795. package/dist/utils/startup-logger.js +10 -5
  796. package/dist/utils/startup-logger.js.map +1 -1
  797. package/dist/utils/startup-logger.mjs +9 -4
  798. package/dist/utils/startup-logger.mjs.map +1 -1
  799. package/dist/utils/transform-content-types-to-models.d.ts +377 -90
  800. package/dist/utils/transform-content-types-to-models.d.ts.map +1 -1
  801. package/dist/utils/transform-content-types-to-models.js +112 -61
  802. package/dist/utils/transform-content-types-to-models.js.map +1 -1
  803. package/dist/utils/transform-content-types-to-models.mjs +111 -60
  804. package/dist/utils/transform-content-types-to-models.mjs.map +1 -1
  805. package/dist/utils/update-notifier/index.d.ts +2 -7
  806. package/dist/utils/update-notifier/index.d.ts.map +1 -1
  807. package/dist/utils/update-notifier/index.js +11 -14
  808. package/dist/utils/update-notifier/index.js.map +1 -1
  809. package/dist/utils/update-notifier/index.mjs +11 -14
  810. package/dist/utils/update-notifier/index.mjs.map +1 -1
  811. package/package.json +36 -33
  812. package/dist/registries/config.d.ts +0 -4
  813. package/dist/registries/config.d.ts.map +0 -1
  814. package/dist/registries/config.js +0 -31
  815. package/dist/registries/config.js.map +0 -1
  816. package/dist/registries/config.mjs +0 -32
  817. package/dist/registries/config.mjs.map +0 -1
  818. package/dist/services/document-service/middlewares.d.ts +0 -8
  819. package/dist/services/document-service/middlewares.d.ts.map +0 -1
  820. package/dist/services/document-service/middlewares.js.map +0 -1
  821. package/dist/services/document-service/middlewares.mjs.map +0 -1
  822. package/dist/services/document-service/transform/filters.d.ts +0 -3
  823. package/dist/services/document-service/transform/filters.d.ts.map +0 -1
  824. package/dist/services/document-service/transform/relations/transform/output-ids.d.ts +0 -4
  825. package/dist/services/document-service/transform/relations/transform/output-ids.d.ts.map +0 -1
  826. package/dist/services/document-service/transform/relations/utils/data.js +0 -12
  827. package/dist/services/document-service/transform/relations/utils/data.js.map +0 -1
  828. package/dist/services/document-service/transform/relations/utils/data.mjs +0 -12
  829. package/dist/services/document-service/transform/relations/utils/data.mjs.map +0 -1
  830. package/dist/services/document-service/transform/sort.d.ts +0 -5
  831. package/dist/services/document-service/transform/sort.d.ts.map +0 -1
  832. package/dist/services/document-service/transform/utils.d.ts +0 -9
  833. package/dist/services/document-service/transform/utils.d.ts.map +0 -1
  834. package/dist/services/entity-service/attributes/index.d.ts +0 -6
  835. package/dist/services/entity-service/attributes/index.d.ts.map +0 -1
  836. package/dist/services/entity-service/attributes/index.js.map +0 -1
  837. package/dist/services/entity-service/attributes/index.mjs.map +0 -1
  838. package/dist/services/entity-service/attributes/transforms.d.ts +0 -10
  839. package/dist/services/entity-service/attributes/transforms.d.ts.map +0 -1
  840. package/dist/services/entity-service/attributes/transforms.js.map +0 -1
  841. package/dist/services/entity-service/attributes/transforms.mjs.map +0 -1
  842. package/dist/services/entity-service/components.d.ts +0 -23
  843. package/dist/services/entity-service/components.d.ts.map +0 -1
  844. package/dist/services/entity-service/components.js.map +0 -1
  845. package/dist/services/entity-service/components.mjs.map +0 -1
  846. package/dist/services/entity-service/params.d.ts +0 -8
  847. package/dist/services/entity-service/params.d.ts.map +0 -1
  848. package/dist/services/entity-service/params.js.map +0 -1
  849. package/dist/services/entity-service/params.mjs.map +0 -1
  850. package/dist/services/utils/upload-files.d.ts +0 -8
  851. package/dist/services/utils/upload-files.d.ts.map +0 -1
  852. package/dist/services/utils/upload-files.js +0 -64
  853. package/dist/services/utils/upload-files.js.map +0 -1
  854. package/dist/services/utils/upload-files.mjs +0 -63
  855. package/dist/services/utils/upload-files.mjs.map +0 -1
  856. package/dist/utils/get-dirs.d.ts +0 -9
  857. package/dist/utils/get-dirs.d.ts.map +0 -1
  858. package/dist/utils/get-dirs.js.map +0 -1
  859. package/dist/utils/get-dirs.mjs.map +0 -1
  860. /package/dist/services/{entity-service → document-service}/attributes/transforms.mjs +0 -0
  861. /package/dist/services/{entity-service → document-service}/params.mjs +0 -0
package/dist/Strapi.js CHANGED
@@ -1,163 +1,140 @@
1
1
  "use strict";
2
+ const globalAgent = require("global-agent");
2
3
  const path = require("path");
3
4
  const _ = require("lodash");
4
- const _$1 = require("lodash/fp");
5
+ const fp = require("lodash/fp");
5
6
  const logger = require("@strapi/logger");
6
7
  const database = require("@strapi/database");
7
- const strapiUtils = require("@strapi/utils");
8
+ const tsUtils = require("@strapi/typescript-utils");
8
9
  const index = require("./configuration/index.js");
9
10
  const factories = require("./factories.js");
10
- const compile = require("./compile.js");
11
11
  const openBrowser = require("./utils/open-browser.js");
12
12
  const isInitialized = require("./utils/is-initialized.js");
13
- const getDirs = require("./utils/get-dirs.js");
14
- const index$6 = require("./ee/index.js");
15
- const index$5 = require("./utils/update-notifier/index.js");
13
+ const index$2 = require("./ee/index.js");
14
+ require("./utils/update-notifier/index.js");
16
15
  const fetch = require("./utils/fetch.js");
17
16
  const convertCustomFieldType = require("./utils/convert-custom-field-type.js");
18
17
  const startupLogger = require("./utils/startup-logger.js");
19
18
  const transformContentTypesToModels = require("./utils/transform-content-types-to-models.js");
20
- const signals = require("./utils/signals.js");
21
19
  const lifecycles = require("./utils/lifecycles.js");
22
- const contentTypes = require("./registries/content-types.js");
23
- const components = require("./registries/components.js");
24
- const services = require("./registries/services.js");
25
- const policies = require("./registries/policies.js");
26
- const middlewares = require("./registries/middlewares.js");
27
- const hooks = require("./registries/hooks.js");
28
- const controllers = require("./registries/controllers.js");
29
- const modules = require("./registries/modules.js");
30
- const plugins = require("./registries/plugins.js");
31
- const customFields = require("./registries/custom-fields.js");
32
- const config = require("./registries/config.js");
33
- const apis = require("./registries/apis.js");
34
- const sanitizers = require("./registries/sanitizers.js");
35
- const validators = require("./registries/validators.js");
36
- const models = require("./registries/models.js");
37
- const index$7 = require("./loaders/index.js");
20
+ require("node:path");
38
21
  const container = require("./container.js");
39
22
  const fs = require("./services/fs.js");
40
23
  const eventHub = require("./services/event-hub.js");
41
- const index$3 = require("./services/server/index.js");
42
- const webhookRunner = require("./services/webhook-runner.js");
43
- const webhookStore = require("./services/webhook-store.js");
44
- const coreStore = require("./services/core-store.js");
45
- const index$9 = require("./services/entity-service/index.js");
46
- const cron = require("./services/cron.js");
47
- const index$8 = require("./services/entity-validator/index.js");
48
- const index$4 = require("./services/metrics/index.js");
24
+ const index$5 = require("./services/server/index.js");
25
+ const reloader = require("./services/reloader.js");
26
+ const index$1 = require("./providers/index.js");
27
+ const index$7 = require("./services/entity-service/index.js");
28
+ const queryParams = require("./services/query-params.js");
29
+ const index$6 = require("./services/entity-validator/index.js");
49
30
  const requestContext = require("./services/request-context.js");
50
- const index$2 = require("./services/auth/index.js");
51
- const customFields$1 = require("./services/custom-fields.js");
52
- const index$1 = require("./services/content-api/index.js");
31
+ const index$4 = require("./services/auth/index.js");
32
+ const customFields = require("./services/custom-fields.js");
33
+ const index$3 = require("./services/content-api/index.js");
53
34
  const dynamicZones = require("./services/utils/dynamic-zones.js");
54
35
  const features = require("./services/features.js");
55
- const index$a = require("./services/document-service/index.js");
56
- const draftPublish = require("./migrations/draft-publish.js");
36
+ const index$8 = require("./services/document-service/index.js");
37
+ const coreStore = require("./services/core-store.js");
38
+ const config = require("./services/config.js");
57
39
  const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
58
- const path__default = /* @__PURE__ */ _interopDefault(path);
59
- const ___default = /* @__PURE__ */ _interopDefault(_);
60
- const resolveWorkingDirectories = (opts) => {
61
- const cwd = process.cwd();
62
- const appDir = opts.appDir ? path__default.default.resolve(cwd, opts.appDir) : cwd;
63
- const distDir = opts.distDir ? path__default.default.resolve(cwd, opts.distDir) : appDir;
64
- return { app: appDir, dist: distDir };
65
- };
66
- const reloader = (strapi) => {
67
- const state = {
68
- shouldReload: 0,
69
- isWatching: true
70
- };
71
- function reload() {
72
- if (state.shouldReload > 0) {
73
- state.shouldReload -= 1;
74
- reload.isReloading = false;
75
- return;
76
- }
77
- if (strapi.config.get("autoReload")) {
78
- process.send?.("reload");
79
- }
80
- }
81
- Object.defineProperty(reload, "isWatching", {
82
- configurable: true,
83
- enumerable: true,
84
- set(value) {
85
- if (state.isWatching === false && value === true) {
86
- state.shouldReload += 1;
40
+ function _interopNamespace(e) {
41
+ if (e && e.__esModule) return e;
42
+ const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
43
+ if (e) {
44
+ for (const k in e) {
45
+ if (k !== "default") {
46
+ const d = Object.getOwnPropertyDescriptor(e, k);
47
+ Object.defineProperty(n, k, d.get ? d : {
48
+ enumerable: true,
49
+ get: () => e[k]
50
+ });
87
51
  }
88
- state.isWatching = value;
89
- },
90
- get() {
91
- return state.isWatching;
92
52
  }
93
- });
94
- reload.isReloading = false;
95
- reload.isWatching = true;
96
- return reload;
97
- };
53
+ }
54
+ n.default = e;
55
+ return Object.freeze(n);
56
+ }
57
+ const globalAgent__namespace = /* @__PURE__ */ _interopNamespace(globalAgent);
58
+ const path__default = /* @__PURE__ */ _interopDefault(path);
59
+ const ___default = /* @__PURE__ */ _interopDefault(_);
60
+ const tsUtils__default = /* @__PURE__ */ _interopDefault(tsUtils);
98
61
  class Strapi extends container.Container {
99
- server;
100
- log;
101
- fs;
102
- eventHub;
103
- startupLogger;
104
- cron;
105
- webhookRunner;
106
- webhookStore;
107
- store;
108
- entityValidator;
109
- entityService;
110
- documents;
111
- telemetry;
112
- requestContext;
113
- customFields;
114
- fetch;
115
- dirs;
116
- admin;
117
- isLoaded;
118
- db;
119
62
  app;
120
- EE;
121
- reload;
122
- features;
123
- // @ts-expect-error - Assigned in constructor
124
- ee;
125
- constructor(opts = {}) {
63
+ isLoaded = false;
64
+ internal_config = {};
65
+ constructor(opts) {
126
66
  super();
127
- signals.destroyOnSignal(this);
128
- const rootDirs = resolveWorkingDirectories(opts);
129
- const appConfig = index(rootDirs, opts);
130
- this.add("config", config(appConfig, this)).add("content-types", contentTypes()).add("components", components()).add("services", services(this)).add("policies", policies()).add("middlewares", middlewares()).add("hooks", hooks()).add("controllers", controllers(this)).add("modules", modules(this)).add("plugins", plugins(this)).add("custom-fields", customFields(this)).add("apis", apis(this)).add("sanitizers", sanitizers()).add("validators", validators()).add("content-api", index$1(this)).add("auth", index$2()).add("models", models.registry());
131
- this.dirs = getDirs.getDirs(rootDirs, { strapi: this });
132
- this.isLoaded = false;
133
- this.reload = reloader(this);
134
- this.server = index$3.createServer(this);
135
- this.fs = fs(this);
136
- this.eventHub = eventHub();
137
- this.startupLogger = startupLogger.createStartupLogger(this);
138
- const logLevel = this.config.get(
139
- "server.logger.config",
140
- this.config.get("logger", { level: "info" })
141
- );
142
- this.log = logger.createLogger(logLevel);
143
- this.cron = cron();
144
- this.telemetry = index$4(this);
145
- this.requestContext = requestContext;
146
- this.customFields = customFields$1(this);
147
- this.fetch = fetch.createStrapiFetch(this);
148
- this.features = features.createFeaturesService(this);
149
- index$5.createUpdateNotifier(this).notify();
150
- Object.defineProperty(this, "EE", {
151
- get: () => {
152
- index$6.init(this.dirs.app.root, this.log);
153
- return index$6.isEE;
154
- },
155
- configurable: false
156
- });
157
- Object.defineProperty(this, "ee", {
158
- get: () => index$6,
159
- configurable: false
160
- });
67
+ this.internal_config = index.loadConfiguration(opts);
68
+ this.registerInternalServices();
69
+ for (const provider of index$1.providers) {
70
+ provider.init?.(this);
71
+ }
72
+ }
73
+ get admin() {
74
+ return this.get("admin");
75
+ }
76
+ get EE() {
77
+ return index$2.isEE;
78
+ }
79
+ get ee() {
80
+ return index$2;
81
+ }
82
+ get dirs() {
83
+ return this.config.get("dirs");
84
+ }
85
+ get reload() {
86
+ return this.get("reload");
87
+ }
88
+ get db() {
89
+ return this.get("db");
90
+ }
91
+ get requestContext() {
92
+ return this.get("requestContext");
93
+ }
94
+ get customFields() {
95
+ return this.get("customFields");
96
+ }
97
+ get entityValidator() {
98
+ return this.get("entityValidator");
99
+ }
100
+ /**
101
+ * @deprecated `strapi.entityService` will be removed in the next major version
102
+ */
103
+ get entityService() {
104
+ return this.get("entityService");
105
+ }
106
+ get documents() {
107
+ return this.get("documents");
108
+ }
109
+ get features() {
110
+ return this.get("features");
111
+ }
112
+ get fetch() {
113
+ return this.get("fetch");
114
+ }
115
+ get cron() {
116
+ return this.get("cron");
117
+ }
118
+ get log() {
119
+ return this.get("logger");
120
+ }
121
+ get startupLogger() {
122
+ return this.get("startupLogger");
123
+ }
124
+ get eventHub() {
125
+ return this.get("eventHub");
126
+ }
127
+ get fs() {
128
+ return this.get("fs");
129
+ }
130
+ get server() {
131
+ return this.get("server");
132
+ }
133
+ get telemetry() {
134
+ return this.get("telemetry");
135
+ }
136
+ get store() {
137
+ return this.get("coreStore");
161
138
  }
162
139
  get config() {
163
140
  return this.get("config");
@@ -207,12 +184,12 @@ class Strapi extends container.Container {
207
184
  hook(name) {
208
185
  return this.get("hooks").get(name);
209
186
  }
210
- // api(name) {
211
- // return this.get('apis').get(name);
212
- // }
213
- get api() {
187
+ get apis() {
214
188
  return this.get("apis").getAll();
215
189
  }
190
+ api(name) {
191
+ return this.get("apis").get(name);
192
+ }
216
193
  get auth() {
217
194
  return this.get("auth");
218
195
  }
@@ -236,15 +213,31 @@ class Strapi extends container.Container {
236
213
  return this.stopWithError(error);
237
214
  }
238
215
  }
239
- async destroy() {
240
- await this.server.destroy();
241
- await this.runLifecyclesFunctions(lifecycles.LIFECYCLES.DESTROY);
242
- this.eventHub.destroy();
243
- await this.db?.destroy();
244
- this.telemetry.destroy();
245
- this.cron.destroy();
246
- process.removeAllListeners();
247
- delete global.strapi;
216
+ // TODO: split into more providers
217
+ registerInternalServices() {
218
+ const config$1 = config.createConfigProvider(this.internal_config, this);
219
+ const logger$1 = logger.createLogger({
220
+ level: "http",
221
+ // Strapi defaults to level 'http'
222
+ ...config$1.get("logger"),
223
+ // DEPRECATED
224
+ ...config$1.get("server.logger.config")
225
+ });
226
+ this.add("config", () => config$1).add("query-params", queryParams(this)).add("content-api", index$3(this)).add("auth", index$4()).add("server", () => index$5.createServer(this)).add("fs", () => fs(this)).add("eventHub", () => eventHub()).add("startupLogger", () => startupLogger.createStartupLogger(this)).add("logger", () => logger$1).add("fetch", () => fetch.createStrapiFetch(this)).add("features", () => features.createFeaturesService(this)).add("requestContext", requestContext).add("customFields", customFields(this)).add("entityValidator", index$6).add("entityService", () => index$7({ strapi: this, db: this.db })).add("documents", () => index$8.createDocumentService(this)).add("db", () => {
227
+ const tsDir = tsUtils__default.default.resolveOutDirSync(this.dirs.app.root);
228
+ const tsMigrationsEnabled = this.config.get("database.settings.useTypescriptMigrations") === true && tsDir;
229
+ const projectDir = tsMigrationsEnabled ? tsDir : this.dirs.app.root;
230
+ return new database.Database(
231
+ ___default.default.merge(this.config.get("database"), {
232
+ logger: logger$1,
233
+ settings: {
234
+ migrations: {
235
+ dir: path__default.default.join(projectDir, "database/migrations")
236
+ }
237
+ }
238
+ })
239
+ );
240
+ }).add("reload", () => reloader.createReloader(this));
248
241
  }
249
242
  sendStartupTelemetry() {
250
243
  this.telemetry.send("didStartServer", {
@@ -279,6 +272,7 @@ class Strapi extends container.Container {
279
272
  async postListen() {
280
273
  const isInitialized$1 = await isInitialized.isInitialized(this);
281
274
  this.startupLogger.logStartupMessage({ isInitialized: isInitialized$1 });
275
+ this.log.info("Strapi started successfully");
282
276
  this.sendStartupTelemetry();
283
277
  this.openAdmin({ isInitialized: isInitialized$1 });
284
278
  }
@@ -319,51 +313,32 @@ class Strapi extends container.Container {
319
313
  }
320
314
  process.exit(exitCode);
321
315
  }
322
- registerInternalHooks() {
323
- this.get("hooks").set("strapi::content-types.beforeSync", strapiUtils.hooks.createAsyncParallelHook());
324
- this.get("hooks").set("strapi::content-types.afterSync", strapiUtils.hooks.createAsyncParallelHook());
325
- this.hook("strapi::content-types.beforeSync").register(draftPublish.disable);
326
- this.hook("strapi::content-types.afterSync").register(draftPublish.enable);
316
+ async load() {
317
+ await this.register();
318
+ await this.bootstrap();
319
+ this.isLoaded = true;
320
+ return this;
327
321
  }
328
322
  async register() {
329
- await index$7.loadApplicationContext(this);
330
- this.get("models").add(coreStore.coreStoreModel).add(webhookStore.webhookModel);
331
- this.webhookRunner = webhookRunner({
332
- eventHub: this.eventHub,
333
- logger: this.log,
334
- configuration: this.config.get("server.webhooks", {}),
335
- fetch: this.fetch
336
- });
337
- this.registerInternalHooks();
338
- this.telemetry.register();
339
- await this.runLifecyclesFunctions(lifecycles.LIFECYCLES.REGISTER);
323
+ this.ee.init(this.dirs.app.root, this.log);
324
+ for (const provider of index$1.providers) {
325
+ await provider.register?.(this);
326
+ }
327
+ await this.runPluginsLifecycles(lifecycles.LIFECYCLES.REGISTER);
328
+ await this.runUserLifecycles(lifecycles.LIFECYCLES.REGISTER);
340
329
  convertCustomFieldType.convertCustomFieldType(this);
341
330
  return this;
342
331
  }
343
332
  async bootstrap() {
344
- const models2 = [
345
- ...transformContentTypesToModels.transformContentTypesToModels([
346
- ...Object.values(this.contentTypes),
347
- ...Object.values(this.components)
348
- ]),
333
+ this.configureGlobalProxy();
334
+ const models = [
335
+ ...transformContentTypesToModels.transformContentTypesToModels(
336
+ [...Object.values(this.contentTypes), ...Object.values(this.components)],
337
+ this.db.metadata.identifiers
338
+ ),
349
339
  ...this.get("models").get()
350
340
  ];
351
- this.db = await database.Database.init({ ...this.config.get("database"), models: models2 });
352
- this.store = coreStore.createCoreStore({ db: this.db });
353
- this.webhookStore = webhookStore.createWebhookStore({ db: this.db });
354
- this.entityValidator = index$8;
355
- this.entityService = index$9({
356
- strapi: this,
357
- db: this.db,
358
- eventHub: this.eventHub,
359
- entityValidator: this.entityValidator
360
- });
361
- this.documents = index$a.createDocumentService(this);
362
- if (this.config.get("server.cron.enabled", true)) {
363
- const cronTasks = this.config.get("server.cron.tasks", {});
364
- this.cron.add(cronTasks);
365
- }
366
- this.telemetry.bootstrap();
341
+ await this.db.init({ models });
367
342
  let oldContentTypes;
368
343
  if (await this.db.getSchemaConnection().hasTable(coreStore.coreStoreModel.tableName)) {
369
344
  oldContentTypes = await this.store.get({
@@ -376,9 +351,12 @@ class Strapi extends container.Container {
376
351
  oldContentTypes,
377
352
  contentTypes: this.contentTypes
378
353
  });
379
- await this.db.schema.sync();
354
+ const status = await this.db.schema.sync();
355
+ if (status === "CHANGED") {
356
+ await this.db.repair.removeOrphanMorphType({ pivot: "component_type" });
357
+ }
380
358
  if (this.EE) {
381
- await index$6.checkLicense({ strapi: this });
359
+ await index$2.checkLicense({ strapi: this });
382
360
  }
383
361
  await this.hook("strapi::content-types.afterSync").call({
384
362
  oldContentTypes,
@@ -390,37 +368,53 @@ class Strapi extends container.Container {
390
368
  key: "schema",
391
369
  value: this.contentTypes
392
370
  });
393
- await this.startWebhooks();
394
371
  await this.server.initMiddlewares();
395
372
  this.server.initRouting();
396
373
  await this.contentAPI.permissions.registerActions();
397
- await this.runLifecyclesFunctions(lifecycles.LIFECYCLES.BOOTSTRAP);
398
- this.cron.start();
399
- return this;
400
- }
401
- async load() {
402
- await this.register();
403
- await this.bootstrap();
404
- this.isLoaded = true;
374
+ await this.runPluginsLifecycles(lifecycles.LIFECYCLES.BOOTSTRAP);
375
+ for (const provider of index$1.providers) {
376
+ await provider.bootstrap?.(this);
377
+ }
378
+ await this.runUserLifecycles(lifecycles.LIFECYCLES.BOOTSTRAP);
405
379
  return this;
406
380
  }
407
- async startWebhooks() {
408
- const webhooks = await this.webhookStore?.findWebhooks();
409
- if (!webhooks) {
381
+ configureGlobalProxy() {
382
+ const globalProxy = this.config.get("server.proxy.global");
383
+ const httpProxy = this.config.get("server.proxy.http") || globalProxy;
384
+ const httpsProxy = this.config.get("server.proxy.https") || globalProxy;
385
+ if (!httpProxy && !httpsProxy) {
410
386
  return;
411
387
  }
412
- for (const webhook of webhooks) {
413
- this.webhookRunner?.add(webhook);
388
+ globalAgent__namespace.bootstrap();
389
+ if (httpProxy) {
390
+ this.log.info(`Using HTTP proxy: ${httpProxy}`);
391
+ global.GLOBAL_AGENT.HTTP_PROXY = httpProxy;
392
+ }
393
+ if (httpsProxy) {
394
+ this.log.info(`Using HTTPS proxy: ${httpsProxy}`);
395
+ global.GLOBAL_AGENT.HTTPS_PROXY = httpsProxy;
414
396
  }
415
397
  }
416
- async runLifecyclesFunctions(lifecycleName) {
417
- await this.get("modules")[lifecycleName]();
418
- const adminLifecycleFunction = this.admin && this.admin[lifecycleName];
419
- if (_$1.isFunction(adminLifecycleFunction)) {
420
- await adminLifecycleFunction({ strapi: this });
398
+ async destroy() {
399
+ this.log.info("Shutting down Strapi");
400
+ await this.runPluginsLifecycles(lifecycles.LIFECYCLES.DESTROY);
401
+ for (const provider of index$1.providers) {
402
+ await provider.destroy?.(this);
421
403
  }
404
+ await this.runUserLifecycles(lifecycles.LIFECYCLES.DESTROY);
405
+ await this.server.destroy();
406
+ this.eventHub.destroy();
407
+ await this.db?.destroy();
408
+ process.removeAllListeners();
409
+ delete global.strapi;
410
+ this.log.info("Strapi has been shut down");
411
+ }
412
+ async runPluginsLifecycles(lifecycleName) {
413
+ await this.get("modules")[lifecycleName]();
414
+ }
415
+ async runUserLifecycles(lifecycleName) {
422
416
  const userLifecycleFunction = this.app && this.app[lifecycleName];
423
- if (_$1.isFunction(userLifecycleFunction)) {
417
+ if (fp.isFunction(userLifecycleFunction)) {
424
418
  await userLifecycleFunction({ strapi: this });
425
419
  }
426
420
  }
@@ -433,18 +427,11 @@ class Strapi extends container.Container {
433
427
  }
434
428
  }
435
429
  /**
436
- * Binds queries with a specific model
437
- * @param {string} uid
430
+ * @deprecated Use `strapi.db.query` instead
438
431
  */
439
432
  query(uid) {
440
433
  return this.db.query(uid);
441
434
  }
442
435
  }
443
- const initFn = (options = {}) => {
444
- const strapi = new Strapi(options);
445
- global.strapi = strapi;
446
- return strapi;
447
- };
448
- const init = Object.assign(initFn, { factories, compile });
449
- module.exports = init;
436
+ module.exports = Strapi;
450
437
  //# sourceMappingURL=Strapi.js.map