@dyrected/core 2.5.53 → 2.5.55

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 (405) hide show
  1. package/package.json +1 -1
  2. package/dist/__tests__/admin-auth.test.d.ts +0 -2
  3. package/dist/__tests__/admin-auth.test.d.ts.map +0 -1
  4. package/dist/__tests__/admin-auth.test.js +0 -440
  5. package/dist/__tests__/admin-auth.test.js.map +0 -1
  6. package/dist/__tests__/app.test.d.ts +0 -2
  7. package/dist/__tests__/app.test.d.ts.map +0 -1
  8. package/dist/__tests__/app.test.js +0 -27
  9. package/dist/__tests__/app.test.js.map +0 -1
  10. package/dist/__tests__/config.test.d.ts +0 -2
  11. package/dist/__tests__/config.test.d.ts.map +0 -1
  12. package/dist/__tests__/config.test.js +0 -91
  13. package/dist/__tests__/config.test.js.map +0 -1
  14. package/dist/__tests__/deleteMany.test.d.ts +0 -2
  15. package/dist/__tests__/deleteMany.test.d.ts.map +0 -1
  16. package/dist/__tests__/deleteMany.test.js +0 -75
  17. package/dist/__tests__/deleteMany.test.js.map +0 -1
  18. package/dist/__tests__/depth.test.d.ts +0 -2
  19. package/dist/__tests__/depth.test.d.ts.map +0 -1
  20. package/dist/__tests__/depth.test.js +0 -81
  21. package/dist/__tests__/depth.test.js.map +0 -1
  22. package/dist/__tests__/dynamic-options.test.d.ts +0 -2
  23. package/dist/__tests__/dynamic-options.test.d.ts.map +0 -1
  24. package/dist/__tests__/dynamic-options.test.js +0 -132
  25. package/dist/__tests__/dynamic-options.test.js.map +0 -1
  26. package/dist/__tests__/email.service.test.d.ts +0 -2
  27. package/dist/__tests__/email.service.test.d.ts.map +0 -1
  28. package/dist/__tests__/email.service.test.js +0 -46
  29. package/dist/__tests__/email.service.test.js.map +0 -1
  30. package/dist/__tests__/field-inference.test-types.d.ts +0 -24
  31. package/dist/__tests__/field-inference.test-types.d.ts.map +0 -1
  32. package/dist/__tests__/field-inference.test-types.js +0 -87
  33. package/dist/__tests__/field-inference.test-types.js.map +0 -1
  34. package/dist/__tests__/fixtures/editorial-workflow.d.ts +0 -9
  35. package/dist/__tests__/fixtures/editorial-workflow.d.ts.map +0 -1
  36. package/dist/__tests__/fixtures/editorial-workflow.js +0 -12
  37. package/dist/__tests__/fixtures/editorial-workflow.js.map +0 -1
  38. package/dist/__tests__/hooks.test.d.ts +0 -2
  39. package/dist/__tests__/hooks.test.d.ts.map +0 -1
  40. package/dist/__tests__/hooks.test.js +0 -320
  41. package/dist/__tests__/hooks.test.js.map +0 -1
  42. package/dist/__tests__/mocks.d.ts +0 -74
  43. package/dist/__tests__/mocks.d.ts.map +0 -1
  44. package/dist/__tests__/mocks.js +0 -159
  45. package/dist/__tests__/mocks.js.map +0 -1
  46. package/dist/__tests__/openapi.test.d.ts +0 -2
  47. package/dist/__tests__/openapi.test.d.ts.map +0 -1
  48. package/dist/__tests__/openapi.test.js +0 -95
  49. package/dist/__tests__/openapi.test.js.map +0 -1
  50. package/dist/__tests__/parse-sort.test.d.ts +0 -2
  51. package/dist/__tests__/parse-sort.test.d.ts.map +0 -1
  52. package/dist/__tests__/parse-sort.test.js +0 -24
  53. package/dist/__tests__/parse-sort.test.js.map +0 -1
  54. package/dist/__tests__/preferences.test.d.ts +0 -2
  55. package/dist/__tests__/preferences.test.d.ts.map +0 -1
  56. package/dist/__tests__/preferences.test.js +0 -168
  57. package/dist/__tests__/preferences.test.js.map +0 -1
  58. package/dist/__tests__/router.test.d.ts +0 -2
  59. package/dist/__tests__/router.test.d.ts.map +0 -1
  60. package/dist/__tests__/router.test.js +0 -52
  61. package/dist/__tests__/router.test.js.map +0 -1
  62. package/dist/__tests__/where.test.d.ts +0 -2
  63. package/dist/__tests__/where.test.d.ts.map +0 -1
  64. package/dist/__tests__/where.test.js +0 -105
  65. package/dist/__tests__/where.test.js.map +0 -1
  66. package/dist/__tests__/workflow.test.d.ts +0 -2
  67. package/dist/__tests__/workflow.test.d.ts.map +0 -1
  68. package/dist/__tests__/workflow.test.js +0 -497
  69. package/dist/__tests__/workflow.test.js.map +0 -1
  70. package/dist/app-B2tg7Djj.d.cts +0 -1575
  71. package/dist/app-B2tg7Djj.d.ts +0 -1575
  72. package/dist/app-BElen1tP.d.cts +0 -1690
  73. package/dist/app-BElen1tP.d.ts +0 -1690
  74. package/dist/app-BOrsS7Tz.d.cts +0 -1771
  75. package/dist/app-BOrsS7Tz.d.ts +0 -1771
  76. package/dist/app-Bh4_Opv0.d.cts +0 -1522
  77. package/dist/app-Bh4_Opv0.d.ts +0 -1522
  78. package/dist/app-BibuoHQG.d.cts +0 -1764
  79. package/dist/app-BibuoHQG.d.ts +0 -1764
  80. package/dist/app-Bv9gaDAN.d.cts +0 -561
  81. package/dist/app-Bv9gaDAN.d.ts +0 -561
  82. package/dist/app-BvG3bRc8.d.cts +0 -419
  83. package/dist/app-BvG3bRc8.d.ts +0 -419
  84. package/dist/app-C-HgyliB.d.cts +0 -1694
  85. package/dist/app-C-HgyliB.d.ts +0 -1694
  86. package/dist/app-C3B9N1KR.d.cts +0 -1522
  87. package/dist/app-C3B9N1KR.d.ts +0 -1522
  88. package/dist/app-Cc2mG3zi.d.cts +0 -373
  89. package/dist/app-Cc2mG3zi.d.ts +0 -373
  90. package/dist/app-Ctfmo2Re.d.cts +0 -1692
  91. package/dist/app-Ctfmo2Re.d.ts +0 -1692
  92. package/dist/app-D0ffogDd.d.cts +0 -1690
  93. package/dist/app-D0ffogDd.d.ts +0 -1690
  94. package/dist/app-D2uR47gK.d.cts +0 -1690
  95. package/dist/app-D2uR47gK.d.ts +0 -1690
  96. package/dist/app-DDJJa0ep.d.cts +0 -1621
  97. package/dist/app-DDJJa0ep.d.ts +0 -1621
  98. package/dist/app-DO1s9YW1.d.cts +0 -1621
  99. package/dist/app-DO1s9YW1.d.ts +0 -1621
  100. package/dist/app-DTP3-9PJ.d.cts +0 -561
  101. package/dist/app-DTP3-9PJ.d.ts +0 -561
  102. package/dist/app-DZt5nslu.d.cts +0 -374
  103. package/dist/app-DZt5nslu.d.ts +0 -377
  104. package/dist/app-DbKDGYTI.d.cts +0 -566
  105. package/dist/app-DbKDGYTI.d.ts +0 -566
  106. package/dist/app-Dk3SzV1a.d.cts +0 -374
  107. package/dist/app-Dk3SzV1a.d.ts +0 -374
  108. package/dist/app-DnX9mNsh.d.cts +0 -374
  109. package/dist/app-DnX9mNsh.d.ts +0 -374
  110. package/dist/app-DqRO-CMi.d.cts +0 -1457
  111. package/dist/app-DqRO-CMi.d.ts +0 -1457
  112. package/dist/app-DvaFpOtj.d.cts +0 -398
  113. package/dist/app-DvaFpOtj.d.ts +0 -398
  114. package/dist/app-FGzip4XM.d.cts +0 -1563
  115. package/dist/app-FGzip4XM.d.ts +0 -1563
  116. package/dist/app-KApbf4XL.d.cts +0 -362
  117. package/dist/app-KApbf4XL.d.ts +0 -362
  118. package/dist/app-T0alZAE0.d.cts +0 -383
  119. package/dist/app-T0alZAE0.d.ts +0 -383
  120. package/dist/app-aW2FMuYM.d.cts +0 -1759
  121. package/dist/app-aW2FMuYM.d.ts +0 -1759
  122. package/dist/app-config-2vF6W56z.d.cts +0 -1335
  123. package/dist/app-config-2vF6W56z.d.ts +0 -1335
  124. package/dist/app-config-3XBnu9Xz.d.cts +0 -1379
  125. package/dist/app-config-3XBnu9Xz.d.ts +0 -1379
  126. package/dist/app-config-BLMX-9MN.d.cts +0 -1045
  127. package/dist/app-config-BLMX-9MN.d.ts +0 -1045
  128. package/dist/app-config-CaEQH0Kb.d.cts +0 -1383
  129. package/dist/app-config-CaEQH0Kb.d.ts +0 -1383
  130. package/dist/app-config-DLK6bCaP.d.cts +0 -1390
  131. package/dist/app-config-DLK6bCaP.d.ts +0 -1390
  132. package/dist/app-config-oOarB6Fw.d.cts +0 -1411
  133. package/dist/app-config-oOarB6Fw.d.ts +0 -1411
  134. package/dist/app-oQt5-9MU.d.cts +0 -1560
  135. package/dist/app-oQt5-9MU.d.ts +0 -1560
  136. package/dist/app-rZj1VFer.d.cts +0 -1621
  137. package/dist/app-rZj1VFer.d.ts +0 -1621
  138. package/dist/app-wo82JRHl.d.cts +0 -445
  139. package/dist/app-wo82JRHl.d.ts +0 -445
  140. package/dist/app.d.ts +0 -21
  141. package/dist/app.d.ts.map +0 -1
  142. package/dist/app.js +0 -56
  143. package/dist/app.js.map +0 -1
  144. package/dist/auth/jexl.d.ts +0 -10
  145. package/dist/auth/jexl.d.ts.map +0 -1
  146. package/dist/auth/jexl.js +0 -22
  147. package/dist/auth/jexl.js.map +0 -1
  148. package/dist/auth/password.d.ts +0 -10
  149. package/dist/auth/password.d.ts.map +0 -1
  150. package/dist/auth/password.js +0 -28
  151. package/dist/auth/password.js.map +0 -1
  152. package/dist/auth/token.d.ts +0 -22
  153. package/dist/auth/token.d.ts.map +0 -1
  154. package/dist/auth/token.js +0 -40
  155. package/dist/auth/token.js.map +0 -1
  156. package/dist/chunk-22JTWD74.js +0 -1784
  157. package/dist/chunk-23URSKPI.js +0 -2371
  158. package/dist/chunk-2JMA3M5S.js +0 -2475
  159. package/dist/chunk-3FZEUK36.js +0 -2470
  160. package/dist/chunk-3VUH2MNW.js +0 -1903
  161. package/dist/chunk-44O2LDPT.js +0 -1513
  162. package/dist/chunk-45JDQDA2.js +0 -1899
  163. package/dist/chunk-4C4L6SD2.js +0 -1524
  164. package/dist/chunk-4EDMZAM5.js +0 -2692
  165. package/dist/chunk-52T4RCFU.js +0 -1972
  166. package/dist/chunk-6ZXEGKT6.js +0 -619
  167. package/dist/chunk-7GGHK75W.js +0 -1835
  168. package/dist/chunk-ALNQINX7.js +0 -2496
  169. package/dist/chunk-B6KDKYXB.js +0 -2502
  170. package/dist/chunk-BEONZV6M.js +0 -1951
  171. package/dist/chunk-C4GEQ5RP.js +0 -1993
  172. package/dist/chunk-CQDVPMEU.js +0 -613
  173. package/dist/chunk-DOJHZ7XN.js +0 -2394
  174. package/dist/chunk-EH7G3LLL.js +0 -2065
  175. package/dist/chunk-EXXOPW3I.js +0 -2483
  176. package/dist/chunk-F4ZC6TXR.js +0 -2065
  177. package/dist/chunk-FCXE5CVC.js +0 -1528
  178. package/dist/chunk-FDQYPPG3.js +0 -2698
  179. package/dist/chunk-FURYJ254.mjs +0 -33
  180. package/dist/chunk-G2QQLBHW.js +0 -24
  181. package/dist/chunk-GM4WW6IE.js +0 -66
  182. package/dist/chunk-GZODLJ3C.js +0 -1861
  183. package/dist/chunk-IIY3E7Q7.js +0 -1996
  184. package/dist/chunk-JJN4J5NS.js +0 -2069
  185. package/dist/chunk-MRUHCNDM.js +0 -1940
  186. package/dist/chunk-NKDX67AW.js +0 -2698
  187. package/dist/chunk-NYUB4AHZ.js +0 -1951
  188. package/dist/chunk-OD4SLW7H.js +0 -1930
  189. package/dist/chunk-OE5MH3NB.js +0 -2070
  190. package/dist/chunk-PH36WQYS.js +0 -1875
  191. package/dist/chunk-PKNFV7KE.js +0 -2469
  192. package/dist/chunk-SUGK7UYL.js +0 -311
  193. package/dist/chunk-TIJHR54M.js +0 -1879
  194. package/dist/chunk-TUUHGLB5.js +0 -2609
  195. package/dist/chunk-UBTRANFX.js +0 -2476
  196. package/dist/chunk-VJWUG2XK.js +0 -1951
  197. package/dist/chunk-W6KURRMW.js +0 -2471
  198. package/dist/chunk-Y4AYI52W.js +0 -631
  199. package/dist/chunk-YDOBB7MY.js +0 -1457
  200. package/dist/chunk-YNJ3YC4N.js +0 -2483
  201. package/dist/chunk-ZFAOBRHT.js +0 -2709
  202. package/dist/controllers/admin-auth.controller.d.ts +0 -68
  203. package/dist/controllers/admin-auth.controller.d.ts.map +0 -1
  204. package/dist/controllers/admin-auth.controller.js +0 -414
  205. package/dist/controllers/admin-auth.controller.js.map +0 -1
  206. package/dist/controllers/auth.controller.d.ts +0 -125
  207. package/dist/controllers/auth.controller.d.ts.map +0 -1
  208. package/dist/controllers/auth.controller.js +0 -323
  209. package/dist/controllers/auth.controller.js.map +0 -1
  210. package/dist/controllers/collection.controller.d.ts +0 -157
  211. package/dist/controllers/collection.controller.d.ts.map +0 -1
  212. package/dist/controllers/collection.controller.js +0 -779
  213. package/dist/controllers/collection.controller.js.map +0 -1
  214. package/dist/controllers/global.controller.d.ts +0 -17
  215. package/dist/controllers/global.controller.d.ts.map +0 -1
  216. package/dist/controllers/global.controller.js +0 -132
  217. package/dist/controllers/global.controller.js.map +0 -1
  218. package/dist/controllers/media.controller.d.ts +0 -38
  219. package/dist/controllers/media.controller.d.ts.map +0 -1
  220. package/dist/controllers/media.controller.js +0 -162
  221. package/dist/controllers/media.controller.js.map +0 -1
  222. package/dist/controllers/preview.controller.d.ts +0 -37
  223. package/dist/controllers/preview.controller.d.ts.map +0 -1
  224. package/dist/controllers/preview.controller.js +0 -48
  225. package/dist/controllers/preview.controller.js.map +0 -1
  226. package/dist/index-BKYugiYp.d.cts +0 -1988
  227. package/dist/index-BKYugiYp.d.ts +0 -1988
  228. package/dist/index-BSWCiAen.d.cts +0 -1983
  229. package/dist/index-BSWCiAen.d.ts +0 -1983
  230. package/dist/index-BfLDb3b0.d.cts +0 -1467
  231. package/dist/index-BfLDb3b0.d.ts +0 -1467
  232. package/dist/index-Bi4sX_eC.d.cts +0 -1491
  233. package/dist/index-Bi4sX_eC.d.ts +0 -1491
  234. package/dist/index-Bp7PDOYG.d.cts +0 -1750
  235. package/dist/index-Bp7PDOYG.d.ts +0 -1750
  236. package/dist/index-ByXooLy-.d.cts +0 -1762
  237. package/dist/index-ByXooLy-.d.ts +0 -1762
  238. package/dist/index-C9Vp1DCT.d.cts +0 -1563
  239. package/dist/index-C9Vp1DCT.d.ts +0 -1563
  240. package/dist/index-CFezd8p1.d.cts +0 -1986
  241. package/dist/index-CFezd8p1.d.ts +0 -1986
  242. package/dist/index-CdQwnbfh.d.cts +0 -1889
  243. package/dist/index-CdQwnbfh.d.ts +0 -1889
  244. package/dist/index-D38_E0gf.d.cts +0 -336
  245. package/dist/index-D38_E0gf.d.ts +0 -336
  246. package/dist/index-DR2z1rrf.d.cts +0 -1503
  247. package/dist/index-DR2z1rrf.d.ts +0 -1503
  248. package/dist/index-DTrpTru7.d.cts +0 -1881
  249. package/dist/index-DTrpTru7.d.ts +0 -1881
  250. package/dist/index-DfAmTZXk.d.cts +0 -1749
  251. package/dist/index-DfAmTZXk.d.ts +0 -1749
  252. package/dist/index-DfkPT4NR.d.cts +0 -1584
  253. package/dist/index-DfkPT4NR.d.ts +0 -1584
  254. package/dist/index-DzUlE5Hc.d.cts +0 -1751
  255. package/dist/index-DzUlE5Hc.d.ts +0 -1751
  256. package/dist/index-M_m6dXZV.d.cts +0 -1889
  257. package/dist/index-M_m6dXZV.d.ts +0 -1889
  258. package/dist/index-RylhgOwj.d.cts +0 -340
  259. package/dist/index-RylhgOwj.d.ts +0 -340
  260. package/dist/index-qhLus8ZO.d.cts +0 -1881
  261. package/dist/index-qhLus8ZO.d.ts +0 -1881
  262. package/dist/index-xB1lMg79.d.cts +0 -1456
  263. package/dist/index-xB1lMg79.d.ts +0 -1456
  264. package/dist/index.d.mts +0 -417
  265. package/dist/index.d.ts.map +0 -1
  266. package/dist/index.js.map +0 -1
  267. package/dist/index.mjs +0 -1974
  268. package/dist/middleware/auth.d.ts +0 -18
  269. package/dist/middleware/auth.d.ts.map +0 -1
  270. package/dist/middleware/auth.js +0 -45
  271. package/dist/middleware/auth.js.map +0 -1
  272. package/dist/password-ACI2YUGZ.js +0 -8
  273. package/dist/router.d.ts +0 -8
  274. package/dist/router.d.ts.map +0 -1
  275. package/dist/router.js +0 -625
  276. package/dist/router.js.map +0 -1
  277. package/dist/server.d.ts.map +0 -1
  278. package/dist/server.js.map +0 -1
  279. package/dist/services/audit.service.d.ts +0 -23
  280. package/dist/services/audit.service.d.ts.map +0 -1
  281. package/dist/services/audit.service.js +0 -28
  282. package/dist/services/audit.service.js.map +0 -1
  283. package/dist/services/defaults.service.d.ts +0 -8
  284. package/dist/services/defaults.service.d.ts.map +0 -1
  285. package/dist/services/defaults.service.js +0 -55
  286. package/dist/services/defaults.service.js.map +0 -1
  287. package/dist/services/email-template.d.ts +0 -46
  288. package/dist/services/email-template.d.ts.map +0 -1
  289. package/dist/services/email-template.js +0 -88
  290. package/dist/services/email-template.js.map +0 -1
  291. package/dist/services/email.service.d.ts +0 -33
  292. package/dist/services/email.service.d.ts.map +0 -1
  293. package/dist/services/email.service.js +0 -96
  294. package/dist/services/email.service.js.map +0 -1
  295. package/dist/services/media.service.d.ts +0 -20
  296. package/dist/services/media.service.d.ts.map +0 -1
  297. package/dist/services/media.service.js +0 -49
  298. package/dist/services/media.service.js.map +0 -1
  299. package/dist/services/population.service.d.ts +0 -20
  300. package/dist/services/population.service.d.ts.map +0 -1
  301. package/dist/services/population.service.js +0 -194
  302. package/dist/services/population.service.js.map +0 -1
  303. package/dist/token-7QG5DBME.mjs +0 -10
  304. package/dist/types/access.d.ts +0 -38
  305. package/dist/types/access.d.ts.map +0 -1
  306. package/dist/types/access.js +0 -2
  307. package/dist/types/access.js.map +0 -1
  308. package/dist/types/adapters.d.ts +0 -146
  309. package/dist/types/adapters.d.ts.map +0 -1
  310. package/dist/types/adapters.js +0 -2
  311. package/dist/types/adapters.js.map +0 -1
  312. package/dist/types/admin-auth.d.ts +0 -132
  313. package/dist/types/admin-auth.d.ts.map +0 -1
  314. package/dist/types/admin-auth.js +0 -2
  315. package/dist/types/admin-auth.js.map +0 -1
  316. package/dist/types/admin.d.ts +0 -65
  317. package/dist/types/admin.d.ts.map +0 -1
  318. package/dist/types/admin.js +0 -2
  319. package/dist/types/admin.js.map +0 -1
  320. package/dist/types/app-config.d.ts +0 -143
  321. package/dist/types/app-config.d.ts.map +0 -1
  322. package/dist/types/app-config.js +0 -2
  323. package/dist/types/app-config.js.map +0 -1
  324. package/dist/types/documents.d.ts +0 -65
  325. package/dist/types/documents.d.ts.map +0 -1
  326. package/dist/types/documents.js +0 -2
  327. package/dist/types/documents.js.map +0 -1
  328. package/dist/types/hooks.d.ts +0 -122
  329. package/dist/types/hooks.d.ts.map +0 -1
  330. package/dist/types/hooks.js +0 -2
  331. package/dist/types/hooks.js.map +0 -1
  332. package/dist/types/index.d.ts +0 -13
  333. package/dist/types/index.d.ts.map +0 -1
  334. package/dist/types/index.js +0 -13
  335. package/dist/types/index.js.map +0 -1
  336. package/dist/types/request.d.ts +0 -42
  337. package/dist/types/request.d.ts.map +0 -1
  338. package/dist/types/request.js +0 -2
  339. package/dist/types/request.js.map +0 -1
  340. package/dist/types/schema-config.d.ts +0 -303
  341. package/dist/types/schema-config.d.ts.map +0 -1
  342. package/dist/types/schema-config.js +0 -2
  343. package/dist/types/schema-config.js.map +0 -1
  344. package/dist/types/schema-core.d.ts +0 -294
  345. package/dist/types/schema-core.d.ts.map +0 -1
  346. package/dist/types/schema-core.js +0 -2
  347. package/dist/types/schema-core.js.map +0 -1
  348. package/dist/types/schema-inference.d.ts +0 -73
  349. package/dist/types/schema-inference.d.ts.map +0 -1
  350. package/dist/types/schema-inference.js +0 -2
  351. package/dist/types/schema-inference.js.map +0 -1
  352. package/dist/types/workflows.d.ts +0 -84
  353. package/dist/types/workflows.d.ts.map +0 -1
  354. package/dist/types/workflows.js +0 -7
  355. package/dist/types/workflows.js.map +0 -1
  356. package/dist/utils/admin-auth.d.ts +0 -5
  357. package/dist/utils/admin-auth.d.ts.map +0 -1
  358. package/dist/utils/admin-auth.js +0 -39
  359. package/dist/utils/admin-auth.js.map +0 -1
  360. package/dist/utils/config.d.ts +0 -8
  361. package/dist/utils/config.d.ts.map +0 -1
  362. package/dist/utils/config.js +0 -238
  363. package/dist/utils/config.js.map +0 -1
  364. package/dist/utils/hooks.d.ts +0 -41
  365. package/dist/utils/hooks.d.ts.map +0 -1
  366. package/dist/utils/hooks.js +0 -173
  367. package/dist/utils/hooks.js.map +0 -1
  368. package/dist/utils/openapi.d.ts +0 -6
  369. package/dist/utils/openapi.d.ts.map +0 -1
  370. package/dist/utils/openapi.js +0 -842
  371. package/dist/utils/openapi.js.map +0 -1
  372. package/dist/utils/parse-sort.d.ts +0 -7
  373. package/dist/utils/parse-sort.d.ts.map +0 -1
  374. package/dist/utils/parse-sort.js +0 -23
  375. package/dist/utils/parse-sort.js.map +0 -1
  376. package/dist/utils/parse-where.d.ts +0 -63
  377. package/dist/utils/parse-where.d.ts.map +0 -1
  378. package/dist/utils/parse-where.js +0 -196
  379. package/dist/utils/parse-where.js.map +0 -1
  380. package/dist/utils/readonly-db.d.ts +0 -9
  381. package/dist/utils/readonly-db.d.ts.map +0 -1
  382. package/dist/utils/readonly-db.js +0 -21
  383. package/dist/utils/readonly-db.js.map +0 -1
  384. package/dist/utils/setup-prompt.d.ts +0 -11
  385. package/dist/utils/setup-prompt.d.ts.map +0 -1
  386. package/dist/utils/setup-prompt.js +0 -863
  387. package/dist/utils/setup-prompt.js.map +0 -1
  388. package/dist/utils/swagger.d.ts +0 -11
  389. package/dist/utils/swagger.d.ts.map +0 -1
  390. package/dist/utils/swagger.js +0 -62
  391. package/dist/utils/swagger.js.map +0 -1
  392. package/dist/utils/upload-validation.d.ts +0 -23
  393. package/dist/utils/upload-validation.d.ts.map +0 -1
  394. package/dist/utils/upload-validation.js +0 -44
  395. package/dist/utils/upload-validation.js.map +0 -1
  396. package/dist/utils/where-sanitizer.d.ts +0 -10
  397. package/dist/utils/where-sanitizer.d.ts.map +0 -1
  398. package/dist/utils/where-sanitizer.js +0 -67
  399. package/dist/utils/where-sanitizer.js.map +0 -1
  400. package/dist/where-sanitizer-7Q4JXMX6.js +0 -57
  401. package/dist/where-sanitizer-DQIWTQZW.js +0 -50
  402. package/dist/workflows.d.ts +0 -54
  403. package/dist/workflows.d.ts.map +0 -1
  404. package/dist/workflows.js +0 -282
  405. package/dist/workflows.js.map +0 -1
@@ -1,1045 +0,0 @@
1
- import { icons } from 'lucide-react';
2
-
3
- /**
4
- * Minimum HTTP request context passed to every server-side hook and resolver.
5
- *
6
- * The full Web Standard `Request` is available as `raw` when you need it, but
7
- * most hooks only need `query` (URL search parameters).
8
- */
9
- interface HookRequestContext {
10
- /** Parsed URL query-string parameters, e.g. `{ page: '2', search: 'hello' }`. */
11
- query: Record<string, string>;
12
- /** Incoming HTTP headers, lowercased. */
13
- headers: Record<string, string>;
14
- /** The raw Web Standard `Request` object. Useful for streaming or advanced header inspection. */
15
- raw?: Request;
16
- }
17
- /**
18
- * Base shape of an authenticated user as decoded from the JWT.
19
- *
20
- * The actual shape will include every field on your auth collection — this
21
- * interface only guarantees the properties that Dyrected always stamps on the
22
- * token. Extend it in your own codebase for stronger typing:
23
- *
24
- * @example
25
- * declare module '@dyrected/core' {
26
- * interface AuthenticatedUser {
27
- * role: 'admin' | 'editor'
28
- * organizationId: string
29
- * }
30
- * }
31
- */
32
- interface AuthenticatedUser {
33
- /** The user's document ID in the database. */
34
- sub: string;
35
- /** The user's email address. */
36
- email?: string;
37
- /** Slug of the collection this user was authenticated against. */
38
- collection: string;
39
- /** Array of role strings, if your auth collection has a `roles` field. */
40
- roles?: string[];
41
- /** Any additional fields from the auth collection document. */
42
- [key: string]: unknown;
43
- }
44
-
45
- /**
46
- * A function that determines whether the current user can perform an operation.
47
- *
48
- * Return `true` to allow, `false` to deny.
49
- * Return a `where`-style object to allow access only to matching documents
50
- * (useful for multi-tenant setups where users can only see their own data).
51
- *
52
- * Can also be expressed as a Jexl expression **string** for simple role checks
53
- * that need to be serialised (e.g. stored in the database or sent to the Admin UI).
54
- *
55
- * @template TDoc The shape of the collection's document.
56
- *
57
- * @example
58
- * // Simple role check
59
- * access: {
60
- * delete: ({ user }) => user?.roles?.includes('admin') ?? false,
61
- * }
62
- *
63
- * @example
64
- * // Row-level: users can only read their own documents
65
- * access: {
66
- * read: ({ user }) => ({ owner: { equals: user?.sub } }),
67
- * }
68
- *
69
- * @example
70
- * // Jexl string — evaluated server-side
71
- * access: {
72
- * update: "user.roles contains 'editor'",
73
- * }
74
- */
75
- type AccessFunction<TDoc extends object = Record<string, unknown>> = (args: {
76
- user: AuthenticatedUser | undefined;
77
- doc?: TDoc;
78
- data?: Partial<TDoc>;
79
- req: HookRequestContext;
80
- }) => boolean | Record<string, unknown> | Promise<boolean | Record<string, unknown>>;
81
-
82
- /**
83
- * The minimum shape of every document returned by the database layer.
84
- *
85
- * All documents have an `id` field assigned by the adapter. Additional fields
86
- * are stored as `unknown` until you narrow them with your own interface.
87
- *
88
- * Use this as the base when declaring your collection document types:
89
- * ```ts
90
- * interface Post extends BaseDocument {
91
- * title: string
92
- * slug: string
93
- * }
94
- * ```
95
- */
96
- interface BaseDocument {
97
- /** The document's unique identifier, assigned by the database adapter. */
98
- id: string;
99
- [key: string]: any;
100
- }
101
- /**
102
- * The envelope returned by collection list endpoints (`GET /api/collections/:slug`).
103
- *
104
- * @template T The document type.
105
- */
106
- interface PaginatedResult<T = Record<string, any>> {
107
- /** The documents on the current page. */
108
- docs: T[];
109
- /** Total number of documents matching the query (across all pages). */
110
- total: number;
111
- /** Maximum number of documents per page as requested. */
112
- limit: number;
113
- /** The current page number (1-indexed). */
114
- page: number;
115
- /** Total number of pages given the current `limit`. */
116
- totalPages: number;
117
- /** Whether a next page exists. */
118
- hasNextPage: boolean;
119
- /** Whether a previous page exists. */
120
- hasPrevPage: boolean;
121
- }
122
- /**
123
- * Metadata returned after a file is uploaded and stored.
124
- * Stored on the document in upload collections.
125
- */
126
- interface FileData {
127
- filename: string;
128
- filesize?: number;
129
- mimeType: string;
130
- /** Public URL of the stored file. */
131
- url: string;
132
- width?: number;
133
- height?: number;
134
- focalPoint?: {
135
- x: number;
136
- y: number;
137
- };
138
- /** Base64-encoded BlurHash string for progressive image loading. */
139
- blurhash?: string;
140
- /** `'upload'` for server-stored files; `'external'` for provider-managed files. */
141
- type?: "upload" | "external";
142
- provider?: string;
143
- provider_metadata?: unknown;
144
- [key: string]: unknown;
145
- }
146
-
147
- /** A valid icon component name from the Lucide icon set bundled with Dyrected Admin. */
148
- type AdminIconName = keyof typeof icons;
149
- /** Ordered custom component keys rendered around the built-in Admin dashboard. */
150
- interface AdminDashboardComponentSlots {
151
- beforeDashboard?: string[];
152
- afterDashboard?: string[];
153
- }
154
- /** Ordered custom component keys rendered around a collection's list content. */
155
- interface CollectionListComponentSlots {
156
- beforeList?: string[];
157
- beforeListTable?: string[];
158
- afterListTable?: string[];
159
- afterList?: string[];
160
- }
161
- /**
162
- * Branding and metadata options for the Dyrected Admin UI.
163
- *
164
- * @example
165
- * admin: {
166
- * branding: {
167
- * logo: '/logo.svg',
168
- * primaryColor: '#6366f1',
169
- * },
170
- * meta: {
171
- * titleSuffix: '- My App',
172
- * },
173
- * }
174
- */
175
- interface AdminConfig {
176
- /** Custom component slots around the built-in dashboard. */
177
- components?: AdminDashboardComponentSlots;
178
- branding?: {
179
- /** Full logo image shown in the expanded sidebar. URL or imported image asset. */
180
- logo?: string;
181
- /** Compact logo mark used in the collapsed sidebar state. */
182
- logoMark?: string;
183
- /** Text alternative or addition to the logo image. */
184
- logoText?: string;
185
- /**
186
- * Primary accent colour as any CSS colour value.
187
- * @example '#6366f1'
188
- * @example 'hsl(240 50% 60%)'
189
- */
190
- primaryColor?: string;
191
- /** Browser tab favicon URL. */
192
- favicon?: string;
193
- /** Font family for body and UI text. Must be loaded separately. */
194
- fontSans?: string;
195
- /** Font family for headings. Must be loaded separately. */
196
- fontSerif?: string;
197
- };
198
- meta?: {
199
- /**
200
- * String appended to every Admin page's `<title>`.
201
- * @default '- Dyrected'
202
- */
203
- titleSuffix?: string;
204
- };
205
- }
206
-
207
- type FieldType = "text" | "textarea" | "richText" | "number" | "boolean" | "date" | "datetime" | "time" | "select" | "multiSelect" | "radio" | "relationship" | "array" | "object" | "json" | "blocks" | "image" | "email" | "url" | "icon" | "join" | "row";
208
- interface DynamicOptionsResolverArgs {
209
- /** Database adapter available to server-side option resolvers. */
210
- db?: DatabaseAdapter;
211
- /** Authenticated user making the request, if any. */
212
- user?: AuthenticatedUser;
213
- /** Current HTTP request context, including query parameters. */
214
- req: HookRequestContext;
215
- }
216
- type DynamicOptionsResolver = (args: DynamicOptionsResolverArgs) => Promise<DynamicOptionItem[]> | DynamicOptionItem[];
217
- interface DynamicOptionsConfig {
218
- /** Resolver function executed on the server to produce option items. */
219
- resolve: DynamicOptionsResolver;
220
- /** Cache duration in seconds for identical resolver calls. */
221
- cacheTTL?: number;
222
- }
223
- type DynamicOptionItem = string | {
224
- label: string;
225
- value: unknown;
226
- };
227
- interface Block {
228
- /** Stable identifier stored in each block row as `blockType`. */
229
- slug: string;
230
- /** Human-readable labels shown in the Admin block picker. */
231
- labels?: {
232
- /** Singular label, for example `Hero`. */
233
- singular: string;
234
- /** Plural label, for example `Heroes`. */
235
- plural: string;
236
- };
237
- /** Fields that make up this block's payload. */
238
- fields: Field[];
239
- }
240
- interface FieldBase {
241
- /** Stored key for this field. Omit only for layout-only fields such as `row` or `join`. */
242
- name?: string;
243
- /** Human-readable label shown in the Admin UI. */
244
- label?: string;
245
- /** Whether the field must have a value when saving. */
246
- required?: boolean;
247
- /** Whether values for this field must be unique across the collection. */
248
- unique?: boolean;
249
- /** Default value used when a new document omits this field. */
250
- defaultValue?: unknown;
251
- /** Static or dynamic option source for supported selection fields. */
252
- options?: string[] | {
253
- label: string;
254
- value: unknown;
255
- }[] | DynamicOptionsResolver | DynamicOptionsConfig;
256
- /** Target collection slug for `relationship` fields. */
257
- relationTo?: string;
258
- /** Whether the field stores multiple values instead of one. */
259
- hasMany?: boolean;
260
- /** Child fields for `object` and `array` field types. */
261
- fields?: Field[];
262
- /** Allowed block definitions for a `blocks` field. */
263
- blocks?: Block[];
264
- /** Target collection slug for `join` fields. */
265
- collection?: string;
266
- /** Back-reference field name on the joined collection. */
267
- on?: string;
268
- /** Maximum number of joined documents returned by a `join` field. */
269
- limit?: number;
270
- /** Field-level read and update access rules. */
271
- access?: {
272
- /** Controls whether this field is returned in API responses. */
273
- read?: AccessFunction | string;
274
- /** Controls whether incoming writes may change this field. */
275
- update?: AccessFunction | string;
276
- };
277
- /** Admin-only presentation options for this field. */
278
- admin?: BaseFieldAdmin;
279
- /** Previous storage key to migrate from during schema sync. */
280
- renameTo?: string;
281
- /** Whether SQL adapters should promote this field into a first-class column. */
282
- promoted?: boolean;
283
- }
284
- interface BaseFieldAdmin {
285
- /** Placeholder text shown when the input has no value. */
286
- placeholder?: string;
287
- /** Custom component key registered in the Admin UI. */
288
- component?: string;
289
- /** Help text rendered below the field. */
290
- description?: string;
291
- /** Hides the field from the Admin form without deleting stored data. */
292
- hidden?: boolean;
293
- /** Excludes the field from Admin list filtering. */
294
- filterable?: boolean;
295
- /** Renders the field as non-editable in the Admin UI. */
296
- readOnly?: boolean;
297
- /** Reactive condition controlling whether the field is visible in the Admin UI. */
298
- condition?: ((data: Record<string, unknown>, siblingData: Record<string, unknown>) => boolean) | string;
299
- /** Tab name used when the edit form is rendered as tabs. */
300
- tab?: string;
301
- /** CSS width hint used when the field appears inside a `row`. */
302
- width?: string;
303
- }
304
- interface FieldBeforeChangeHookArgs<TValue = unknown, TDoc extends object = Record<string, unknown>> {
305
- /** Current field value after previous hooks in the chain. */
306
- value: TValue;
307
- /** Existing stored document before the write, if this is an update. */
308
- originalDoc?: TDoc;
309
- /** Full incoming payload being written. */
310
- data: Record<string, unknown>;
311
- /** Authenticated user performing the write, if any. */
312
- user?: AuthenticatedUser;
313
- /** Read-only database adapter for related lookups. */
314
- db: ReadonlyDatabaseAdapter;
315
- }
316
- type FieldBeforeChangeHook<TValue = unknown, TDoc extends object = Record<string, unknown>> = (args: FieldBeforeChangeHookArgs<TValue, TDoc>) => unknown;
317
- interface FieldAfterReadHookArgs<TValue = unknown, TDoc extends object = Record<string, unknown>> {
318
- /** Raw stored field value before this hook transforms it. */
319
- value: TValue;
320
- /** Full document currently being returned to the caller. */
321
- doc: TDoc;
322
- /** Authenticated user requesting the document, if any. */
323
- user?: AuthenticatedUser;
324
- /** Read-only database adapter for related lookups. */
325
- db: ReadonlyDatabaseAdapter;
326
- }
327
- type FieldAfterReadHook<TValue = unknown, TDoc extends object = Record<string, unknown>> = (args: FieldAfterReadHookArgs<TValue, TDoc>) => unknown;
328
- type FieldHooks<TValue> = {
329
- hooks?: {
330
- beforeChange?: Array<FieldBeforeChangeHook<TValue>>;
331
- afterRead?: Array<FieldAfterReadHook<TValue>>;
332
- };
333
- };
334
- interface FieldAdminOnChangeHookArgs<TValue = unknown> {
335
- /** Current field value in the form state. */
336
- value: TValue;
337
- /** Current values for sibling fields at the same nesting level. */
338
- siblingData: Record<string, unknown>;
339
- /** Current values for the entire form. */
340
- data: Record<string, unknown>;
341
- /** Imperative setter for async or derived updates. */
342
- setValue: (value: unknown) => void;
343
- }
344
- type FieldAdminOnChangeHook<TValue = unknown> = (args: FieldAdminOnChangeHookArgs<TValue>) => unknown;
345
- type FieldAdminHooks<TValue> = {
346
- admin?: {
347
- hooks?: {
348
- onChange?: FieldAdminOnChangeHook<TValue>;
349
- };
350
- };
351
- };
352
- interface FieldAdminOptionsHookArgs {
353
- /** Current values for sibling fields at the same nesting level. */
354
- siblingData: Record<string, unknown>;
355
- /** Current values for the entire form. */
356
- data: Record<string, unknown>;
357
- }
358
- type FieldAdminOptionsHookResult = Array<string | {
359
- label: string;
360
- value: unknown;
361
- }>;
362
- type FieldAdminOptionsHook = (args: FieldAdminOptionsHookArgs) => FieldAdminOptionsHookResult | Promise<FieldAdminOptionsHookResult>;
363
- type TypedField<TType extends FieldType, TValue, TAdminExtra = Record<never, never>> = Omit<FieldBase, "admin"> & {
364
- type: TType;
365
- admin?: BaseFieldAdmin & TAdminExtra;
366
- } & FieldHooks<TValue> & FieldAdminHooks<TValue>;
367
- type BooleanFieldAdmin = {
368
- /** Boolean presentation style. */
369
- layout?: "checkbox" | "switch";
370
- };
371
- type SelectFieldAdmin = {
372
- /** Select presentation style. */
373
- layout?: "radio" | "select";
374
- /** Radio orientation when `layout: 'radio'` is used. */
375
- direction?: "horizontal" | "vertical";
376
- hooks?: {
377
- /** Client-side option recalculation for dependent dropdowns or radios. */
378
- options?: FieldAdminOptionsHook;
379
- };
380
- };
381
- type RadioFieldAdmin = {
382
- /** Radio group orientation. */
383
- direction?: "horizontal" | "vertical";
384
- hooks?: {
385
- /** Client-side option recalculation for dependent radio groups. */
386
- options?: FieldAdminOptionsHook;
387
- };
388
- };
389
- type MultiSelectFieldAdmin = {
390
- hooks?: {
391
- /** Client-side option recalculation for dependent multi-select fields. */
392
- options?: FieldAdminOptionsHook;
393
- };
394
- };
395
- interface CharacterLimitFieldConfig {
396
- /** Advisory maximum character count exposed to editors and client tooling. */
397
- maxLength?: number;
398
- }
399
- interface WordLimitFieldConfig {
400
- /** Advisory maximum word count exposed to editors and client tooling. */
401
- maxWords?: number;
402
- }
403
- type CharacterLimitFieldAdmin = {
404
- /** Admin-only compatibility alias for `field.maxLength`. Prefer the top-level field property. */
405
- maxLength?: number;
406
- };
407
- type WordLimitFieldAdmin = {
408
- /** Admin-only compatibility alias for `field.maxWords`. Prefer the top-level field property. */
409
- maxWords?: number;
410
- };
411
- type TextFieldAdmin = CharacterLimitFieldAdmin & WordLimitFieldAdmin;
412
- type TextareaFieldAdmin = CharacterLimitFieldAdmin & WordLimitFieldAdmin;
413
- type EmailFieldAdmin = CharacterLimitFieldAdmin;
414
- type UrlFieldAdmin = CharacterLimitFieldAdmin;
415
- type IconFieldAdmin = CharacterLimitFieldAdmin;
416
- type TextField = TypedField<"text", string, TextFieldAdmin> & CharacterLimitFieldConfig & WordLimitFieldConfig;
417
- type TextareaField = TypedField<"textarea", string, TextareaFieldAdmin> & CharacterLimitFieldConfig & WordLimitFieldConfig;
418
- type EmailField = TypedField<"email", string, EmailFieldAdmin> & CharacterLimitFieldConfig;
419
- type UrlField = TypedField<"url", string, UrlFieldAdmin> & CharacterLimitFieldConfig;
420
- type IconField = TypedField<"icon", string, IconFieldAdmin> & CharacterLimitFieldConfig;
421
- type DateField = TypedField<"date", string>;
422
- type DateTimeField = TypedField<"datetime", string>;
423
- type TimeField = TypedField<"time", string>;
424
- type SelectField = TypedField<"select", string, SelectFieldAdmin>;
425
- type RadioField = TypedField<"radio", string, RadioFieldAdmin>;
426
- type NumberField = TypedField<"number", number>;
427
- type BooleanField = TypedField<"boolean", boolean, BooleanFieldAdmin>;
428
- type MultiSelectField = TypedField<"multiSelect", string[], MultiSelectFieldAdmin>;
429
- type RelationshipField = TypedField<"relationship", string | string[]>;
430
- type ImageField = TypedField<"image", string | string[]>;
431
- type RichTextField = TypedField<"richText", Record<string, unknown>>;
432
- type JsonField = TypedField<"json", Record<string, unknown>>;
433
- type ObjectField = TypedField<"object", unknown>;
434
- type ArrayField = TypedField<"array", unknown>;
435
- type BlocksField = TypedField<"blocks", unknown>;
436
- type JoinField = TypedField<"join", unknown>;
437
- type RowField = TypedField<"row", unknown>;
438
- type Field = TextField | TextareaField | EmailField | UrlField | IconField | DateField | DateTimeField | TimeField | SelectField | RadioField | NumberField | BooleanField | MultiSelectField | RelationshipField | ImageField | RichTextField | JsonField | ObjectField | ArrayField | BlocksField | JoinField | RowField;
439
- interface UploadConfig {
440
- /** Allowed MIME types for uploaded files. */
441
- allowedMimeTypes?: string[];
442
- /** Maximum upload size in bytes. */
443
- maxFileSize?: number;
444
- /** Local filesystem destination used by disk-based storage adapters. */
445
- staticDir?: string;
446
- /** Public URL prefix for disk-based uploads. */
447
- staticURL?: string;
448
- /** Generated image size name used as the Admin media thumbnail. */
449
- adminThumbnail?: string;
450
- imageSizes?: {
451
- /** Stable name used to reference this generated size. */
452
- name: string;
453
- /** Target width in pixels. */
454
- width?: number;
455
- /** Target height in pixels. */
456
- height?: number;
457
- /** Crop strategy forwarded to the image processor. */
458
- crop?: string;
459
- /** Resize fit strategy forwarded to the image processor. */
460
- fit?: string;
461
- /** Prevents upscaling smaller source images. */
462
- withoutEnlargement?: boolean;
463
- /** Format-specific options forwarded to the image processor. */
464
- formatOptions?: Record<string, unknown>;
465
- }[];
466
- }
467
-
468
- /**
469
- * @deprecated Use {@link FieldBeforeChangeHook} or `FieldAfterReadHook` instead.
470
- * This alias remains for backwards compatibility.
471
- */
472
- type FieldHook<TDoc extends object = Record<string, unknown>, TValue = unknown> = FieldBeforeChangeHook<TValue, TDoc>;
473
- /**
474
- * Runs before Dyrected queries the database for a list or single-document fetch.
475
- *
476
- * Return a new `where` query object to override or extend the current filter.
477
- * Return `undefined` (or nothing) to leave the query unchanged.
478
- */
479
- type CollectionBeforeReadHook = (args: {
480
- req: HookRequestContext;
481
- query?: Record<string, unknown>;
482
- user?: AuthenticatedUser;
483
- db: ReadonlyDatabaseAdapter;
484
- }) => Record<string, unknown> | void | Promise<Record<string, unknown> | void>;
485
- /**
486
- * Runs after a document (or list of documents) is fetched from the database,
487
- * before the response is sent to the client.
488
- */
489
- type CollectionAfterReadHook<TDoc extends object = Record<string, unknown>> = (args: {
490
- doc: TDoc;
491
- req: HookRequestContext;
492
- user?: AuthenticatedUser;
493
- db: ReadonlyDatabaseAdapter;
494
- }) => TDoc | Promise<TDoc>;
495
- /**
496
- * Runs **before** a document is created or updated in the database.
497
- */
498
- type CollectionBeforeChangeHook<TDoc extends object = Record<string, unknown>> = (args: {
499
- data: Partial<TDoc>;
500
- doc?: TDoc;
501
- req: HookRequestContext;
502
- user?: AuthenticatedUser;
503
- operation: "create" | "update";
504
- db: ReadonlyDatabaseAdapter;
505
- }) => Partial<TDoc> | void | Promise<Partial<TDoc> | void>;
506
- /**
507
- * Runs **after** a document is created or updated in the database.
508
- */
509
- type CollectionAfterChangeHook<TDoc extends object = Record<string, unknown>> = (args: {
510
- doc: TDoc;
511
- previousDoc?: TDoc;
512
- req: HookRequestContext;
513
- user?: AuthenticatedUser;
514
- operation: "create" | "update";
515
- db: DatabaseAdapter;
516
- }) => void | Promise<void>;
517
- /**
518
- * Runs **before** a document is deleted from the database.
519
- */
520
- type CollectionBeforeDeleteHook<TDoc extends object = Record<string, unknown>> = (args: {
521
- id: string;
522
- doc: TDoc;
523
- req: HookRequestContext;
524
- user?: AuthenticatedUser;
525
- db: ReadonlyDatabaseAdapter;
526
- }) => void | Promise<void>;
527
- /**
528
- * Runs **after** a document has been deleted from the database.
529
- */
530
- type CollectionAfterDeleteHook<TDoc extends object = Record<string, unknown>> = (args: {
531
- id: string;
532
- doc: TDoc;
533
- req: HookRequestContext;
534
- user?: AuthenticatedUser;
535
- db: DatabaseAdapter;
536
- }) => void | Promise<void>;
537
- /** @see {@link CollectionBeforeReadHook} */
538
- type GlobalBeforeReadHook = CollectionBeforeReadHook;
539
- /**
540
- * Runs after the global document is fetched, before the response is sent.
541
- */
542
- type GlobalAfterReadHook<TDoc extends object = Record<string, unknown>> = (args: {
543
- doc: TDoc;
544
- req: HookRequestContext;
545
- user?: AuthenticatedUser;
546
- db: ReadonlyDatabaseAdapter;
547
- }) => TDoc | Promise<TDoc>;
548
- /**
549
- * Runs before the global document is updated.
550
- * Operation is always `'update'` (globals cannot be created or deleted).
551
- */
552
- type GlobalBeforeChangeHook<TDoc extends object = Record<string, unknown>> = (args: {
553
- data: Partial<TDoc>;
554
- doc?: TDoc;
555
- req: HookRequestContext;
556
- user?: AuthenticatedUser;
557
- operation: "update";
558
- db: ReadonlyDatabaseAdapter;
559
- }) => Partial<TDoc> | void | Promise<Partial<TDoc> | void>;
560
- /**
561
- * Runs after the global document is updated. Side-effects only.
562
- */
563
- type GlobalAfterChangeHook<TDoc extends object = Record<string, unknown>> = (args: {
564
- doc: TDoc;
565
- previousDoc?: TDoc;
566
- req: HookRequestContext;
567
- user?: AuthenticatedUser;
568
- operation: "update";
569
- db: DatabaseAdapter;
570
- }) => void | Promise<void>;
571
- /**
572
- * @deprecated Use the specific hook types instead:
573
- * `CollectionBeforeChangeHook`, `CollectionAfterReadHook`, etc.
574
- *
575
- * This broad type remains for backwards compatibility with the internal hook runner.
576
- */
577
- type HookFunction<TDoc extends object = Record<string, unknown>> = (args: {
578
- data?: Partial<TDoc>;
579
- doc?: TDoc;
580
- user?: AuthenticatedUser;
581
- req?: HookRequestContext;
582
- operation?: "create" | "update" | "delete";
583
- db?: DatabaseAdapter;
584
- [key: string]: unknown;
585
- }) => unknown | Promise<unknown>;
586
-
587
- declare const LIFECYCLE_EVENT_NAMES: readonly ["revision.created", "workflow.transitioned", "entry.published", "entry.unpublished"];
588
- type LifecycleEventName = (typeof LIFECYCLE_EVENT_NAMES)[number];
589
- interface WorkflowState {
590
- /** Stable machine-readable state key. */
591
- name: string;
592
- /** Label rendered in the Admin UI. */
593
- label: string;
594
- /** Marks the state whose revision is visible to public readers. */
595
- published?: boolean;
596
- /** Optional visual tone used by the Admin UI. */
597
- color?: "neutral" | "warning" | "success" | "danger" | "info";
598
- }
599
- interface WorkflowTransition {
600
- /** Stable transition key used by the REST and SDK APIs. */
601
- name: string;
602
- label: string;
603
- from: string | string[];
604
- to: string;
605
- /** Every listed capability is required. */
606
- requiredCapabilities?: string[];
607
- /** Require a non-empty comment when performing the transition. */
608
- requireComment?: boolean;
609
- /** Remove the public snapshot after this transition commits. */
610
- unpublish?: boolean;
611
- }
612
- interface WorkflowRole {
613
- /** Existing user role value, for example `editor` or `publisher`. */
614
- role: string;
615
- capabilities: string[];
616
- }
617
- interface WorkflowConfig<TDoc extends object = Record<string, unknown>> {
618
- initialState: string;
619
- /** State used for a new working revision created from published content. */
620
- draftState?: string;
621
- states: WorkflowState[];
622
- transitions: WorkflowTransition[];
623
- /** Maps values in `user.roles` to workflow capabilities. */
624
- roles?: WorkflowRole[];
625
- hooks?: {
626
- beforeTransition?: CollectionBeforeTransitionHook<TDoc>[];
627
- afterTransition?: CollectionAfterTransitionHook<TDoc>[];
628
- };
629
- }
630
- interface WorkflowMetadata {
631
- state: string;
632
- revision: number;
633
- publishedRevision?: number;
634
- publishedAt?: string;
635
- publishedBy?: string;
636
- /** Transitions currently allowed for the requesting user. Response-only. */
637
- availableTransitions?: string[];
638
- }
639
- interface WorkflowTransitionContext<TDoc extends object = Record<string, unknown>> {
640
- transition: WorkflowTransition;
641
- from: string;
642
- to: string;
643
- doc: TDoc;
644
- user?: AuthenticatedUser;
645
- comment?: string;
646
- req: HookRequestContext;
647
- db: DatabaseAdapter;
648
- }
649
- type CollectionBeforeTransitionHook<TDoc extends object = Record<string, unknown>> = (args: WorkflowTransitionContext<TDoc>) => void | Promise<void>;
650
- type CollectionAfterTransitionHook<TDoc extends object = Record<string, unknown>> = (args: WorkflowTransitionContext<TDoc> & {
651
- event: LifecycleEvent;
652
- }) => void | Promise<void>;
653
- interface LifecycleEvent<TPayload = Record<string, unknown>> {
654
- id: string;
655
- name: LifecycleEventName;
656
- collection: string;
657
- documentId: string;
658
- occurredAt: string;
659
- actorId?: string;
660
- payload: TPayload;
661
- attempts: number;
662
- status: "pending" | "processing" | "delivered" | "failed";
663
- nextAttemptAt?: string;
664
- deliveredAt?: string;
665
- lastError?: string;
666
- }
667
- type LifecycleEventHandler = (event: LifecycleEvent) => void | Promise<void>;
668
-
669
- /**
670
- * Defines a Dyrected collection — a named set of documents with a shared schema.
671
- *
672
- * Pass your document's TypeScript type as the generic parameter `TDoc` to get
673
- * fully typed hooks and access functions.
674
- */
675
- interface CollectionConfig<TDoc extends object = Record<string, unknown>> {
676
- slug: string;
677
- siteId?: string;
678
- shared?: boolean;
679
- labels?: {
680
- singular: string;
681
- plural: string;
682
- };
683
- auth?: boolean;
684
- upload?: boolean | UploadConfig;
685
- fields: Field[];
686
- timestamps?: boolean;
687
- initialData?: Partial<TDoc>[];
688
- audit?: boolean;
689
- workflow?: WorkflowConfig<TDoc>;
690
- access?: {
691
- read?: AccessFunction<TDoc> | string;
692
- create?: AccessFunction<TDoc> | string;
693
- update?: AccessFunction<TDoc> | string;
694
- delete?: AccessFunction<TDoc> | string;
695
- };
696
- hooks?: {
697
- beforeRead?: CollectionBeforeReadHook[];
698
- afterRead?: CollectionAfterReadHook<TDoc>[];
699
- beforeChange?: CollectionBeforeChangeHook<TDoc>[];
700
- afterChange?: CollectionAfterChangeHook<TDoc>[];
701
- beforeDelete?: CollectionBeforeDeleteHook<TDoc>[];
702
- afterDelete?: CollectionAfterDeleteHook<TDoc>[];
703
- };
704
- admin?: {
705
- icon?: AdminIconName;
706
- components?: CollectionListComponentSlots;
707
- useAsTitle?: string;
708
- defaultColumns?: string[];
709
- group?: string;
710
- hidden?: boolean;
711
- filterable?: boolean;
712
- previewUrl?: string | ((doc: TDoc, opts: {
713
- locale?: string;
714
- }) => string | null);
715
- previewMode?: "postMessage" | "token";
716
- urlPattern?: string;
717
- };
718
- }
719
- /**
720
- * Defines a Dyrected global — a singleton document without pagination or IDs.
721
- */
722
- interface GlobalConfig<TDoc extends object = Record<string, unknown>> {
723
- slug: string;
724
- siteId?: string;
725
- shared?: boolean;
726
- label?: string;
727
- fields: Field[];
728
- access?: {
729
- read?: AccessFunction<TDoc>;
730
- update?: AccessFunction<TDoc>;
731
- };
732
- hooks?: {
733
- beforeRead?: GlobalBeforeReadHook[];
734
- afterRead?: GlobalAfterReadHook<TDoc>[];
735
- beforeChange?: GlobalBeforeChangeHook<TDoc>[];
736
- afterChange?: GlobalAfterChangeHook<TDoc>[];
737
- };
738
- admin?: {
739
- icon?: AdminIconName;
740
- group?: string;
741
- hidden?: boolean;
742
- };
743
- initialData?: Partial<TDoc>;
744
- }
745
-
746
- /**
747
- * The interface every database adapter must implement.
748
- *
749
- * Dyrected ships adapters for PostgreSQL, MySQL, SQLite, and MongoDB.
750
- * Implement this interface to connect any other database.
751
- */
752
- interface DatabaseAdapter {
753
- /** Find a paginated list of documents in a collection. */
754
- find(args: {
755
- collection: string;
756
- where?: Record<string, unknown>;
757
- limit?: number;
758
- page?: number;
759
- sort?: string;
760
- }): Promise<PaginatedResult>;
761
- /** Find a single document by its ID. Returns `null` if not found. */
762
- findOne(args: {
763
- collection: string;
764
- id: string;
765
- }): Promise<BaseDocument | null>;
766
- /** Insert a new document and return it with its generated `id`. */
767
- create(args: {
768
- collection: string;
769
- data: Record<string, unknown>;
770
- }): Promise<BaseDocument>;
771
- /** Update a document by ID and return the updated document. */
772
- update(args: {
773
- collection: string;
774
- id: string;
775
- data: Record<string, unknown>;
776
- }): Promise<BaseDocument>;
777
- /** Delete a document by ID. Return value is intentionally untyped — callers do not use it. */
778
- delete(args: {
779
- collection: string;
780
- id: string;
781
- }): Promise<unknown>;
782
- /** Fetch the singleton document for a global. Returns an empty object if not yet initialised. */
783
- getGlobal(args: {
784
- slug: string;
785
- }): Promise<Record<string, unknown>>;
786
- /** Create or replace the singleton document for a global. */
787
- updateGlobal(args: {
788
- slug: string;
789
- data: Record<string, unknown>;
790
- }): Promise<Record<string, unknown>>;
791
- /**
792
- * Sync the database schema with the current collection and global configs.
793
- * Called on startup to create tables/collections that don't exist yet.
794
- * Not all adapters implement this (e.g. MongoDB is schema-less).
795
- */
796
- sync?(collections: CollectionConfig[], globals: GlobalConfig[]): Promise<void>;
797
- /**
798
- * Execute a raw SQL query or database command.
799
- * Optional — not all adapters support raw access.
800
- */
801
- execute?(query: string, params?: unknown[]): Promise<unknown>;
802
- /**
803
- * Run all adapter operations in `callback` as one atomic transaction.
804
- * Shipped adapters implement this; workflow transitions require it.
805
- */
806
- transaction?<T>(callback: (db: DatabaseAdapter) => Promise<T>): Promise<T>;
807
- }
808
- /**
809
- * Read-only view of the database adapter. Exposes only `find`, `findOne`,
810
- * and `getGlobal` — no write operations.
811
- *
812
- * Passed to `beforeChange`, `beforeDelete`, `beforeRead`, `afterRead`,
813
- * and field-level hooks. Write operations are available in `afterChange`
814
- * and `afterDelete` hooks where the full {@link DatabaseAdapter} is provided.
815
- */
816
- type ReadonlyDatabaseAdapter = Pick<DatabaseAdapter, "find" | "findOne" | "getGlobal">;
817
- /**
818
- * The interface every storage adapter must implement.
819
- *
820
- * Dyrected ships adapters for local disk, S3, Cloudflare R2, Cloudinary, and
821
- * Backblaze B2. Implement this interface to use any other storage provider.
822
- */
823
- interface StorageAdapter {
824
- /**
825
- * Upload a file and return its metadata (URL, dimensions, etc.).
826
- * The `prefix` is a path prefix used for multi-tenant setups.
827
- */
828
- upload(args: {
829
- filename: string;
830
- buffer: Uint8Array;
831
- mimeType: string;
832
- prefix?: string;
833
- }): Promise<FileData>;
834
- /** Delete a file by its stored filename. */
835
- delete(args: {
836
- filename: string;
837
- }): Promise<void>;
838
- /** Return the public URL for a stored file. */
839
- getURL(args: {
840
- filename: string;
841
- }): string;
842
- /**
843
- * Retrieve the file's raw bytes and MIME type for serving via the API.
844
- * Only needed by adapters that serve files through the Dyrected API
845
- * (e.g. `LocalStorage`). Cloud adapters return `null` here and rely on
846
- * direct CDN URLs instead.
847
- */
848
- resolve?(args: {
849
- filename: string;
850
- }): Promise<{
851
- buffer: Uint8Array;
852
- mimeType: string;
853
- } | null>;
854
- }
855
- /**
856
- * Processes uploaded images — generates metadata (dimensions, BlurHash) and
857
- * produces resized variants defined in `UploadConfig.imageSizes`.
858
- *
859
- * @example
860
- * import { SharpImageService } from '@dyrected/image-sharp'
861
- * defineConfig({ image: new SharpImageService(), ... })
862
- */
863
- interface ImageService {
864
- process(args: {
865
- buffer: Uint8Array;
866
- mimeType: string;
867
- config?: boolean | UploadConfig;
868
- focalPoint?: {
869
- x: number;
870
- y: number;
871
- };
872
- }): Promise<{
873
- metadata: {
874
- width?: number;
875
- height?: number;
876
- /** Base64-encoded BlurHash for progressive loading. */
877
- blurhash?: string;
878
- };
879
- /** Generated image sizes keyed by their `name`. */
880
- sizes?: Record<string, {
881
- buffer: Uint8Array;
882
- width: number;
883
- height: number;
884
- filename: string;
885
- }>;
886
- }>;
887
- }
888
-
889
- type AdminAuthProvisioningMode = "jit_only" | "jit_plus_membership_management" | "preprovisioned_only";
890
- interface AdminAuthClaimMapping {
891
- sub?: string;
892
- email?: string;
893
- name?: string;
894
- roles?: string;
895
- groups?: string;
896
- siteIds?: string;
897
- workspaceIds?: string;
898
- }
899
- interface AdminAuthResolvedIdentity {
900
- sub: string;
901
- email?: string;
902
- name?: string;
903
- roles?: string[];
904
- groups?: string[];
905
- siteIds?: string[];
906
- workspaceIds?: string[];
907
- rawClaims?: Record<string, unknown>;
908
- }
909
- interface AdminAuthAccessResolution {
910
- allowed: boolean;
911
- roles?: string[];
912
- data?: Record<string, unknown>;
913
- }
914
- interface AdminAuthResolveAccessArgs {
915
- identity: AdminAuthResolvedIdentity;
916
- providerId: string;
917
- siteId?: string;
918
- workspaceId?: string;
919
- req: {
920
- method: string;
921
- path: string;
922
- url: string;
923
- headers: Record<string, string | undefined>;
924
- };
925
- user: Record<string, unknown> | null;
926
- }
927
- interface BaseAdminAuthProvider {
928
- id: string;
929
- type: "oidc" | "custom" | "cloud";
930
- displayName?: string;
931
- autoRedirect?: boolean;
932
- allowJitProvisioning?: boolean;
933
- claimMapping?: AdminAuthClaimMapping;
934
- }
935
- interface OIDCAdminAuthProvider extends BaseAdminAuthProvider {
936
- type: "oidc";
937
- issuer: string;
938
- clientId: string;
939
- clientSecret: string;
940
- redirectUri?: string;
941
- scopes?: string[];
942
- authorizationEndpoint?: string;
943
- tokenEndpoint?: string;
944
- userInfoEndpoint?: string;
945
- }
946
- interface CustomAdminAuthProvider extends BaseAdminAuthProvider {
947
- type: "custom" | "cloud";
948
- startUrl?: string;
949
- issuer?: string;
950
- audience?: string;
951
- secret?: string;
952
- jwksUri?: string;
953
- tokenParam?: string;
954
- }
955
- type AdminAuthProvider = OIDCAdminAuthProvider | CustomAdminAuthProvider;
956
- interface PublicAdminAuthProvider {
957
- id: string;
958
- type: AdminAuthProvider["type"];
959
- displayName: string;
960
- autoRedirect?: boolean;
961
- }
962
- interface PublicAdminAuthConfig {
963
- mode: "local" | "external";
964
- collectionSlug?: string;
965
- provisioningMode?: AdminAuthProvisioningMode;
966
- providers: PublicAdminAuthProvider[];
967
- }
968
- interface AdminAuthConfig {
969
- mode: "local" | "external";
970
- collectionSlug?: string;
971
- provisioningMode?: AdminAuthProvisioningMode;
972
- providers: AdminAuthProvider[];
973
- resolveAccess?: (args: AdminAuthResolveAccessArgs) => Promise<AdminAuthAccessResolution> | AdminAuthAccessResolution;
974
- }
975
-
976
- /**
977
- * The root configuration object passed to `createDyrectedApp`.
978
- *
979
- * This is the single source of truth for your entire Dyrected instance —
980
- * collections, globals, database adapter, storage, email, and more.
981
- */
982
- interface DyrectedConfig {
983
- collections: CollectionConfig<any>[];
984
- globals: GlobalConfig<any>[];
985
- db?: DatabaseAdapter;
986
- storage?: StorageAdapter;
987
- image?: ImageService;
988
- admin?: AdminConfig;
989
- adminAuth?: AdminAuthConfig;
990
- email?: {
991
- from: string;
992
- send: (args: {
993
- to: string;
994
- subject: string;
995
- html: string;
996
- }) => Promise<void>;
997
- templates?: {
998
- welcome?: (args: {
999
- email: string;
1000
- }) => {
1001
- subject?: string;
1002
- html: string;
1003
- };
1004
- invite?: (args: {
1005
- token: string;
1006
- invitedByEmail?: string;
1007
- }) => {
1008
- subject?: string;
1009
- html: string;
1010
- };
1011
- resetPassword?: (args: {
1012
- token: string;
1013
- url?: string;
1014
- }) => {
1015
- subject?: string;
1016
- html: string;
1017
- };
1018
- passwordChanged?: (args: {
1019
- email: string;
1020
- }) => {
1021
- subject?: string;
1022
- html: string;
1023
- };
1024
- };
1025
- };
1026
- redis?: {
1027
- url: string;
1028
- };
1029
- events?: {
1030
- handlers: LifecycleEventHandler[];
1031
- maxAttempts?: number;
1032
- retryDelayMs?: number;
1033
- };
1034
- cors?: {
1035
- origins: string[];
1036
- };
1037
- onSchemaFetch?: (siteId: string) => Promise<{
1038
- collections?: CollectionConfig<any>[];
1039
- globals?: GlobalConfig<any>[];
1040
- admin?: AdminConfig;
1041
- adminAuth?: AdminAuthConfig;
1042
- }>;
1043
- }
1044
-
1045
- export { type FieldAfterReadHookArgs as $, type AdminAuthConfig as A, type Block as B, type CollectionConfig as C, type DyrectedConfig as D, type CollectionBeforeTransitionHook as E, type Field as F, type GlobalConfig as G, type HookRequestContext as H, type CollectionListComponentSlots as I, type CustomAdminAuthProvider as J, type DatabaseAdapter as K, type LifecycleEventName as L, type DateField as M, type DateTimeField as N, type DynamicOptionItem as O, type PublicAdminAuthConfig as P, type DynamicOptionsConfig as Q, type DynamicOptionsResolver as R, type DynamicOptionsResolverArgs as S, type EmailField as T, type FieldAdminOnChangeHook as U, type FieldAdminOnChangeHookArgs as V, type WorkflowConfig as W, type FieldAdminOptionsHook as X, type FieldAdminOptionsHookArgs as Y, type FieldAdminOptionsHookResult as Z, type FieldAfterReadHook as _, type AuthenticatedUser as a, type FieldBeforeChangeHook as a0, type FieldBeforeChangeHookArgs as a1, type FieldHook as a2, type FieldType as a3, type FileData as a4, type GlobalAfterChangeHook as a5, type GlobalAfterReadHook as a6, type GlobalBeforeChangeHook as a7, type GlobalBeforeReadHook as a8, type HookFunction as a9, type WorkflowMetadata as aA, type WorkflowRole as aB, type WorkflowState as aC, type WorkflowTransitionContext as aD, type IconField as aa, type ImageField as ab, type ImageService as ac, type JoinField as ad, type JsonField as ae, LIFECYCLE_EVENT_NAMES as af, type LifecycleEventHandler as ag, type MultiSelectField as ah, type NumberField as ai, type OIDCAdminAuthProvider as aj, type ObjectField as ak, type PaginatedResult as al, type PublicAdminAuthProvider as am, type RadioField as an, type ReadonlyDatabaseAdapter as ao, type RelationshipField as ap, type RichTextField as aq, type RowField as ar, type SelectField as as, type StorageAdapter as at, type TextField as au, type TextareaField as av, type TimeField as aw, type UploadConfig as ax, type UrlField as ay, type WordLimitFieldConfig as az, type WorkflowTransition as b, type LifecycleEvent as c, type BaseDocument as d, type AccessFunction as e, type AdminAuthAccessResolution as f, type AdminAuthClaimMapping as g, type AdminAuthProvider as h, type AdminAuthProvisioningMode as i, type AdminAuthResolveAccessArgs as j, type AdminAuthResolvedIdentity as k, type AdminConfig as l, type AdminDashboardComponentSlots as m, type AdminIconName as n, type ArrayField as o, type BaseAdminAuthProvider as p, type BlocksField as q, type BooleanField as r, type CharacterLimitFieldConfig as s, type CollectionAfterChangeHook as t, type CollectionAfterDeleteHook as u, type CollectionAfterReadHook as v, type CollectionAfterTransitionHook as w, type CollectionBeforeChangeHook as x, type CollectionBeforeDeleteHook as y, type CollectionBeforeReadHook as z };