@kyro-cms/core 0.13.3 → 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 (266) 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-BCgFt3Yx.d.ts → base-C2DOe8wD.d.ts} +3 -2
  10. package/dist/{base-B-i-tjm1.d.ts → base-DIpT2Vuz.d.cts} +3 -2
  11. package/dist/chunk-2TYITUOC.js +122 -0
  12. package/dist/{chunk-K73HOMQY.cjs → chunk-3CIMGC2F.cjs} +3 -3
  13. package/dist/{chunk-DSHKQL3R.cjs → chunk-6YS6XLOD.cjs} +13 -13
  14. package/dist/{chunk-ELFQKQLL.js → chunk-ALTU3FDG.js} +1 -1
  15. package/dist/{chunk-O7CBGP4N.cjs → chunk-LKRI5X2V.cjs} +1 -1
  16. package/dist/{chunk-22RXJ442.js → chunk-YIFKTA5N.js} +1 -1
  17. package/dist/cli/index.cjs +86 -86
  18. package/dist/cli/index.js +87 -87
  19. package/dist/client.d.cts +25 -0
  20. package/dist/client.d.ts +25 -0
  21. package/dist/drizzle/index.d.cts +3 -3
  22. package/dist/drizzle/index.d.ts +3 -3
  23. package/dist/fields/index.d.cts +2 -2
  24. package/dist/fields/index.d.ts +2 -2
  25. package/dist/graphql/index.d.cts +3 -3
  26. package/dist/graphql/index.d.ts +3 -3
  27. package/dist/{index-BttsFZDa.d.ts → index-C9uBoJtm.d.ts} +2 -2
  28. package/dist/{index-8Ino7vKq.d.ts → index-Ci7aUrmN.d.cts} +2 -2
  29. package/dist/index.cjs +4 -4
  30. package/dist/index.d.cts +10 -10
  31. package/dist/index.d.ts +10 -10
  32. package/dist/index.js +3 -3
  33. package/dist/mongodb/index.d.cts +3 -3
  34. package/dist/mongodb/index.d.ts +3 -3
  35. package/dist/rest/index.cjs +1 -1
  36. package/dist/rest/index.d.cts +4 -4
  37. package/dist/rest/index.d.ts +4 -4
  38. package/dist/rest/index.js +1 -1
  39. package/dist/templates/index.d.cts +2 -2
  40. package/dist/templates/index.d.ts +2 -2
  41. package/dist/trpc/index.d.cts +3 -3
  42. package/dist/trpc/index.d.ts +3 -3
  43. package/dist/{types-Bii0bhUV.d.ts → types-C3QFX0l6.d.cts} +5 -0
  44. package/dist/{types-B9oXBEKI.d.cts → types-C3QFX0l6.d.ts} +5 -1
  45. package/dist/{types-Cdssrcbz.d.cts → types-CKWnrUAh.d.ts} +23 -2
  46. package/dist/{types-BRDBNacn.d.ts → types-CdwfDpyW.d.cts} +23 -2
  47. package/package.json +2 -2
  48. package/dist/WebhookService-BcuD8tnn.d.cts +0 -143
  49. package/dist/WebhookService-CFe6Zd0_.d.cts +0 -143
  50. package/dist/WebhookService-CVXmjbtQ.d.cts +0 -143
  51. package/dist/WebhookService-D5PSI5t6.d.cts +0 -143
  52. package/dist/WebhookService-DPCCn_12.d.ts +0 -143
  53. package/dist/WebhookService-Dk1lzSrG.d.cts +0 -143
  54. package/dist/WebhookService-Dncnbgm9.d.cts +0 -143
  55. package/dist/WebhookService-I6hdue2Y.d.ts +0 -143
  56. package/dist/WebhookService-KnQ2UDlW.d.ts +0 -143
  57. package/dist/WebhookService-UY5p89Bj.d.ts +0 -143
  58. package/dist/WebhookService-YZXBCRXA.d.ts +0 -143
  59. package/dist/WebhookService-fk0FGRlk.d.ts +0 -143
  60. package/dist/WebhookService-vsFnWrOh.d.ts +0 -143
  61. package/dist/WebhookService-zrDmAx7L.d.cts +0 -143
  62. package/dist/base-B--L0lCn.d.cts +0 -218
  63. package/dist/base-B-siit_y.d.cts +0 -218
  64. package/dist/base-B8SyZI4D.d.ts +0 -218
  65. package/dist/base-BHRGJ40F.d.cts +0 -218
  66. package/dist/base-BVoDPNjJ.d.cts +0 -218
  67. package/dist/base-BaOJ5uWd.d.cts +0 -218
  68. package/dist/base-BfPaVEAE.d.cts +0 -218
  69. package/dist/base-BxrX5EPU.d.cts +0 -218
  70. package/dist/base-CAb9EYQs.d.ts +0 -218
  71. package/dist/base-CcZIEll-.d.ts +0 -218
  72. package/dist/base-CyG7aF1e.d.cts +0 -218
  73. package/dist/base-DOImeJ-F.d.ts +0 -218
  74. package/dist/base-DbnwE42-.d.cts +0 -218
  75. package/dist/base-NyiSsD-n.d.ts +0 -218
  76. package/dist/base-OYfoYPYP.d.ts +0 -218
  77. package/dist/base-xflndGDO.d.ts +0 -218
  78. package/dist/bootstrap-E24SGUJP.cjs +0 -1
  79. package/dist/bootstrap-QQ6D3OYG.js +0 -1
  80. package/dist/bootstrap-QVKSKXJF.cjs +0 -1
  81. package/dist/bootstrap-RILR44UM.cjs +0 -1
  82. package/dist/bootstrap-YFVE7MRG.js +0 -1
  83. package/dist/bootstrap-ZRRUPRUR.js +0 -1
  84. package/dist/chunk-2FSOHXOU.cjs +0 -56
  85. package/dist/chunk-2OS5Y4LE.cjs +0 -1
  86. package/dist/chunk-2PXXQKN3.cjs +0 -3
  87. package/dist/chunk-32QY56XF.js +0 -122
  88. package/dist/chunk-355R4LS5.cjs +0 -56
  89. package/dist/chunk-35IVNLMA.js +0 -122
  90. package/dist/chunk-3GXLOYM3.js +0 -2
  91. package/dist/chunk-3LAWUINR.cjs +0 -1
  92. package/dist/chunk-3O3AVMWM.cjs +0 -1
  93. package/dist/chunk-3U6MKWET.cjs +0 -120
  94. package/dist/chunk-4YCI3HBD.js +0 -3
  95. package/dist/chunk-4ZWLNGLS.js +0 -2
  96. package/dist/chunk-5A7E7N4B.cjs +0 -431
  97. package/dist/chunk-5ZEYOFAK.js +0 -2
  98. package/dist/chunk-6DD4J7LI.js +0 -2
  99. package/dist/chunk-6GGPY7U2.js +0 -4
  100. package/dist/chunk-6MNLRAKM.cjs +0 -121
  101. package/dist/chunk-73Y63IPP.js +0 -57
  102. package/dist/chunk-7DUKWHRN.cjs +0 -1
  103. package/dist/chunk-7K6ZUNJM.js +0 -4
  104. package/dist/chunk-7LLCXY5O.cjs +0 -19
  105. package/dist/chunk-A35ZP72D.cjs +0 -132
  106. package/dist/chunk-A3IOQOV6.js +0 -2
  107. package/dist/chunk-A3XVL6ED.cjs +0 -3
  108. package/dist/chunk-A7LZ6T42.cjs +0 -1
  109. package/dist/chunk-APDQ6ZTG.cjs +0 -120
  110. package/dist/chunk-ATI2UZ7U.js +0 -2
  111. package/dist/chunk-AWQGDMOE.js +0 -3
  112. package/dist/chunk-B3BSVEFC.cjs +0 -3
  113. package/dist/chunk-B4AC23SG.js +0 -122
  114. package/dist/chunk-BD6XHMMM.cjs +0 -2
  115. package/dist/chunk-CHYVUWZ3.js +0 -2
  116. package/dist/chunk-CIVA6SKW.js +0 -2
  117. package/dist/chunk-CNHUCCQJ.js +0 -121
  118. package/dist/chunk-CRP6PSCE.js +0 -2
  119. package/dist/chunk-DI6TCZSE.js +0 -122
  120. package/dist/chunk-DORUYZQV.cjs +0 -1
  121. package/dist/chunk-E4H3ZZ7U.js +0 -4
  122. package/dist/chunk-EFKEVWAD.js +0 -4
  123. package/dist/chunk-EI7FRSNY.js +0 -57
  124. package/dist/chunk-EON4XLKQ.cjs +0 -1
  125. package/dist/chunk-EUQAOYEO.cjs +0 -121
  126. package/dist/chunk-EVAUBT7H.js +0 -57
  127. package/dist/chunk-EYHD7HZE.cjs +0 -1
  128. package/dist/chunk-EYYIPA5N.js +0 -432
  129. package/dist/chunk-FBWLSWZ4.js +0 -122
  130. package/dist/chunk-FDKU7HJX.js +0 -2
  131. package/dist/chunk-FG3IFGJP.cjs +0 -1
  132. package/dist/chunk-FGN6IMPY.cjs +0 -3
  133. package/dist/chunk-FLS2FJM6.cjs +0 -431
  134. package/dist/chunk-FP5UK272.cjs +0 -1
  135. package/dist/chunk-FSL3NLRT.cjs +0 -2
  136. package/dist/chunk-FUFS65Q5.js +0 -133
  137. package/dist/chunk-GV2IB4WQ.cjs +0 -56
  138. package/dist/chunk-GWIZT2P5.js +0 -57
  139. package/dist/chunk-H3FJ54KB.cjs +0 -121
  140. package/dist/chunk-HY3EAWB2.js +0 -4
  141. package/dist/chunk-I6UJVO2P.js +0 -57
  142. package/dist/chunk-IQSF6XRV.js +0 -57
  143. package/dist/chunk-IXGDTAES.js +0 -4
  144. package/dist/chunk-JB4WG2YJ.cjs +0 -121
  145. package/dist/chunk-JCEJ4VTN.js +0 -20
  146. package/dist/chunk-JZ7Z6WC2.cjs +0 -3
  147. package/dist/chunk-K5XGP57D.cjs +0 -19
  148. package/dist/chunk-LBLFU6KI.js +0 -57
  149. package/dist/chunk-LP3HRZGK.js +0 -57
  150. package/dist/chunk-LPFRMQFQ.js +0 -121
  151. package/dist/chunk-LYU44UNN.cjs +0 -56
  152. package/dist/chunk-M75VGFCI.js +0 -3
  153. package/dist/chunk-MFNN5DYG.cjs +0 -1
  154. package/dist/chunk-MJAODEFC.cjs +0 -121
  155. package/dist/chunk-MLCBSEBU.js +0 -2
  156. package/dist/chunk-MSC4G2HF.cjs +0 -2
  157. package/dist/chunk-MYHNTJLR.cjs +0 -56
  158. package/dist/chunk-N2YHO2WI.cjs +0 -3
  159. package/dist/chunk-N6MNQIQU.js +0 -123
  160. package/dist/chunk-NPBXLPOP.js +0 -3
  161. package/dist/chunk-OJ3H4AQ2.cjs +0 -56
  162. package/dist/chunk-ON5XJEPO.cjs +0 -3
  163. package/dist/chunk-OPTVCCQQ.cjs +0 -122
  164. package/dist/chunk-OT2Z4XBD.cjs +0 -1
  165. package/dist/chunk-PFKVHUOT.js +0 -432
  166. package/dist/chunk-PFTBTWSC.cjs +0 -1
  167. package/dist/chunk-PTPVFLET.js +0 -20
  168. package/dist/chunk-PZDLPRJF.js +0 -4
  169. package/dist/chunk-QC4YXUBT.cjs +0 -383
  170. package/dist/chunk-QUTYCUST.js +0 -4
  171. package/dist/chunk-REKKBAQX.cjs +0 -56
  172. package/dist/chunk-RTNQP6BV.js +0 -2
  173. package/dist/chunk-RUJW47ZJ.js +0 -2
  174. package/dist/chunk-RXYCFZJC.cjs +0 -121
  175. package/dist/chunk-S2MZNEBQ.cjs +0 -1
  176. package/dist/chunk-S5HTTLN7.cjs +0 -2
  177. package/dist/chunk-S73YERS2.js +0 -57
  178. package/dist/chunk-SMQ6736Y.js +0 -57
  179. package/dist/chunk-T3DJ3UTP.cjs +0 -121
  180. package/dist/chunk-TEY5LZ26.cjs +0 -56
  181. package/dist/chunk-TJZO7ZSX.cjs +0 -3
  182. package/dist/chunk-TKUNRCRH.js +0 -4
  183. package/dist/chunk-TQLCOMKC.js +0 -4
  184. package/dist/chunk-TRXYDWGE.cjs +0 -1
  185. package/dist/chunk-TS55CUNJ.js +0 -57
  186. package/dist/chunk-UFBJ3WOZ.js +0 -2
  187. package/dist/chunk-UQRVQUVR.js +0 -2
  188. package/dist/chunk-UW5W35NP.js +0 -122
  189. package/dist/chunk-UWVBFRCW.js +0 -2
  190. package/dist/chunk-UZWYFEUN.js +0 -122
  191. package/dist/chunk-VI7WCO2J.cjs +0 -3
  192. package/dist/chunk-VOYPKTID.cjs +0 -1
  193. package/dist/chunk-VTOL3URF.js +0 -4
  194. package/dist/chunk-VVVCCB6R.js +0 -2
  195. package/dist/chunk-W2GPP6RB.js +0 -122
  196. package/dist/chunk-WHOA7YJU.cjs +0 -1
  197. package/dist/chunk-WNRUPL26.js +0 -2
  198. package/dist/chunk-XBQ6HV3T.cjs +0 -114
  199. package/dist/chunk-XIAJQLGS.js +0 -2
  200. package/dist/chunk-XK6UB77Q.js +0 -4
  201. package/dist/chunk-XP7BXFXT.cjs +0 -121
  202. package/dist/chunk-Y2VHO66Q.cjs +0 -3
  203. package/dist/chunk-Y5O2OD7J.cjs +0 -3
  204. package/dist/chunk-YARB43JG.cjs +0 -56
  205. package/dist/chunk-YLCEMVYY.cjs +0 -56
  206. package/dist/chunk-YSOM57GK.cjs +0 -3
  207. package/dist/chunk-Z2SN2MYP.js +0 -122
  208. package/dist/chunk-Z3UVDGYS.cjs +0 -56
  209. package/dist/chunk-ZO3YB5DK.cjs +0 -1
  210. package/dist/chunk-ZOVH6QT5.cjs +0 -1
  211. package/dist/chunk-ZRIBWDYJ.js +0 -384
  212. package/dist/chunk-ZWDBPEXL.js +0 -115
  213. package/dist/index-B9BFNOHd.d.cts +0 -105
  214. package/dist/index-BMcYFpTv.d.cts +0 -105
  215. package/dist/index-ByOM1Y5x.d.ts +0 -105
  216. package/dist/index-C6xmtRio.d.cts +0 -105
  217. package/dist/index-CTI3K_uq.d.cts +0 -105
  218. package/dist/index-CTL4zv_u.d.ts +0 -105
  219. package/dist/index-CaDbioSg.d.ts +0 -105
  220. package/dist/index-CxA9uOv0.d.ts +0 -105
  221. package/dist/index-D6AXbuPI.d.ts +0 -105
  222. package/dist/index-DF0KDBaM.d.cts +0 -105
  223. package/dist/index-DG4Xu7gA.d.cts +0 -105
  224. package/dist/index-DS3DpJli.d.cts +0 -105
  225. package/dist/index-eHex8Iwj.d.ts +0 -105
  226. package/dist/index-rm7uyOK1.d.cts +0 -105
  227. package/dist/lib-5QYYN6ML.cjs +0 -12
  228. package/dist/lib-XXYYUPMW.js +0 -13
  229. package/dist/local-DPLKZQA3.js +0 -1
  230. package/dist/local-KR3AIGVA.cjs +0 -1
  231. package/dist/local-S5VA7IXE.cjs +0 -1
  232. package/dist/local-T7GISZBL.js +0 -1
  233. package/dist/mongo-auth-adapter-EUHAYWJ6.cjs +0 -1
  234. package/dist/mongo-auth-adapter-FW7ATYQ6.js +0 -1
  235. package/dist/mongo-auth-adapter-GR2CFFEA.js +0 -1
  236. package/dist/mongo-auth-adapter-UOO2LZUJ.cjs +0 -1
  237. package/dist/nodemailer-transport-CHO2WKIY.js +0 -1
  238. package/dist/nodemailer-transport-ED2IXNGW.cjs +0 -1
  239. package/dist/postgres-auth-adapter-SK3N3OSS.js +0 -1
  240. package/dist/postgres-auth-adapter-ZO6HK5AK.cjs +0 -1
  241. package/dist/redis-adapter-EGMUN65D.cjs +0 -1
  242. package/dist/redis-adapter-QPCTMF55.js +0 -1
  243. package/dist/sqlite-adapter-52PL52VU.js +0 -1
  244. package/dist/sqlite-adapter-MNNZZXGX.cjs +0 -1
  245. package/dist/types-6ShQp2EM.d.cts +0 -839
  246. package/dist/types-B5Qz1svz.d.cts +0 -822
  247. package/dist/types-B9oXBEKI.d.ts +0 -330
  248. package/dist/types-Bii0bhUV.d.cts +0 -329
  249. package/dist/types-Bt2_ycUO.d.ts +0 -811
  250. package/dist/types-C4wXHImf.d.ts +0 -822
  251. package/dist/types-C8yIAV6K.d.cts +0 -839
  252. package/dist/types-CORUQhY-.d.ts +0 -839
  253. package/dist/types-CjGqxBd3.d.cts +0 -330
  254. package/dist/types-CjGqxBd3.d.ts +0 -330
  255. package/dist/types-DBGR-eQl.d.cts +0 -839
  256. package/dist/types-DCWgPFmi.d.cts +0 -822
  257. package/dist/types-DROqAsr0.d.cts +0 -330
  258. package/dist/types-DROqAsr0.d.ts +0 -330
  259. package/dist/types-DlGSbh7I.d.cts +0 -297
  260. package/dist/types-DlGSbh7I.d.ts +0 -297
  261. package/dist/types-DsF64Wrc.d.cts +0 -811
  262. package/dist/types-IeKFn7Ky.d.ts +0 -839
  263. package/dist/types-ZrjEVWfi.d.ts +0 -811
  264. package/dist/types-dEy5JxvN.d.ts +0 -822
  265. package/dist/types-tVJc9YbX.d.cts +0 -811
  266. package/dist/types-zt5qIvje.d.ts +0 -839
@@ -1,822 +0,0 @@
1
- import { F as Field } from './types-Bii0bhUV.js';
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
- smartViews?: SmartViewConfig[];
423
- }
424
- interface HierarchyConfig {
425
- parentField?: string;
426
- maxDepth?: number;
427
- slugPrefix?: boolean;
428
- }
429
- interface ProjectConfig {
430
- id: string;
431
- name: string;
432
- slug: string;
433
- description?: string;
434
- environment?: 'development' | 'staging' | 'production' | string;
435
- collections?: string[];
436
- globals?: string[];
437
- settings?: Record<string, unknown>;
438
- }
439
- interface SmartViewConfig {
440
- id: string;
441
- name: string;
442
- icon?: string;
443
- color?: string;
444
- filter: Record<string, any>;
445
- collections?: string[];
446
- description?: string;
447
- }
448
- interface OrganizationConfig {
449
- id: string;
450
- name: string;
451
- slug: string;
452
- billingEmail?: string;
453
- projects?: ProjectConfig[];
454
- roles?: Array<{
455
- name: string;
456
- description?: string;
457
- permissions?: string[];
458
- }>;
459
- }
460
- interface FieldOverrides {
461
- [fieldPath: string]: any;
462
- }
463
- interface CollectionOverrideConfig extends Partial<AdminConfig> {
464
- label?: string;
465
- singularLabel?: string;
466
- labelPlural?: string;
467
- labels?: {
468
- singular?: string;
469
- plural?: string;
470
- };
471
- hidden?: boolean;
472
- timestamps?: boolean;
473
- versions?: {
474
- drafts?: boolean;
475
- maxPerDoc?: number;
476
- autosave?: boolean;
477
- };
478
- seo?: boolean | Record<string, any>;
479
- access?: CollectionAccess;
480
- hooks?: CollectionHooks;
481
- fields?: FieldOverrides;
482
- blocks?: Record<string, any> | any[];
483
- tabs?: Record<string, any> | any[];
484
- [key: string]: any;
485
- }
486
- interface GlobalOverrideConfig extends Partial<AdminConfig> {
487
- label?: string;
488
- hidden?: boolean;
489
- access?: GlobalAccess;
490
- hooks?: GlobalHooks;
491
- fields?: FieldOverrides;
492
- blocks?: Record<string, any> | any[];
493
- tabs?: Record<string, any> | any[];
494
- [key: string]: any;
495
- }
496
- interface UploadConfig {
497
- staticDir?: string;
498
- staticURL?: string;
499
- mimeTypes?: string[];
500
- fileSize?: number;
501
- imageSizes?: ImageSize[];
502
- crop?: boolean;
503
- focalPoint?: boolean;
504
- formatOptions?: {
505
- format: "webp" | "png" | "jpg" | "avif";
506
- options?: Record<string, unknown>;
507
- };
508
- resizeOptions?: Record<string, any>;
509
- adminThumbnail?: string;
510
- }
511
- interface ImageSize {
512
- name: string;
513
- width?: number;
514
- height?: number;
515
- crop?: string;
516
- position?: string;
517
- formatOptions?: {
518
- format: "webp" | "png" | "jpg" | "avif";
519
- };
520
- generateImageName?: (doc: any) => string;
521
- }
522
- interface VersionConfig {
523
- maxPerDoc?: number;
524
- drafts?: boolean;
525
- retainDeleted?: boolean;
526
- }
527
- type DocumentStatus = 'draft' | 'published' | 'archived';
528
- interface AuthConfig {
529
- tokenExpiration?: number;
530
- verify?: boolean | {
531
- generateEmailHTML?: (args: any) => string;
532
- };
533
- maxLoginAttempts?: number;
534
- lockTime?: number;
535
- cookies?: {
536
- secure?: boolean;
537
- sameSite?: "strict" | "lax" | "none";
538
- domain?: string;
539
- };
540
- forgotPassword?: {
541
- generateEmailHTML?: (args: any) => string;
542
- generateEmailSubject?: (args: any) => string;
543
- };
544
- strategies?: Array<{
545
- name: string;
546
- authenticate: (args: any) => Promise<any>;
547
- }>;
548
- }
549
- interface CollectionConfig {
550
- slug: string;
551
- label?: string;
552
- labelPlural?: string;
553
- singularLabel?: string;
554
- admin?: AdminConfig;
555
- fields: Field[];
556
- access?: CollectionAccess;
557
- hooks?: CollectionHooks;
558
- timestamps?: boolean;
559
- tenantScoped?: boolean;
560
- tenantField?: string;
561
- upload?: UploadConfig;
562
- versions?: VersionConfig;
563
- folder?: string;
564
- hierarchy?: HierarchyConfig;
565
- auth?: boolean | AuthConfig;
566
- graphQL?: {
567
- singularName?: string;
568
- pluralName?: string;
569
- };
570
- indexes?: Array<{
571
- fields: Record<string, number | "text">;
572
- options?: Record<string, any>;
573
- }>;
574
- seo?: boolean | Record<string, any>;
575
- custom?: Record<string, any>;
576
- tabs?: Array<{
577
- label: string;
578
- fields: Field[];
579
- name?: string;
580
- }>;
581
- }
582
- interface GlobalConfig {
583
- slug: string;
584
- label?: string;
585
- folder?: string;
586
- admin?: AdminConfig;
587
- fields: Field[];
588
- access?: GlobalAccess;
589
- hooks?: GlobalHooks;
590
- versions?: VersionConfig;
591
- graphQL?: {
592
- name?: string;
593
- };
594
- typescript?: {
595
- interface?: string;
596
- };
597
- custom?: Record<string, any>;
598
- tabs?: Array<{
599
- label: string;
600
- fields: Field[];
601
- name?: string;
602
- }>;
603
- }
604
- interface FindArgs {
605
- collection: string;
606
- where?: Record<string, any>;
607
- sort?: string;
608
- limit?: number;
609
- page?: number;
610
- depth?: number;
611
- tenantId?: string;
612
- select?: string[];
613
- user?: any;
614
- context?: Record<string, any>;
615
- overrideAccess?: boolean;
616
- /** If true, returns draft docs (admin view). If false/omitted, only published docs are returned (public API). */
617
- draft?: boolean;
618
- }
619
- interface FindOneArgs {
620
- collection: string;
621
- where: Record<string, any>;
622
- tenantId?: string;
623
- draft?: boolean;
624
- depth?: number;
625
- select?: string[];
626
- }
627
- interface FindByIDArgs {
628
- collection: string;
629
- id: string;
630
- depth?: number;
631
- tenantId?: string;
632
- select?: string[];
633
- user?: any;
634
- context?: Record<string, any>;
635
- overrideAccess?: boolean;
636
- /** If true, returns document regardless of status (admin view). */
637
- draft?: boolean;
638
- }
639
- interface CreateArgs {
640
- collection: string;
641
- data: Record<string, any>;
642
- depth?: number;
643
- tenantId?: string;
644
- select?: string[];
645
- user?: any;
646
- context?: Record<string, any>;
647
- overrideAccess?: boolean;
648
- }
649
- interface UpdateArgs {
650
- collection: string;
651
- id: string;
652
- data: Record<string, any>;
653
- depth?: number;
654
- tenantId?: string;
655
- select?: string[];
656
- user?: any;
657
- context?: Record<string, any>;
658
- overrideAccess?: boolean;
659
- }
660
- interface DeleteArgs {
661
- collection: string;
662
- id: string;
663
- tenantId?: string;
664
- user?: any;
665
- context?: Record<string, any>;
666
- overrideAccess?: boolean;
667
- }
668
- interface FindResult<T = any> {
669
- docs: T[];
670
- totalDocs: number;
671
- limit: number;
672
- totalPages: number;
673
- page: number;
674
- pagingCounter: number;
675
- hasPrevPage: boolean;
676
- hasNextPage: boolean;
677
- prevPage: number | null;
678
- nextPage: number | null;
679
- }
680
- interface CreateResult<T = any> {
681
- doc: T;
682
- errors?: Array<{
683
- field: string;
684
- message: string;
685
- }>;
686
- }
687
- interface VersionRecord<T = Record<string, any>> {
688
- id: string;
689
- collection: string;
690
- documentId: string;
691
- version: number;
692
- status: DocumentStatus;
693
- data: T;
694
- createdBy?: string;
695
- createdAt: string;
696
- updatedAt: string;
697
- publishedAt?: string | null;
698
- changeDescription?: string;
699
- autosave?: boolean;
700
- }
701
- interface CreateVersionArgs<T = Record<string, any>> {
702
- collection: string;
703
- documentId: string;
704
- data: T;
705
- status: DocumentStatus;
706
- createdBy?: string;
707
- changeDescription?: string;
708
- tenantId?: string;
709
- /** When true, reuses a single version slot (find existing + update) */
710
- autosave?: boolean;
711
- }
712
- interface FindVersionsArgs {
713
- collection: string;
714
- documentId: string;
715
- tenantId?: string;
716
- limit?: number;
717
- page?: number;
718
- sort?: string;
719
- }
720
- interface BaseAdapter {
721
- init(collections: CollectionConfig[], globals: GlobalConfig[]): Promise<void>;
722
- find<T = Record<string, any>>(args: FindArgs): Promise<FindResult<T>>;
723
- findByID<T = Record<string, any>>(args: FindByIDArgs): Promise<T | null>;
724
- create<T = Record<string, any>>(args: CreateArgs): Promise<T>;
725
- update<T = Record<string, any>>(args: UpdateArgs): Promise<T>;
726
- delete<T = Record<string, any>>(args: DeleteArgs): Promise<T>;
727
- count(args: {
728
- collection: string;
729
- where?: Record<string, any>;
730
- tenantId?: string;
731
- }): Promise<number>;
732
- findOne(args: FindOneArgs): Promise<any>;
733
- findVersions(args: FindVersionsArgs): Promise<FindResult<VersionRecord>>;
734
- findVersionByID(args: {
735
- collection: string;
736
- versionId: string;
737
- tenantId?: string;
738
- }): Promise<VersionRecord | null>;
739
- createVersion<T = Record<string, any>>(args: CreateVersionArgs<T>): Promise<VersionRecord<T>>;
740
- deleteVersions(args: {
741
- collection: string;
742
- documentId: string;
743
- keepLatest?: number;
744
- tenantId?: string;
745
- }): Promise<void>;
746
- updateLatestVersion<T = Record<string, any>>(args: CreateVersionArgs<T>): Promise<VersionRecord<T>>;
747
- migrate?(): Promise<void>;
748
- rollback?(): Promise<void>;
749
- connect(): Promise<void>;
750
- disconnect(): Promise<void>;
751
- transaction?<T>(fn: (tx: any) => Promise<T>): Promise<T>;
752
- setTenantContext(context: TenantContext | undefined): void;
753
- getTenantContext(): TenantContext | undefined;
754
- }
755
- interface AdapterConfig {
756
- type: "drizzle" | "mongodb";
757
- client: any;
758
- schema?: any;
759
- connectionOptions?: Record<string, any>;
760
- }
761
- interface KyroConfig {
762
- collections?: CollectionConfig[];
763
- globals?: GlobalConfig[];
764
- projects?: ProjectConfig[];
765
- organizations?: OrganizationConfig[];
766
- adapter: BaseAdapter;
767
- storage?: StorageProvider;
768
- plugins?: KyroPlugin[];
769
- auth?: boolean | {
770
- secret?: string;
771
- tokenExpiration?: number;
772
- cookie?: {
773
- secure?: boolean;
774
- sameSite?: "strict" | "lax" | "none";
775
- domain?: string;
776
- };
777
- checkSession?: boolean;
778
- };
779
- authAdapter?: any;
780
- cors?: {
781
- origins?: string[];
782
- credentials?: boolean;
783
- };
784
- admin?: {
785
- meta?: {
786
- title?: string;
787
- description?: string;
788
- ogImage?: string;
789
- };
790
- dateFormat?: string;
791
- avatar?: "default" | "gravatar";
792
- disable?: boolean;
793
- indexRoute?: string;
794
- components?: Record<string, any>;
795
- collectionOverrides?: Record<string, CollectionOverrideConfig>;
796
- globalOverrides?: Record<string, GlobalOverrideConfig>;
797
- smartViews?: SmartViewConfig[];
798
- };
799
- upload?: {
800
- limits?: {
801
- fileSize?: number;
802
- };
803
- };
804
- graphQL?: {
805
- maxComplexity?: number;
806
- disablePlayground?: boolean;
807
- };
808
- typescript?: {
809
- outputFile?: string;
810
- };
811
- localization?: {
812
- locales: string[];
813
- defaultLocale: string;
814
- };
815
- rateLimit?: {
816
- window?: number;
817
- max?: number;
818
- };
819
- debug?: boolean;
820
- }
821
-
822
- export { getWhereClause 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 SmartViewConfig as Q, type Request as R, type StorageConfig as S, type TenantContext as T, type UpdateArgs as U, type VersionRecord as V, type UploadConfig as W, type VersionConfig as X, type WhereClause as Y, WishlistPlugin as Z, evaluateAccess as _, type StorageProvider as a, mergeWhereClauses as a0, presetPlugins as a1, resolveProvider as a2, runFieldHooks as a3, runHooks as a4, 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 };