@strapi/strapi 4.12.7 → 4.13.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (869) hide show
  1. package/README.md +13 -5
  2. package/dist/Strapi.d.ts +124 -0
  3. package/dist/Strapi.js +524 -0
  4. package/dist/Strapi.js.map +1 -0
  5. package/dist/commands/actions/admin/create-user/action.d.ts +11 -0
  6. package/dist/commands/actions/admin/create-user/action.js +97 -0
  7. package/dist/commands/actions/admin/create-user/action.js.map +1 -0
  8. package/dist/commands/actions/admin/create-user/command.d.ts +6 -0
  9. package/dist/commands/actions/admin/create-user/command.js +19 -0
  10. package/dist/commands/actions/admin/create-user/command.js.map +1 -0
  11. package/dist/commands/actions/admin/reset-user-password/action.d.ts +9 -0
  12. package/dist/commands/actions/admin/reset-user-password/action.js +43 -0
  13. package/dist/commands/actions/admin/reset-user-password/action.js.map +1 -0
  14. package/dist/commands/actions/admin/reset-user-password/command.d.ts +6 -0
  15. package/dist/commands/actions/admin/reset-user-password/command.js +17 -0
  16. package/dist/commands/actions/admin/reset-user-password/command.js.map +1 -0
  17. package/dist/commands/actions/build-command/action.d.ts +9 -0
  18. package/dist/commands/actions/build-command/action.js +20 -0
  19. package/dist/commands/actions/build-command/action.js.map +1 -0
  20. package/dist/commands/actions/build-command/command.d.ts +6 -0
  21. package/dist/commands/actions/build-command/command.js +15 -0
  22. package/dist/commands/actions/build-command/command.js.map +1 -0
  23. package/dist/commands/actions/components/list/action.d.ts +2 -0
  24. package/dist/commands/actions/components/list/action.js +20 -0
  25. package/dist/commands/actions/components/list/action.js.map +1 -0
  26. package/dist/commands/actions/components/list/command.d.ts +6 -0
  27. package/dist/commands/actions/components/list/command.js +14 -0
  28. package/dist/commands/actions/components/list/command.js.map +1 -0
  29. package/dist/commands/actions/configuration/dump/action.d.ts +10 -0
  30. package/dist/commands/actions/configuration/dump/action.js +46 -0
  31. package/dist/commands/actions/configuration/dump/action.js.map +1 -0
  32. package/dist/commands/actions/configuration/dump/command.d.ts +6 -0
  33. package/dist/commands/actions/configuration/dump/command.js +17 -0
  34. package/dist/commands/actions/configuration/dump/command.js.map +1 -0
  35. package/dist/commands/actions/configuration/restore/action.d.ts +10 -0
  36. package/dist/commands/actions/configuration/restore/action.js +153 -0
  37. package/dist/commands/actions/configuration/restore/action.js.map +1 -0
  38. package/dist/commands/actions/configuration/restore/command.d.ts +6 -0
  39. package/dist/commands/actions/configuration/restore/command.js +17 -0
  40. package/dist/commands/actions/configuration/restore/command.js.map +1 -0
  41. package/dist/commands/actions/console/action.d.ts +5 -0
  42. package/dist/commands/actions/console/action.js +26 -0
  43. package/dist/commands/actions/console/action.js.map +1 -0
  44. package/dist/commands/actions/console/command.d.ts +6 -0
  45. package/dist/commands/actions/console/command.js +14 -0
  46. package/dist/commands/actions/console/command.js.map +1 -0
  47. package/dist/commands/actions/content-types/list/action.d.ts +2 -0
  48. package/dist/commands/actions/content-types/list/action.js +20 -0
  49. package/dist/commands/actions/content-types/list/action.js.map +1 -0
  50. package/dist/commands/actions/content-types/list/command.d.ts +6 -0
  51. package/dist/commands/actions/content-types/list/command.js +14 -0
  52. package/dist/commands/actions/content-types/list/command.js.map +1 -0
  53. package/dist/commands/actions/controllers/list/action.d.ts +2 -0
  54. package/dist/commands/actions/controllers/list/action.js +20 -0
  55. package/dist/commands/actions/controllers/list/action.js.map +1 -0
  56. package/dist/commands/actions/controllers/list/command.d.ts +6 -0
  57. package/dist/commands/actions/controllers/list/command.js +14 -0
  58. package/dist/commands/actions/controllers/list/command.js.map +1 -0
  59. package/dist/commands/actions/develop/action.d.ts +13 -0
  60. package/dist/commands/actions/develop/action.js +195 -0
  61. package/dist/commands/actions/develop/action.js.map +1 -0
  62. package/dist/commands/actions/develop/command.d.ts +6 -0
  63. package/dist/commands/actions/develop/command.js +19 -0
  64. package/dist/commands/actions/develop/command.js.map +1 -0
  65. package/dist/commands/actions/export/action.d.ts +20 -0
  66. package/dist/commands/actions/export/action.js +153 -0
  67. package/dist/commands/actions/export/action.js.map +1 -0
  68. package/dist/commands/actions/export/command.d.ts +6 -0
  69. package/dist/commands/actions/export/command.js +27 -0
  70. package/dist/commands/actions/export/command.js.map +1 -0
  71. package/dist/commands/actions/generate/command.d.ts +6 -0
  72. package/dist/commands/actions/generate/command.js +19 -0
  73. package/dist/commands/actions/generate/command.js.map +1 -0
  74. package/dist/commands/actions/hooks/list/action.d.ts +2 -0
  75. package/dist/commands/actions/hooks/list/action.js +20 -0
  76. package/dist/commands/actions/hooks/list/action.js.map +1 -0
  77. package/dist/commands/actions/hooks/list/command.d.ts +6 -0
  78. package/dist/commands/actions/hooks/list/command.js +14 -0
  79. package/dist/commands/actions/hooks/list/command.js.map +1 -0
  80. package/dist/commands/actions/import/action.d.ts +19 -0
  81. package/dist/commands/actions/import/action.js +135 -0
  82. package/dist/commands/actions/import/action.js.map +1 -0
  83. package/dist/commands/actions/import/command.d.ts +6 -0
  84. package/dist/commands/actions/import/command.js +74 -0
  85. package/dist/commands/actions/import/command.js.map +1 -0
  86. package/dist/commands/actions/install/action.d.ts +2 -0
  87. package/dist/commands/actions/install/action.js +49 -0
  88. package/dist/commands/actions/install/action.js.map +1 -0
  89. package/dist/commands/actions/install/command.d.ts +6 -0
  90. package/dist/commands/actions/install/command.js +14 -0
  91. package/dist/commands/actions/install/command.js.map +1 -0
  92. package/dist/commands/actions/middlewares/list/action.d.ts +2 -0
  93. package/dist/commands/actions/middlewares/list/action.js +20 -0
  94. package/dist/commands/actions/middlewares/list/action.js.map +1 -0
  95. package/dist/commands/actions/middlewares/list/command.d.ts +6 -0
  96. package/dist/commands/actions/middlewares/list/command.js +14 -0
  97. package/dist/commands/actions/middlewares/list/command.js.map +1 -0
  98. package/dist/commands/actions/new/action.d.ts +7 -0
  99. package/dist/commands/actions/new/action.js +12 -0
  100. package/dist/commands/actions/new/action.js.map +1 -0
  101. package/dist/commands/actions/new/command.d.ts +6 -0
  102. package/dist/commands/actions/new/command.js +35 -0
  103. package/dist/commands/actions/new/command.js.map +1 -0
  104. package/dist/commands/actions/policies/list/action.d.ts +2 -0
  105. package/dist/commands/actions/policies/list/action.js +20 -0
  106. package/dist/commands/actions/policies/list/action.js.map +1 -0
  107. package/dist/commands/actions/policies/list/command.d.ts +6 -0
  108. package/dist/commands/actions/policies/list/command.js +14 -0
  109. package/dist/commands/actions/policies/list/command.js.map +1 -0
  110. package/dist/commands/actions/report/action.d.ts +7 -0
  111. package/dist/commands/actions/report/action.js +32 -0
  112. package/dist/commands/actions/report/action.js.map +1 -0
  113. package/dist/commands/actions/report/command.d.ts +6 -0
  114. package/dist/commands/actions/report/command.js +17 -0
  115. package/dist/commands/actions/report/command.js.map +1 -0
  116. package/dist/commands/actions/routes/list/action.d.ts +2 -0
  117. package/dist/commands/actions/routes/list/action.js +26 -0
  118. package/dist/commands/actions/routes/list/action.js.map +1 -0
  119. package/dist/commands/actions/routes/list/command.d.ts +6 -0
  120. package/dist/commands/actions/routes/list/command.js +14 -0
  121. package/dist/commands/actions/routes/list/command.js.map +1 -0
  122. package/dist/commands/actions/services/list/action.d.ts +2 -0
  123. package/dist/commands/actions/services/list/action.js +20 -0
  124. package/dist/commands/actions/services/list/action.js.map +1 -0
  125. package/dist/commands/actions/services/list/command.d.ts +6 -0
  126. package/dist/commands/actions/services/list/command.js +14 -0
  127. package/dist/commands/actions/services/list/command.js.map +1 -0
  128. package/dist/commands/actions/start/action.d.ts +5 -0
  129. package/dist/commands/actions/start/action.js +22 -0
  130. package/dist/commands/actions/start/action.js.map +1 -0
  131. package/dist/commands/actions/start/command.d.ts +6 -0
  132. package/dist/commands/actions/start/command.js +14 -0
  133. package/dist/commands/actions/start/command.js.map +1 -0
  134. package/dist/commands/actions/telemetry/disable/action.d.ts +1 -0
  135. package/dist/commands/actions/telemetry/disable/action.js +83 -0
  136. package/dist/commands/actions/telemetry/disable/action.js.map +1 -0
  137. package/dist/commands/actions/telemetry/disable/command.d.ts +6 -0
  138. package/dist/commands/actions/telemetry/disable/command.js +14 -0
  139. package/dist/commands/actions/telemetry/disable/command.js.map +1 -0
  140. package/dist/commands/actions/telemetry/enable/command.d.ts +6 -0
  141. package/dist/commands/actions/telemetry/enable/command.js +14 -0
  142. package/dist/commands/actions/telemetry/enable/command.js.map +1 -0
  143. package/dist/commands/actions/templates/generate/action.d.ts +1 -0
  144. package/dist/commands/actions/templates/generate/action.js +85 -0
  145. package/dist/commands/actions/templates/generate/action.js.map +1 -0
  146. package/dist/commands/actions/templates/generate/command.d.ts +6 -0
  147. package/dist/commands/actions/templates/generate/command.js +14 -0
  148. package/dist/commands/actions/templates/generate/command.js.map +1 -0
  149. package/dist/commands/actions/transfer/action.d.ts +18 -0
  150. package/dist/commands/actions/transfer/action.js +159 -0
  151. package/dist/commands/actions/transfer/action.js.map +1 -0
  152. package/dist/commands/actions/transfer/command.d.ts +6 -0
  153. package/dist/commands/actions/transfer/command.js +68 -0
  154. package/dist/commands/actions/transfer/command.js.map +1 -0
  155. package/dist/commands/actions/ts/generate-types/action.d.ts +8 -0
  156. package/dist/commands/actions/ts/generate-types/action.js +28 -0
  157. package/dist/commands/actions/ts/generate-types/action.js.map +1 -0
  158. package/dist/commands/actions/ts/generate-types/command.d.ts +6 -0
  159. package/dist/commands/actions/ts/generate-types/command.js +18 -0
  160. package/dist/commands/actions/ts/generate-types/command.js.map +1 -0
  161. package/dist/commands/actions/uninstall/action.d.ts +5 -0
  162. package/dist/commands/actions/uninstall/action.js +67 -0
  163. package/dist/commands/actions/uninstall/action.js.map +1 -0
  164. package/dist/commands/actions/uninstall/command.d.ts +6 -0
  165. package/dist/commands/actions/uninstall/command.js +15 -0
  166. package/dist/commands/actions/uninstall/command.js.map +1 -0
  167. package/dist/commands/actions/version/command.d.ts +6 -0
  168. package/dist/commands/actions/version/command.js +19 -0
  169. package/dist/commands/actions/version/command.js.map +1 -0
  170. package/dist/commands/actions/watch-admin/action.d.ts +4 -0
  171. package/dist/commands/actions/watch-admin/action.js +36 -0
  172. package/dist/commands/actions/watch-admin/action.js.map +1 -0
  173. package/dist/commands/actions/watch-admin/command.d.ts +6 -0
  174. package/dist/commands/actions/watch-admin/command.js +15 -0
  175. package/dist/commands/actions/watch-admin/command.js.map +1 -0
  176. package/dist/commands/builders/admin.d.ts +8 -0
  177. package/dist/commands/builders/admin.js +52 -0
  178. package/dist/commands/builders/admin.js.map +1 -0
  179. package/dist/commands/builders/index.d.ts +3 -0
  180. package/dist/commands/builders/index.js +11 -0
  181. package/dist/commands/builders/index.js.map +1 -0
  182. package/dist/commands/builders/typescript.d.ts +6 -0
  183. package/dist/commands/builders/typescript.js +29 -0
  184. package/dist/commands/builders/typescript.js.map +1 -0
  185. package/dist/commands/index.d.ts +36 -0
  186. package/dist/commands/index.js +95 -0
  187. package/dist/commands/index.js.map +1 -0
  188. package/dist/commands/types.d.ts +5 -0
  189. package/dist/commands/types.js +3 -0
  190. package/dist/commands/types.js.map +1 -0
  191. package/dist/commands/utils/commander.d.ts +35 -0
  192. package/dist/commands/utils/commander.js +139 -0
  193. package/dist/commands/utils/commander.js.map +1 -0
  194. package/dist/commands/utils/data-transfer.d.ts +61 -0
  195. package/dist/commands/utils/data-transfer.js +336 -0
  196. package/dist/commands/utils/data-transfer.js.map +1 -0
  197. package/dist/commands/utils/helpers.d.ts +32 -0
  198. package/dist/commands/utils/helpers.js +122 -0
  199. package/dist/commands/utils/helpers.js.map +1 -0
  200. package/dist/compile.d.ts +4 -0
  201. package/dist/compile.js +21 -0
  202. package/dist/compile.js.map +1 -0
  203. package/dist/container.d.ts +7 -0
  204. package/dist/container.js +39 -0
  205. package/dist/container.js.map +1 -0
  206. package/dist/core/app-configuration/config-loader.d.ts +2 -0
  207. package/dist/core/app-configuration/config-loader.js +22 -0
  208. package/dist/core/app-configuration/config-loader.js.map +1 -0
  209. package/dist/core/app-configuration/index.d.ts +35 -0
  210. package/dist/core/app-configuration/index.js +54 -0
  211. package/dist/core/app-configuration/index.js.map +1 -0
  212. package/dist/core/app-configuration/load-config-file.d.ts +1 -0
  213. package/dist/core/app-configuration/load-config-file.js +49 -0
  214. package/dist/core/app-configuration/load-config-file.js.map +1 -0
  215. package/dist/core/bootstrap.d.ts +4 -0
  216. package/dist/core/bootstrap.js +27 -0
  217. package/dist/core/bootstrap.js.map +1 -0
  218. package/dist/core/domain/content-type/index.d.ts +8 -0
  219. package/dist/core/domain/content-type/index.js +116 -0
  220. package/dist/core/domain/content-type/index.js.map +1 -0
  221. package/dist/core/domain/content-type/validator.d.ts +21 -0
  222. package/dist/core/domain/content-type/validator.js +91 -0
  223. package/dist/core/domain/content-type/validator.js.map +1 -0
  224. package/dist/core/domain/module/index.d.ts +39 -0
  225. package/dist/core/domain/module/index.js +110 -0
  226. package/dist/core/domain/module/index.js.map +1 -0
  227. package/dist/core/domain/module/validation.d.ts +13 -0
  228. package/dist/core/domain/module/validation.js +29 -0
  229. package/dist/core/domain/module/validation.js.map +1 -0
  230. package/dist/core/loaders/admin.d.ts +2 -0
  231. package/dist/core/loaders/admin.js +18 -0
  232. package/dist/core/loaders/admin.js.map +1 -0
  233. package/dist/core/loaders/apis.d.ts +2 -0
  234. package/dist/core/loaders/apis.js +156 -0
  235. package/dist/core/loaders/apis.js.map +1 -0
  236. package/dist/core/loaders/components.d.ts +7 -0
  237. package/dist/core/loaders/components.js +37 -0
  238. package/dist/core/loaders/components.js.map +1 -0
  239. package/dist/core/loaders/index.d.ts +18 -0
  240. package/dist/core/loaders/index.js +26 -0
  241. package/dist/core/loaders/index.js.map +1 -0
  242. package/dist/core/loaders/middlewares.d.ts +2 -0
  243. package/dist/core/loaders/middlewares.js +34 -0
  244. package/dist/core/loaders/middlewares.js.map +1 -0
  245. package/dist/core/loaders/plugins/get-enabled-plugins.d.ts +4 -0
  246. package/dist/core/loaders/plugins/get-enabled-plugins.js +113 -0
  247. package/dist/core/loaders/plugins/get-enabled-plugins.js.map +1 -0
  248. package/dist/core/loaders/plugins/get-user-plugins-config.d.ts +6 -0
  249. package/dist/core/loaders/plugins/get-user-plugins-config.js +31 -0
  250. package/dist/core/loaders/plugins/get-user-plugins-config.js.map +1 -0
  251. package/dist/core/loaders/plugins/index.d.ts +2 -0
  252. package/dist/core/loaders/plugins/index.js +109 -0
  253. package/dist/core/loaders/plugins/index.js.map +1 -0
  254. package/dist/core/loaders/policies.d.ts +2 -0
  255. package/dist/core/loaders/policies.js +28 -0
  256. package/dist/core/loaders/policies.js.map +1 -0
  257. package/dist/core/loaders/sanitizers.d.ts +3 -0
  258. package/dist/core/loaders/sanitizers.js +6 -0
  259. package/dist/core/loaders/sanitizers.js.map +1 -0
  260. package/dist/core/loaders/src-index.d.ts +3 -0
  261. package/dist/core/loaders/src-index.js +37 -0
  262. package/dist/core/loaders/src-index.js.map +1 -0
  263. package/dist/core/loaders/validators.d.ts +3 -0
  264. package/dist/core/loaders/validators.js +6 -0
  265. package/dist/core/loaders/validators.js.map +1 -0
  266. package/dist/core/registries/apis.d.ts +7 -0
  267. package/dist/core/registries/apis.js +24 -0
  268. package/dist/core/registries/apis.js.map +1 -0
  269. package/dist/core/registries/config.d.ts +7 -0
  270. package/dist/core/registries/config.js +24 -0
  271. package/dist/core/registries/config.js.map +1 -0
  272. package/dist/core/registries/content-types.d.ts +32 -0
  273. package/dist/core/registries/content-types.js +70 -0
  274. package/dist/core/registries/content-types.js.map +1 -0
  275. package/dist/core/registries/controllers.d.ts +35 -0
  276. package/dist/core/registries/controllers.js +81 -0
  277. package/dist/core/registries/controllers.js.map +1 -0
  278. package/dist/core/registries/custom-fields.d.ts +8 -0
  279. package/dist/core/registries/custom-fields.js +74 -0
  280. package/dist/core/registries/custom-fields.js.map +1 -0
  281. package/dist/core/registries/hooks.d.ts +43 -0
  282. package/dist/core/registries/hooks.js +59 -0
  283. package/dist/core/registries/hooks.js.map +1 -0
  284. package/dist/core/registries/middlewares.d.ts +30 -0
  285. package/dist/core/registries/middlewares.js +62 -0
  286. package/dist/core/registries/middlewares.js.map +1 -0
  287. package/dist/core/registries/modules.d.ts +14 -0
  288. package/dist/core/registries/modules.js +40 -0
  289. package/dist/core/registries/modules.js.map +1 -0
  290. package/dist/core/registries/plugins.d.ts +9 -0
  291. package/dist/core/registries/plugins.js +24 -0
  292. package/dist/core/registries/plugins.js.map +1 -0
  293. package/dist/core/registries/policies.d.ts +33 -0
  294. package/dist/core/registries/policies.js +64 -0
  295. package/dist/core/registries/policies.js.map +1 -0
  296. package/dist/core/registries/sanitizers.d.ts +9 -0
  297. package/dist/core/registries/sanitizers.js +27 -0
  298. package/dist/core/registries/sanitizers.js.map +1 -0
  299. package/dist/core/registries/services.d.ts +35 -0
  300. package/dist/core/registries/services.js +82 -0
  301. package/dist/core/registries/services.js.map +1 -0
  302. package/dist/core/registries/validators.d.ts +9 -0
  303. package/dist/core/registries/validators.js +27 -0
  304. package/dist/core/registries/validators.js.map +1 -0
  305. package/dist/core/utils.d.ts +4 -0
  306. package/dist/core/utils.js +28 -0
  307. package/dist/core/utils.js.map +1 -0
  308. package/dist/core-api/controller/collection-type.d.ts +10 -0
  309. package/dist/core-api/controller/collection-type.js +95 -0
  310. package/dist/core-api/controller/collection-type.js.map +1 -0
  311. package/dist/core-api/controller/index.d.ts +5 -0
  312. package/dist/core-api/controller/index.js +50 -0
  313. package/dist/core-api/controller/index.js.map +1 -0
  314. package/dist/core-api/controller/single-type.d.ts +9 -0
  315. package/dist/core-api/controller/single-type.js +52 -0
  316. package/dist/core-api/controller/single-type.js.map +1 -0
  317. package/dist/core-api/controller/transform.d.ts +21 -0
  318. package/dist/core-api/controller/transform.js +88 -0
  319. package/dist/core-api/controller/transform.js.map +1 -0
  320. package/dist/core-api/routes/index.d.ts +23 -0
  321. package/dist/core-api/routes/index.js +68 -0
  322. package/dist/core-api/routes/index.js.map +1 -0
  323. package/dist/core-api/service/collection-type.d.ts +9 -0
  324. package/dist/core-api/service/collection-type.js +58 -0
  325. package/dist/core-api/service/collection-type.js.map +1 -0
  326. package/dist/core-api/service/get-fetch-params.d.ts +6 -0
  327. package/dist/core-api/service/get-fetch-params.js +16 -0
  328. package/dist/core-api/service/get-fetch-params.js.map +1 -0
  329. package/dist/core-api/service/index.d.ts +8 -0
  330. package/dist/core-api/service/index.js +18 -0
  331. package/dist/core-api/service/index.js.map +1 -0
  332. package/dist/core-api/service/pagination.d.ts +40 -0
  333. package/dist/core-api/service/pagination.js +96 -0
  334. package/dist/core-api/service/pagination.js.map +1 -0
  335. package/dist/core-api/service/single-type.d.ts +8 -0
  336. package/dist/core-api/service/single-type.js +56 -0
  337. package/dist/core-api/service/single-type.js.map +1 -0
  338. package/dist/ee/index.d.ts +19 -0
  339. package/dist/ee/index.js +185 -0
  340. package/dist/ee/index.js.map +1 -0
  341. package/dist/ee/license.d.ts +20 -0
  342. package/dist/ee/license.js +94 -0
  343. package/dist/ee/license.js.map +1 -0
  344. package/dist/factories.d.ts +13 -0
  345. package/dist/factories.js +70 -0
  346. package/dist/factories.js.map +1 -0
  347. package/dist/index.d.ts +3 -0
  348. package/dist/index.js +8 -0
  349. package/dist/index.js.map +1 -0
  350. package/dist/load/filepath-to-prop-path.d.ts +5 -0
  351. package/dist/load/filepath-to-prop-path.js +21 -0
  352. package/dist/load/filepath-to-prop-path.js.map +1 -0
  353. package/dist/load/glob.d.ts +6 -0
  354. package/dist/load/glob.js +20 -0
  355. package/dist/load/glob.js.map +1 -0
  356. package/dist/load/index.d.ts +2 -0
  357. package/dist/load/index.js +11 -0
  358. package/dist/load/index.js.map +1 -0
  359. package/dist/load/load-files.d.ts +9 -0
  360. package/dist/load/load-files.js +44 -0
  361. package/dist/load/load-files.js.map +1 -0
  362. package/dist/load/package-path.d.ts +5 -0
  363. package/dist/load/package-path.js +11 -0
  364. package/dist/load/package-path.js.map +1 -0
  365. package/dist/middlewares/body.d.ts +5 -0
  366. package/dist/middlewares/body.js +78 -0
  367. package/dist/middlewares/body.js.map +1 -0
  368. package/dist/middlewares/compression.d.ts +4 -0
  369. package/dist/middlewares/compression.js +10 -0
  370. package/dist/middlewares/compression.js.map +1 -0
  371. package/dist/middlewares/cors.d.ts +12 -0
  372. package/dist/middlewares/cors.js +54 -0
  373. package/dist/middlewares/cors.js.map +1 -0
  374. package/dist/middlewares/errors.d.ts +3 -0
  375. package/dist/middlewares/errors.js +35 -0
  376. package/dist/middlewares/errors.js.map +1 -0
  377. package/dist/middlewares/favicon.d.ts +4 -0
  378. package/dist/middlewares/favicon.js +30 -0
  379. package/dist/middlewares/favicon.js.map +1 -0
  380. package/dist/middlewares/index.d.ts +2 -0
  381. package/dist/middlewares/index.js +34 -0
  382. package/dist/middlewares/index.js.map +1 -0
  383. package/dist/middlewares/ip.d.ts +4 -0
  384. package/dist/middlewares/ip.js +10 -0
  385. package/dist/middlewares/ip.js.map +1 -0
  386. package/dist/middlewares/logger.d.ts +2 -0
  387. package/dist/middlewares/logger.js +13 -0
  388. package/dist/middlewares/logger.js.map +1 -0
  389. package/dist/middlewares/powered-by.d.ts +5 -0
  390. package/dist/middlewares/powered-by.js +15 -0
  391. package/dist/middlewares/powered-by.js.map +1 -0
  392. package/dist/middlewares/public/index.d.ts +2 -0
  393. package/dist/middlewares/public/index.js +112 -0
  394. package/dist/middlewares/public/index.js.map +1 -0
  395. package/dist/middlewares/public/serve-static.d.ts +3 -0
  396. package/dist/middlewares/public/serve-static.js +27 -0
  397. package/dist/middlewares/public/serve-static.js.map +1 -0
  398. package/dist/middlewares/query.d.ts +2 -0
  399. package/dist/middlewares/query.js +45 -0
  400. package/dist/middlewares/query.js.map +1 -0
  401. package/dist/middlewares/response-time.d.ts +2 -0
  402. package/dist/middlewares/response-time.js +13 -0
  403. package/dist/middlewares/response-time.js.map +1 -0
  404. package/dist/middlewares/responses.d.ts +5 -0
  405. package/dist/middlewares/responses.js +16 -0
  406. package/dist/middlewares/responses.js.map +1 -0
  407. package/dist/middlewares/security.d.ts +4 -0
  408. package/dist/middlewares/security.js +52 -0
  409. package/dist/middlewares/security.js.map +1 -0
  410. package/dist/middlewares/session.d.ts +3 -0
  411. package/dist/middlewares/session.js +30 -0
  412. package/dist/middlewares/session.js.map +1 -0
  413. package/dist/migrations/draft-publish.d.ts +8 -0
  414. package/dist/migrations/draft-publish.js +46 -0
  415. package/dist/migrations/draft-publish.js.map +1 -0
  416. package/dist/services/auth/index.d.ts +25 -0
  417. package/dist/services/auth/index.js +84 -0
  418. package/dist/services/auth/index.js.map +1 -0
  419. package/dist/services/content-api/index.d.ts +54 -0
  420. package/dist/services/content-api/index.js +62 -0
  421. package/dist/services/content-api/index.js.map +1 -0
  422. package/dist/services/content-api/permissions/engine.d.ts +4 -0
  423. package/dist/services/content-api/permissions/engine.js +8 -0
  424. package/dist/services/content-api/permissions/engine.js.map +1 -0
  425. package/dist/services/content-api/permissions/index.d.ts +51 -0
  426. package/dist/services/content-api/permissions/index.js +119 -0
  427. package/dist/services/content-api/permissions/index.js.map +1 -0
  428. package/dist/services/content-api/permissions/providers/action.d.ts +19 -0
  429. package/dist/services/content-api/permissions/providers/action.js +16 -0
  430. package/dist/services/content-api/permissions/providers/action.js.map +1 -0
  431. package/dist/services/content-api/permissions/providers/condition.d.ts +23 -0
  432. package/dist/services/content-api/permissions/providers/condition.js +16 -0
  433. package/dist/services/content-api/permissions/providers/condition.js.map +1 -0
  434. package/dist/services/content-api/permissions/providers/index.d.ts +2 -0
  435. package/dist/services/content-api/permissions/providers/index.js +11 -0
  436. package/dist/services/content-api/permissions/providers/index.js.map +1 -0
  437. package/dist/services/core-store.d.ts +52 -0
  438. package/dist/services/core-store.js +123 -0
  439. package/dist/services/core-store.js.map +1 -0
  440. package/dist/services/cron.d.ts +26 -0
  441. package/dist/services/cron.js +69 -0
  442. package/dist/services/cron.js.map +1 -0
  443. package/dist/services/custom-fields.d.ts +4 -0
  444. package/dist/services/custom-fields.js +11 -0
  445. package/dist/services/custom-fields.js.map +1 -0
  446. package/dist/services/entity-service/attributes/index.d.ts +5 -0
  447. package/dist/services/entity-service/attributes/index.js +25 -0
  448. package/dist/services/entity-service/attributes/index.js.map +1 -0
  449. package/dist/services/entity-service/attributes/transforms.d.ts +9 -0
  450. package/dist/services/entity-service/attributes/transforms.js +19 -0
  451. package/dist/services/entity-service/attributes/transforms.js.map +1 -0
  452. package/dist/services/entity-service/components.d.ts +18 -0
  453. package/dist/services/entity-service/components.js +373 -0
  454. package/dist/services/entity-service/components.js.map +1 -0
  455. package/dist/services/entity-service/index.d.ts +4 -0
  456. package/dist/services/entity-service/index.js +314 -0
  457. package/dist/services/entity-service/index.js.map +1 -0
  458. package/dist/services/entity-service/params.d.ts +2 -0
  459. package/dist/services/entity-service/params.js +7 -0
  460. package/dist/services/entity-service/params.js.map +1 -0
  461. package/dist/services/entity-service/types/index.d.ts +70 -0
  462. package/dist/services/entity-service/types/index.js +34 -0
  463. package/dist/services/entity-service/types/index.js.map +1 -0
  464. package/dist/services/entity-service/types/params/attributes.d.ts +72 -0
  465. package/dist/services/entity-service/types/params/attributes.js +3 -0
  466. package/dist/services/entity-service/types/params/attributes.js.map +1 -0
  467. package/dist/services/entity-service/types/params/data.d.ts +3 -0
  468. package/dist/services/entity-service/types/params/data.js +3 -0
  469. package/dist/services/entity-service/types/params/data.js.map +1 -0
  470. package/dist/services/entity-service/types/params/fields.d.ts +58 -0
  471. package/dist/services/entity-service/types/params/fields.js +3 -0
  472. package/dist/services/entity-service/types/params/fields.js.map +1 -0
  473. package/dist/services/entity-service/types/params/filters/index.d.ts +44 -0
  474. package/dist/services/entity-service/types/params/filters/index.js +3 -0
  475. package/dist/services/entity-service/types/params/filters/index.js.map +1 -0
  476. package/dist/services/entity-service/types/params/filters/operators.d.ts +8 -0
  477. package/dist/services/entity-service/types/params/filters/operators.js +3 -0
  478. package/dist/services/entity-service/types/params/filters/operators.js.map +1 -0
  479. package/dist/services/entity-service/types/params/index.d.ts +132 -0
  480. package/dist/services/entity-service/types/params/index.js +3 -0
  481. package/dist/services/entity-service/types/params/index.js.map +1 -0
  482. package/dist/services/entity-service/types/params/pagination.d.ts +10 -0
  483. package/dist/services/entity-service/types/params/pagination.js +3 -0
  484. package/dist/services/entity-service/types/params/pagination.js.map +1 -0
  485. package/dist/services/entity-service/types/params/populate.d.ts +68 -0
  486. package/dist/services/entity-service/types/params/populate.js +3 -0
  487. package/dist/services/entity-service/types/params/populate.js.map +1 -0
  488. package/dist/services/entity-service/types/params/publication-state.d.ts +15 -0
  489. package/dist/services/entity-service/types/params/publication-state.js +3 -0
  490. package/dist/services/entity-service/types/params/publication-state.js.map +1 -0
  491. package/dist/services/entity-service/types/params/search.d.ts +1 -0
  492. package/dist/services/entity-service/types/params/search.js +3 -0
  493. package/dist/services/entity-service/types/params/search.js.map +1 -0
  494. package/dist/services/entity-service/types/params/sort.d.ts +84 -0
  495. package/dist/services/entity-service/types/params/sort.js +3 -0
  496. package/dist/services/entity-service/types/params/sort.js.map +1 -0
  497. package/dist/services/entity-service/types/plugin.d.ts +7 -0
  498. package/dist/services/entity-service/types/plugin.js +3 -0
  499. package/dist/services/entity-service/types/plugin.js.map +1 -0
  500. package/dist/services/entity-service/types/result.d.ts +88 -0
  501. package/dist/services/entity-service/types/result.js +3 -0
  502. package/dist/services/entity-service/types/result.js.map +1 -0
  503. package/dist/services/entity-validator/index.d.ts +15 -0
  504. package/dist/services/entity-validator/index.js +347 -0
  505. package/dist/services/entity-validator/index.js.map +1 -0
  506. package/dist/services/entity-validator/types.d.ts +1 -0
  507. package/dist/services/entity-validator/types.js +3 -0
  508. package/dist/services/entity-validator/types.js.map +1 -0
  509. package/dist/services/entity-validator/validators.d.ts +36 -0
  510. package/dist/services/entity-validator/validators.js +146 -0
  511. package/dist/services/entity-validator/validators.js.map +1 -0
  512. package/dist/services/errors.d.ts +39 -0
  513. package/dist/services/errors.js +78 -0
  514. package/dist/services/errors.js.map +1 -0
  515. package/dist/services/event-hub.d.ts +18 -0
  516. package/dist/services/event-hub.js +77 -0
  517. package/dist/services/event-hub.js.map +1 -0
  518. package/dist/services/fs.d.ts +12 -0
  519. package/dist/services/fs.js +54 -0
  520. package/dist/services/fs.js.map +1 -0
  521. package/dist/services/metrics/admin-user-hash.d.ts +6 -0
  522. package/dist/services/metrics/admin-user-hash.js +19 -0
  523. package/dist/services/metrics/admin-user-hash.js.map +1 -0
  524. package/dist/services/metrics/index.d.ts +13 -0
  525. package/dist/services/metrics/index.js +53 -0
  526. package/dist/services/metrics/index.js.map +1 -0
  527. package/dist/services/metrics/is-truthy.d.ts +2 -0
  528. package/dist/services/metrics/is-truthy.js +11 -0
  529. package/dist/services/metrics/is-truthy.js.map +1 -0
  530. package/dist/services/metrics/middleware.d.ts +6 -0
  531. package/dist/services/metrics/middleware.js +28 -0
  532. package/dist/services/metrics/middleware.js.map +1 -0
  533. package/dist/services/metrics/rate-limiter.d.ts +6 -0
  534. package/dist/services/metrics/rate-limiter.js +21 -0
  535. package/dist/services/metrics/rate-limiter.js.map +1 -0
  536. package/dist/services/metrics/sender.d.ts +12 -0
  537. package/dist/services/metrics/sender.js +80 -0
  538. package/dist/services/metrics/sender.js.map +1 -0
  539. package/dist/services/request-context.d.ts +6 -0
  540. package/dist/services/request-context.js +14 -0
  541. package/dist/services/request-context.js.map +1 -0
  542. package/dist/services/server/admin-api.d.ts +10 -0
  543. package/dist/services/server/admin-api.js +13 -0
  544. package/dist/services/server/admin-api.js.map +1 -0
  545. package/dist/services/server/api.d.ts +15 -0
  546. package/dist/services/server/api.js +32 -0
  547. package/dist/services/server/api.js.map +1 -0
  548. package/dist/services/server/compose-endpoint.d.ts +7 -0
  549. package/dist/services/server/compose-endpoint.js +121 -0
  550. package/dist/services/server/compose-endpoint.js.map +1 -0
  551. package/dist/services/server/content-api.d.ts +10 -0
  552. package/dist/services/server/content-api.js +13 -0
  553. package/dist/services/server/content-api.js.map +1 -0
  554. package/dist/services/server/http-server.d.ts +9 -0
  555. package/dist/services/server/http-server.js +54 -0
  556. package/dist/services/server/http-server.js.map +1 -0
  557. package/dist/services/server/index.d.ts +33 -0
  558. package/dist/services/server/index.js +99 -0
  559. package/dist/services/server/index.js.map +1 -0
  560. package/dist/services/server/koa.d.ts +15 -0
  561. package/dist/services/server/koa.js +56 -0
  562. package/dist/services/server/koa.js.map +1 -0
  563. package/dist/services/server/middleware.d.ts +15 -0
  564. package/dist/services/server/middleware.js +103 -0
  565. package/dist/services/server/middleware.js.map +1 -0
  566. package/dist/services/server/policy.d.ts +3 -0
  567. package/dist/services/server/policy.js +21 -0
  568. package/dist/services/server/policy.js.map +1 -0
  569. package/dist/services/server/register-middlewares.d.ts +6 -0
  570. package/dist/services/server/register-middlewares.js +82 -0
  571. package/dist/services/server/register-middlewares.js.map +1 -0
  572. package/dist/services/server/register-routes.d.ts +6 -0
  573. package/dist/services/server/register-routes.js +94 -0
  574. package/dist/services/server/register-routes.js.map +1 -0
  575. package/dist/services/server/routing.d.ts +33 -0
  576. package/dist/services/server/routing.js +105 -0
  577. package/dist/services/server/routing.js.map +1 -0
  578. package/dist/services/utils/dynamic-zones.d.ts +2 -0
  579. package/dist/services/utils/dynamic-zones.js +13 -0
  580. package/dist/services/utils/dynamic-zones.js.map +1 -0
  581. package/dist/services/utils/upload-files.d.ts +8 -0
  582. package/dist/services/utils/upload-files.js +73 -0
  583. package/dist/services/utils/upload-files.js.map +1 -0
  584. package/dist/services/webhook-runner.d.ts +48 -0
  585. package/dist/services/webhook-runner.js +136 -0
  586. package/dist/services/webhook-runner.js.map +1 -0
  587. package/dist/services/webhook-store.d.ts +49 -0
  588. package/dist/services/webhook-store.js +106 -0
  589. package/dist/services/webhook-store.js.map +1 -0
  590. package/dist/services/worker-queue.d.ts +19 -0
  591. package/dist/services/worker-queue.js +59 -0
  592. package/dist/services/worker-queue.js.map +1 -0
  593. package/dist/types/core/attributes/base.d.ts +54 -0
  594. package/dist/types/core/attributes/base.js +3 -0
  595. package/dist/types/core/attributes/base.js.map +1 -0
  596. package/dist/types/core/attributes/biginteger.d.ts +4 -0
  597. package/dist/types/core/attributes/biginteger.js +3 -0
  598. package/dist/types/core/attributes/biginteger.js.map +1 -0
  599. package/dist/types/core/attributes/boolean.d.ts +6 -0
  600. package/dist/types/core/attributes/boolean.js +3 -0
  601. package/dist/types/core/attributes/boolean.js.map +1 -0
  602. package/dist/types/core/attributes/common.d.ts +58 -0
  603. package/dist/types/core/attributes/common.js +6 -0
  604. package/dist/types/core/attributes/common.js.map +1 -0
  605. package/dist/types/core/attributes/component.d.ts +10 -0
  606. package/dist/types/core/attributes/component.js +3 -0
  607. package/dist/types/core/attributes/component.js.map +1 -0
  608. package/dist/types/core/attributes/date-time.d.ts +4 -0
  609. package/dist/types/core/attributes/date-time.js +3 -0
  610. package/dist/types/core/attributes/date-time.js.map +1 -0
  611. package/dist/types/core/attributes/date.d.ts +4 -0
  612. package/dist/types/core/attributes/date.js +3 -0
  613. package/dist/types/core/attributes/date.js.map +1 -0
  614. package/dist/types/core/attributes/decimal.d.ts +4 -0
  615. package/dist/types/core/attributes/decimal.js +3 -0
  616. package/dist/types/core/attributes/decimal.js.map +1 -0
  617. package/dist/types/core/attributes/dynamic-zone.d.ts +12 -0
  618. package/dist/types/core/attributes/dynamic-zone.js +3 -0
  619. package/dist/types/core/attributes/dynamic-zone.js.map +1 -0
  620. package/dist/types/core/attributes/email.d.ts +4 -0
  621. package/dist/types/core/attributes/email.js +3 -0
  622. package/dist/types/core/attributes/email.js.map +1 -0
  623. package/dist/types/core/attributes/enumeration.d.ts +8 -0
  624. package/dist/types/core/attributes/enumeration.js +3 -0
  625. package/dist/types/core/attributes/enumeration.js.map +1 -0
  626. package/dist/types/core/attributes/float.d.ts +4 -0
  627. package/dist/types/core/attributes/float.js +3 -0
  628. package/dist/types/core/attributes/float.js.map +1 -0
  629. package/dist/types/core/attributes/index.d.ts +24 -0
  630. package/dist/types/core/attributes/index.js +41 -0
  631. package/dist/types/core/attributes/index.js.map +1 -0
  632. package/dist/types/core/attributes/integer.d.ts +4 -0
  633. package/dist/types/core/attributes/integer.js +3 -0
  634. package/dist/types/core/attributes/integer.js.map +1 -0
  635. package/dist/types/core/attributes/json.d.ts +4 -0
  636. package/dist/types/core/attributes/json.js +3 -0
  637. package/dist/types/core/attributes/json.js.map +1 -0
  638. package/dist/types/core/attributes/media.d.ts +12 -0
  639. package/dist/types/core/attributes/media.js +3 -0
  640. package/dist/types/core/attributes/media.js.map +1 -0
  641. package/dist/types/core/attributes/password.d.ts +4 -0
  642. package/dist/types/core/attributes/password.js +3 -0
  643. package/dist/types/core/attributes/password.js.map +1 -0
  644. package/dist/types/core/attributes/relation.d.ts +75 -0
  645. package/dist/types/core/attributes/relation.js +3 -0
  646. package/dist/types/core/attributes/relation.js.map +1 -0
  647. package/dist/types/core/attributes/richtext.d.ts +4 -0
  648. package/dist/types/core/attributes/richtext.js +3 -0
  649. package/dist/types/core/attributes/richtext.js.map +1 -0
  650. package/dist/types/core/attributes/string.d.ts +9 -0
  651. package/dist/types/core/attributes/string.js +3 -0
  652. package/dist/types/core/attributes/string.js.map +1 -0
  653. package/dist/types/core/attributes/text.d.ts +7 -0
  654. package/dist/types/core/attributes/text.js +3 -0
  655. package/dist/types/core/attributes/text.js.map +1 -0
  656. package/dist/types/core/attributes/time.d.ts +4 -0
  657. package/dist/types/core/attributes/time.js +3 -0
  658. package/dist/types/core/attributes/time.js.map +1 -0
  659. package/dist/types/core/attributes/timestamp.d.ts +4 -0
  660. package/dist/types/core/attributes/timestamp.js +3 -0
  661. package/dist/types/core/attributes/timestamp.js.map +1 -0
  662. package/dist/types/core/attributes/uid.d.ts +15 -0
  663. package/dist/types/core/attributes/uid.js +3 -0
  664. package/dist/types/core/attributes/uid.js.map +1 -0
  665. package/dist/types/core/attributes/utils.d.ts +27 -0
  666. package/dist/types/core/attributes/utils.js +3 -0
  667. package/dist/types/core/attributes/utils.js.map +1 -0
  668. package/dist/types/core/commands/index.d.ts +5 -0
  669. package/dist/types/core/commands/index.js +3 -0
  670. package/dist/types/core/commands/index.js.map +1 -0
  671. package/dist/types/core/common/api.d.ts +3 -0
  672. package/dist/types/core/common/api.js +3 -0
  673. package/dist/types/core/common/api.js.map +1 -0
  674. package/dist/types/core/common/controller.d.ts +3 -0
  675. package/dist/types/core/common/controller.js +3 -0
  676. package/dist/types/core/common/controller.js.map +1 -0
  677. package/dist/types/core/common/index.d.ts +18 -0
  678. package/dist/types/core/common/index.js +40 -0
  679. package/dist/types/core/common/index.js.map +1 -0
  680. package/dist/types/core/common/middleware.d.ts +7 -0
  681. package/dist/types/core/common/middleware.js +3 -0
  682. package/dist/types/core/common/middleware.js.map +1 -0
  683. package/dist/types/core/common/module.d.ts +24 -0
  684. package/dist/types/core/common/module.js +3 -0
  685. package/dist/types/core/common/module.js.map +1 -0
  686. package/dist/types/core/common/plugin.d.ts +5 -0
  687. package/dist/types/core/common/plugin.js +3 -0
  688. package/dist/types/core/common/plugin.js.map +1 -0
  689. package/dist/types/core/common/policy.d.ts +9 -0
  690. package/dist/types/core/common/policy.js +3 -0
  691. package/dist/types/core/common/policy.js.map +1 -0
  692. package/dist/types/core/common/router.d.ts +34 -0
  693. package/dist/types/core/common/router.js +3 -0
  694. package/dist/types/core/common/router.js.map +1 -0
  695. package/dist/types/core/common/schema.d.ts +2 -0
  696. package/dist/types/core/common/schema.js +3 -0
  697. package/dist/types/core/common/schema.js.map +1 -0
  698. package/dist/types/core/common/service.d.ts +3 -0
  699. package/dist/types/core/common/service.js +3 -0
  700. package/dist/types/core/common/service.js.map +1 -0
  701. package/dist/types/core/common/uid.d.ts +15 -0
  702. package/dist/types/core/common/uid.js +3 -0
  703. package/dist/types/core/common/uid.js.map +1 -0
  704. package/dist/types/core/index.d.ts +8 -0
  705. package/dist/types/core/index.js +38 -0
  706. package/dist/types/core/index.js.map +1 -0
  707. package/dist/types/core/namespace.d.ts +77 -0
  708. package/dist/types/core/namespace.js +3 -0
  709. package/dist/types/core/namespace.js.map +1 -0
  710. package/dist/types/core/registry.d.ts +57 -0
  711. package/dist/types/core/registry.js +3 -0
  712. package/dist/types/core/registry.js.map +1 -0
  713. package/dist/types/core/schemas/index.d.ts +122 -0
  714. package/dist/types/core/schemas/index.js +3 -0
  715. package/dist/types/core/schemas/index.js.map +1 -0
  716. package/dist/types/core/uid.d.ts +108 -0
  717. package/dist/types/core/uid.js +3 -0
  718. package/dist/types/core/uid.js.map +1 -0
  719. package/dist/types/core-api/controller.d.ts +44 -0
  720. package/dist/types/core-api/controller.js +3 -0
  721. package/dist/types/core-api/controller.js.map +1 -0
  722. package/dist/types/core-api/index.d.ts +3 -0
  723. package/dist/types/core-api/index.js +30 -0
  724. package/dist/types/core-api/index.js.map +1 -0
  725. package/dist/types/core-api/router.d.ts +62 -0
  726. package/dist/types/core-api/router.js +3 -0
  727. package/dist/types/core-api/router.js.map +1 -0
  728. package/dist/types/core-api/service.d.ts +64 -0
  729. package/dist/types/core-api/service.js +3 -0
  730. package/dist/types/core-api/service.js.map +1 -0
  731. package/dist/types/index.d.ts +5 -0
  732. package/dist/types/index.js +36 -0
  733. package/dist/types/index.js.map +1 -0
  734. package/dist/types/shared/index.d.ts +3 -0
  735. package/dist/types/shared/index.js +20 -0
  736. package/dist/types/shared/index.js.map +1 -0
  737. package/dist/types/shared/registries.d.ts +37 -0
  738. package/dist/types/shared/registries.js +3 -0
  739. package/dist/types/shared/registries.js.map +1 -0
  740. package/dist/types/utils/array.d.ts +15 -0
  741. package/dist/types/utils/array.js +3 -0
  742. package/dist/types/utils/array.js.map +1 -0
  743. package/dist/types/utils/expression.d.ts +42 -0
  744. package/dist/types/utils/expression.js +3 -0
  745. package/dist/types/utils/expression.js.map +1 -0
  746. package/dist/types/utils/function.d.ts +1 -0
  747. package/dist/types/utils/function.js +3 -0
  748. package/dist/types/utils/function.js.map +1 -0
  749. package/dist/types/utils/guard.d.ts +19 -0
  750. package/dist/types/utils/guard.js +3 -0
  751. package/dist/types/utils/guard.js.map +1 -0
  752. package/dist/types/utils/index.d.ts +25 -0
  753. package/dist/types/utils/index.js +34 -0
  754. package/dist/types/utils/index.js.map +1 -0
  755. package/dist/types/utils/object.d.ts +58 -0
  756. package/dist/types/utils/object.js +3 -0
  757. package/dist/types/utils/object.js.map +1 -0
  758. package/dist/types/utils/string.d.ts +37 -0
  759. package/dist/types/utils/string.js +3 -0
  760. package/dist/types/utils/string.js.map +1 -0
  761. package/dist/types/utils/tuple.d.ts +8 -0
  762. package/dist/types/utils/tuple.js +3 -0
  763. package/dist/types/utils/tuple.js.map +1 -0
  764. package/dist/utils/addSlash.d.ts +2 -0
  765. package/dist/utils/addSlash.js +15 -0
  766. package/dist/utils/addSlash.js.map +1 -0
  767. package/dist/utils/convert-custom-field-type.d.ts +3 -0
  768. package/dist/utils/convert-custom-field-type.js +20 -0
  769. package/dist/utils/convert-custom-field-type.js.map +1 -0
  770. package/dist/utils/cron.d.ts +7 -0
  771. package/dist/utils/cron.js +56 -0
  772. package/dist/utils/cron.js.map +1 -0
  773. package/dist/utils/ee.d.ts +2 -0
  774. package/dist/utils/ee.js +8 -0
  775. package/dist/utils/ee.js.map +1 -0
  776. package/dist/utils/fetch.d.ts +8 -0
  777. package/dist/utils/fetch.js +23 -0
  778. package/dist/utils/fetch.js.map +1 -0
  779. package/dist/utils/get-dirs.d.ts +10 -0
  780. package/dist/utils/get-dirs.js +30 -0
  781. package/dist/utils/get-dirs.js.map +1 -0
  782. package/dist/utils/index.d.ts +4 -0
  783. package/dist/utils/index.js +13 -0
  784. package/dist/utils/index.js.map +1 -0
  785. package/dist/utils/is-initialized.d.ts +5 -0
  786. package/dist/utils/is-initialized.js +21 -0
  787. package/dist/utils/is-initialized.js.map +1 -0
  788. package/dist/utils/lifecycles.d.ts +5 -0
  789. package/dist/utils/lifecycles.js +9 -0
  790. package/dist/utils/lifecycles.js.map +1 -0
  791. package/dist/utils/machine-id.d.ts +2 -0
  792. package/dist/utils/machine-id.js +15 -0
  793. package/dist/utils/machine-id.js.map +1 -0
  794. package/dist/utils/open-browser.d.ts +4 -0
  795. package/dist/utils/open-browser.js +13 -0
  796. package/dist/utils/open-browser.js.map +1 -0
  797. package/dist/utils/signals.d.ts +2 -0
  798. package/dist/utils/signals.js +20 -0
  799. package/dist/utils/signals.js.map +1 -0
  800. package/dist/utils/startup-logger.d.ts +10 -0
  801. package/dist/utils/startup-logger.js +68 -0
  802. package/dist/utils/startup-logger.js.map +1 -0
  803. package/dist/utils/success.d.ts +1 -0
  804. package/dist/utils/success.js +32 -0
  805. package/dist/utils/success.js.map +1 -0
  806. package/dist/utils/update-notifier/index.d.ts +8 -0
  807. package/dist/utils/update-notifier/index.js +85 -0
  808. package/dist/utils/update-notifier/index.js.map +1 -0
  809. package/lib/Strapi.js +11 -0
  810. package/lib/commands/actions/import/action.js +4 -4
  811. package/lib/commands/actions/import/command.js +1 -1
  812. package/lib/commands/actions/transfer/action.js +3 -6
  813. package/lib/commands/actions/transfer/command.js +1 -1
  814. package/lib/commands/actions/watch-admin/action.js +1 -1
  815. package/lib/commands/builders/admin.js +1 -1
  816. package/lib/commands/utils/data-transfer.js +39 -1
  817. package/lib/core/loaders/index.js +1 -0
  818. package/lib/core/loaders/plugins/get-enabled-plugins.js +40 -13
  819. package/lib/core/loaders/sanitizers.js +1 -1
  820. package/lib/core/loaders/validators.js +5 -0
  821. package/lib/core/registries/validators.js +26 -0
  822. package/lib/core-api/controller/collection-type.js +14 -8
  823. package/lib/core-api/controller/index.js +15 -3
  824. package/lib/core-api/controller/single-type.js +2 -0
  825. package/lib/factories.d.ts +10 -13
  826. package/lib/factories.js +12 -2
  827. package/lib/services/entity-service/index.d.ts +1 -100
  828. package/lib/services/entity-service/index.js +1 -0
  829. package/lib/services/entity-service/types/index.d.ts +228 -0
  830. package/lib/services/entity-service/types/params/attributes.d.ts +146 -0
  831. package/lib/services/entity-service/types/params/data.d.ts +4 -0
  832. package/lib/services/entity-service/types/params/fields.d.ts +74 -0
  833. package/lib/services/entity-service/types/params/filters/index.d.ts +75 -0
  834. package/lib/services/entity-service/types/params/filters/operators.d.ts +30 -0
  835. package/lib/services/entity-service/types/params/index.d.ts +79 -0
  836. package/lib/services/entity-service/types/params/pagination.d.ts +13 -0
  837. package/lib/services/entity-service/types/params/populate.d.ts +130 -0
  838. package/lib/services/entity-service/types/params/publication-state.d.ts +38 -0
  839. package/lib/services/entity-service/types/params/search.d.ts +1 -0
  840. package/lib/services/entity-service/types/params/sort.d.ts +106 -0
  841. package/lib/services/entity-service/types/plugin.d.ts +11 -0
  842. package/lib/services/entity-service/types/result.d.ts +205 -0
  843. package/lib/types/core/attributes/common.d.ts +13 -10
  844. package/lib/types/core/attributes/component.d.ts +3 -0
  845. package/lib/types/core/attributes/date-time.d.ts +2 -1
  846. package/lib/types/core/attributes/dynamic-zone.d.ts +10 -7
  847. package/lib/types/core/attributes/media.d.ts +8 -0
  848. package/lib/types/core/attributes/relation.d.ts +69 -28
  849. package/lib/types/core/attributes/time.d.ts +1 -1
  850. package/lib/types/core/attributes/timestamp.d.ts +1 -1
  851. package/lib/types/core/attributes/uid.d.ts +7 -17
  852. package/lib/types/core/attributes/utils.d.ts +61 -6
  853. package/lib/types/core/common/index.d.ts +12 -0
  854. package/lib/types/core/common/uid.d.ts +12 -16
  855. package/lib/types/core/index.d.ts +1 -0
  856. package/lib/types/core/plugins/index.d.ts +16 -0
  857. package/lib/types/core/schemas/index.d.ts +1 -0
  858. package/lib/types/core/strapi/index.d.ts +7 -2
  859. package/lib/types/core-api/controller.d.ts +12 -10
  860. package/lib/types/index.d.ts +2 -0
  861. package/lib/types/shared/entity-service.d.ts +1 -0
  862. package/lib/types/shared/index.d.ts +2 -0
  863. package/lib/types/shared/plugins.d.ts +3 -0
  864. package/lib/types/utils/expression.d.ts +29 -6
  865. package/lib/types/utils/guard.d.ts +14 -1
  866. package/lib/types/utils/index.d.ts +8 -0
  867. package/lib/types/utils/object.d.ts +35 -1
  868. package/lib/types/utils/string.d.ts +18 -0
  869. package/package.json +17 -16
@@ -0,0 +1,347 @@
1
+ "use strict";
2
+ /**
3
+ * Entity validator
4
+ * Module that will validate input data for entity creation or edition
5
+ */
6
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
7
+ if (k2 === undefined) k2 = k;
8
+ var desc = Object.getOwnPropertyDescriptor(m, k);
9
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
10
+ desc = { enumerable: true, get: function() { return m[k]; } };
11
+ }
12
+ Object.defineProperty(o, k2, desc);
13
+ }) : (function(o, m, k, k2) {
14
+ if (k2 === undefined) k2 = k;
15
+ o[k2] = m[k];
16
+ }));
17
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
18
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
19
+ }) : function(o, v) {
20
+ o["default"] = v;
21
+ });
22
+ var __importStar = (this && this.__importStar) || function (mod) {
23
+ if (mod && mod.__esModule) return mod;
24
+ var result = {};
25
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
26
+ __setModuleDefault(result, mod);
27
+ return result;
28
+ };
29
+ var __importDefault = (this && this.__importDefault) || function (mod) {
30
+ return (mod && mod.__esModule) ? mod : { "default": mod };
31
+ };
32
+ Object.defineProperty(exports, "__esModule", { value: true });
33
+ const lodash_1 = require("lodash");
34
+ const fp_1 = require("lodash/fp");
35
+ const utils_1 = __importDefault(require("@strapi/utils"));
36
+ const validators = __importStar(require("./validators"));
37
+ const { yup, validateYupSchema } = utils_1.default;
38
+ const { isMediaAttribute, isScalarAttribute, getWritableAttributes } = utils_1.default.contentTypes;
39
+ const { ValidationError } = utils_1.default.errors;
40
+ const isInteger = (value) => Number.isInteger(value);
41
+ const addMinMax = (validator, { attr, updatedAttribute }) => {
42
+ let nextValidator = validator;
43
+ if (isInteger(attr.min) &&
44
+ (('required' in attr && attr.required) ||
45
+ (Array.isArray(updatedAttribute.value) && updatedAttribute.value.length > 0))) {
46
+ nextValidator = nextValidator.min(attr.min);
47
+ }
48
+ if (isInteger(attr.max)) {
49
+ nextValidator = nextValidator.max(attr.max);
50
+ }
51
+ return nextValidator;
52
+ };
53
+ const addRequiredValidation = (createOrUpdate) => {
54
+ return (validator, { attr: { required } }) => {
55
+ let nextValidator = validator;
56
+ if (required) {
57
+ if (createOrUpdate === 'creation') {
58
+ nextValidator = nextValidator.notNil();
59
+ }
60
+ else if (createOrUpdate === 'update') {
61
+ nextValidator = nextValidator.notNull();
62
+ }
63
+ }
64
+ else {
65
+ nextValidator = nextValidator.nullable();
66
+ }
67
+ return nextValidator;
68
+ };
69
+ };
70
+ const addDefault = (createOrUpdate) => {
71
+ return (validator, { attr }) => {
72
+ let nextValidator = validator;
73
+ if (createOrUpdate === 'creation') {
74
+ if (((attr.type === 'component' && attr.repeatable) || attr.type === 'dynamiczone') &&
75
+ !attr.required) {
76
+ nextValidator = nextValidator.default([]);
77
+ }
78
+ else {
79
+ nextValidator = nextValidator.default(attr.default);
80
+ }
81
+ }
82
+ else {
83
+ nextValidator = nextValidator.default(undefined);
84
+ }
85
+ return nextValidator;
86
+ };
87
+ };
88
+ const preventCast = (validator) => validator.transform((val, originalVal) => originalVal);
89
+ const createComponentValidator = (createOrUpdate) => ({ attr, updatedAttribute }, { isDraft }) => {
90
+ const model = strapi.getModel(attr.component);
91
+ if (!model) {
92
+ throw new Error('Validation failed: Model not found');
93
+ }
94
+ if (attr?.repeatable) {
95
+ // FIXME: yup v1
96
+ let validator = yup
97
+ .array()
98
+ .of(yup.lazy((item) => createModelValidator(createOrUpdate)({ model, data: item }, { isDraft }).notNull()));
99
+ validator = addRequiredValidation(createOrUpdate)(validator, {
100
+ attr: { required: true },
101
+ updatedAttribute,
102
+ });
103
+ validator = addMinMax(validator, { attr, updatedAttribute });
104
+ return validator;
105
+ }
106
+ // FIXME: v4 was broken
107
+ let validator = yup.lazy((item) => createModelValidator(createOrUpdate)({ model, data: item }, { isDraft }));
108
+ validator = addRequiredValidation(createOrUpdate)(validator, {
109
+ attr: { required: !isDraft && attr.required },
110
+ updatedAttribute,
111
+ });
112
+ return validator;
113
+ };
114
+ const createDzValidator = (createOrUpdate) => ({ attr, updatedAttribute }, { isDraft }) => {
115
+ let validator;
116
+ validator = yup.array().of(yup.lazy((item) => {
117
+ const model = strapi.getModel((0, fp_1.prop)('__component', item));
118
+ const schema = yup
119
+ .object()
120
+ .shape({
121
+ __component: yup.string().required().oneOf(Object.keys(strapi.components)),
122
+ })
123
+ .notNull();
124
+ return model
125
+ ? schema.concat(createModelValidator(createOrUpdate)({ model, data: item }, { isDraft }))
126
+ : schema;
127
+ }) // FIXME: yup v1
128
+ );
129
+ validator = addRequiredValidation(createOrUpdate)(validator, {
130
+ attr: { required: true },
131
+ updatedAttribute,
132
+ });
133
+ validator = addMinMax(validator, { attr, updatedAttribute });
134
+ return validator;
135
+ };
136
+ const createRelationValidator = (createOrUpdate) => ({ attr, updatedAttribute }, { isDraft }) => {
137
+ let validator;
138
+ if (Array.isArray(updatedAttribute.value)) {
139
+ validator = yup.array().of(yup.mixed());
140
+ }
141
+ else {
142
+ validator = yup.mixed();
143
+ }
144
+ validator = addRequiredValidation(createOrUpdate)(validator, {
145
+ attr: { required: !isDraft && attr.required },
146
+ updatedAttribute,
147
+ });
148
+ return validator;
149
+ };
150
+ const createScalarAttributeValidator = (createOrUpdate) => (metas, options) => {
151
+ let validator;
152
+ if ((0, fp_1.has)(metas.attr.type, validators)) {
153
+ validator = validators[metas.attr.type](metas, options);
154
+ }
155
+ else {
156
+ // No validators specified - fall back to mixed
157
+ validator = yup.mixed();
158
+ }
159
+ validator = addRequiredValidation(createOrUpdate)(validator, {
160
+ attr: { required: !options.isDraft && metas.attr.required },
161
+ updatedAttribute: metas.updatedAttribute,
162
+ });
163
+ return validator;
164
+ };
165
+ const createAttributeValidator = (createOrUpdate) => (metas, options) => {
166
+ let validator = yup.mixed();
167
+ if (isMediaAttribute(metas.attr)) {
168
+ validator = yup.mixed();
169
+ }
170
+ else if (isScalarAttribute(metas.attr)) {
171
+ validator = createScalarAttributeValidator(createOrUpdate)(metas, options);
172
+ }
173
+ else {
174
+ if (metas.attr.type === 'component') {
175
+ validator = createComponentValidator(createOrUpdate)({ attr: metas.attr, updatedAttribute: metas.updatedAttribute }, options);
176
+ }
177
+ else if (metas.attr.type === 'dynamiczone') {
178
+ validator = createDzValidator(createOrUpdate)(metas, options);
179
+ }
180
+ else if (metas.attr.type === 'relation') {
181
+ validator = createRelationValidator(createOrUpdate)({
182
+ attr: metas.attr,
183
+ updatedAttribute: metas.updatedAttribute,
184
+ }, options);
185
+ }
186
+ validator = preventCast(validator);
187
+ }
188
+ validator = addDefault(createOrUpdate)(validator, metas);
189
+ return validator;
190
+ };
191
+ const createModelValidator = (createOrUpdate) => ({ model, data, entity }, options) => {
192
+ const writableAttributes = model ? getWritableAttributes(model) : [];
193
+ const schema = writableAttributes.reduce((validators, attributeName) => {
194
+ const validator = createAttributeValidator(createOrUpdate)({
195
+ attr: model.attributes[attributeName],
196
+ updatedAttribute: { name: attributeName, value: (0, fp_1.prop)(attributeName, data) },
197
+ model,
198
+ entity,
199
+ }, options);
200
+ return (0, fp_1.assoc)(attributeName, validator)(validators);
201
+ }, {});
202
+ return yup.object().shape(schema);
203
+ };
204
+ const createValidateEntity = (createOrUpdate) => async (model, data, { isDraft = false } = {}, entity) => {
205
+ if (!(0, fp_1.isObject)(data)) {
206
+ const { displayName } = model.info;
207
+ throw new ValidationError(`Invalid payload submitted for the ${createOrUpdate} of an entity of type ${displayName}. Expected an object, but got ${typeof data}`);
208
+ }
209
+ const validator = createModelValidator(createOrUpdate)({
210
+ model,
211
+ data,
212
+ entity,
213
+ }, { isDraft })
214
+ .test('relations-test', 'check that all relations exist', async function (data) {
215
+ try {
216
+ await checkRelationsExist(buildRelationsStore({ uid: model.uid, data }));
217
+ }
218
+ catch (e) {
219
+ return this.createError({
220
+ path: this.path,
221
+ message: (e instanceof ValidationError && e.message) || 'Invalid relations',
222
+ });
223
+ }
224
+ return true;
225
+ })
226
+ .required();
227
+ return validateYupSchema(validator, {
228
+ strict: false,
229
+ abortEarly: false,
230
+ })(data);
231
+ };
232
+ /**
233
+ * Builds an object containing all the media and relations being associated with an entity
234
+ */
235
+ const buildRelationsStore = ({ uid, data, }) => {
236
+ if (!uid) {
237
+ throw new ValidationError(`Cannot build relations store: "uid" is undefined`);
238
+ }
239
+ if ((0, fp_1.isEmpty)(data)) {
240
+ return {};
241
+ }
242
+ const currentModel = strapi.getModel(uid);
243
+ return Object.keys(currentModel.attributes).reduce((result, attributeName) => {
244
+ const attribute = currentModel.attributes[attributeName];
245
+ const value = data[attributeName];
246
+ if ((0, lodash_1.isNil)(value)) {
247
+ return result;
248
+ }
249
+ switch (attribute.type) {
250
+ case 'relation':
251
+ case 'media': {
252
+ if (attribute.type === 'relation' &&
253
+ (attribute.relation === 'morphToMany' || attribute.relation === 'morphToOne')) {
254
+ // TODO: handle polymorphic relations
255
+ break;
256
+ }
257
+ const target =
258
+ // eslint-disable-next-line no-nested-ternary
259
+ attribute.type === 'media' ? 'plugin::upload.file' : attribute.target;
260
+ // As there are multiple formats supported for associating relations
261
+ // with an entity, the value here can be an: array, object or number.
262
+ let source;
263
+ if (Array.isArray(value)) {
264
+ source = value;
265
+ }
266
+ else if ((0, fp_1.isObject)(value)) {
267
+ source = (0, lodash_1.castArray)(('connect' in value && value.connect) ?? ('set' in value && value.set) ?? []);
268
+ }
269
+ else {
270
+ source = (0, lodash_1.castArray)(value);
271
+ }
272
+ const idArray = source.map((v) => ({
273
+ id: typeof v === 'object' ? v.id : v,
274
+ }));
275
+ // Update the relationStore to keep track of all associations being made
276
+ // with relations and media.
277
+ result[target] = result[target] || [];
278
+ result[target].push(...idArray);
279
+ break;
280
+ }
281
+ case 'component': {
282
+ return (0, lodash_1.castArray)(value).reduce((relationsStore, componentValue) => {
283
+ if (!attribute.component) {
284
+ throw new ValidationError(`Cannot build relations store from component, component identifier is undefined`);
285
+ }
286
+ return (0, lodash_1.mergeWith)(relationsStore, buildRelationsStore({
287
+ uid: attribute.component,
288
+ data: componentValue,
289
+ }), (objValue, srcValue) => {
290
+ if ((0, lodash_1.isArray)(objValue)) {
291
+ return objValue.concat(srcValue);
292
+ }
293
+ });
294
+ }, result);
295
+ }
296
+ case 'dynamiczone': {
297
+ return (0, lodash_1.castArray)(value).reduce((relationsStore, dzValue) => {
298
+ const value = dzValue;
299
+ if (!value.__component) {
300
+ throw new ValidationError(`Cannot build relations store from dynamiczone, component identifier is undefined`);
301
+ }
302
+ return (0, lodash_1.mergeWith)(relationsStore, buildRelationsStore({
303
+ uid: value.__component,
304
+ data: value,
305
+ }), (objValue, srcValue) => {
306
+ if ((0, lodash_1.isArray)(objValue)) {
307
+ return objValue.concat(srcValue);
308
+ }
309
+ });
310
+ }, result);
311
+ }
312
+ default:
313
+ break;
314
+ }
315
+ return result;
316
+ }, {});
317
+ };
318
+ /**
319
+ * Iterate through the relations store and validates that every relation or media
320
+ * mentioned exists
321
+ */
322
+ const checkRelationsExist = async (relationsStore = {}) => {
323
+ const promises = [];
324
+ for (const [key, value] of Object.entries(relationsStore)) {
325
+ const evaluate = async () => {
326
+ const uniqueValues = (0, lodash_1.uniqBy)(value, `id`);
327
+ const count = await strapi.query(key).count({
328
+ where: {
329
+ id: {
330
+ $in: uniqueValues.map((v) => v.id),
331
+ },
332
+ },
333
+ });
334
+ if (count !== uniqueValues.length) {
335
+ throw new ValidationError(`${uniqueValues.length - count} relation(s) of type ${key} associated with this entity do not exist`);
336
+ }
337
+ };
338
+ promises.push(evaluate());
339
+ }
340
+ return Promise.all(promises);
341
+ };
342
+ const entityValidator = {
343
+ validateEntityCreation: createValidateEntity('creation'),
344
+ validateEntityUpdate: createValidateEntity('update'),
345
+ };
346
+ exports.default = entityValidator;
347
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/services/entity-validator/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,mCAAsE;AACtE,kCAAgE;AAChE,0DAAwC;AACxC,yDAA2C;AAK3C,MAAM,EAAE,GAAG,EAAE,iBAAiB,EAAE,GAAG,eAAW,CA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AAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,cAAc,CAAC,EAAE;QACzD,MAAM,QAAQ,GAAG,KAAK,IAAI,EAAE;YAC1B,MAAM,YAAY,GAAG,IAAA,eAAM,EAAC,KAAK,EAAE,IAAI,CAAC,CAAC;YACzC,MAAM,KAAK,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC,GAAsB,CAAC,CAAC,KAAK,CAAC;gBAC7D,KAAK,EAAE;oBACL,EAAE,EAAE;wBACF,GAAG,EAAE,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;qBACnC;iBACF;aACF,CAAC,CAAC;YAEH,IAAI,KAAK,KAAK,YAAY,CAAC,MAAM,EAAE;gBACjC,MAAM,IAAI,eAAe,CACvB,GACE,YAAY,CAAC,MAAM,GAAG,KACxB,wBAAwB,GAAG,2CAA2C,CACvE,CAAC;aACH;QACH,CAAC,CAAC;QACF,QAAQ,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;KAC3B;IAED,OAAO,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC/B,CAAC,CAAC;AAeF,MAAM,eAAe,GAAoB;IACvC,sBAAsB,EAAE,oBAAoB,CAAC,UAAU,CAAC;IACxD,oBAAoB,EAAE,oBAAoB,CAAC,QAAQ,CAAC;CACrD,CAAC;AAEF,kBAAe,eAAe,CAAC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/services/entity-validator/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,36 @@
1
+ import type { Attribute, Schema } from '../../types';
2
+ interface ValidatorMetas<TAttribute extends Attribute.Any> {
3
+ attr: TAttribute;
4
+ model: Schema.ContentType;
5
+ updatedAttribute: {
6
+ name: string;
7
+ value: unknown;
8
+ };
9
+ entity: Record<string, unknown>;
10
+ isDraft: boolean;
11
+ }
12
+ interface ValidatorOptions {
13
+ isDraft: boolean;
14
+ }
15
+ declare const _default: {
16
+ string: (metas: ValidatorMetas<Attribute.Password | Attribute.RichText | (Attribute.OfType<"string"> & Attribute.StringProperties & Attribute.ConfigurableOption & Attribute.DefaultOption<string> & Attribute.MinMaxLengthOption & Attribute.PrivateOption & Attribute.UniqueOption & Attribute.RequiredOption & Attribute.WritableOption & Attribute.VisibleOption) | Attribute.Text | Attribute.Email | Attribute.UID<never, string, Attribute.UIDOptions>>, options: ValidatorOptions) => import("yup").StringSchema<string | undefined, Record<string, any>, string | undefined>;
17
+ text: (metas: ValidatorMetas<Attribute.Password | Attribute.RichText | (Attribute.OfType<"string"> & Attribute.StringProperties & Attribute.ConfigurableOption & Attribute.DefaultOption<string> & Attribute.MinMaxLengthOption & Attribute.PrivateOption & Attribute.UniqueOption & Attribute.RequiredOption & Attribute.WritableOption & Attribute.VisibleOption) | Attribute.Text | Attribute.Email | Attribute.UID<never, string, Attribute.UIDOptions>>, options: ValidatorOptions) => import("yup").StringSchema<string | undefined, Record<string, any>, string | undefined>;
18
+ richtext: (metas: ValidatorMetas<Attribute.Password | Attribute.RichText | (Attribute.OfType<"string"> & Attribute.StringProperties & Attribute.ConfigurableOption & Attribute.DefaultOption<string> & Attribute.MinMaxLengthOption & Attribute.PrivateOption & Attribute.UniqueOption & Attribute.RequiredOption & Attribute.WritableOption & Attribute.VisibleOption) | Attribute.Text | Attribute.Email | Attribute.UID<never, string, Attribute.UIDOptions>>, options: ValidatorOptions) => import("yup").StringSchema<string | undefined, Record<string, any>, string | undefined>;
19
+ password: (metas: ValidatorMetas<Attribute.Password | Attribute.RichText | (Attribute.OfType<"string"> & Attribute.StringProperties & Attribute.ConfigurableOption & Attribute.DefaultOption<string> & Attribute.MinMaxLengthOption & Attribute.PrivateOption & Attribute.UniqueOption & Attribute.RequiredOption & Attribute.WritableOption & Attribute.VisibleOption) | Attribute.Text | Attribute.Email | Attribute.UID<never, string, Attribute.UIDOptions>>, options: ValidatorOptions) => import("yup").StringSchema<string | undefined, Record<string, any>, string | undefined>;
20
+ email: (metas: ValidatorMetas<Attribute.Email>, options: ValidatorOptions) => void;
21
+ enumeration: ({ attr }: {
22
+ attr: Attribute.Enumeration<[]>;
23
+ }) => import("yup").StringSchema<string | undefined, Record<string, any>, string | undefined>;
24
+ boolean: () => import("yup").BooleanSchema<boolean | undefined, Record<string, any>, boolean | undefined>;
25
+ uid: (metas: ValidatorMetas<Attribute.UID<never, string, Attribute.UIDOptions>>, options: ValidatorOptions) => import("yup").StringSchema<string | undefined, Record<string, any>, string | undefined>;
26
+ json: () => import("yup/lib/mixed").MixedSchema<any, Record<string, any>, any>;
27
+ integer: (metas: ValidatorMetas<Attribute.BigInteger | Attribute.Integer | Attribute.DynamicZone<`${string}.${string}`[]> | Attribute.Component<`${string}.${string}`, false>>) => void;
28
+ biginteger: (metas: ValidatorMetas<Attribute.BigInteger>) => void;
29
+ float: (metas: ValidatorMetas<Attribute.Decimal | Attribute.Float>) => void;
30
+ decimal: (metas: ValidatorMetas<Attribute.Decimal | Attribute.Float>) => void;
31
+ date: (metas: ValidatorMetas<Attribute.Date | Attribute.DateTime | Attribute.Timestamp | Attribute.Time>) => void;
32
+ time: (metas: ValidatorMetas<Attribute.Date | Attribute.DateTime | Attribute.Timestamp | Attribute.Time>) => void;
33
+ datetime: (metas: ValidatorMetas<Attribute.Date | Attribute.DateTime | Attribute.Timestamp | Attribute.Time>) => void;
34
+ timestamp: (metas: ValidatorMetas<Attribute.Date | Attribute.DateTime | Attribute.Timestamp | Attribute.Time>) => void;
35
+ };
36
+ export default _default;
@@ -0,0 +1,146 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const lodash_1 = __importDefault(require("lodash"));
7
+ const utils_1 = __importDefault(require("@strapi/utils"));
8
+ const { yup } = utils_1.default;
9
+ /* Validator utils */
10
+ /**
11
+ * Adds minLength validator
12
+ */
13
+ const addMinLengthValidator = (validator, { attr, }, { isDraft }) => {
14
+ return attr.minLength && lodash_1.default.isInteger(attr.minLength) && !isDraft
15
+ ? validator.min(attr.minLength)
16
+ : validator;
17
+ };
18
+ /**
19
+ * Adds maxLength validator
20
+ * @returns {StringSchema}
21
+ */
22
+ const addMaxLengthValidator = (validator, { attr, }) => {
23
+ return attr.maxLength && lodash_1.default.isInteger(attr.maxLength) ? validator.max(attr.maxLength) : validator;
24
+ };
25
+ /**
26
+ * Adds min integer validator
27
+ * @returns {NumberSchema}
28
+ */
29
+ const addMinIntegerValidator = (validator, { attr, }) => (lodash_1.default.isNumber(attr.min) ? validator.min(lodash_1.default.toInteger(attr.min)) : validator);
30
+ /**
31
+ * Adds max integer validator
32
+ */
33
+ const addMaxIntegerValidator = (validator, { attr, }) => (lodash_1.default.isNumber(attr.max) ? validator.max(lodash_1.default.toInteger(attr.max)) : validator);
34
+ /**
35
+ * Adds min float/decimal validator
36
+ */
37
+ const addMinFloatValidator = (validator, { attr, }) => (lodash_1.default.isNumber(attr.min) ? validator.min(attr.min) : validator);
38
+ /**
39
+ * Adds max float/decimal validator
40
+ */
41
+ const addMaxFloatValidator = (validator, { attr, }) => (lodash_1.default.isNumber(attr.max) ? validator.max(attr.max) : validator);
42
+ /**
43
+ * Adds regex validator
44
+ */
45
+ const addStringRegexValidator = (validator, { attr, }) => {
46
+ return 'regex' in attr && !lodash_1.default.isUndefined(attr.regex)
47
+ ? validator.matches(new RegExp(attr.regex), { excludeEmptyString: !attr.required })
48
+ : validator;
49
+ };
50
+ /**
51
+ * Adds unique validator
52
+ */
53
+ const addUniqueValidator = (validator, { attr, model, updatedAttribute, entity, }) => {
54
+ if (attr.type !== 'uid' && !attr.unique) {
55
+ return validator;
56
+ }
57
+ return validator.test('unique', 'This attribute must be unique', async (value) => {
58
+ /**
59
+ * If the attribute value is `null` we want to skip the unique validation.
60
+ * Otherwise it'll only accept a single `null` entry in the database.
61
+ */
62
+ if (lodash_1.default.isNil(updatedAttribute.value)) {
63
+ return true;
64
+ }
65
+ /**
66
+ * If the attribute is unchanged we skip the unique verification. This will
67
+ * prevent the validator to be triggered in case the user activated the
68
+ * unique constraint after already creating multiple entries with
69
+ * the same attribute value for that field.
70
+ */
71
+ if (entity && updatedAttribute.value === entity[updatedAttribute.name]) {
72
+ return true;
73
+ }
74
+ const whereParams = entity
75
+ ? { $and: [{ [updatedAttribute.name]: value }, { $not: { id: entity.id } }] }
76
+ : { [updatedAttribute.name]: value };
77
+ const record = await strapi.query(model.uid).findOne({
78
+ select: ['id'],
79
+ where: whereParams,
80
+ });
81
+ return !record;
82
+ });
83
+ };
84
+ /* Type validators */
85
+ const stringValidator = (metas, options) => {
86
+ const schema = yup.string().transform((val, originalVal) => originalVal);
87
+ addMinLengthValidator(schema, metas, options);
88
+ addMaxLengthValidator(schema, metas);
89
+ addStringRegexValidator(schema, metas);
90
+ addUniqueValidator(schema, metas);
91
+ return schema;
92
+ };
93
+ const emailValidator = (metas, options) => {
94
+ const schema = stringValidator(metas, options);
95
+ schema.email().min(1, '${path} cannot be empty');
96
+ };
97
+ const uidValidator = (metas, options) => {
98
+ const schema = stringValidator(metas, options);
99
+ schema.matches(/^[A-Za-z0-9-_.~]*$/);
100
+ return schema;
101
+ };
102
+ const enumerationValidator = ({ attr }) => {
103
+ return yup
104
+ .string()
105
+ .oneOf((Array.isArray(attr.enum) ? attr.enum : [attr.enum]).concat(null));
106
+ };
107
+ const integerValidator = (metas) => {
108
+ const schema = yup.number().integer();
109
+ addMinIntegerValidator(schema, metas);
110
+ addMaxIntegerValidator(schema, metas);
111
+ addUniqueValidator(schema, metas);
112
+ };
113
+ const floatValidator = (metas) => {
114
+ const schema = yup.number();
115
+ addMinFloatValidator(schema, metas);
116
+ addMaxFloatValidator(schema, metas);
117
+ addUniqueValidator(schema, metas);
118
+ };
119
+ const bigintegerValidator = (metas) => {
120
+ const schema = yup.mixed();
121
+ addUniqueValidator(schema, metas);
122
+ };
123
+ const datesValidator = (metas) => {
124
+ const schema = yup.date();
125
+ addUniqueValidator(schema, metas);
126
+ };
127
+ exports.default = {
128
+ string: stringValidator,
129
+ text: stringValidator,
130
+ richtext: stringValidator,
131
+ password: stringValidator,
132
+ email: emailValidator,
133
+ enumeration: enumerationValidator,
134
+ boolean: () => yup.boolean(),
135
+ uid: uidValidator,
136
+ json: () => yup.mixed(),
137
+ integer: integerValidator,
138
+ biginteger: bigintegerValidator,
139
+ float: floatValidator,
140
+ decimal: floatValidator,
141
+ date: datesValidator,
142
+ time: datesValidator,
143
+ datetime: datesValidator,
144
+ timestamp: datesValidator,
145
+ };
146
+ //# sourceMappingURL=validators.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validators.js","sourceRoot":"","sources":["../../../src/services/entity-validator/validators.ts"],"names":[],"mappings":";;;;;AAAA,oDAAuB;AACvB,0DAAwC;AAIxC,MAAM,EAAE,GAAG,EAAE,GAAG,eAAW,CAAC;AAc5B,qBAAqB;AAErB;;GAEG;AACH,MAAM,qBAAqB,GAAG,CAC5B,SAAuC,EACvC,EACE,IAAI,GASL,EACD,EAAE,OAAO,EAAwB,EACjC,EAAE;IACF,OAAO,IAAI,CAAC,SAAS,IAAI,gBAAC,CAAC,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO;QAC9D,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC;QAC/B,CAAC,CAAC,SAAS,CAAC;AAChB,CAAC,CAAC;AAEF;;;GAGG;AACH,MAAM,qBAAqB,GAAG,CAC5B,SAAuC,EACvC,EACE,IAAI,GASL,EACD,EAAE;IACF,OAAO,IAAI,CAAC,SAAS,IAAI,gBAAC,CAAC,SAAS,CAAC,IAAI,C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,EAAE,eAAe;IACzB,KAAK,EAAE,cAAc;IACrB,WAAW,EAAE,oBAAoB;IACjC,OAAO,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,OAAO,EAAE;IAC5B,GAAG,EAAE,YAAY;IACjB,IAAI,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,KAAK,EAAE;IACvB,OAAO,EAAE,gBAAgB;IACzB,UAAU,EAAE,mBAAmB;IAC/B,KAAK,EAAE,cAAc;IACrB,OAAO,EAAE,cAAc;IACvB,IAAI,EAAE,cAAc;IACpB,IAAI,EAAE,cAAc;IACpB,QAAQ,EAAE,cAAc;IACxB,SAAS,EAAE,cAAc;CAC1B,CAAC"}
@@ -0,0 +1,39 @@
1
+ import createError from 'http-errors';
2
+ import { errors } from '@strapi/utils';
3
+ declare const formatApplicationError: (error: InstanceType<typeof errors.ApplicationError>) => {
4
+ status: number;
5
+ body: {
6
+ data: null;
7
+ error: {
8
+ status: number;
9
+ name: string;
10
+ message: string;
11
+ details: unknown;
12
+ };
13
+ };
14
+ };
15
+ declare const formatHttpError: (error: createError.HttpError) => {
16
+ status: number;
17
+ body: {
18
+ data: null;
19
+ error: {
20
+ status: number;
21
+ name: string;
22
+ message: string;
23
+ details: any;
24
+ };
25
+ };
26
+ };
27
+ declare const formatInternalError: (error: unknown) => {
28
+ status: number;
29
+ body: {
30
+ data: null;
31
+ error: {
32
+ status: number;
33
+ name: string;
34
+ message: string;
35
+ details: any;
36
+ };
37
+ };
38
+ };
39
+ export { formatApplicationError, formatHttpError, formatInternalError };