@kyro-cms/core 0.13.2 → 0.13.5

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 (262) hide show
  1. package/dist/{WebhookService-BOJMgjBm.d.cts → WebhookService-BJTCP3cU.d.cts} +1 -1
  2. package/dist/{WebhookService-BLi5Rz2m.d.ts → WebhookService-Bqr_66lK.d.ts} +1 -1
  3. package/dist/api-handler-graphql.cjs +1 -1
  4. package/dist/api-handler-graphql.js +1 -1
  5. package/dist/api-handler-trpc.cjs +1 -1
  6. package/dist/api-handler-trpc.js +1 -1
  7. package/dist/api-handler.cjs +1 -1
  8. package/dist/api-handler.js +1 -1
  9. package/dist/{base-OYfoYPYP.d.ts → base-A9AJPCG5.d.ts} +1 -0
  10. package/dist/{base-BCgFt3Yx.d.ts → base-C2DOe8wD.d.ts} +3 -2
  11. package/dist/{base-BaOJ5uWd.d.cts → base-C6wyX2nC.d.cts} +1 -0
  12. package/dist/{base-B-i-tjm1.d.ts → base-DIpT2Vuz.d.cts} +3 -2
  13. package/dist/{bootstrap-QQ6D3OYG.js → bootstrap-PG2LGDLB.js} +1 -1
  14. package/dist/bootstrap-YD3GLTWX.cjs +1 -0
  15. package/dist/chunk-2SPWRQ5O.js +122 -0
  16. package/dist/chunk-2TYITUOC.js +122 -0
  17. package/dist/{chunk-GV2IB4WQ.cjs → chunk-3CIMGC2F.cjs} +3 -3
  18. package/dist/{chunk-S5HTTLN7.cjs → chunk-4NTIK6DF.cjs} +1 -1
  19. package/dist/chunk-6E44MQQ5.js +115 -0
  20. package/dist/{chunk-PTPVFLET.js → chunk-6LWF5MPL.js} +1 -1
  21. package/dist/chunk-6YS6XLOD.cjs +121 -0
  22. package/dist/{chunk-2OS5Y4LE.cjs → chunk-7KLEANTO.cjs} +1 -1
  23. package/dist/{chunk-3GXLOYM3.js → chunk-ALTU3FDG.js} +1 -1
  24. package/dist/{chunk-OPTVCCQQ.cjs → chunk-EQN3HDES.cjs} +7 -6
  25. package/dist/{chunk-3O3AVMWM.cjs → chunk-EW424IBO.cjs} +1 -1
  26. package/dist/{chunk-JZ7Z6WC2.cjs → chunk-GTR7JAKP.cjs} +2 -2
  27. package/dist/{chunk-M75VGFCI.js → chunk-HPIJI7TM.js} +1 -1
  28. package/dist/chunk-J6V573PE.cjs +1 -0
  29. package/dist/{chunk-3LAWUINR.cjs → chunk-LKRI5X2V.cjs} +1 -1
  30. package/dist/{chunk-6MNLRAKM.cjs → chunk-NRE6VKL6.cjs} +12 -12
  31. package/dist/{chunk-MYHNTJLR.cjs → chunk-OOVNTOZC.cjs} +6 -6
  32. package/dist/{chunk-SMQ6736Y.js → chunk-PYUWSKKP.js} +1 -1
  33. package/dist/{chunk-XBQ6HV3T.cjs → chunk-QYN6C3FZ.cjs} +4 -4
  34. package/dist/{chunk-ATI2UZ7U.js → chunk-RYXLEFS5.js} +1 -1
  35. package/dist/{chunk-E4H3ZZ7U.js → chunk-SRIXRJHL.js} +1 -1
  36. package/dist/chunk-V4FAL7AG.js +2 -0
  37. package/dist/{chunk-6DD4J7LI.js → chunk-WAVGRSE6.js} +1 -1
  38. package/dist/{chunk-N6MNQIQU.js → chunk-WNU76M2C.js} +7 -6
  39. package/dist/chunk-XDQVYCIR.cjs +1 -0
  40. package/dist/{chunk-K5XGP57D.cjs → chunk-XOR64WUQ.cjs} +1 -1
  41. package/dist/chunk-YGI5W4RS.js +2 -0
  42. package/dist/{chunk-I6UJVO2P.js → chunk-YIFKTA5N.js} +6 -6
  43. package/dist/cli/index.cjs +86 -86
  44. package/dist/cli/index.js +87 -87
  45. package/dist/client.d.cts +26 -0
  46. package/dist/client.d.ts +26 -0
  47. package/dist/drizzle/index.cjs +1 -1
  48. package/dist/drizzle/index.d.cts +3 -3
  49. package/dist/drizzle/index.d.ts +3 -3
  50. package/dist/drizzle/index.js +1 -1
  51. package/dist/fields/index.d.cts +2 -2
  52. package/dist/fields/index.d.ts +2 -2
  53. package/dist/graphql/index.d.cts +3 -3
  54. package/dist/graphql/index.d.ts +3 -3
  55. package/dist/{index-BttsFZDa.d.ts → index-C9uBoJtm.d.ts} +2 -2
  56. package/dist/{index-8Ino7vKq.d.ts → index-Ci7aUrmN.d.cts} +2 -2
  57. package/dist/index.cjs +4 -4
  58. package/dist/index.d.cts +13 -10
  59. package/dist/index.d.ts +13 -10
  60. package/dist/index.js +4 -4
  61. package/dist/{local-DPLKZQA3.js → local-6UUGBZ4M.js} +1 -1
  62. package/dist/{local-KR3AIGVA.cjs → local-ZYHV3J2K.cjs} +1 -1
  63. package/dist/{mongo-auth-adapter-EUHAYWJ6.cjs → mongo-auth-adapter-2H2AXDRH.cjs} +1 -1
  64. package/dist/{mongo-auth-adapter-FW7ATYQ6.js → mongo-auth-adapter-YWMEOC42.js} +1 -1
  65. package/dist/mongodb/index.cjs +1 -1
  66. package/dist/mongodb/index.d.cts +3 -3
  67. package/dist/mongodb/index.d.ts +3 -3
  68. package/dist/mongodb/index.js +1 -1
  69. package/dist/{postgres-auth-adapter-SK3N3OSS.js → postgres-auth-adapter-QKBNXVPT.js} +1 -1
  70. package/dist/{postgres-auth-adapter-ZO6HK5AK.cjs → postgres-auth-adapter-WMLM4UUC.cjs} +1 -1
  71. package/dist/{redis-adapter-EGMUN65D.cjs → redis-adapter-EVK2SMKH.cjs} +1 -1
  72. package/dist/{redis-adapter-QPCTMF55.js → redis-adapter-LY2NBSAG.js} +1 -1
  73. package/dist/rest/index.cjs +1 -1
  74. package/dist/rest/index.d.cts +4 -4
  75. package/dist/rest/index.d.ts +4 -4
  76. package/dist/rest/index.js +1 -1
  77. package/dist/{sqlite-adapter-MNNZZXGX.cjs → sqlite-adapter-KPSISY6E.cjs} +1 -1
  78. package/dist/{sqlite-adapter-52PL52VU.js → sqlite-adapter-PI6SIY7O.js} +1 -1
  79. package/dist/templates/index.cjs +1 -1
  80. package/dist/templates/index.d.cts +2 -2
  81. package/dist/templates/index.d.ts +2 -2
  82. package/dist/templates/index.js +1 -1
  83. package/dist/trpc/index.d.cts +3 -3
  84. package/dist/trpc/index.d.ts +3 -3
  85. package/dist/{types-Bii0bhUV.d.ts → types-C3QFX0l6.d.cts} +5 -0
  86. package/dist/{types-B9oXBEKI.d.cts → types-C3QFX0l6.d.ts} +5 -1
  87. package/dist/{types-Cdssrcbz.d.cts → types-CKWnrUAh.d.ts} +23 -2
  88. package/dist/{types-BRDBNacn.d.ts → types-CdwfDpyW.d.cts} +23 -2
  89. package/package.json +2 -2
  90. package/dist/WebhookService-BcuD8tnn.d.cts +0 -143
  91. package/dist/WebhookService-CFe6Zd0_.d.cts +0 -143
  92. package/dist/WebhookService-CVXmjbtQ.d.cts +0 -143
  93. package/dist/WebhookService-D5PSI5t6.d.cts +0 -143
  94. package/dist/WebhookService-DPCCn_12.d.ts +0 -143
  95. package/dist/WebhookService-Dk1lzSrG.d.cts +0 -143
  96. package/dist/WebhookService-Dncnbgm9.d.cts +0 -143
  97. package/dist/WebhookService-I6hdue2Y.d.ts +0 -143
  98. package/dist/WebhookService-KnQ2UDlW.d.ts +0 -143
  99. package/dist/WebhookService-UY5p89Bj.d.ts +0 -143
  100. package/dist/WebhookService-YZXBCRXA.d.ts +0 -143
  101. package/dist/WebhookService-fk0FGRlk.d.ts +0 -143
  102. package/dist/WebhookService-vsFnWrOh.d.ts +0 -143
  103. package/dist/WebhookService-zrDmAx7L.d.cts +0 -143
  104. package/dist/base-B--L0lCn.d.cts +0 -218
  105. package/dist/base-B-siit_y.d.cts +0 -218
  106. package/dist/base-B8SyZI4D.d.ts +0 -218
  107. package/dist/base-BHRGJ40F.d.cts +0 -218
  108. package/dist/base-BVoDPNjJ.d.cts +0 -218
  109. package/dist/base-BfPaVEAE.d.cts +0 -218
  110. package/dist/base-BxrX5EPU.d.cts +0 -218
  111. package/dist/base-CAb9EYQs.d.ts +0 -218
  112. package/dist/base-CcZIEll-.d.ts +0 -218
  113. package/dist/base-CyG7aF1e.d.cts +0 -218
  114. package/dist/base-DOImeJ-F.d.ts +0 -218
  115. package/dist/base-DbnwE42-.d.cts +0 -218
  116. package/dist/base-NyiSsD-n.d.ts +0 -218
  117. package/dist/base-xflndGDO.d.ts +0 -218
  118. package/dist/bootstrap-E24SGUJP.cjs +0 -1
  119. package/dist/bootstrap-QVKSKXJF.cjs +0 -1
  120. package/dist/bootstrap-RILR44UM.cjs +0 -1
  121. package/dist/bootstrap-YFVE7MRG.js +0 -1
  122. package/dist/bootstrap-ZRRUPRUR.js +0 -1
  123. package/dist/chunk-2FSOHXOU.cjs +0 -56
  124. package/dist/chunk-2PXXQKN3.cjs +0 -3
  125. package/dist/chunk-355R4LS5.cjs +0 -56
  126. package/dist/chunk-35IVNLMA.js +0 -122
  127. package/dist/chunk-3U6MKWET.cjs +0 -120
  128. package/dist/chunk-4YCI3HBD.js +0 -3
  129. package/dist/chunk-4ZWLNGLS.js +0 -2
  130. package/dist/chunk-5A7E7N4B.cjs +0 -431
  131. package/dist/chunk-5ZEYOFAK.js +0 -2
  132. package/dist/chunk-6GGPY7U2.js +0 -4
  133. package/dist/chunk-73Y63IPP.js +0 -57
  134. package/dist/chunk-7DUKWHRN.cjs +0 -1
  135. package/dist/chunk-7K6ZUNJM.js +0 -4
  136. package/dist/chunk-7LLCXY5O.cjs +0 -19
  137. package/dist/chunk-A35ZP72D.cjs +0 -132
  138. package/dist/chunk-A3IOQOV6.js +0 -2
  139. package/dist/chunk-A3XVL6ED.cjs +0 -3
  140. package/dist/chunk-APDQ6ZTG.cjs +0 -120
  141. package/dist/chunk-AWQGDMOE.js +0 -3
  142. package/dist/chunk-B3BSVEFC.cjs +0 -3
  143. package/dist/chunk-B4AC23SG.js +0 -122
  144. package/dist/chunk-BD6XHMMM.cjs +0 -2
  145. package/dist/chunk-CHYVUWZ3.js +0 -2
  146. package/dist/chunk-CIVA6SKW.js +0 -2
  147. package/dist/chunk-CNHUCCQJ.js +0 -121
  148. package/dist/chunk-CRP6PSCE.js +0 -2
  149. package/dist/chunk-DI6TCZSE.js +0 -122
  150. package/dist/chunk-DORUYZQV.cjs +0 -1
  151. package/dist/chunk-EFKEVWAD.js +0 -4
  152. package/dist/chunk-EI7FRSNY.js +0 -57
  153. package/dist/chunk-EON4XLKQ.cjs +0 -1
  154. package/dist/chunk-EUQAOYEO.cjs +0 -121
  155. package/dist/chunk-EVAUBT7H.js +0 -57
  156. package/dist/chunk-EYHD7HZE.cjs +0 -1
  157. package/dist/chunk-EYYIPA5N.js +0 -432
  158. package/dist/chunk-FBWLSWZ4.js +0 -122
  159. package/dist/chunk-FDKU7HJX.js +0 -2
  160. package/dist/chunk-FG3IFGJP.cjs +0 -1
  161. package/dist/chunk-FGN6IMPY.cjs +0 -3
  162. package/dist/chunk-FLS2FJM6.cjs +0 -431
  163. package/dist/chunk-FP5UK272.cjs +0 -1
  164. package/dist/chunk-FSL3NLRT.cjs +0 -2
  165. package/dist/chunk-FUFS65Q5.js +0 -133
  166. package/dist/chunk-GWIZT2P5.js +0 -57
  167. package/dist/chunk-H3FJ54KB.cjs +0 -121
  168. package/dist/chunk-HY3EAWB2.js +0 -4
  169. package/dist/chunk-IQSF6XRV.js +0 -57
  170. package/dist/chunk-IXGDTAES.js +0 -4
  171. package/dist/chunk-JCEJ4VTN.js +0 -20
  172. package/dist/chunk-LPFRMQFQ.js +0 -121
  173. package/dist/chunk-LYU44UNN.cjs +0 -56
  174. package/dist/chunk-MFNN5DYG.cjs +0 -1
  175. package/dist/chunk-MJAODEFC.cjs +0 -121
  176. package/dist/chunk-MSC4G2HF.cjs +0 -2
  177. package/dist/chunk-N2YHO2WI.cjs +0 -3
  178. package/dist/chunk-NPBXLPOP.js +0 -3
  179. package/dist/chunk-ON5XJEPO.cjs +0 -3
  180. package/dist/chunk-OT2Z4XBD.cjs +0 -1
  181. package/dist/chunk-PFKVHUOT.js +0 -432
  182. package/dist/chunk-PFTBTWSC.cjs +0 -1
  183. package/dist/chunk-PZDLPRJF.js +0 -4
  184. package/dist/chunk-QC4YXUBT.cjs +0 -383
  185. package/dist/chunk-QUTYCUST.js +0 -4
  186. package/dist/chunk-REKKBAQX.cjs +0 -56
  187. package/dist/chunk-RTNQP6BV.js +0 -2
  188. package/dist/chunk-RUJW47ZJ.js +0 -2
  189. package/dist/chunk-RXYCFZJC.cjs +0 -121
  190. package/dist/chunk-S2MZNEBQ.cjs +0 -1
  191. package/dist/chunk-S73YERS2.js +0 -57
  192. package/dist/chunk-T3DJ3UTP.cjs +0 -121
  193. package/dist/chunk-TJZO7ZSX.cjs +0 -3
  194. package/dist/chunk-TKUNRCRH.js +0 -4
  195. package/dist/chunk-TQLCOMKC.js +0 -4
  196. package/dist/chunk-TRXYDWGE.cjs +0 -1
  197. package/dist/chunk-TS55CUNJ.js +0 -57
  198. package/dist/chunk-UFBJ3WOZ.js +0 -2
  199. package/dist/chunk-UQRVQUVR.js +0 -2
  200. package/dist/chunk-UW5W35NP.js +0 -122
  201. package/dist/chunk-VI7WCO2J.cjs +0 -3
  202. package/dist/chunk-VTOL3URF.js +0 -4
  203. package/dist/chunk-VVVCCB6R.js +0 -2
  204. package/dist/chunk-W2GPP6RB.js +0 -122
  205. package/dist/chunk-WHOA7YJU.cjs +0 -1
  206. package/dist/chunk-WNRUPL26.js +0 -2
  207. package/dist/chunk-XIAJQLGS.js +0 -2
  208. package/dist/chunk-XK6UB77Q.js +0 -4
  209. package/dist/chunk-Y2VHO66Q.cjs +0 -3
  210. package/dist/chunk-Y5O2OD7J.cjs +0 -3
  211. package/dist/chunk-YARB43JG.cjs +0 -56
  212. package/dist/chunk-YLCEMVYY.cjs +0 -56
  213. package/dist/chunk-YSOM57GK.cjs +0 -3
  214. package/dist/chunk-Z3UVDGYS.cjs +0 -56
  215. package/dist/chunk-ZO3YB5DK.cjs +0 -1
  216. package/dist/chunk-ZOVH6QT5.cjs +0 -1
  217. package/dist/chunk-ZRIBWDYJ.js +0 -384
  218. package/dist/chunk-ZWDBPEXL.js +0 -115
  219. package/dist/index-B9BFNOHd.d.cts +0 -105
  220. package/dist/index-BMcYFpTv.d.cts +0 -105
  221. package/dist/index-ByOM1Y5x.d.ts +0 -105
  222. package/dist/index-C6xmtRio.d.cts +0 -105
  223. package/dist/index-CTI3K_uq.d.cts +0 -105
  224. package/dist/index-CTL4zv_u.d.ts +0 -105
  225. package/dist/index-CaDbioSg.d.ts +0 -105
  226. package/dist/index-CxA9uOv0.d.ts +0 -105
  227. package/dist/index-D6AXbuPI.d.ts +0 -105
  228. package/dist/index-DF0KDBaM.d.cts +0 -105
  229. package/dist/index-DG4Xu7gA.d.cts +0 -105
  230. package/dist/index-DS3DpJli.d.cts +0 -105
  231. package/dist/index-eHex8Iwj.d.ts +0 -105
  232. package/dist/index-rm7uyOK1.d.cts +0 -105
  233. package/dist/lib-5QYYN6ML.cjs +0 -12
  234. package/dist/lib-XXYYUPMW.js +0 -13
  235. package/dist/local-S5VA7IXE.cjs +0 -1
  236. package/dist/local-T7GISZBL.js +0 -1
  237. package/dist/mongo-auth-adapter-GR2CFFEA.js +0 -1
  238. package/dist/mongo-auth-adapter-UOO2LZUJ.cjs +0 -1
  239. package/dist/nodemailer-transport-CHO2WKIY.js +0 -1
  240. package/dist/nodemailer-transport-ED2IXNGW.cjs +0 -1
  241. package/dist/types-6ShQp2EM.d.cts +0 -839
  242. package/dist/types-B5Qz1svz.d.cts +0 -822
  243. package/dist/types-B9oXBEKI.d.ts +0 -330
  244. package/dist/types-Bii0bhUV.d.cts +0 -329
  245. package/dist/types-Bt2_ycUO.d.ts +0 -811
  246. package/dist/types-C4wXHImf.d.ts +0 -822
  247. package/dist/types-C8yIAV6K.d.cts +0 -839
  248. package/dist/types-CORUQhY-.d.ts +0 -839
  249. package/dist/types-CjGqxBd3.d.cts +0 -330
  250. package/dist/types-CjGqxBd3.d.ts +0 -330
  251. package/dist/types-DBGR-eQl.d.cts +0 -839
  252. package/dist/types-DCWgPFmi.d.cts +0 -822
  253. package/dist/types-DROqAsr0.d.cts +0 -330
  254. package/dist/types-DROqAsr0.d.ts +0 -330
  255. package/dist/types-DlGSbh7I.d.cts +0 -297
  256. package/dist/types-DlGSbh7I.d.ts +0 -297
  257. package/dist/types-DsF64Wrc.d.cts +0 -811
  258. package/dist/types-IeKFn7Ky.d.ts +0 -839
  259. package/dist/types-ZrjEVWfi.d.ts +0 -811
  260. package/dist/types-dEy5JxvN.d.ts +0 -822
  261. package/dist/types-tVJc9YbX.d.cts +0 -811
  262. package/dist/types-zt5qIvje.d.ts +0 -839
@@ -1,811 +0,0 @@
1
- import { F as Field } from './types-DlGSbh7I.cjs';
2
-
3
- interface Request {
4
- body?: any;
5
- headers: Record<string, string>;
6
- method?: string;
7
- url?: string;
8
- cookies?: Record<string, string>;
9
- query?: Record<string, any>;
10
- }
11
- interface User {
12
- id: string;
13
- email: string;
14
- role: string;
15
- tenantId?: string;
16
- [key: string]: any;
17
- }
18
- interface HookArgs<T = any> {
19
- collection?: string;
20
- global?: string;
21
- data?: T;
22
- originalDoc?: T;
23
- doc?: T;
24
- req: Request;
25
- user?: User;
26
- operation: 'create' | 'read' | 'update' | 'delete';
27
- tenantId?: string;
28
- field?: string;
29
- siblingData?: Record<string, any>;
30
- value?: any;
31
- previousValue?: any;
32
- context?: Record<string, any>;
33
- }
34
- type Hook<T = any> = (args: HookArgs<T>) => Promise<T | void> | T | void;
35
- interface CollectionHooks {
36
- beforeValidate?: Hook[];
37
- beforeChange?: Hook[];
38
- afterChange?: Hook[];
39
- beforeRead?: Hook[];
40
- afterRead?: Hook[];
41
- beforeDelete?: Hook[];
42
- afterDelete?: Hook[];
43
- beforeLogin?: Hook[];
44
- afterLogin?: Hook[];
45
- afterLogout?: Hook[];
46
- afterRefresh?: Hook[];
47
- afterForgotPassword?: Hook[];
48
- }
49
- interface FieldHooks {
50
- beforeValidate?: Hook[];
51
- beforeChange?: Hook[];
52
- afterChange?: Hook[];
53
- afterRead?: Hook[];
54
- }
55
- interface GlobalHooks {
56
- beforeValidate?: Hook[];
57
- beforeChange?: Hook[];
58
- afterChange?: Hook[];
59
- beforeRead?: Hook[];
60
- afterRead?: Hook[];
61
- }
62
- declare function runHooks(hooks: Hook[], args: HookArgs): Promise<any>;
63
- declare function runFieldHooks(hooks: Hook[], args: HookArgs): Promise<any>;
64
-
65
- interface PluginHooks {
66
- beforeInit?: Hook[];
67
- afterInit?: Hook[];
68
- beforeRegisterCollections?: Hook[];
69
- afterRegisterCollections?: Hook[];
70
- beforeRegisterGlobals?: Hook[];
71
- afterRegisterGlobals?: Hook[];
72
- beforeServerStart?: Hook[];
73
- afterServerStart?: Hook[];
74
- beforeServerStop?: Hook[];
75
- afterServerStop?: Hook[];
76
- }
77
- interface PluginCollectionExtension {
78
- slug: string;
79
- config: Partial<CollectionConfig>;
80
- }
81
- interface PluginGlobalExtension {
82
- slug: string;
83
- config: Partial<GlobalConfig>;
84
- }
85
- interface PluginFieldExtension {
86
- collectionSlug: string;
87
- field: Field;
88
- }
89
- interface PluginAPI {
90
- registry: {
91
- getCollection: (slug: string) => CollectionConfig | undefined;
92
- getCollections: () => CollectionConfig[];
93
- getGlobal: (slug: string) => GlobalConfig | undefined;
94
- addCollection: (config: CollectionConfig) => void;
95
- addGlobal: (config: GlobalConfig) => void;
96
- extendCollection: (slug: string, extension: Partial<CollectionConfig>) => void;
97
- extendGlobal: (slug: string, extension: Partial<GlobalConfig>) => void;
98
- addField: (collectionSlug: string, field: Field, position?: number) => void;
99
- };
100
- hooks: {
101
- register: (event: string, handler: Hook) => void;
102
- unregister: (event: string, handler: Hook) => void;
103
- };
104
- config: {
105
- get: (key: string) => any;
106
- set: (key: string, value: any) => void;
107
- };
108
- db: any;
109
- }
110
- declare abstract class KyroPlugin {
111
- name: string;
112
- displayName?: string;
113
- adminEntry?: string;
114
- version?: string;
115
- description?: string;
116
- hooks: PluginHooks;
117
- collections: Partial<CollectionConfig>[];
118
- globals: Partial<GlobalConfig>[];
119
- fields: PluginFieldExtension[];
120
- extensions: {
121
- collections: PluginCollectionExtension[];
122
- globals: PluginGlobalExtension[];
123
- };
124
- adminComponents: Record<string, any>;
125
- adminStyles: string[];
126
- serverMiddleware?: (app: any) => void;
127
- clientMiddleware?: (req: any) => any;
128
- constructor(name: string);
129
- init?(api: PluginAPI): Promise<void>;
130
- beforeInit?(api: PluginAPI): Promise<void>;
131
- afterInit?(api: PluginAPI): Promise<void>;
132
- getCollections?(): Partial<CollectionConfig>[];
133
- getGlobals?(): Partial<GlobalConfig>[];
134
- getHooks?(): PluginHooks;
135
- }
136
- declare class PluginManager {
137
- private plugins;
138
- private hooks;
139
- register(plugin: KyroPlugin): void;
140
- unregister(name: string): void;
141
- get(name: string): KyroPlugin | undefined;
142
- getAll(): KyroPlugin[];
143
- has(name: string): boolean;
144
- registerHook(event: string, handler: Hook): void;
145
- unregisterHook(event: string, handler: Hook): void;
146
- executeHook(event: string, args?: any): Promise<any>;
147
- getAllCollections(): Partial<CollectionConfig>[];
148
- getAllGlobals(): Partial<GlobalConfig>[];
149
- getAllFields(): PluginFieldExtension[];
150
- getAdminComponents(): Record<string, any>;
151
- getAdminStyles(): string[];
152
- }
153
- declare class SEOPlugin extends KyroPlugin {
154
- constructor();
155
- }
156
- declare class AnalyticsPlugin extends KyroPlugin {
157
- constructor();
158
- }
159
- declare class CommentsPlugin extends KyroPlugin {
160
- constructor();
161
- }
162
- declare class ReviewsPlugin extends KyroPlugin {
163
- constructor();
164
- }
165
- declare class WishlistPlugin extends KyroPlugin {
166
- constructor();
167
- }
168
- declare const presetPlugins: {
169
- SEO: typeof SEOPlugin;
170
- Analytics: typeof AnalyticsPlugin;
171
- Comments: typeof CommentsPlugin;
172
- Reviews: typeof ReviewsPlugin;
173
- Wishlist: typeof WishlistPlugin;
174
- };
175
-
176
- interface WhereClause {
177
- [field: string]: any;
178
- }
179
- interface AccessArgs {
180
- req: Request;
181
- user?: User;
182
- data?: unknown;
183
- doc?: unknown;
184
- id?: string;
185
- tenantId?: string;
186
- context?: Record<string, unknown>;
187
- }
188
- type AccessControl = boolean | ((args: AccessArgs) => Promise<boolean | WhereClause> | boolean | WhereClause);
189
- interface CollectionAccess {
190
- create?: AccessControl;
191
- read?: AccessControl;
192
- update?: AccessControl;
193
- delete?: AccessControl;
194
- admin?: AccessControl;
195
- unlock?: AccessControl;
196
- readVersions?: AccessControl;
197
- }
198
- interface GlobalAccess {
199
- read?: AccessControl;
200
- update?: AccessControl;
201
- }
202
- interface FieldAccess {
203
- create?: AccessControl;
204
- read?: AccessControl;
205
- update?: AccessControl;
206
- }
207
- declare function evaluateAccess(access: AccessControl, args: AccessArgs): Promise<boolean | WhereClause>;
208
- declare function mergeWhereClauses(...whereClauses: (WhereClause | boolean | undefined)[]): WhereClause;
209
- declare function getWhereClause(access: AccessControl, args: AccessArgs): Promise<WhereClause | undefined>;
210
-
211
- interface TenantContext {
212
- tenantId: string;
213
- userId: string;
214
- role?: string;
215
- roles?: string[];
216
- permissions?: string[];
217
- isSuperAdmin?: boolean;
218
- }
219
-
220
- interface S3CompatibleConfig {
221
- bucket?: string;
222
- region?: string;
223
- accessKeyId?: string;
224
- secretAccessKey?: string;
225
- endpoint?: string;
226
- cdnUrl?: string;
227
- prefix?: string;
228
- }
229
- interface R2Config {
230
- accountId?: string;
231
- accessKeyId?: string;
232
- secretAccessKey?: string;
233
- bucket?: string;
234
- cdnUrl?: string;
235
- prefix?: string;
236
- publicDevUrl?: string;
237
- }
238
- interface GCSConfig {
239
- bucket?: string;
240
- projectId?: string;
241
- clientEmail?: string;
242
- privateKey?: string;
243
- cdnUrl?: string;
244
- prefix?: string;
245
- }
246
- interface BackblazeConfig {
247
- bucket?: string;
248
- accountId?: string;
249
- applicationKeyId?: string;
250
- applicationKey?: string;
251
- cdnUrl?: string;
252
- prefix?: string;
253
- }
254
- interface BunnyConfig {
255
- storageZone?: string;
256
- apiKey?: string;
257
- cdnUrl?: string;
258
- prefix?: string;
259
- }
260
- interface FTPConfig {
261
- host?: string;
262
- port?: number;
263
- user?: string;
264
- password?: string;
265
- secure?: boolean;
266
- baseUrl?: string;
267
- prefix?: string;
268
- }
269
- interface StorageConfig {
270
- type: string;
271
- s3: S3CompatibleConfig;
272
- r2: R2Config;
273
- gcs: GCSConfig;
274
- digitalocean: S3CompatibleConfig;
275
- backblaze: BackblazeConfig;
276
- wasabi: S3CompatibleConfig;
277
- bunny: BunnyConfig;
278
- ftp: FTPConfig;
279
- cloudinary: {
280
- cloudName?: string;
281
- apiKey?: string;
282
- apiSecret?: string;
283
- folder?: string;
284
- };
285
- imgix: {
286
- domain?: string;
287
- signKey?: string;
288
- };
289
- local: {
290
- uploadDir?: string;
291
- baseUrl?: string;
292
- };
293
- }
294
- interface EmailConfig {
295
- provider?: string;
296
- host?: string;
297
- port?: number;
298
- secure?: boolean;
299
- user?: string;
300
- pass?: string;
301
- from?: string;
302
- fromName?: string;
303
- replyTo?: string;
304
- }
305
- declare class ConfigService {
306
- private db;
307
- private cache;
308
- private loaded;
309
- private static readonly SENSITIVE_KEYS;
310
- constructor(db: any);
311
- /**
312
- * Initialize the service by loading all settings from the database
313
- */
314
- load(): Promise<void>;
315
- private ensureSettingsTable;
316
- /**
317
- * Load settings from the _globals_storage-settings table (SQLite fallback)
318
- * Maps nested global structure to flat key-value cache
319
- */
320
- private loadFromGlobals;
321
- /**
322
- * Get a settings value with environment fallback
323
- */
324
- get(key: string, envKey?: string, defaultValue?: string): string | undefined;
325
- /**
326
- * Get storage configuration
327
- */
328
- getStorageConfig(): StorageConfig;
329
- /**
330
- * Get email configuration
331
- */
332
- getEmailConfig(): EmailConfig;
333
- /**
334
- * Mask sensitive values for display
335
- */
336
- maskSensitive(key: string, value: string | undefined): string | undefined;
337
- /**
338
- * Update a setting in the database
339
- */
340
- set(key: string, value: string, description?: string): Promise<void>;
341
- }
342
-
343
- interface UploadOptions {
344
- folder?: string;
345
- filename?: string;
346
- mimeType?: string;
347
- metadata?: Record<string, unknown>;
348
- }
349
- interface UploadedFile {
350
- id: string;
351
- filename: string;
352
- originalName: string;
353
- mimeType: string;
354
- size: number;
355
- url: string;
356
- thumbnailUrl?: string;
357
- width?: number;
358
- height?: number;
359
- folder?: string;
360
- provider: string;
361
- metadata?: Record<string, unknown>;
362
- createdAt: string;
363
- }
364
- interface ImageTransforms {
365
- width?: number;
366
- height?: number;
367
- fit?: "clip" | "crop" | "fill" | "fillmax" | "scale" | "max" | "min";
368
- format?: "webp" | "avif" | "jpeg" | "jpg" | "png" | "gif";
369
- quality?: number;
370
- blur?: number;
371
- sharpen?: number;
372
- /** Crop region as percentages (0-100) of the original image */
373
- cropX?: number;
374
- cropY?: number;
375
- cropWidth?: number;
376
- cropHeight?: number;
377
- }
378
- interface StorageProvider {
379
- name: string;
380
- displayName: string;
381
- supportsDynamicResize: boolean;
382
- upload(file: File, options?: UploadOptions): Promise<UploadedFile>;
383
- uploadFromUrl(url: string, options?: UploadOptions): Promise<UploadedFile>;
384
- delete(url: string): Promise<void>;
385
- rename(oldUrl: string, newKey: string): Promise<string>;
386
- getImageUrl(url: string, transforms?: ImageTransforms): string;
387
- generateThumbnail(file: UploadedFile, size: {
388
- width: number;
389
- height: number;
390
- }): Promise<string>;
391
- list(prefix?: string): Promise<UploadedFile[]>;
392
- exists(url: string): Promise<boolean>;
393
- createFolder?(folder: string): Promise<void>;
394
- deleteFolder?(folder: string): Promise<void>;
395
- }
396
-
397
- declare function resolveProvider(configService: ConfigService): Promise<StorageProvider>;
398
-
399
- interface AdminConfig {
400
- useAsTitle?: string;
401
- defaultColumns?: string[];
402
- hidden?: boolean;
403
- description?: string;
404
- hideAPIURL?: boolean;
405
- group?: string;
406
- folder?: string;
407
- parentFolder?: string;
408
- treeHierarchy?: boolean;
409
- icon?: string;
410
- order?: number;
411
- preview?: (doc: Record<string, unknown>, options: {
412
- req: unknown;
413
- token?: string;
414
- }) => string | Promise<string>;
415
- disableDuplicate?: boolean;
416
- disablePreview?: boolean;
417
- pagination?: {
418
- defaultLimit?: number;
419
- limits?: number[];
420
- };
421
- layout?: "split" | "single";
422
- }
423
- interface HierarchyConfig {
424
- parentField?: string;
425
- maxDepth?: number;
426
- slugPrefix?: boolean;
427
- }
428
- interface ProjectConfig {
429
- id: string;
430
- name: string;
431
- slug: string;
432
- description?: string;
433
- environment?: 'development' | 'staging' | 'production' | string;
434
- collections?: string[];
435
- globals?: string[];
436
- settings?: Record<string, unknown>;
437
- }
438
- interface OrganizationConfig {
439
- id: string;
440
- name: string;
441
- slug: string;
442
- billingEmail?: string;
443
- projects?: ProjectConfig[];
444
- roles?: Array<{
445
- name: string;
446
- description?: string;
447
- permissions?: string[];
448
- }>;
449
- }
450
- interface FieldOverrides {
451
- [fieldPath: string]: any;
452
- }
453
- interface CollectionOverrideConfig extends Partial<AdminConfig> {
454
- label?: string;
455
- singularLabel?: string;
456
- labelPlural?: string;
457
- labels?: {
458
- singular?: string;
459
- plural?: string;
460
- };
461
- hidden?: boolean;
462
- timestamps?: boolean;
463
- versions?: {
464
- drafts?: boolean;
465
- maxPerDoc?: number;
466
- autosave?: boolean;
467
- };
468
- seo?: boolean | Record<string, any>;
469
- access?: CollectionAccess;
470
- hooks?: CollectionHooks;
471
- fields?: FieldOverrides;
472
- blocks?: Record<string, any> | any[];
473
- tabs?: Record<string, any> | any[];
474
- [key: string]: any;
475
- }
476
- interface GlobalOverrideConfig extends Partial<AdminConfig> {
477
- label?: string;
478
- hidden?: boolean;
479
- access?: GlobalAccess;
480
- hooks?: GlobalHooks;
481
- fields?: FieldOverrides;
482
- blocks?: Record<string, any> | any[];
483
- tabs?: Record<string, any> | any[];
484
- [key: string]: any;
485
- }
486
- interface UploadConfig {
487
- staticDir?: string;
488
- staticURL?: string;
489
- mimeTypes?: string[];
490
- fileSize?: number;
491
- imageSizes?: ImageSize[];
492
- crop?: boolean;
493
- focalPoint?: boolean;
494
- formatOptions?: {
495
- format: "webp" | "png" | "jpg" | "avif";
496
- options?: Record<string, unknown>;
497
- };
498
- resizeOptions?: Record<string, any>;
499
- adminThumbnail?: string;
500
- }
501
- interface ImageSize {
502
- name: string;
503
- width?: number;
504
- height?: number;
505
- crop?: string;
506
- position?: string;
507
- formatOptions?: {
508
- format: "webp" | "png" | "jpg" | "avif";
509
- };
510
- generateImageName?: (doc: any) => string;
511
- }
512
- interface VersionConfig {
513
- maxPerDoc?: number;
514
- drafts?: boolean;
515
- retainDeleted?: boolean;
516
- }
517
- type DocumentStatus = 'draft' | 'published' | 'archived';
518
- interface AuthConfig {
519
- tokenExpiration?: number;
520
- verify?: boolean | {
521
- generateEmailHTML?: (args: any) => string;
522
- };
523
- maxLoginAttempts?: number;
524
- lockTime?: number;
525
- cookies?: {
526
- secure?: boolean;
527
- sameSite?: "strict" | "lax" | "none";
528
- domain?: string;
529
- };
530
- forgotPassword?: {
531
- generateEmailHTML?: (args: any) => string;
532
- generateEmailSubject?: (args: any) => string;
533
- };
534
- strategies?: Array<{
535
- name: string;
536
- authenticate: (args: any) => Promise<any>;
537
- }>;
538
- }
539
- interface CollectionConfig {
540
- slug: string;
541
- label?: string;
542
- labelPlural?: string;
543
- singularLabel?: string;
544
- admin?: AdminConfig;
545
- fields: Field[];
546
- access?: CollectionAccess;
547
- hooks?: CollectionHooks;
548
- timestamps?: boolean;
549
- tenantScoped?: boolean;
550
- tenantField?: string;
551
- upload?: UploadConfig;
552
- versions?: VersionConfig;
553
- folder?: string;
554
- hierarchy?: HierarchyConfig;
555
- auth?: boolean | AuthConfig;
556
- graphQL?: {
557
- singularName?: string;
558
- pluralName?: string;
559
- };
560
- indexes?: Array<{
561
- fields: Record<string, number | "text">;
562
- options?: Record<string, any>;
563
- }>;
564
- seo?: boolean | Record<string, any>;
565
- custom?: Record<string, any>;
566
- tabs?: Array<{
567
- label: string;
568
- fields: Field[];
569
- name?: string;
570
- }>;
571
- }
572
- interface GlobalConfig {
573
- slug: string;
574
- label?: string;
575
- folder?: string;
576
- admin?: AdminConfig;
577
- fields: Field[];
578
- access?: GlobalAccess;
579
- hooks?: GlobalHooks;
580
- versions?: VersionConfig;
581
- graphQL?: {
582
- name?: string;
583
- };
584
- typescript?: {
585
- interface?: string;
586
- };
587
- custom?: Record<string, any>;
588
- tabs?: Array<{
589
- label: string;
590
- fields: Field[];
591
- name?: string;
592
- }>;
593
- }
594
- interface FindArgs {
595
- collection: string;
596
- where?: Record<string, any>;
597
- sort?: string;
598
- limit?: number;
599
- page?: number;
600
- depth?: number;
601
- tenantId?: string;
602
- select?: string[];
603
- user?: any;
604
- context?: Record<string, any>;
605
- overrideAccess?: boolean;
606
- /** If true, returns draft docs (admin view). If false/omitted, only published docs are returned (public API). */
607
- draft?: boolean;
608
- }
609
- interface FindOneArgs {
610
- collection: string;
611
- where: Record<string, any>;
612
- tenantId?: string;
613
- draft?: boolean;
614
- depth?: number;
615
- select?: string[];
616
- }
617
- interface FindByIDArgs {
618
- collection: string;
619
- id: string;
620
- depth?: number;
621
- tenantId?: string;
622
- select?: string[];
623
- user?: any;
624
- context?: Record<string, any>;
625
- overrideAccess?: boolean;
626
- /** If true, returns document regardless of status (admin view). */
627
- draft?: boolean;
628
- }
629
- interface CreateArgs {
630
- collection: string;
631
- data: Record<string, any>;
632
- depth?: number;
633
- tenantId?: string;
634
- select?: string[];
635
- user?: any;
636
- context?: Record<string, any>;
637
- overrideAccess?: boolean;
638
- }
639
- interface UpdateArgs {
640
- collection: string;
641
- id: string;
642
- data: Record<string, any>;
643
- depth?: number;
644
- tenantId?: string;
645
- select?: string[];
646
- user?: any;
647
- context?: Record<string, any>;
648
- overrideAccess?: boolean;
649
- }
650
- interface DeleteArgs {
651
- collection: string;
652
- id: string;
653
- tenantId?: string;
654
- user?: any;
655
- context?: Record<string, any>;
656
- overrideAccess?: boolean;
657
- }
658
- interface FindResult<T = any> {
659
- docs: T[];
660
- totalDocs: number;
661
- limit: number;
662
- totalPages: number;
663
- page: number;
664
- pagingCounter: number;
665
- hasPrevPage: boolean;
666
- hasNextPage: boolean;
667
- prevPage: number | null;
668
- nextPage: number | null;
669
- }
670
- interface CreateResult<T = any> {
671
- doc: T;
672
- errors?: Array<{
673
- field: string;
674
- message: string;
675
- }>;
676
- }
677
- interface VersionRecord<T = Record<string, any>> {
678
- id: string;
679
- collection: string;
680
- documentId: string;
681
- version: number;
682
- status: DocumentStatus;
683
- data: T;
684
- createdBy?: string;
685
- createdAt: string;
686
- updatedAt: string;
687
- publishedAt?: string | null;
688
- changeDescription?: string;
689
- autosave?: boolean;
690
- }
691
- interface CreateVersionArgs<T = Record<string, any>> {
692
- collection: string;
693
- documentId: string;
694
- data: T;
695
- status: DocumentStatus;
696
- createdBy?: string;
697
- changeDescription?: string;
698
- tenantId?: string;
699
- /** When true, reuses a single version slot (find existing + update) */
700
- autosave?: boolean;
701
- }
702
- interface FindVersionsArgs {
703
- collection: string;
704
- documentId: string;
705
- tenantId?: string;
706
- limit?: number;
707
- page?: number;
708
- sort?: string;
709
- }
710
- interface BaseAdapter {
711
- init(collections: CollectionConfig[], globals: GlobalConfig[]): Promise<void>;
712
- find<T = Record<string, any>>(args: FindArgs): Promise<FindResult<T>>;
713
- findByID<T = Record<string, any>>(args: FindByIDArgs): Promise<T | null>;
714
- create<T = Record<string, any>>(args: CreateArgs): Promise<T>;
715
- update<T = Record<string, any>>(args: UpdateArgs): Promise<T>;
716
- delete<T = Record<string, any>>(args: DeleteArgs): Promise<T>;
717
- count(args: {
718
- collection: string;
719
- where?: Record<string, any>;
720
- tenantId?: string;
721
- }): Promise<number>;
722
- findOne(args: FindOneArgs): Promise<any>;
723
- findVersions(args: FindVersionsArgs): Promise<FindResult<VersionRecord>>;
724
- findVersionByID(args: {
725
- collection: string;
726
- versionId: string;
727
- tenantId?: string;
728
- }): Promise<VersionRecord | null>;
729
- createVersion<T = Record<string, any>>(args: CreateVersionArgs<T>): Promise<VersionRecord<T>>;
730
- deleteVersions(args: {
731
- collection: string;
732
- documentId: string;
733
- keepLatest?: number;
734
- tenantId?: string;
735
- }): Promise<void>;
736
- updateLatestVersion<T = Record<string, any>>(args: CreateVersionArgs<T>): Promise<VersionRecord<T>>;
737
- migrate?(): Promise<void>;
738
- rollback?(): Promise<void>;
739
- connect(): Promise<void>;
740
- disconnect(): Promise<void>;
741
- transaction?<T>(fn: (tx: any) => Promise<T>): Promise<T>;
742
- setTenantContext(context: TenantContext | undefined): void;
743
- getTenantContext(): TenantContext | undefined;
744
- }
745
- interface AdapterConfig {
746
- type: "drizzle" | "mongodb";
747
- client: any;
748
- schema?: any;
749
- connectionOptions?: Record<string, any>;
750
- }
751
- interface KyroConfig {
752
- collections?: CollectionConfig[];
753
- globals?: GlobalConfig[];
754
- projects?: ProjectConfig[];
755
- organizations?: OrganizationConfig[];
756
- adapter: BaseAdapter;
757
- storage?: StorageProvider;
758
- plugins?: KyroPlugin[];
759
- auth?: boolean | {
760
- secret?: string;
761
- tokenExpiration?: number;
762
- cookie?: {
763
- secure?: boolean;
764
- sameSite?: "strict" | "lax" | "none";
765
- domain?: string;
766
- };
767
- checkSession?: boolean;
768
- };
769
- authAdapter?: any;
770
- cors?: {
771
- origins?: string[];
772
- credentials?: boolean;
773
- };
774
- admin?: {
775
- meta?: {
776
- title?: string;
777
- description?: string;
778
- ogImage?: string;
779
- };
780
- dateFormat?: string;
781
- avatar?: "default" | "gravatar";
782
- disable?: boolean;
783
- indexRoute?: string;
784
- components?: Record<string, any>;
785
- collectionOverrides?: Record<string, CollectionOverrideConfig>;
786
- globalOverrides?: Record<string, GlobalOverrideConfig>;
787
- };
788
- upload?: {
789
- limits?: {
790
- fileSize?: number;
791
- };
792
- };
793
- graphQL?: {
794
- maxComplexity?: number;
795
- disablePlayground?: boolean;
796
- };
797
- typescript?: {
798
- outputFile?: string;
799
- };
800
- localization?: {
801
- locales: string[];
802
- defaultLocale: string;
803
- };
804
- rateLimit?: {
805
- window?: number;
806
- max?: number;
807
- };
808
- debug?: boolean;
809
- }
810
-
811
- export { mergeWhereClauses as $, type AccessArgs as A, type BaseAdapter as B, type CollectionConfig as C, type DeleteArgs as D, type EmailConfig as E, type FindArgs as F, type GlobalConfig as G, type HierarchyConfig as H, type ImageSize as I, type PluginHooks as J, KyroPlugin as K, type ProjectConfig as L, ReviewsPlugin as M, SEOPlugin as N, type OrganizationConfig as O, PluginManager as P, type UploadConfig as Q, type Request as R, type StorageConfig as S, type TenantContext as T, type UpdateArgs as U, type VersionRecord as V, type VersionConfig as W, type WhereClause as X, WishlistPlugin as Y, evaluateAccess as Z, getWhereClause as _, type StorageProvider as a, presetPlugins as a0, resolveProvider as a1, runFieldHooks as a2, runHooks as a3, type FindResult as b, type FindByIDArgs as c, type CreateArgs as d, type FindOneArgs as e, type FindVersionsArgs as f, type CreateVersionArgs as g, type KyroConfig as h, type User as i, type AccessControl as j, type AdapterConfig as k, type AdminConfig as l, AnalyticsPlugin as m, type AuthConfig as n, type CollectionAccess as o, type CollectionHooks as p, CommentsPlugin as q, ConfigService as r, type CreateResult as s, type FieldAccess as t, type FieldHooks as u, type GlobalAccess as v, type GlobalHooks as w, type Hook as x, type HookArgs as y, type PluginAPI as z };