@strapi/core 0.0.0-experimental.15989d13d8be058bf37afc84b7a8377ef1da3263 → 0.0.0-experimental.16a6ec52546a0c189b42121e51a744fd04fc0d65

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 (689) hide show
  1. package/dist/configuration/index.d.ts.map +1 -1
  2. package/dist/ee/index.d.ts +1 -0
  3. package/dist/ee/index.d.ts.map +1 -1
  4. package/dist/ee/license.d.ts.map +1 -1
  5. package/dist/index.js +10116 -27
  6. package/dist/index.js.map +1 -1
  7. package/dist/index.mjs +10094 -29
  8. package/dist/index.mjs.map +1 -1
  9. package/dist/middlewares/body.d.ts.map +1 -1
  10. package/dist/migrations/database/5.0.0-discard-drafts.d.ts +2 -2
  11. package/dist/migrations/database/5.0.0-discard-drafts.d.ts.map +1 -1
  12. package/dist/migrations/draft-publish.d.ts +1 -1
  13. package/dist/migrations/draft-publish.d.ts.map +1 -1
  14. package/dist/services/document-service/components.d.ts.map +1 -1
  15. package/dist/services/document-service/draft-and-publish.d.ts +1 -1
  16. package/dist/services/document-service/draft-and-publish.d.ts.map +1 -1
  17. package/dist/services/document-service/events.d.ts +1 -1
  18. package/dist/services/document-service/events.d.ts.map +1 -1
  19. package/dist/services/document-service/repository.d.ts.map +1 -1
  20. package/dist/services/document-service/transform/id-map.d.ts +1 -1
  21. package/dist/services/document-service/transform/id-map.d.ts.map +1 -1
  22. package/dist/services/document-service/transform/id-transform.d.ts +1 -1
  23. package/dist/services/document-service/transform/id-transform.d.ts.map +1 -1
  24. package/dist/services/document-service/transform/relations/extract/data-ids.d.ts +1 -1
  25. package/dist/services/document-service/transform/relations/extract/data-ids.d.ts.map +1 -1
  26. package/dist/services/document-service/transform/relations/utils/dp.d.ts +1 -1
  27. package/dist/services/document-service/transform/relations/utils/dp.d.ts.map +1 -1
  28. package/dist/services/document-service/transform/relations/utils/i18n.d.ts +1 -1
  29. package/dist/services/document-service/transform/relations/utils/i18n.d.ts.map +1 -1
  30. package/dist/services/document-service/utils/bidirectional-relations.d.ts +95 -0
  31. package/dist/services/document-service/utils/bidirectional-relations.d.ts.map +1 -0
  32. package/dist/services/document-service/utils/populate.d.ts +1 -1
  33. package/dist/services/document-service/utils/populate.d.ts.map +1 -1
  34. package/dist/services/document-service/utils/unidirectional-relations.d.ts +1 -1
  35. package/dist/services/document-service/utils/unidirectional-relations.d.ts.map +1 -1
  36. package/dist/services/entity-validator/index.d.ts +1 -1
  37. package/dist/services/entity-validator/index.d.ts.map +1 -1
  38. package/dist/services/metrics/middleware.d.ts.map +1 -1
  39. package/dist/services/metrics/rate-limiter.d.ts.map +1 -1
  40. package/dist/utils/update-notifier/index.d.ts.map +1 -1
  41. package/package.json +25 -26
  42. package/dist/Strapi.js +0 -437
  43. package/dist/Strapi.js.map +0 -1
  44. package/dist/Strapi.mjs +0 -416
  45. package/dist/Strapi.mjs.map +0 -1
  46. package/dist/compile.js +0 -18
  47. package/dist/compile.js.map +0 -1
  48. package/dist/compile.mjs +0 -17
  49. package/dist/compile.mjs.map +0 -1
  50. package/dist/configuration/config-loader.js +0 -105
  51. package/dist/configuration/config-loader.js.map +0 -1
  52. package/dist/configuration/config-loader.mjs +0 -103
  53. package/dist/configuration/config-loader.mjs.map +0 -1
  54. package/dist/configuration/get-dirs.js +0 -31
  55. package/dist/configuration/get-dirs.js.map +0 -1
  56. package/dist/configuration/get-dirs.mjs +0 -31
  57. package/dist/configuration/get-dirs.mjs.map +0 -1
  58. package/dist/configuration/index.js +0 -85
  59. package/dist/configuration/index.js.map +0 -1
  60. package/dist/configuration/index.mjs +0 -80
  61. package/dist/configuration/index.mjs.map +0 -1
  62. package/dist/configuration/urls.js +0 -68
  63. package/dist/configuration/urls.js.map +0 -1
  64. package/dist/configuration/urls.mjs +0 -66
  65. package/dist/configuration/urls.mjs.map +0 -1
  66. package/dist/container.js +0 -30
  67. package/dist/container.js.map +0 -1
  68. package/dist/container.mjs +0 -30
  69. package/dist/container.mjs.map +0 -1
  70. package/dist/core-api/controller/collection-type.js +0 -84
  71. package/dist/core-api/controller/collection-type.js.map +0 -1
  72. package/dist/core-api/controller/collection-type.mjs +0 -84
  73. package/dist/core-api/controller/collection-type.mjs.map +0 -1
  74. package/dist/core-api/controller/index.js +0 -52
  75. package/dist/core-api/controller/index.js.map +0 -1
  76. package/dist/core-api/controller/index.mjs +0 -52
  77. package/dist/core-api/controller/index.mjs.map +0 -1
  78. package/dist/core-api/controller/single-type.js +0 -46
  79. package/dist/core-api/controller/single-type.js.map +0 -1
  80. package/dist/core-api/controller/single-type.mjs +0 -46
  81. package/dist/core-api/controller/single-type.mjs.map +0 -1
  82. package/dist/core-api/controller/transform.js +0 -76
  83. package/dist/core-api/controller/transform.js.map +0 -1
  84. package/dist/core-api/controller/transform.mjs +0 -76
  85. package/dist/core-api/controller/transform.mjs.map +0 -1
  86. package/dist/core-api/routes/index.js +0 -67
  87. package/dist/core-api/routes/index.js.map +0 -1
  88. package/dist/core-api/routes/index.mjs +0 -67
  89. package/dist/core-api/routes/index.mjs.map +0 -1
  90. package/dist/core-api/service/collection-type.js +0 -67
  91. package/dist/core-api/service/collection-type.js.map +0 -1
  92. package/dist/core-api/service/collection-type.mjs +0 -67
  93. package/dist/core-api/service/collection-type.mjs.map +0 -1
  94. package/dist/core-api/service/core-service.js +0 -12
  95. package/dist/core-api/service/core-service.js.map +0 -1
  96. package/dist/core-api/service/core-service.mjs +0 -12
  97. package/dist/core-api/service/core-service.mjs.map +0 -1
  98. package/dist/core-api/service/index.js +0 -16
  99. package/dist/core-api/service/index.js.map +0 -1
  100. package/dist/core-api/service/index.mjs +0 -16
  101. package/dist/core-api/service/index.mjs.map +0 -1
  102. package/dist/core-api/service/pagination.js +0 -52
  103. package/dist/core-api/service/pagination.js.map +0 -1
  104. package/dist/core-api/service/pagination.mjs +0 -52
  105. package/dist/core-api/service/pagination.mjs.map +0 -1
  106. package/dist/core-api/service/single-type.js +0 -45
  107. package/dist/core-api/service/single-type.js.map +0 -1
  108. package/dist/core-api/service/single-type.mjs +0 -45
  109. package/dist/core-api/service/single-type.mjs.map +0 -1
  110. package/dist/domain/content-type/index.js +0 -111
  111. package/dist/domain/content-type/index.js.map +0 -1
  112. package/dist/domain/content-type/index.mjs +0 -109
  113. package/dist/domain/content-type/index.mjs.map +0 -1
  114. package/dist/domain/content-type/validator.js +0 -77
  115. package/dist/domain/content-type/validator.js.map +0 -1
  116. package/dist/domain/content-type/validator.mjs +0 -75
  117. package/dist/domain/content-type/validator.mjs.map +0 -1
  118. package/dist/domain/module/index.js +0 -107
  119. package/dist/domain/module/index.js.map +0 -1
  120. package/dist/domain/module/index.mjs +0 -105
  121. package/dist/domain/module/index.mjs.map +0 -1
  122. package/dist/domain/module/validation.js +0 -25
  123. package/dist/domain/module/validation.js.map +0 -1
  124. package/dist/domain/module/validation.mjs +0 -25
  125. package/dist/domain/module/validation.mjs.map +0 -1
  126. package/dist/ee/index.js +0 -158
  127. package/dist/ee/index.js.map +0 -1
  128. package/dist/ee/index.mjs +0 -159
  129. package/dist/ee/index.mjs.map +0 -1
  130. package/dist/ee/license.js +0 -91
  131. package/dist/ee/license.js.map +0 -1
  132. package/dist/ee/license.mjs +0 -88
  133. package/dist/ee/license.mjs.map +0 -1
  134. package/dist/factories.js +0 -80
  135. package/dist/factories.js.map +0 -1
  136. package/dist/factories.mjs +0 -80
  137. package/dist/factories.mjs.map +0 -1
  138. package/dist/loaders/admin.js +0 -26
  139. package/dist/loaders/admin.js.map +0 -1
  140. package/dist/loaders/admin.mjs +0 -25
  141. package/dist/loaders/admin.mjs.map +0 -1
  142. package/dist/loaders/apis.js +0 -137
  143. package/dist/loaders/apis.js.map +0 -1
  144. package/dist/loaders/apis.mjs +0 -135
  145. package/dist/loaders/apis.mjs.map +0 -1
  146. package/dist/loaders/components.js +0 -38
  147. package/dist/loaders/components.js.map +0 -1
  148. package/dist/loaders/components.mjs +0 -37
  149. package/dist/loaders/components.mjs.map +0 -1
  150. package/dist/loaders/index.js +0 -24
  151. package/dist/loaders/index.js.map +0 -1
  152. package/dist/loaders/index.mjs +0 -24
  153. package/dist/loaders/index.mjs.map +0 -1
  154. package/dist/loaders/middlewares.js +0 -31
  155. package/dist/loaders/middlewares.js.map +0 -1
  156. package/dist/loaders/middlewares.mjs +0 -30
  157. package/dist/loaders/middlewares.mjs.map +0 -1
  158. package/dist/loaders/plugins/get-enabled-plugins.js +0 -141
  159. package/dist/loaders/plugins/get-enabled-plugins.js.map +0 -1
  160. package/dist/loaders/plugins/get-enabled-plugins.mjs +0 -117
  161. package/dist/loaders/plugins/get-enabled-plugins.mjs.map +0 -1
  162. package/dist/loaders/plugins/get-user-plugins-config.js +0 -27
  163. package/dist/loaders/plugins/get-user-plugins-config.js.map +0 -1
  164. package/dist/loaders/plugins/get-user-plugins-config.mjs +0 -25
  165. package/dist/loaders/plugins/get-user-plugins-config.mjs.map +0 -1
  166. package/dist/loaders/plugins/index.js +0 -144
  167. package/dist/loaders/plugins/index.js.map +0 -1
  168. package/dist/loaders/plugins/index.mjs +0 -125
  169. package/dist/loaders/plugins/index.mjs.map +0 -1
  170. package/dist/loaders/policies.js +0 -25
  171. package/dist/loaders/policies.js.map +0 -1
  172. package/dist/loaders/policies.mjs +0 -24
  173. package/dist/loaders/policies.mjs.map +0 -1
  174. package/dist/loaders/sanitizers.js +0 -6
  175. package/dist/loaders/sanitizers.js.map +0 -1
  176. package/dist/loaders/sanitizers.mjs +0 -7
  177. package/dist/loaders/sanitizers.mjs.map +0 -1
  178. package/dist/loaders/src-index.js +0 -33
  179. package/dist/loaders/src-index.js.map +0 -1
  180. package/dist/loaders/src-index.mjs +0 -34
  181. package/dist/loaders/src-index.mjs.map +0 -1
  182. package/dist/loaders/validators.js +0 -6
  183. package/dist/loaders/validators.js.map +0 -1
  184. package/dist/loaders/validators.mjs +0 -7
  185. package/dist/loaders/validators.mjs.map +0 -1
  186. package/dist/middlewares/body.js +0 -65
  187. package/dist/middlewares/body.js.map +0 -1
  188. package/dist/middlewares/body.mjs +0 -61
  189. package/dist/middlewares/body.mjs.map +0 -1
  190. package/dist/middlewares/compression.js +0 -8
  191. package/dist/middlewares/compression.js.map +0 -1
  192. package/dist/middlewares/compression.mjs +0 -6
  193. package/dist/middlewares/compression.mjs.map +0 -1
  194. package/dist/middlewares/cors.js +0 -53
  195. package/dist/middlewares/cors.js.map +0 -1
  196. package/dist/middlewares/cors.mjs +0 -51
  197. package/dist/middlewares/cors.mjs.map +0 -1
  198. package/dist/middlewares/errors.js +0 -33
  199. package/dist/middlewares/errors.js.map +0 -1
  200. package/dist/middlewares/errors.mjs +0 -33
  201. package/dist/middlewares/errors.mjs.map +0 -1
  202. package/dist/middlewares/favicon.js +0 -22
  203. package/dist/middlewares/favicon.js.map +0 -1
  204. package/dist/middlewares/favicon.mjs +0 -20
  205. package/dist/middlewares/favicon.mjs.map +0 -1
  206. package/dist/middlewares/index.js +0 -34
  207. package/dist/middlewares/index.js.map +0 -1
  208. package/dist/middlewares/index.mjs +0 -34
  209. package/dist/middlewares/index.mjs.map +0 -1
  210. package/dist/middlewares/ip.js +0 -8
  211. package/dist/middlewares/ip.js.map +0 -1
  212. package/dist/middlewares/ip.mjs +0 -6
  213. package/dist/middlewares/ip.mjs.map +0 -1
  214. package/dist/middlewares/logger.js +0 -12
  215. package/dist/middlewares/logger.js.map +0 -1
  216. package/dist/middlewares/logger.mjs +0 -12
  217. package/dist/middlewares/logger.mjs.map +0 -1
  218. package/dist/middlewares/powered-by.js +0 -14
  219. package/dist/middlewares/powered-by.js.map +0 -1
  220. package/dist/middlewares/powered-by.mjs +0 -14
  221. package/dist/middlewares/powered-by.mjs.map +0 -1
  222. package/dist/middlewares/public.js +0 -34
  223. package/dist/middlewares/public.js.map +0 -1
  224. package/dist/middlewares/public.mjs +0 -32
  225. package/dist/middlewares/public.mjs.map +0 -1
  226. package/dist/middlewares/query.js +0 -40
  227. package/dist/middlewares/query.js.map +0 -1
  228. package/dist/middlewares/query.mjs +0 -38
  229. package/dist/middlewares/query.mjs.map +0 -1
  230. package/dist/middlewares/response-time.js +0 -12
  231. package/dist/middlewares/response-time.js.map +0 -1
  232. package/dist/middlewares/response-time.mjs +0 -12
  233. package/dist/middlewares/response-time.mjs.map +0 -1
  234. package/dist/middlewares/responses.js +0 -15
  235. package/dist/middlewares/responses.js.map +0 -1
  236. package/dist/middlewares/responses.mjs +0 -15
  237. package/dist/middlewares/responses.mjs.map +0 -1
  238. package/dist/middlewares/security.js +0 -78
  239. package/dist/middlewares/security.js.map +0 -1
  240. package/dist/middlewares/security.mjs +0 -76
  241. package/dist/middlewares/security.mjs.map +0 -1
  242. package/dist/middlewares/session.js +0 -30
  243. package/dist/middlewares/session.js.map +0 -1
  244. package/dist/middlewares/session.mjs +0 -28
  245. package/dist/middlewares/session.mjs.map +0 -1
  246. package/dist/migrations/database/5.0.0-discard-drafts.js +0 -106
  247. package/dist/migrations/database/5.0.0-discard-drafts.js.map +0 -1
  248. package/dist/migrations/database/5.0.0-discard-drafts.mjs +0 -106
  249. package/dist/migrations/database/5.0.0-discard-drafts.mjs.map +0 -1
  250. package/dist/migrations/draft-publish.js +0 -42
  251. package/dist/migrations/draft-publish.js.map +0 -1
  252. package/dist/migrations/draft-publish.mjs +0 -42
  253. package/dist/migrations/draft-publish.mjs.map +0 -1
  254. package/dist/migrations/i18n.js +0 -54
  255. package/dist/migrations/i18n.js.map +0 -1
  256. package/dist/migrations/i18n.mjs +0 -54
  257. package/dist/migrations/i18n.mjs.map +0 -1
  258. package/dist/migrations/index.js +0 -15
  259. package/dist/migrations/index.js.map +0 -1
  260. package/dist/migrations/index.mjs +0 -15
  261. package/dist/migrations/index.mjs.map +0 -1
  262. package/dist/providers/admin.js +0 -20
  263. package/dist/providers/admin.js.map +0 -1
  264. package/dist/providers/admin.mjs +0 -21
  265. package/dist/providers/admin.mjs.map +0 -1
  266. package/dist/providers/coreStore.js +0 -11
  267. package/dist/providers/coreStore.js.map +0 -1
  268. package/dist/providers/coreStore.mjs +0 -12
  269. package/dist/providers/coreStore.mjs.map +0 -1
  270. package/dist/providers/cron.js +0 -20
  271. package/dist/providers/cron.js.map +0 -1
  272. package/dist/providers/cron.mjs +0 -21
  273. package/dist/providers/cron.mjs.map +0 -1
  274. package/dist/providers/index.js +0 -11
  275. package/dist/providers/index.js.map +0 -1
  276. package/dist/providers/index.mjs +0 -11
  277. package/dist/providers/index.mjs.map +0 -1
  278. package/dist/providers/provider.js +0 -5
  279. package/dist/providers/provider.js.map +0 -1
  280. package/dist/providers/provider.mjs +0 -5
  281. package/dist/providers/provider.mjs.map +0 -1
  282. package/dist/providers/registries.js +0 -35
  283. package/dist/providers/registries.js.map +0 -1
  284. package/dist/providers/registries.mjs +0 -36
  285. package/dist/providers/registries.mjs.map +0 -1
  286. package/dist/providers/telemetry.js +0 -19
  287. package/dist/providers/telemetry.js.map +0 -1
  288. package/dist/providers/telemetry.mjs +0 -20
  289. package/dist/providers/telemetry.mjs.map +0 -1
  290. package/dist/providers/webhooks.js +0 -30
  291. package/dist/providers/webhooks.js.map +0 -1
  292. package/dist/providers/webhooks.mjs +0 -31
  293. package/dist/providers/webhooks.mjs.map +0 -1
  294. package/dist/registries/apis.js +0 -23
  295. package/dist/registries/apis.js.map +0 -1
  296. package/dist/registries/apis.mjs +0 -24
  297. package/dist/registries/apis.mjs.map +0 -1
  298. package/dist/registries/components.js +0 -45
  299. package/dist/registries/components.js.map +0 -1
  300. package/dist/registries/components.mjs +0 -46
  301. package/dist/registries/components.mjs.map +0 -1
  302. package/dist/registries/content-types.js +0 -70
  303. package/dist/registries/content-types.js.map +0 -1
  304. package/dist/registries/content-types.mjs +0 -71
  305. package/dist/registries/content-types.mjs.map +0 -1
  306. package/dist/registries/controllers.js +0 -80
  307. package/dist/registries/controllers.js.map +0 -1
  308. package/dist/registries/controllers.mjs +0 -81
  309. package/dist/registries/controllers.mjs.map +0 -1
  310. package/dist/registries/custom-fields.js +0 -71
  311. package/dist/registries/custom-fields.js.map +0 -1
  312. package/dist/registries/custom-fields.mjs +0 -72
  313. package/dist/registries/custom-fields.mjs.map +0 -1
  314. package/dist/registries/hooks.js +0 -58
  315. package/dist/registries/hooks.js.map +0 -1
  316. package/dist/registries/hooks.mjs +0 -59
  317. package/dist/registries/hooks.mjs.map +0 -1
  318. package/dist/registries/middlewares.js +0 -60
  319. package/dist/registries/middlewares.js.map +0 -1
  320. package/dist/registries/middlewares.mjs +0 -61
  321. package/dist/registries/middlewares.mjs.map +0 -1
  322. package/dist/registries/models.js +0 -16
  323. package/dist/registries/models.js.map +0 -1
  324. package/dist/registries/models.mjs +0 -16
  325. package/dist/registries/models.mjs.map +0 -1
  326. package/dist/registries/modules.js +0 -39
  327. package/dist/registries/modules.js.map +0 -1
  328. package/dist/registries/modules.mjs +0 -40
  329. package/dist/registries/modules.mjs.map +0 -1
  330. package/dist/registries/namespace.js +0 -27
  331. package/dist/registries/namespace.js.map +0 -1
  332. package/dist/registries/namespace.mjs +0 -27
  333. package/dist/registries/namespace.mjs.map +0 -1
  334. package/dist/registries/plugins.js +0 -23
  335. package/dist/registries/plugins.js.map +0 -1
  336. package/dist/registries/plugins.mjs +0 -24
  337. package/dist/registries/plugins.mjs.map +0 -1
  338. package/dist/registries/policies.js +0 -108
  339. package/dist/registries/policies.js.map +0 -1
  340. package/dist/registries/policies.mjs +0 -109
  341. package/dist/registries/policies.mjs.map +0 -1
  342. package/dist/registries/sanitizers.js +0 -25
  343. package/dist/registries/sanitizers.js.map +0 -1
  344. package/dist/registries/sanitizers.mjs +0 -24
  345. package/dist/registries/sanitizers.mjs.map +0 -1
  346. package/dist/registries/services.js +0 -80
  347. package/dist/registries/services.js.map +0 -1
  348. package/dist/registries/services.mjs +0 -81
  349. package/dist/registries/services.mjs.map +0 -1
  350. package/dist/registries/validators.js +0 -25
  351. package/dist/registries/validators.js.map +0 -1
  352. package/dist/registries/validators.mjs +0 -24
  353. package/dist/registries/validators.mjs.map +0 -1
  354. package/dist/services/auth/index.js +0 -81
  355. package/dist/services/auth/index.js.map +0 -1
  356. package/dist/services/auth/index.mjs +0 -80
  357. package/dist/services/auth/index.mjs.map +0 -1
  358. package/dist/services/config.js +0 -47
  359. package/dist/services/config.js.map +0 -1
  360. package/dist/services/config.mjs +0 -47
  361. package/dist/services/config.mjs.map +0 -1
  362. package/dist/services/content-api/index.js +0 -85
  363. package/dist/services/content-api/index.js.map +0 -1
  364. package/dist/services/content-api/index.mjs +0 -84
  365. package/dist/services/content-api/index.mjs.map +0 -1
  366. package/dist/services/content-api/permissions/engine.js +0 -7
  367. package/dist/services/content-api/permissions/engine.js.map +0 -1
  368. package/dist/services/content-api/permissions/engine.mjs +0 -6
  369. package/dist/services/content-api/permissions/engine.mjs.map +0 -1
  370. package/dist/services/content-api/permissions/index.js +0 -87
  371. package/dist/services/content-api/permissions/index.js.map +0 -1
  372. package/dist/services/content-api/permissions/index.mjs +0 -86
  373. package/dist/services/content-api/permissions/index.mjs.map +0 -1
  374. package/dist/services/content-api/permissions/providers/action.js +0 -16
  375. package/dist/services/content-api/permissions/providers/action.js.map +0 -1
  376. package/dist/services/content-api/permissions/providers/action.mjs +0 -17
  377. package/dist/services/content-api/permissions/providers/action.mjs.map +0 -1
  378. package/dist/services/content-api/permissions/providers/condition.js +0 -16
  379. package/dist/services/content-api/permissions/providers/condition.js.map +0 -1
  380. package/dist/services/content-api/permissions/providers/condition.mjs +0 -17
  381. package/dist/services/content-api/permissions/providers/condition.mjs.map +0 -1
  382. package/dist/services/core-store.js +0 -107
  383. package/dist/services/core-store.js.map +0 -1
  384. package/dist/services/core-store.mjs +0 -107
  385. package/dist/services/core-store.mjs.map +0 -1
  386. package/dist/services/cron.js +0 -67
  387. package/dist/services/cron.js.map +0 -1
  388. package/dist/services/cron.mjs +0 -68
  389. package/dist/services/cron.mjs.map +0 -1
  390. package/dist/services/custom-fields.js +0 -10
  391. package/dist/services/custom-fields.js.map +0 -1
  392. package/dist/services/custom-fields.mjs +0 -11
  393. package/dist/services/custom-fields.mjs.map +0 -1
  394. package/dist/services/document-service/attributes/index.js +0 -22
  395. package/dist/services/document-service/attributes/index.js.map +0 -1
  396. package/dist/services/document-service/attributes/index.mjs +0 -22
  397. package/dist/services/document-service/attributes/index.mjs.map +0 -1
  398. package/dist/services/document-service/attributes/transforms.js +0 -20
  399. package/dist/services/document-service/attributes/transforms.js.map +0 -1
  400. package/dist/services/document-service/attributes/transforms.mjs +0 -19
  401. package/dist/services/document-service/attributes/transforms.mjs.map +0 -1
  402. package/dist/services/document-service/common.js +0 -7
  403. package/dist/services/document-service/common.js.map +0 -1
  404. package/dist/services/document-service/common.mjs +0 -7
  405. package/dist/services/document-service/common.mjs.map +0 -1
  406. package/dist/services/document-service/components.js +0 -288
  407. package/dist/services/document-service/components.js.map +0 -1
  408. package/dist/services/document-service/components.mjs +0 -286
  409. package/dist/services/document-service/components.mjs.map +0 -1
  410. package/dist/services/document-service/draft-and-publish.js +0 -69
  411. package/dist/services/document-service/draft-and-publish.js.map +0 -1
  412. package/dist/services/document-service/draft-and-publish.mjs +0 -69
  413. package/dist/services/document-service/draft-and-publish.mjs.map +0 -1
  414. package/dist/services/document-service/entries.js +0 -95
  415. package/dist/services/document-service/entries.js.map +0 -1
  416. package/dist/services/document-service/entries.mjs +0 -95
  417. package/dist/services/document-service/entries.mjs.map +0 -1
  418. package/dist/services/document-service/events.js +0 -47
  419. package/dist/services/document-service/events.js.map +0 -1
  420. package/dist/services/document-service/events.mjs +0 -47
  421. package/dist/services/document-service/events.mjs.map +0 -1
  422. package/dist/services/document-service/index.js +0 -36
  423. package/dist/services/document-service/index.js.map +0 -1
  424. package/dist/services/document-service/index.mjs +0 -36
  425. package/dist/services/document-service/index.mjs.map +0 -1
  426. package/dist/services/document-service/internationalization.js +0 -63
  427. package/dist/services/document-service/internationalization.js.map +0 -1
  428. package/dist/services/document-service/internationalization.mjs +0 -63
  429. package/dist/services/document-service/internationalization.mjs.map +0 -1
  430. package/dist/services/document-service/middlewares/errors.js +0 -25
  431. package/dist/services/document-service/middlewares/errors.js.map +0 -1
  432. package/dist/services/document-service/middlewares/errors.mjs +0 -25
  433. package/dist/services/document-service/middlewares/errors.mjs.map +0 -1
  434. package/dist/services/document-service/middlewares/middleware-manager.js +0 -49
  435. package/dist/services/document-service/middlewares/middleware-manager.js.map +0 -1
  436. package/dist/services/document-service/middlewares/middleware-manager.mjs +0 -49
  437. package/dist/services/document-service/middlewares/middleware-manager.mjs.map +0 -1
  438. package/dist/services/document-service/params.js +0 -8
  439. package/dist/services/document-service/params.js.map +0 -1
  440. package/dist/services/document-service/params.mjs +0 -8
  441. package/dist/services/document-service/params.mjs.map +0 -1
  442. package/dist/services/document-service/repository.js +0 -332
  443. package/dist/services/document-service/repository.js.map +0 -1
  444. package/dist/services/document-service/repository.mjs +0 -332
  445. package/dist/services/document-service/repository.mjs.map +0 -1
  446. package/dist/services/document-service/transform/data.js +0 -15
  447. package/dist/services/document-service/transform/data.js.map +0 -1
  448. package/dist/services/document-service/transform/data.mjs +0 -15
  449. package/dist/services/document-service/transform/data.mjs.map +0 -1
  450. package/dist/services/document-service/transform/fields.js +0 -24
  451. package/dist/services/document-service/transform/fields.js.map +0 -1
  452. package/dist/services/document-service/transform/fields.mjs +0 -24
  453. package/dist/services/document-service/transform/fields.mjs.map +0 -1
  454. package/dist/services/document-service/transform/id-map.js +0 -85
  455. package/dist/services/document-service/transform/id-map.js.map +0 -1
  456. package/dist/services/document-service/transform/id-map.mjs +0 -85
  457. package/dist/services/document-service/transform/id-map.mjs.map +0 -1
  458. package/dist/services/document-service/transform/id-transform.js +0 -33
  459. package/dist/services/document-service/transform/id-transform.js.map +0 -1
  460. package/dist/services/document-service/transform/id-transform.mjs +0 -33
  461. package/dist/services/document-service/transform/id-transform.mjs.map +0 -1
  462. package/dist/services/document-service/transform/populate.js +0 -21
  463. package/dist/services/document-service/transform/populate.js.map +0 -1
  464. package/dist/services/document-service/transform/populate.mjs +0 -21
  465. package/dist/services/document-service/transform/populate.mjs.map +0 -1
  466. package/dist/services/document-service/transform/query.js +0 -9
  467. package/dist/services/document-service/transform/query.js.map +0 -1
  468. package/dist/services/document-service/transform/query.mjs +0 -9
  469. package/dist/services/document-service/transform/query.mjs.map +0 -1
  470. package/dist/services/document-service/transform/relations/extract/data-ids.js +0 -64
  471. package/dist/services/document-service/transform/relations/extract/data-ids.js.map +0 -1
  472. package/dist/services/document-service/transform/relations/extract/data-ids.mjs +0 -64
  473. package/dist/services/document-service/transform/relations/extract/data-ids.mjs.map +0 -1
  474. package/dist/services/document-service/transform/relations/transform/data-ids.js +0 -85
  475. package/dist/services/document-service/transform/relations/transform/data-ids.js.map +0 -1
  476. package/dist/services/document-service/transform/relations/transform/data-ids.mjs +0 -85
  477. package/dist/services/document-service/transform/relations/transform/data-ids.mjs.map +0 -1
  478. package/dist/services/document-service/transform/relations/transform/default-locale.js +0 -32
  479. package/dist/services/document-service/transform/relations/transform/default-locale.js.map +0 -1
  480. package/dist/services/document-service/transform/relations/transform/default-locale.mjs +0 -32
  481. package/dist/services/document-service/transform/relations/transform/default-locale.mjs.map +0 -1
  482. package/dist/services/document-service/transform/relations/utils/dp.js +0 -30
  483. package/dist/services/document-service/transform/relations/utils/dp.js.map +0 -1
  484. package/dist/services/document-service/transform/relations/utils/dp.mjs +0 -30
  485. package/dist/services/document-service/transform/relations/utils/dp.mjs.map +0 -1
  486. package/dist/services/document-service/transform/relations/utils/i18n.js +0 -25
  487. package/dist/services/document-service/transform/relations/utils/i18n.js.map +0 -1
  488. package/dist/services/document-service/transform/relations/utils/i18n.mjs +0 -25
  489. package/dist/services/document-service/transform/relations/utils/i18n.mjs.map +0 -1
  490. package/dist/services/document-service/transform/relations/utils/map-relation.js +0 -84
  491. package/dist/services/document-service/transform/relations/utils/map-relation.js.map +0 -1
  492. package/dist/services/document-service/transform/relations/utils/map-relation.mjs +0 -84
  493. package/dist/services/document-service/transform/relations/utils/map-relation.mjs.map +0 -1
  494. package/dist/services/document-service/utils/populate.js +0 -47
  495. package/dist/services/document-service/utils/populate.js.map +0 -1
  496. package/dist/services/document-service/utils/populate.mjs +0 -47
  497. package/dist/services/document-service/utils/populate.mjs.map +0 -1
  498. package/dist/services/document-service/utils/unidirectional-relations.js +0 -68
  499. package/dist/services/document-service/utils/unidirectional-relations.js.map +0 -1
  500. package/dist/services/document-service/utils/unidirectional-relations.mjs +0 -68
  501. package/dist/services/document-service/utils/unidirectional-relations.mjs.map +0 -1
  502. package/dist/services/entity-service/index.js +0 -169
  503. package/dist/services/entity-service/index.js.map +0 -1
  504. package/dist/services/entity-service/index.mjs +0 -167
  505. package/dist/services/entity-service/index.mjs.map +0 -1
  506. package/dist/services/entity-validator/blocks-validator.js +0 -128
  507. package/dist/services/entity-validator/blocks-validator.js.map +0 -1
  508. package/dist/services/entity-validator/blocks-validator.mjs +0 -128
  509. package/dist/services/entity-validator/blocks-validator.mjs.map +0 -1
  510. package/dist/services/entity-validator/index.js +0 -389
  511. package/dist/services/entity-validator/index.js.map +0 -1
  512. package/dist/services/entity-validator/index.mjs +0 -388
  513. package/dist/services/entity-validator/index.mjs.map +0 -1
  514. package/dist/services/entity-validator/validators.js +0 -241
  515. package/dist/services/entity-validator/validators.js.map +0 -1
  516. package/dist/services/entity-validator/validators.mjs +0 -239
  517. package/dist/services/entity-validator/validators.mjs.map +0 -1
  518. package/dist/services/errors.js +0 -76
  519. package/dist/services/errors.js.map +0 -1
  520. package/dist/services/errors.mjs +0 -74
  521. package/dist/services/errors.mjs.map +0 -1
  522. package/dist/services/event-hub.js +0 -72
  523. package/dist/services/event-hub.js.map +0 -1
  524. package/dist/services/event-hub.mjs +0 -73
  525. package/dist/services/event-hub.mjs.map +0 -1
  526. package/dist/services/features.js +0 -17
  527. package/dist/services/features.js.map +0 -1
  528. package/dist/services/features.mjs +0 -17
  529. package/dist/services/features.mjs.map +0 -1
  530. package/dist/services/fs.js +0 -51
  531. package/dist/services/fs.js.map +0 -1
  532. package/dist/services/fs.mjs +0 -49
  533. package/dist/services/fs.mjs.map +0 -1
  534. package/dist/services/metrics/admin-user-hash.js +0 -14
  535. package/dist/services/metrics/admin-user-hash.js.map +0 -1
  536. package/dist/services/metrics/admin-user-hash.mjs +0 -12
  537. package/dist/services/metrics/admin-user-hash.mjs.map +0 -1
  538. package/dist/services/metrics/index.js +0 -44
  539. package/dist/services/metrics/index.js.map +0 -1
  540. package/dist/services/metrics/index.mjs +0 -45
  541. package/dist/services/metrics/index.mjs.map +0 -1
  542. package/dist/services/metrics/is-truthy.js +0 -9
  543. package/dist/services/metrics/is-truthy.js.map +0 -1
  544. package/dist/services/metrics/is-truthy.mjs +0 -8
  545. package/dist/services/metrics/is-truthy.mjs.map +0 -1
  546. package/dist/services/metrics/middleware.js +0 -25
  547. package/dist/services/metrics/middleware.js.map +0 -1
  548. package/dist/services/metrics/middleware.mjs +0 -26
  549. package/dist/services/metrics/middleware.mjs.map +0 -1
  550. package/dist/services/metrics/rate-limiter.js +0 -21
  551. package/dist/services/metrics/rate-limiter.js.map +0 -1
  552. package/dist/services/metrics/rate-limiter.mjs +0 -22
  553. package/dist/services/metrics/rate-limiter.mjs.map +0 -1
  554. package/dist/services/metrics/sender.js +0 -76
  555. package/dist/services/metrics/sender.js.map +0 -1
  556. package/dist/services/metrics/sender.mjs +0 -70
  557. package/dist/services/metrics/sender.mjs.map +0 -1
  558. package/dist/services/query-params.js +0 -12
  559. package/dist/services/query-params.js.map +0 -1
  560. package/dist/services/query-params.mjs +0 -13
  561. package/dist/services/query-params.mjs.map +0 -1
  562. package/dist/services/reloader.js +0 -36
  563. package/dist/services/reloader.js.map +0 -1
  564. package/dist/services/reloader.mjs +0 -36
  565. package/dist/services/reloader.mjs.map +0 -1
  566. package/dist/services/request-context.js +0 -13
  567. package/dist/services/request-context.js.map +0 -1
  568. package/dist/services/request-context.mjs +0 -14
  569. package/dist/services/request-context.mjs.map +0 -1
  570. package/dist/services/server/admin-api.js +0 -13
  571. package/dist/services/server/admin-api.js.map +0 -1
  572. package/dist/services/server/admin-api.mjs +0 -13
  573. package/dist/services/server/admin-api.mjs.map +0 -1
  574. package/dist/services/server/api.js +0 -30
  575. package/dist/services/server/api.js.map +0 -1
  576. package/dist/services/server/api.mjs +0 -28
  577. package/dist/services/server/api.mjs.map +0 -1
  578. package/dist/services/server/compose-endpoint.js +0 -117
  579. package/dist/services/server/compose-endpoint.js.map +0 -1
  580. package/dist/services/server/compose-endpoint.mjs +0 -116
  581. package/dist/services/server/compose-endpoint.mjs.map +0 -1
  582. package/dist/services/server/content-api.js +0 -12
  583. package/dist/services/server/content-api.js.map +0 -1
  584. package/dist/services/server/content-api.mjs +0 -12
  585. package/dist/services/server/content-api.mjs.map +0 -1
  586. package/dist/services/server/http-server.js +0 -50
  587. package/dist/services/server/http-server.js.map +0 -1
  588. package/dist/services/server/http-server.mjs +0 -48
  589. package/dist/services/server/http-server.mjs.map +0 -1
  590. package/dist/services/server/index.js +0 -87
  591. package/dist/services/server/index.js.map +0 -1
  592. package/dist/services/server/index.mjs +0 -85
  593. package/dist/services/server/index.mjs.map +0 -1
  594. package/dist/services/server/koa.js +0 -52
  595. package/dist/services/server/koa.js.map +0 -1
  596. package/dist/services/server/koa.mjs +0 -48
  597. package/dist/services/server/koa.mjs.map +0 -1
  598. package/dist/services/server/middleware.js +0 -92
  599. package/dist/services/server/middleware.js.map +0 -1
  600. package/dist/services/server/middleware.mjs +0 -90
  601. package/dist/services/server/middleware.mjs.map +0 -1
  602. package/dist/services/server/policy.js +0 -20
  603. package/dist/services/server/policy.js.map +0 -1
  604. package/dist/services/server/policy.mjs +0 -20
  605. package/dist/services/server/policy.mjs.map +0 -1
  606. package/dist/services/server/register-middlewares.js +0 -72
  607. package/dist/services/server/register-middlewares.js.map +0 -1
  608. package/dist/services/server/register-middlewares.mjs +0 -73
  609. package/dist/services/server/register-middlewares.mjs.map +0 -1
  610. package/dist/services/server/register-routes.js +0 -76
  611. package/dist/services/server/register-routes.js.map +0 -1
  612. package/dist/services/server/register-routes.mjs +0 -75
  613. package/dist/services/server/register-routes.mjs.map +0 -1
  614. package/dist/services/server/routing.js +0 -91
  615. package/dist/services/server/routing.js.map +0 -1
  616. package/dist/services/server/routing.mjs +0 -89
  617. package/dist/services/server/routing.mjs.map +0 -1
  618. package/dist/services/utils/dynamic-zones.js +0 -17
  619. package/dist/services/utils/dynamic-zones.js.map +0 -1
  620. package/dist/services/utils/dynamic-zones.mjs +0 -18
  621. package/dist/services/utils/dynamic-zones.mjs.map +0 -1
  622. package/dist/services/webhook-runner.js +0 -133
  623. package/dist/services/webhook-runner.js.map +0 -1
  624. package/dist/services/webhook-runner.mjs +0 -131
  625. package/dist/services/webhook-runner.mjs.map +0 -1
  626. package/dist/services/webhook-store.js +0 -110
  627. package/dist/services/webhook-store.js.map +0 -1
  628. package/dist/services/webhook-store.mjs +0 -110
  629. package/dist/services/webhook-store.mjs.map +0 -1
  630. package/dist/services/worker-queue.js +0 -56
  631. package/dist/services/worker-queue.js.map +0 -1
  632. package/dist/services/worker-queue.mjs +0 -55
  633. package/dist/services/worker-queue.mjs.map +0 -1
  634. package/dist/utils/convert-custom-field-type.js +0 -24
  635. package/dist/utils/convert-custom-field-type.js.map +0 -1
  636. package/dist/utils/convert-custom-field-type.mjs +0 -24
  637. package/dist/utils/convert-custom-field-type.mjs.map +0 -1
  638. package/dist/utils/cron.js +0 -38
  639. package/dist/utils/cron.js.map +0 -1
  640. package/dist/utils/cron.mjs +0 -38
  641. package/dist/utils/cron.mjs.map +0 -1
  642. package/dist/utils/fetch.js +0 -21
  643. package/dist/utils/fetch.js.map +0 -1
  644. package/dist/utils/fetch.mjs +0 -21
  645. package/dist/utils/fetch.mjs.map +0 -1
  646. package/dist/utils/filepath-to-prop-path.js +0 -33
  647. package/dist/utils/filepath-to-prop-path.js.map +0 -1
  648. package/dist/utils/filepath-to-prop-path.mjs +0 -30
  649. package/dist/utils/filepath-to-prop-path.mjs.map +0 -1
  650. package/dist/utils/is-initialized.js +0 -16
  651. package/dist/utils/is-initialized.js.map +0 -1
  652. package/dist/utils/is-initialized.mjs +0 -16
  653. package/dist/utils/is-initialized.mjs.map +0 -1
  654. package/dist/utils/lifecycles.js +0 -9
  655. package/dist/utils/lifecycles.js.map +0 -1
  656. package/dist/utils/lifecycles.mjs +0 -9
  657. package/dist/utils/lifecycles.mjs.map +0 -1
  658. package/dist/utils/load-config-file.js +0 -45
  659. package/dist/utils/load-config-file.js.map +0 -1
  660. package/dist/utils/load-config-file.mjs +0 -42
  661. package/dist/utils/load-config-file.mjs.map +0 -1
  662. package/dist/utils/load-files.js +0 -38
  663. package/dist/utils/load-files.js.map +0 -1
  664. package/dist/utils/load-files.mjs +0 -34
  665. package/dist/utils/load-files.mjs.map +0 -1
  666. package/dist/utils/open-browser.js +0 -11
  667. package/dist/utils/open-browser.js.map +0 -1
  668. package/dist/utils/open-browser.mjs +0 -9
  669. package/dist/utils/open-browser.mjs.map +0 -1
  670. package/dist/utils/resolve-working-dirs.js +0 -13
  671. package/dist/utils/resolve-working-dirs.js.map +0 -1
  672. package/dist/utils/resolve-working-dirs.mjs +0 -11
  673. package/dist/utils/resolve-working-dirs.mjs.map +0 -1
  674. package/dist/utils/signals.js +0 -17
  675. package/dist/utils/signals.js.map +0 -1
  676. package/dist/utils/signals.mjs +0 -17
  677. package/dist/utils/signals.mjs.map +0 -1
  678. package/dist/utils/startup-logger.js +0 -86
  679. package/dist/utils/startup-logger.js.map +0 -1
  680. package/dist/utils/startup-logger.mjs +0 -82
  681. package/dist/utils/startup-logger.mjs.map +0 -1
  682. package/dist/utils/transform-content-types-to-models.js +0 -288
  683. package/dist/utils/transform-content-types-to-models.js.map +0 -1
  684. package/dist/utils/transform-content-types-to-models.mjs +0 -285
  685. package/dist/utils/transform-content-types-to-models.mjs.map +0 -1
  686. package/dist/utils/update-notifier/index.js +0 -85
  687. package/dist/utils/update-notifier/index.js.map +0 -1
  688. package/dist/utils/update-notifier/index.mjs +0 -78
  689. package/dist/utils/update-notifier/index.mjs.map +0 -1
@@ -1,285 +0,0 @@
1
- import { createId } from "@paralleldrive/cuid2";
2
- import assert from "node:assert";
3
- import fp from "lodash/fp";
4
- const getComponentJoinTableName = (collectionName, identifiers) => {
5
- return identifiers.getNameFromTokens([
6
- { name: collectionName, compressible: true },
7
- { name: "components", shortName: "cmps", compressible: false }
8
- ]);
9
- };
10
- const getDzJoinTableName = (collectionName, identifiers) => {
11
- return identifiers.getNameFromTokens([
12
- { name: collectionName, compressible: true },
13
- { name: "components", shortName: "cmps", compressible: false }
14
- ]);
15
- };
16
- const getComponentJoinColumnEntityName = (identifiers) => {
17
- return identifiers.getNameFromTokens([
18
- { name: "entity", compressible: false },
19
- { name: "id", compressible: false }
20
- ]);
21
- };
22
- const getComponentJoinColumnInverseName = (identifiers) => {
23
- return identifiers.getNameFromTokens([
24
- { name: "component", shortName: "cmp", compressible: false },
25
- { name: "id", compressible: false }
26
- ]);
27
- };
28
- const getComponentTypeColumn = (identifiers) => {
29
- return identifiers.getNameFromTokens([{ name: "component_type", compressible: false }]);
30
- };
31
- const getComponentFkIndexName = (contentType, identifiers) => {
32
- return identifiers.getNameFromTokens([
33
- { name: contentType, compressible: true },
34
- { name: "entity", compressible: false },
35
- { name: "fk", compressible: false }
36
- ]);
37
- };
38
- const transformAttribute = (name, attribute, contentType, identifiers) => {
39
- switch (attribute.type) {
40
- case "media": {
41
- return {
42
- type: "relation",
43
- relation: attribute.multiple === true ? "morphMany" : "morphOne",
44
- target: "plugin::upload.file",
45
- morphBy: "related"
46
- };
47
- }
48
- case "component": {
49
- const joinTableName = getComponentJoinTableName(contentType.collectionName, identifiers);
50
- const joinColumnEntityName = getComponentJoinColumnEntityName(identifiers);
51
- const joinColumnInverseName = getComponentJoinColumnInverseName(identifiers);
52
- const compTypeColumn = getComponentTypeColumn(identifiers);
53
- return {
54
- type: "relation",
55
- relation: attribute.repeatable === true ? "oneToMany" : "oneToOne",
56
- target: attribute.component,
57
- // We need the join table name to be deterministic,
58
- // We need to allow passing the join table name as an option
59
- joinTable: {
60
- name: joinTableName,
61
- joinColumn: {
62
- name: joinColumnEntityName,
63
- referencedColumn: identifiers.ID_COLUMN
64
- },
65
- inverseJoinColumn: {
66
- name: joinColumnInverseName,
67
- referencedColumn: identifiers.ID_COLUMN
68
- },
69
- on: {
70
- field: name
71
- },
72
- orderColumnName: identifiers.ORDER_COLUMN,
73
- orderBy: {
74
- order: "asc"
75
- },
76
- pivotColumns: [
77
- joinColumnEntityName,
78
- joinColumnInverseName,
79
- identifiers.FIELD_COLUMN,
80
- compTypeColumn
81
- ]
82
- }
83
- };
84
- }
85
- case "dynamiczone": {
86
- const joinTableName = getDzJoinTableName(contentType.collectionName, identifiers);
87
- const joinColumnEntityName = getComponentJoinColumnEntityName(identifiers);
88
- const joinColumnInverseName = getComponentJoinColumnInverseName(identifiers);
89
- const compTypeColumn = getComponentTypeColumn(identifiers);
90
- return {
91
- type: "relation",
92
- relation: "morphToMany",
93
- // TODO: handle restrictions at some point
94
- // target: attribute.components,
95
- joinTable: {
96
- name: joinTableName,
97
- joinColumn: {
98
- name: joinColumnEntityName,
99
- referencedColumn: identifiers.ID_COLUMN
100
- },
101
- morphColumn: {
102
- idColumn: {
103
- name: joinColumnInverseName,
104
- referencedColumn: identifiers.ID_COLUMN
105
- },
106
- typeColumn: {
107
- name: compTypeColumn
108
- },
109
- typeField: "__component"
110
- },
111
- on: {
112
- field: name
113
- },
114
- orderBy: {
115
- order: "asc"
116
- },
117
- pivotColumns: [
118
- joinColumnEntityName,
119
- joinColumnInverseName,
120
- identifiers.FIELD_COLUMN,
121
- compTypeColumn
122
- ]
123
- }
124
- };
125
- }
126
- default: {
127
- return attribute;
128
- }
129
- }
130
- };
131
- const transformAttributes = (contentType, identifiers) => {
132
- return Object.keys(contentType.attributes || {}).reduce((attrs, attrName) => {
133
- return {
134
- ...attrs,
135
- [attrName]: transformAttribute(
136
- attrName,
137
- contentType.attributes[attrName],
138
- contentType,
139
- identifiers
140
- )
141
- };
142
- }, {});
143
- };
144
- const hasComponentsOrDz = (contentType) => {
145
- return Object.values(contentType.attributes || {}).some(
146
- ({ type }) => type === "dynamiczone" || type === "component"
147
- );
148
- };
149
- const createDocumentId = createId;
150
- const createCompoLinkModel = (contentType, identifiers) => {
151
- const name = getComponentJoinTableName(contentType.collectionName, identifiers);
152
- const entityId = getComponentJoinColumnEntityName(identifiers);
153
- const componentId = getComponentJoinColumnInverseName(identifiers);
154
- const compTypeColumn = getComponentTypeColumn(identifiers);
155
- const fkIndex = getComponentFkIndexName(contentType.collectionName, identifiers);
156
- return {
157
- // TODO: make sure there can't be any conflicts with a prefix
158
- singularName: name,
159
- uid: name,
160
- tableName: name,
161
- attributes: {
162
- [identifiers.ID_COLUMN]: {
163
- type: "increments"
164
- },
165
- [entityId]: {
166
- type: "integer",
167
- column: {
168
- unsigned: true
169
- }
170
- },
171
- [componentId]: {
172
- type: "integer",
173
- column: {
174
- unsigned: true
175
- }
176
- },
177
- [compTypeColumn]: {
178
- type: "string"
179
- },
180
- [identifiers.FIELD_COLUMN]: {
181
- type: "string"
182
- },
183
- [identifiers.ORDER_COLUMN]: {
184
- type: "float",
185
- column: {
186
- unsigned: true,
187
- defaultTo: null
188
- }
189
- }
190
- },
191
- indexes: [
192
- {
193
- name: identifiers.getIndexName([contentType.collectionName, identifiers.FIELD_COLUMN]),
194
- columns: [identifiers.FIELD_COLUMN]
195
- },
196
- {
197
- name: identifiers.getIndexName([contentType.collectionName, compTypeColumn]),
198
- columns: [compTypeColumn]
199
- },
200
- {
201
- name: fkIndex,
202
- columns: [entityId]
203
- },
204
- {
205
- // NOTE: since we don't include attribute names, we need to be careful not to create another unique index
206
- name: identifiers.getUniqueIndexName([contentType.collectionName]),
207
- columns: [entityId, componentId, identifiers.FIELD_COLUMN, compTypeColumn],
208
- type: "unique"
209
- }
210
- ],
211
- foreignKeys: [
212
- {
213
- name: fkIndex,
214
- columns: [entityId],
215
- referencedColumns: [identifiers.ID_COLUMN],
216
- referencedTable: identifiers.getTableName(contentType.collectionName),
217
- onDelete: "CASCADE"
218
- }
219
- ]
220
- };
221
- };
222
- const transformContentTypesToModels = (contentTypes, identifiers) => {
223
- const models = [];
224
- contentTypes.forEach((contentType) => {
225
- assert(contentType.collectionName, 'Content type "collectionName" is required');
226
- assert(contentType.modelName, 'Content type "modelName" is required');
227
- assert(contentType.uid, 'Content type "uid" is required');
228
- const documentIdAttribute = contentType.modelType === "contentType" ? { documentId: { type: "string", default: createDocumentId } } : {};
229
- const reservedAttributeNames = ["document_id", identifiers.ID_COLUMN];
230
- Object.keys(contentType.attributes || {}).forEach((attributeName) => {
231
- const snakeCasedAttributeName = fp.snakeCase(attributeName);
232
- if (reservedAttributeNames.includes(snakeCasedAttributeName)) {
233
- throw new Error(
234
- `The attribute "${attributeName}" is reserved and cannot be used in a model. Please rename "${contentType.modelName}" attribute "${attributeName}" to something else.`
235
- );
236
- }
237
- });
238
- if (hasComponentsOrDz(contentType)) {
239
- const compoLinkModel = createCompoLinkModel(contentType, identifiers);
240
- models.push(compoLinkModel);
241
- }
242
- const model = {
243
- uid: contentType.uid,
244
- singularName: contentType.modelName,
245
- tableName: contentType.collectionName,
246
- // This gets shortened in metadata.loadModels(), so we don't shorten here or it will happen twice
247
- attributes: {
248
- [identifiers.ID_COLUMN]: {
249
- type: "increments"
250
- },
251
- ...documentIdAttribute,
252
- ...transformAttributes(contentType, identifiers)
253
- },
254
- indexes: contentType.indexes,
255
- foreignKeys: contentType.foreignKeys,
256
- lifecycles: contentType?.lifecycles ?? {}
257
- };
258
- if (contentType.modelType === "contentType") {
259
- model.indexes = [
260
- ...model.indexes || [],
261
- {
262
- name: identifiers.getIndexName([contentType.collectionName, "documents"]),
263
- // Filter attributes that are not in the schema
264
- columns: ["documentId", "locale", "publishedAt"].filter((n) => model.attributes[n]).map((name) => identifiers.getColumnName(fp.snakeCase(name)))
265
- }
266
- ];
267
- }
268
- models.push(model);
269
- });
270
- return models;
271
- };
272
- export {
273
- createDocumentId,
274
- getComponentFkIndexName,
275
- getComponentJoinColumnEntityName,
276
- getComponentJoinColumnInverseName,
277
- getComponentJoinTableName,
278
- getComponentTypeColumn,
279
- getDzJoinTableName,
280
- hasComponentsOrDz,
281
- transformAttribute,
282
- transformAttributes,
283
- transformContentTypesToModels
284
- };
285
- //# sourceMappingURL=transform-content-types-to-models.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"transform-content-types-to-models.mjs","sources":["../../src/utils/transform-content-types-to-models.ts"],"sourcesContent":["import { type Model, type Identifiers } from '@strapi/database';\nimport type { Struct, Schema } from '@strapi/types';\nimport { createId } from '@paralleldrive/cuid2';\nimport assert from 'node:assert';\nimport _ from 'lodash/fp';\n\n/**\n * Because strapi/database models don't know about things like components or dynamic zones, we use this file to convert them\n * to a relations format that it recognizes\n *\n * Therefore we have to keep an additional set of helpers/extensions to the database naming methods\n *\n * IMPORTANT!\n * If we use short versions of anything, we MUST call getNameFromTokens directly; attempting to shorten them ourselves\n * prevents the unshortened name map from being filled properly, so for example it will think that the short name\n * 'collection4f3a_cmps' maps to the unshortened 'collectionname_cmps' rather than 'collectionname_components'\n * Therefore, we only use the identifiers helpers in cases where we do not do any of our own shortening\n */\n\nexport const getComponentJoinTableName = (collectionName: string, identifiers: Identifiers) => {\n return identifiers.getNameFromTokens([\n { name: collectionName, compressible: true },\n { name: 'components', shortName: 'cmps', compressible: false },\n ]);\n};\n\nexport const getDzJoinTableName = (collectionName: string, identifiers: Identifiers) => {\n return identifiers.getNameFromTokens([\n { name: collectionName, compressible: true },\n { name: 'components', shortName: 'cmps', compressible: false },\n ]);\n};\n\nexport const getComponentJoinColumnEntityName = (identifiers: Identifiers) => {\n return identifiers.getNameFromTokens([\n { name: 'entity', compressible: false },\n { name: 'id', compressible: false },\n ]);\n};\n\nexport const getComponentJoinColumnInverseName = (identifiers: Identifiers) => {\n return identifiers.getNameFromTokens([\n { name: 'component', shortName: 'cmp', compressible: false },\n { name: 'id', compressible: false },\n ]);\n};\n\nexport const getComponentTypeColumn = (identifiers: Identifiers) => {\n return identifiers.getNameFromTokens([{ name: 'component_type', compressible: false }]);\n};\n\nexport const getComponentFkIndexName = (contentType: string, identifiers: Identifiers) => {\n return identifiers.getNameFromTokens([\n { name: contentType, compressible: true },\n { name: 'entity', compressible: false },\n { name: 'fk', compressible: false },\n ]);\n};\n\n// const { ID_COLUMN: id, FIELD_COLUMN: field, ORDER_COLUMN: order } = identifiers;\n\nexport type LoadedContentTypeModel = Struct.ContentTypeSchema &\n Required<Pick<Struct.ContentTypeSchema, 'collectionName' | 'uid' | 'modelName'>> &\n Pick<Model, 'lifecycles'>;\n\n// Transforms an attribute (particularly for relation types) into the format that strapi/database accepts\nexport const transformAttribute = (\n name: string,\n attribute: Schema.Attribute.AnyAttribute,\n contentType: LoadedContentTypeModel,\n identifiers: Identifiers\n) => {\n switch (attribute.type) {\n case 'media': {\n return {\n type: 'relation',\n relation: attribute.multiple === true ? 'morphMany' : 'morphOne',\n target: 'plugin::upload.file',\n morphBy: 'related',\n };\n }\n case 'component': {\n const joinTableName = getComponentJoinTableName(contentType.collectionName, identifiers);\n const joinColumnEntityName = getComponentJoinColumnEntityName(identifiers);\n const joinColumnInverseName = getComponentJoinColumnInverseName(identifiers);\n const compTypeColumn = getComponentTypeColumn(identifiers);\n return {\n type: 'relation',\n relation: attribute.repeatable === true ? 'oneToMany' : 'oneToOne',\n target: attribute.component,\n\n // We need the join table name to be deterministic,\n // We need to allow passing the join table name as an option\n joinTable: {\n name: joinTableName,\n joinColumn: {\n name: joinColumnEntityName,\n referencedColumn: identifiers.ID_COLUMN,\n },\n inverseJoinColumn: {\n name: joinColumnInverseName,\n referencedColumn: identifiers.ID_COLUMN,\n },\n on: {\n field: name,\n },\n orderColumnName: identifiers.ORDER_COLUMN,\n orderBy: {\n order: 'asc',\n },\n pivotColumns: [\n joinColumnEntityName,\n joinColumnInverseName,\n identifiers.FIELD_COLUMN,\n compTypeColumn,\n ],\n },\n };\n }\n case 'dynamiczone': {\n const joinTableName = getDzJoinTableName(contentType.collectionName, identifiers);\n const joinColumnEntityName = getComponentJoinColumnEntityName(identifiers);\n const joinColumnInverseName = getComponentJoinColumnInverseName(identifiers);\n const compTypeColumn = getComponentTypeColumn(identifiers);\n\n return {\n type: 'relation',\n relation: 'morphToMany',\n // TODO: handle restrictions at some point\n // target: attribute.components,\n joinTable: {\n name: joinTableName,\n joinColumn: {\n name: joinColumnEntityName,\n referencedColumn: identifiers.ID_COLUMN,\n },\n morphColumn: {\n idColumn: {\n name: joinColumnInverseName,\n referencedColumn: identifiers.ID_COLUMN,\n },\n typeColumn: {\n name: compTypeColumn,\n },\n typeField: '__component',\n },\n on: {\n field: name,\n },\n orderBy: {\n order: 'asc',\n },\n pivotColumns: [\n joinColumnEntityName,\n joinColumnInverseName,\n identifiers.FIELD_COLUMN,\n compTypeColumn,\n ],\n },\n };\n }\n default: {\n return attribute;\n }\n }\n};\n\nexport const transformAttributes = (\n contentType: LoadedContentTypeModel,\n identifiers: Identifiers\n) => {\n return Object.keys(contentType.attributes! || {}).reduce((attrs, attrName) => {\n return {\n ...attrs,\n [attrName]: transformAttribute(\n attrName,\n contentType.attributes[attrName]!,\n contentType,\n identifiers\n ),\n };\n }, {});\n};\n\nexport const hasComponentsOrDz = (\n contentType: LoadedContentTypeModel\n): contentType is LoadedContentTypeModel & { type: 'dynamiczone' | 'component' } => {\n return Object.values(contentType.attributes || {}).some(\n (({ type }: { type: string }) => type === 'dynamiczone' || type === 'component') as any\n );\n};\n\nexport const createDocumentId = createId;\n\nconst createCompoLinkModel = (\n contentType: LoadedContentTypeModel,\n identifiers: Identifiers\n): Model => {\n const name = getComponentJoinTableName(contentType.collectionName, identifiers);\n\n const entityId = getComponentJoinColumnEntityName(identifiers);\n const componentId = getComponentJoinColumnInverseName(identifiers);\n const compTypeColumn = getComponentTypeColumn(identifiers);\n const fkIndex = getComponentFkIndexName(contentType.collectionName, identifiers);\n\n return {\n // TODO: make sure there can't be any conflicts with a prefix\n singularName: name,\n uid: name,\n tableName: name,\n attributes: {\n [identifiers.ID_COLUMN]: {\n type: 'increments',\n },\n [entityId]: {\n type: 'integer',\n column: {\n unsigned: true,\n },\n },\n [componentId]: {\n type: 'integer',\n column: {\n unsigned: true,\n },\n },\n [compTypeColumn]: {\n type: 'string',\n },\n [identifiers.FIELD_COLUMN]: {\n type: 'string',\n },\n [identifiers.ORDER_COLUMN]: {\n type: 'float',\n column: {\n unsigned: true,\n defaultTo: null,\n },\n },\n },\n indexes: [\n {\n name: identifiers.getIndexName([contentType.collectionName, identifiers.FIELD_COLUMN]),\n columns: [identifiers.FIELD_COLUMN],\n },\n {\n name: identifiers.getIndexName([contentType.collectionName, compTypeColumn]),\n columns: [compTypeColumn],\n },\n {\n name: fkIndex,\n columns: [entityId],\n },\n {\n // NOTE: since we don't include attribute names, we need to be careful not to create another unique index\n name: identifiers.getUniqueIndexName([contentType.collectionName]),\n columns: [entityId, componentId, identifiers.FIELD_COLUMN, compTypeColumn],\n type: 'unique',\n },\n ],\n foreignKeys: [\n {\n name: fkIndex,\n columns: [entityId],\n referencedColumns: [identifiers.ID_COLUMN],\n referencedTable: identifiers.getTableName(contentType.collectionName),\n onDelete: 'CASCADE',\n },\n ],\n };\n};\n\nexport const transformContentTypesToModels = (\n contentTypes: LoadedContentTypeModel[],\n identifiers: Identifiers\n): Model[] => {\n const models: Model[] = [];\n\n contentTypes.forEach((contentType) => {\n assert(contentType.collectionName, 'Content type \"collectionName\" is required');\n assert(contentType.modelName, 'Content type \"modelName\" is required');\n assert(contentType.uid, 'Content type \"uid\" is required');\n\n // Add document id to content types\n // as it is not documented\n const documentIdAttribute: Record<string, Schema.Attribute.AnyAttribute> =\n contentType.modelType === 'contentType'\n ? { documentId: { type: 'string', default: createDocumentId } }\n : {};\n\n // TODO: this needs to be combined with getReservedNames, we should not be maintaining two lists\n // Prevent user from creating a documentId attribute\n const reservedAttributeNames = ['document_id', identifiers.ID_COLUMN];\n Object.keys(contentType.attributes || {}).forEach((attributeName) => {\n const snakeCasedAttributeName = _.snakeCase(attributeName);\n if (reservedAttributeNames.includes(snakeCasedAttributeName)) {\n throw new Error(\n `The attribute \"${attributeName}\" is reserved and cannot be used in a model. Please rename \"${contentType.modelName}\" attribute \"${attributeName}\" to something else.`\n );\n }\n });\n\n if (hasComponentsOrDz(contentType)) {\n const compoLinkModel = createCompoLinkModel(contentType, identifiers);\n models.push(compoLinkModel);\n }\n\n const model: Model = {\n uid: contentType.uid,\n singularName: contentType.modelName,\n tableName: contentType.collectionName, // This gets shortened in metadata.loadModels(), so we don't shorten here or it will happen twice\n attributes: {\n [identifiers.ID_COLUMN]: {\n type: 'increments',\n },\n ...documentIdAttribute,\n ...transformAttributes(contentType, identifiers),\n },\n indexes: contentType.indexes as Model['indexes'],\n foreignKeys: contentType.foreignKeys as Model['foreignKeys'],\n lifecycles: contentType?.lifecycles ?? {},\n };\n\n // Add indexes to model\n if (contentType.modelType === 'contentType') {\n model.indexes = [\n ...(model.indexes || []),\n {\n name: identifiers.getIndexName([contentType.collectionName, 'documents']),\n // Filter attributes that are not in the schema\n columns: ['documentId', 'locale', 'publishedAt']\n .filter((n) => model.attributes[n])\n .map((name) => identifiers.getColumnName(_.snakeCase(name))),\n },\n ];\n }\n\n models.push(model);\n });\n\n return models;\n};\n"],"names":["_"],"mappings":";;;AAmBa,MAAA,4BAA4B,CAAC,gBAAwB,gBAA6B;AAC7F,SAAO,YAAY,kBAAkB;AAAA,IACnC,EAAE,MAAM,gBAAgB,cAAc,KAAK;AAAA,IAC3C,EAAE,MAAM,cAAc,WAAW,QAAQ,cAAc,MAAM;AAAA,EAAA,CAC9D;AACH;AAEa,MAAA,qBAAqB,CAAC,gBAAwB,gBAA6B;AACtF,SAAO,YAAY,kBAAkB;AAAA,IACnC,EAAE,MAAM,gBAAgB,cAAc,KAAK;AAAA,IAC3C,EAAE,MAAM,cAAc,WAAW,QAAQ,cAAc,MAAM;AAAA,EAAA,CAC9D;AACH;AAEa,MAAA,mCAAmC,CAAC,gBAA6B;AAC5E,SAAO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+D,YAAY,SAAS,gBAAgB,aAAa;AAAA,QAClJ;AAAA,MAAA;AAAA,IACF,CACD;AAEG,QAAA,kBAAkB,WAAW,GAAG;AAC5B,YAAA,iBAAiB,qBAAqB,aAAa,WAAW;AACpE,aAAO,KAAK,cAAc;AAAA,IAAA;AAG5B,UAAM,QAAe;AAAA,MACnB,KAAK,YAAY;AAAA,MACjB,cAAc,YAAY;AAAA,MAC1B,WAAW,YAAY;AAAA;AAAA,MACvB,YAAY;AAAA,QACV,CAAC,YAAY,SAAS,GAAG;AAAA,UACvB,MAAM;AAAA,QACR;AAAA,QACA,GAAG;AAAA,QACH,GAAG,oBAAoB,aAAa,WAAW;AAAA,MACjD;AAAA,MACA,SAAS,YAAY;AAAA,MACrB,aAAa,YAAY;AAAA,MACzB,YAAY,aAAa,cAAc,CAAA;AAAA,IACzC;AAGI,QAAA,YAAY,cAAc,eAAe;AAC3C,YAAM,UAAU;AAAA,QACd,GAAI,MAAM,WAAW,CAAC;AAAA,QACtB;AAAA,UACE,MAAM,YAAY,aAAa,CAAC,YAAY,gBAAgB,WAAW,CAAC;AAAA;AAAA,UAExE,SAAS,CAAC,cAAc,UAAU,aAAa,EAC5C,OAAO,CAAC,MAAM,MAAM,WAAW,CAAC,CAAC,EACjC,IAAI,CAAC,SAAS,YAAY,cAAcA,GAAE,UAAU,IAAI,CAAC,CAAC;AAAA,QAAA;AAAA,MAEjE;AAAA,IAAA;AAGF,WAAO,KAAK,KAAK;AAAA,EAAA,CAClB;AAEM,SAAA;AACT;"}
@@ -1,85 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const path = require("path");
4
- const packageJson = require("package-json");
5
- const Configstore = require("configstore");
6
- const semver = require("semver");
7
- const boxen = require("boxen");
8
- const chalk = require("chalk");
9
- const strapiUtils = require("@strapi/utils");
10
- const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
11
- const path__default = /* @__PURE__ */ _interopDefault(path);
12
- const packageJson__default = /* @__PURE__ */ _interopDefault(packageJson);
13
- const Configstore__default = /* @__PURE__ */ _interopDefault(Configstore);
14
- const semver__default = /* @__PURE__ */ _interopDefault(semver);
15
- const boxen__default = /* @__PURE__ */ _interopDefault(boxen);
16
- const chalk__default = /* @__PURE__ */ _interopDefault(chalk);
17
- const pkg = require("../../../package.json");
18
- const CHECK_INTERVAL = 1e3 * 60 * 60 * 24 * 1;
19
- const NOTIF_INTERVAL = 1e3 * 60 * 60 * 24 * 7;
20
- const boxenOptions = {
21
- padding: 1,
22
- margin: 1,
23
- align: "center",
24
- borderColor: "yellow",
25
- borderStyle: "round"
26
- };
27
- const getUpdateMessage = (newVersion, currentVersion) => {
28
- const currentVersionLog = chalk__default.default.dim(currentVersion);
29
- const newVersionLog = chalk__default.default.green(newVersion);
30
- const releaseLink = chalk__default.default.bold("https://github.com/strapi/strapi/releases");
31
- return `
32
- A new version of Strapi is available ${currentVersionLog} → ${newVersionLog}
33
- Check out the new releases at: ${releaseLink}
34
- `.trim();
35
- };
36
- const createUpdateNotifier = (strapi) => {
37
- let config;
38
- try {
39
- config = new Configstore__default.default(
40
- pkg.name,
41
- {},
42
- { configPath: path__default.default.join(strapi.dirs.app.root, ".strapi-updater.json") }
43
- );
44
- } catch {
45
- return;
46
- }
47
- const checkUpdate = async (checkInterval) => {
48
- const now = Date.now();
49
- const lastUpdateCheck = config.get("lastUpdateCheck") || 0;
50
- if (lastUpdateCheck + checkInterval > now) {
51
- return;
52
- }
53
- try {
54
- const res = await packageJson__default.default(pkg.name);
55
- if (res.version) {
56
- config.set("latest", res.version);
57
- config.set("lastUpdateCheck", now);
58
- }
59
- } catch {
60
- }
61
- };
62
- const display = (notifInterval) => {
63
- const now = Date.now();
64
- const latestVersion = config.get("latest");
65
- const lastNotification = config.get("lastNotification") || 0;
66
- if (!process.stdout.isTTY || lastNotification + notifInterval > now || !semver__default.default.valid(latestVersion) || !semver__default.default.valid(pkg.version) || semver__default.default.lte(latestVersion, pkg.version)) {
67
- return;
68
- }
69
- const message = boxen__default.default(getUpdateMessage(latestVersion, pkg.version), boxenOptions);
70
- config.set("lastNotification", now);
71
- console.log(message);
72
- };
73
- if (strapiUtils.env.bool("STRAPI_DISABLE_UPDATE_NOTIFICATION", false)) {
74
- strapi.log.warn(
75
- "STRAPI_DISABLE_UPDATE_NOTIFICATION is no longer supported. Instead, set logger.updates.enabled to false in your server configuration."
76
- );
77
- }
78
- if (!strapi.config.get("server.logger.updates.enabled") || !config) {
79
- return;
80
- }
81
- display(NOTIF_INTERVAL);
82
- checkUpdate(CHECK_INTERVAL);
83
- };
84
- exports.createUpdateNotifier = createUpdateNotifier;
85
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/utils/update-notifier/index.ts"],"sourcesContent":["import path from 'path';\nimport packageJson from 'package-json';\nimport Configstore from 'configstore';\nimport semver from 'semver';\nimport boxen from 'boxen';\nimport chalk from 'chalk';\nimport { env } from '@strapi/utils';\nimport type { Core } from '@strapi/types';\n\n// eslint-disable-next-line @typescript-eslint/no-var-requires\nconst pkg = require('../../../package.json');\n\nconst CHECK_INTERVAL = 1000 * 60 * 60 * 24 * 1; // 1 day\nconst NOTIF_INTERVAL = 1000 * 60 * 60 * 24 * 7; // 1 week\nconst boxenOptions: boxen.Options = {\n padding: 1,\n margin: 1,\n align: 'center',\n borderColor: 'yellow',\n borderStyle: 'round',\n};\n\nconst getUpdateMessage = (newVersion: string, currentVersion: string) => {\n const currentVersionLog = chalk.dim(currentVersion);\n const newVersionLog = chalk.green(newVersion);\n const releaseLink = chalk.bold('https://github.com/strapi/strapi/releases');\n\n return `\nA new version of Strapi is available ${currentVersionLog} → ${newVersionLog}\nCheck out the new releases at: ${releaseLink}\n`.trim();\n};\n\nexport const createUpdateNotifier = (strapi: Core.Strapi) => {\n let config: InstanceType<typeof Configstore>;\n\n try {\n config = new Configstore(\n pkg.name,\n {},\n { configPath: path.join(strapi.dirs.app.root, '.strapi-updater.json') }\n );\n } catch {\n // we don't have write access to the file system\n // we silence the error\n return;\n }\n\n const checkUpdate = async (checkInterval: number) => {\n const now = Date.now();\n const lastUpdateCheck = config.get('lastUpdateCheck') || 0;\n if (lastUpdateCheck + checkInterval > now) {\n return;\n }\n\n try {\n const res = await packageJson(pkg.name);\n if (res.version) {\n config.set('latest', res.version);\n config.set('lastUpdateCheck', now);\n }\n } catch {\n // silence error if offline\n }\n };\n\n const display = (notifInterval: number) => {\n const now = Date.now();\n const latestVersion = config.get('latest');\n const lastNotification = config.get('lastNotification') || 0;\n\n if (\n !process.stdout.isTTY ||\n lastNotification + notifInterval > now ||\n !semver.valid(latestVersion) ||\n !semver.valid(pkg.version) ||\n semver.lte(latestVersion, pkg.version)\n ) {\n return;\n }\n\n const message = boxen(getUpdateMessage(latestVersion, pkg.version), boxenOptions);\n config.set('lastNotification', now);\n console.log(message);\n };\n\n // TODO v6: Remove this warning\n if (env.bool('STRAPI_DISABLE_UPDATE_NOTIFICATION', false)) {\n strapi.log.warn(\n 'STRAPI_DISABLE_UPDATE_NOTIFICATION is no longer supported. Instead, set logger.updates.enabled to false in your server configuration.'\n );\n }\n\n if (!strapi.config.get('server.logger.updates.enabled') || !config) {\n return;\n }\n\n display(NOTIF_INTERVAL);\n checkUpdate(CHECK_INTERVAL); // doesn't need to await\n};\n"],"names":["chalk","Configstore","path","packageJson","semver","boxen","env"],"mappings":";;;;;;;;;;;;;;;;AAUA,MAAM,MAAM,QAAQ,uBAAuB;AAE3C,MAAM,iBAAiB,MAAO,KAAK,KAAK,KAAK;AAC7C,MAAM,iBAAiB,MAAO,KAAK,KAAK,KAAK;AAC7C,MAAM,eAA8B;AAAA,EAClC,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,aAAa;AAAA,EACb,aAAa;AACf;AAEA,MAAM,mBAAmB,CAAC,YAAoB,mBAA2B;AACjE,QAAA,oBAAoBA,eAAAA,QAAM,IAAI,cAAc;AAC5C,QAAA,gBAAg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I,OAAO;AAAA,EACrB;AAGA,MAAIC,gBAAI,KAAK,sCAAsC,KAAK,GAAG;AACzD,WAAO,IAAI;AAAA,MACT;AAAA,IACF;AAAA,EAAA;AAGF,MAAI,CAAC,OAAO,OAAO,IAAI,+BAA+B,KAAK,CAAC,QAAQ;AAClE;AAAA,EAAA;AAGF,UAAQ,cAAc;AACtB,cAAY,cAAc;AAC5B;;"}
@@ -1,78 +0,0 @@
1
- import path from "path";
2
- import packageJson from "package-json";
3
- import Configstore from "configstore";
4
- import semver from "semver";
5
- import boxen from "boxen";
6
- import chalk from "chalk";
7
- import { env } from "@strapi/utils";
8
- const pkg = require("../../../package.json");
9
- const CHECK_INTERVAL = 1e3 * 60 * 60 * 24 * 1;
10
- const NOTIF_INTERVAL = 1e3 * 60 * 60 * 24 * 7;
11
- const boxenOptions = {
12
- padding: 1,
13
- margin: 1,
14
- align: "center",
15
- borderColor: "yellow",
16
- borderStyle: "round"
17
- };
18
- const getUpdateMessage = (newVersion, currentVersion) => {
19
- const currentVersionLog = chalk.dim(currentVersion);
20
- const newVersionLog = chalk.green(newVersion);
21
- const releaseLink = chalk.bold("https://github.com/strapi/strapi/releases");
22
- return `
23
- A new version of Strapi is available ${currentVersionLog} → ${newVersionLog}
24
- Check out the new releases at: ${releaseLink}
25
- `.trim();
26
- };
27
- const createUpdateNotifier = (strapi) => {
28
- let config;
29
- try {
30
- config = new Configstore(
31
- pkg.name,
32
- {},
33
- { configPath: path.join(strapi.dirs.app.root, ".strapi-updater.json") }
34
- );
35
- } catch {
36
- return;
37
- }
38
- const checkUpdate = async (checkInterval) => {
39
- const now = Date.now();
40
- const lastUpdateCheck = config.get("lastUpdateCheck") || 0;
41
- if (lastUpdateCheck + checkInterval > now) {
42
- return;
43
- }
44
- try {
45
- const res = await packageJson(pkg.name);
46
- if (res.version) {
47
- config.set("latest", res.version);
48
- config.set("lastUpdateCheck", now);
49
- }
50
- } catch {
51
- }
52
- };
53
- const display = (notifInterval) => {
54
- const now = Date.now();
55
- const latestVersion = config.get("latest");
56
- const lastNotification = config.get("lastNotification") || 0;
57
- if (!process.stdout.isTTY || lastNotification + notifInterval > now || !semver.valid(latestVersion) || !semver.valid(pkg.version) || semver.lte(latestVersion, pkg.version)) {
58
- return;
59
- }
60
- const message = boxen(getUpdateMessage(latestVersion, pkg.version), boxenOptions);
61
- config.set("lastNotification", now);
62
- console.log(message);
63
- };
64
- if (env.bool("STRAPI_DISABLE_UPDATE_NOTIFICATION", false)) {
65
- strapi.log.warn(
66
- "STRAPI_DISABLE_UPDATE_NOTIFICATION is no longer supported. Instead, set logger.updates.enabled to false in your server configuration."
67
- );
68
- }
69
- if (!strapi.config.get("server.logger.updates.enabled") || !config) {
70
- return;
71
- }
72
- display(NOTIF_INTERVAL);
73
- checkUpdate(CHECK_INTERVAL);
74
- };
75
- export {
76
- createUpdateNotifier
77
- };
78
- //# sourceMappingURL=index.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.mjs","sources":["../../../src/utils/update-notifier/index.ts"],"sourcesContent":["import path from 'path';\nimport packageJson from 'package-json';\nimport Configstore from 'configstore';\nimport semver from 'semver';\nimport boxen from 'boxen';\nimport chalk from 'chalk';\nimport { env } from '@strapi/utils';\nimport type { Core } from '@strapi/types';\n\n// eslint-disable-next-line @typescript-eslint/no-var-requires\nconst pkg = require('../../../package.json');\n\nconst CHECK_INTERVAL = 1000 * 60 * 60 * 24 * 1; // 1 day\nconst NOTIF_INTERVAL = 1000 * 60 * 60 * 24 * 7; // 1 week\nconst boxenOptions: boxen.Options = {\n padding: 1,\n margin: 1,\n align: 'center',\n borderColor: 'yellow',\n borderStyle: 'round',\n};\n\nconst getUpdateMessage = (newVersion: string, currentVersion: string) => {\n const currentVersionLog = chalk.dim(currentVersion);\n const newVersionLog = chalk.green(newVersion);\n const releaseLink = chalk.bold('https://github.com/strapi/strapi/releases');\n\n return `\nA new version of Strapi is available ${currentVersionLog} → ${newVersionLog}\nCheck out the new releases at: ${releaseLink}\n`.trim();\n};\n\nexport const createUpdateNotifier = (strapi: Core.Strapi) => {\n let config: InstanceType<typeof Configstore>;\n\n try {\n config = new Configstore(\n pkg.name,\n {},\n { configPath: path.join(strapi.dirs.app.root, '.strapi-updater.json') }\n );\n } catch {\n // we don't have write access to the file system\n // we silence the error\n return;\n }\n\n const checkUpdate = async (checkInterval: number) => {\n const now = Date.now();\n const lastUpdateCheck = config.get('lastUpdateCheck') || 0;\n if (lastUpdateCheck + checkInterval > now) {\n return;\n }\n\n try {\n const res = await packageJson(pkg.name);\n if (res.version) {\n config.set('latest', res.version);\n config.set('lastUpdateCheck', now);\n }\n } catch {\n // silence error if offline\n }\n };\n\n const display = (notifInterval: number) => {\n const now = Date.now();\n const latestVersion = config.get('latest');\n const lastNotification = config.get('lastNotification') || 0;\n\n if (\n !process.stdout.isTTY ||\n lastNotification + notifInterval > now ||\n !semver.valid(latestVersion) ||\n !semver.valid(pkg.version) ||\n semver.lte(latestVersion, pkg.version)\n ) {\n return;\n }\n\n const message = boxen(getUpdateMessage(latestVersion, pkg.version), boxenOptions);\n config.set('lastNotification', now);\n console.log(message);\n };\n\n // TODO v6: Remove this warning\n if (env.bool('STRAPI_DISABLE_UPDATE_NOTIFICATION', false)) {\n strapi.log.warn(\n 'STRAPI_DISABLE_UPDATE_NOTIFICATION is no longer supported. Instead, set logger.updates.enabled to false in your server configuration.'\n );\n }\n\n if (!strapi.config.get('server.logger.updates.enabled') || !config) {\n return;\n }\n\n display(NOTIF_INTERVAL);\n checkUpdate(CHECK_INTERVAL); // doesn't need to await\n};\n"],"names":[],"mappings":";;;;;;;AAUA,MAAM,MAAM,QAAQ,uBAAuB;AAE3C,MAAM,iBAAiB,MAAO,KAAK,KAAK,KAAK;AAC7C,MAAM,iBAAiB,MAAO,KAAK,KAAK,KAAK;AAC7C,MAAM,eAA8B;AAAA,EAClC,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,aAAa;AAAA,EACb,aAAa;AACf;AAEA,MA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