@kyro-cms/core 0.9.0 → 0.9.2

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 (265) hide show
  1. package/README.md +55 -593
  2. package/dist/{WebhookService-AefJfqX0.d.cts → WebhookService-BKszZlG0.d.cts} +1 -1
  3. package/dist/{WebhookService-118ZTFis.d.ts → WebhookService-Ccf1j-IN.d.ts} +1 -1
  4. package/dist/api-handler-graphql.cjs +44 -0
  5. package/dist/api-handler-graphql.cjs.map +1 -0
  6. package/dist/api-handler-graphql.d.cts +6 -0
  7. package/dist/api-handler-graphql.d.ts +6 -0
  8. package/dist/api-handler-graphql.js +41 -0
  9. package/dist/api-handler-graphql.js.map +1 -0
  10. package/dist/api-handler-trpc.cjs +38 -0
  11. package/dist/api-handler-trpc.cjs.map +1 -0
  12. package/dist/api-handler-trpc.d.cts +5 -0
  13. package/dist/api-handler-trpc.d.ts +5 -0
  14. package/dist/api-handler-trpc.js +36 -0
  15. package/dist/api-handler-trpc.js.map +1 -0
  16. package/dist/api-handler.cjs +33 -99
  17. package/dist/api-handler.cjs.map +1 -1
  18. package/dist/api-handler.d.cts +2 -1
  19. package/dist/api-handler.d.ts +2 -1
  20. package/dist/api-handler.js +21 -97
  21. package/dist/api-handler.js.map +1 -1
  22. package/dist/{tenant-B1YB0Jy8.d.ts → base-CIuXkrH4.d.cts} +7 -15
  23. package/dist/{tenant-Cpeveji6.d.cts → base-fFo4lqER.d.ts} +7 -15
  24. package/dist/bootstrap-3PV3GJ3S.js +7 -0
  25. package/dist/{bootstrap-JCML6NFO.js.map → bootstrap-3PV3GJ3S.js.map} +1 -1
  26. package/dist/bootstrap-4CELFLJO.cjs +32 -0
  27. package/dist/{bootstrap-AKAUP6F6.cjs.map → bootstrap-4CELFLJO.cjs.map} +1 -1
  28. package/dist/{chunk-VJT6P4N6.cjs → chunk-3HR772HI.cjs} +199 -32
  29. package/dist/chunk-3HR772HI.cjs.map +1 -0
  30. package/dist/chunk-3KTWGODI.cjs +178 -0
  31. package/dist/chunk-3KTWGODI.cjs.map +1 -0
  32. package/dist/{chunk-QXIQWPAP.js → chunk-3UK5XBVJ.js} +4 -134
  33. package/dist/chunk-3UK5XBVJ.js.map +1 -0
  34. package/dist/{chunk-FXYP2HA6.js → chunk-4AO3A3JM.js} +48 -4
  35. package/dist/chunk-4AO3A3JM.js.map +1 -0
  36. package/dist/{chunk-Z6ZWNWWR.js → chunk-4CV4JOE5.js} +3 -9
  37. package/dist/{chunk-Z6ZWNWWR.js.map → chunk-4CV4JOE5.js.map} +1 -1
  38. package/dist/chunk-4M7X5HAB.cjs +173 -0
  39. package/dist/chunk-4M7X5HAB.cjs.map +1 -0
  40. package/dist/chunk-53NYVYVX.js +3243 -0
  41. package/dist/chunk-53NYVYVX.js.map +1 -0
  42. package/dist/{chunk-35U3FROB.js → chunk-5H3MWQJS.js} +714 -184
  43. package/dist/chunk-5H3MWQJS.js.map +1 -0
  44. package/dist/{chunk-YVUJBEXE.cjs → chunk-5PMQQFRE.cjs} +16 -7
  45. package/dist/chunk-5PMQQFRE.cjs.map +1 -0
  46. package/dist/{chunk-57P6MJKC.js → chunk-6UNONDW7.js} +94 -10
  47. package/dist/chunk-6UNONDW7.js.map +1 -0
  48. package/dist/{chunk-Y3N7UUDO.js → chunk-7OGPN7MP.js} +5 -2
  49. package/dist/chunk-7OGPN7MP.js.map +1 -0
  50. package/dist/{chunk-2OL4O2TH.cjs → chunk-7OS7TX2Q.cjs} +68 -62
  51. package/dist/chunk-7OS7TX2Q.cjs.map +1 -0
  52. package/dist/{chunk-3TPQ2BU6.js → chunk-BYBMTIMT.js} +2 -6
  53. package/dist/chunk-BYBMTIMT.js.map +1 -0
  54. package/dist/{chunk-ES5HNFFT.js → chunk-CF7OL6HR.js} +4 -2
  55. package/dist/chunk-CF7OL6HR.js.map +1 -0
  56. package/dist/chunk-CJONKRHJ.js +162 -0
  57. package/dist/chunk-CJONKRHJ.js.map +1 -0
  58. package/dist/{chunk-OHVB4AJ7.js → chunk-CJX74IYK.js} +24 -18
  59. package/dist/chunk-CJX74IYK.js.map +1 -0
  60. package/dist/{chunk-5KVM3WEY.cjs → chunk-CNKT4PME.cjs} +1592 -868
  61. package/dist/chunk-CNKT4PME.cjs.map +1 -0
  62. package/dist/{chunk-G7VZBCD6.cjs → chunk-CZLDE2OZ.cjs} +2 -9
  63. package/dist/{chunk-G7VZBCD6.cjs.map → chunk-CZLDE2OZ.cjs.map} +1 -1
  64. package/dist/{chunk-WQBRWOQT.cjs → chunk-DPA3KWPY.cjs} +4 -3
  65. package/dist/chunk-DPA3KWPY.cjs.map +1 -0
  66. package/dist/{chunk-LINKCEG4.cjs → chunk-E2763JUP.cjs} +726 -196
  67. package/dist/chunk-E2763JUP.cjs.map +1 -0
  68. package/dist/chunk-E5UJBLQ7.js +220 -0
  69. package/dist/chunk-E5UJBLQ7.js.map +1 -0
  70. package/dist/{chunk-DVD5P72E.cjs → chunk-EEJUFDMF.cjs} +2 -6
  71. package/dist/chunk-EEJUFDMF.cjs.map +1 -0
  72. package/dist/chunk-FSKONGCX.cjs +253 -0
  73. package/dist/chunk-FSKONGCX.cjs.map +1 -0
  74. package/dist/{chunk-Y3QQN7PN.js → chunk-GAAHG2Z4.js} +13 -4
  75. package/dist/chunk-GAAHG2Z4.js.map +1 -0
  76. package/dist/chunk-GAOXD3XT.js +175 -0
  77. package/dist/chunk-GAOXD3XT.js.map +1 -0
  78. package/dist/{chunk-SA7NSSIQ.cjs → chunk-GUUB5EAG.cjs} +13 -187
  79. package/dist/chunk-GUUB5EAG.cjs.map +1 -0
  80. package/dist/{chunk-4DA7QPLA.cjs → chunk-GXFOGU7N.cjs} +5 -2
  81. package/dist/chunk-GXFOGU7N.cjs.map +1 -0
  82. package/dist/{chunk-I7HHI6QV.cjs → chunk-IDVRRRAK.cjs} +17 -9
  83. package/dist/chunk-IDVRRRAK.cjs.map +1 -0
  84. package/dist/{chunk-HXRD4B37.js → chunk-IPTZM3VE.js} +1423 -704
  85. package/dist/chunk-IPTZM3VE.js.map +1 -0
  86. package/dist/chunk-KC2GDBLS.cjs +84 -0
  87. package/dist/chunk-KC2GDBLS.cjs.map +1 -0
  88. package/dist/{chunk-QUW2RZTM.cjs → chunk-L46ROHUS.cjs} +51 -7
  89. package/dist/chunk-L46ROHUS.cjs.map +1 -0
  90. package/dist/chunk-L4EZKIEX.js +185 -0
  91. package/dist/chunk-L4EZKIEX.js.map +1 -0
  92. package/dist/{chunk-REK7AYOC.js → chunk-L5UKKZQN.js} +199 -32
  93. package/dist/chunk-L5UKKZQN.js.map +1 -0
  94. package/dist/chunk-NKPKR5BW.cjs +188 -0
  95. package/dist/chunk-NKPKR5BW.cjs.map +1 -0
  96. package/dist/chunk-NWUEVLQT.cjs +99 -0
  97. package/dist/chunk-NWUEVLQT.cjs.map +1 -0
  98. package/dist/{chunk-3AJE4SEG.js → chunk-OHC6UHFY.js} +208 -76
  99. package/dist/chunk-OHC6UHFY.js.map +1 -0
  100. package/dist/chunk-PHJRNPHY.cjs +3291 -0
  101. package/dist/chunk-PHJRNPHY.cjs.map +1 -0
  102. package/dist/{chunk-DXHRBMGB.js → chunk-PQ72Z6WC.js} +67 -112
  103. package/dist/chunk-PQ72Z6WC.js.map +1 -0
  104. package/dist/{chunk-K7JPTH3G.cjs → chunk-PV2I2KMI.cjs} +214 -82
  105. package/dist/chunk-PV2I2KMI.cjs.map +1 -0
  106. package/dist/{chunk-PDYFVNUX.cjs → chunk-Q23GAMLE.cjs} +71 -116
  107. package/dist/chunk-Q23GAMLE.cjs.map +1 -0
  108. package/dist/{chunk-H727JIG7.js → chunk-Q72BOAPK.js} +16 -8
  109. package/dist/chunk-Q72BOAPK.js.map +1 -0
  110. package/dist/{chunk-IBG6V56E.cjs → chunk-QFLB4EIJ.cjs} +2 -139
  111. package/dist/chunk-QFLB4EIJ.cjs.map +1 -0
  112. package/dist/{chunk-2KVHZE6O.cjs → chunk-RFFSZSCL.cjs} +282 -190
  113. package/dist/chunk-RFFSZSCL.cjs.map +1 -0
  114. package/dist/{chunk-V3LKPM3O.cjs → chunk-SHTTJMLT.cjs} +4 -2
  115. package/dist/chunk-SHTTJMLT.cjs.map +1 -0
  116. package/dist/{chunk-WOWUL7ZY.js → chunk-UUDTPZX6.js} +5 -4
  117. package/dist/chunk-UUDTPZX6.js.map +1 -0
  118. package/dist/{chunk-QPPDLRNR.js → chunk-V7KZQIZ6.js} +277 -185
  119. package/dist/chunk-V7KZQIZ6.js.map +1 -0
  120. package/dist/{chunk-3ZFYL34R.js → chunk-WXVB364T.js} +12 -185
  121. package/dist/chunk-WXVB364T.js.map +1 -0
  122. package/dist/chunk-XEB7PH2E.js +81 -0
  123. package/dist/chunk-XEB7PH2E.js.map +1 -0
  124. package/dist/{chunk-IA6AU5PI.cjs → chunk-Y7AQK4R4.cjs} +94 -10
  125. package/dist/chunk-Y7AQK4R4.cjs.map +1 -0
  126. package/dist/chunk-YFAVQQTU.js +92 -0
  127. package/dist/chunk-YFAVQQTU.js.map +1 -0
  128. package/dist/cli/index.cjs +6 -6
  129. package/dist/cli/index.cjs.map +1 -1
  130. package/dist/cli/index.js +6 -6
  131. package/dist/cli/index.js.map +1 -1
  132. package/dist/client.cjs +4 -4
  133. package/dist/client.d.cts +3 -3
  134. package/dist/client.d.ts +3 -3
  135. package/dist/client.js +2 -2
  136. package/dist/drizzle/index.cjs +15 -14
  137. package/dist/drizzle/index.d.cts +10 -14
  138. package/dist/drizzle/index.d.ts +10 -14
  139. package/dist/drizzle/index.js +6 -5
  140. package/dist/fields/index.cjs +22 -38
  141. package/dist/fields/index.d.cts +2 -22
  142. package/dist/fields/index.d.ts +2 -22
  143. package/dist/fields/index.js +2 -2
  144. package/dist/graphql/index.cjs +6 -5
  145. package/dist/graphql/index.d.cts +5 -3
  146. package/dist/graphql/index.d.ts +5 -3
  147. package/dist/graphql/index.js +4 -3
  148. package/dist/index-BKta3cBH.d.cts +277 -0
  149. package/dist/index-ClOqnkTO.d.ts +277 -0
  150. package/dist/index.cjs +310 -168
  151. package/dist/index.cjs.map +1 -1
  152. package/dist/index.d.cts +130 -211
  153. package/dist/index.d.ts +130 -211
  154. package/dist/index.js +174 -35
  155. package/dist/index.js.map +1 -1
  156. package/dist/integration.cjs +3 -3
  157. package/dist/integration.js +2 -2
  158. package/dist/media-7WDX4BDJ.js +4 -0
  159. package/dist/{media-GPPTZ43E.js.map → media-7WDX4BDJ.js.map} +1 -1
  160. package/dist/{media-XNTUFJZR.cjs → media-TUSLVRQ6.cjs} +3 -3
  161. package/dist/{media-XNTUFJZR.cjs.map → media-TUSLVRQ6.cjs.map} +1 -1
  162. package/dist/mongo-auth-adapter-GT4S7SCU.cjs +17 -0
  163. package/dist/{mongo-auth-adapter-NHHUJHVH.cjs.map → mongo-auth-adapter-GT4S7SCU.cjs.map} +1 -1
  164. package/dist/mongo-auth-adapter-M7VV4LNB.js +4 -0
  165. package/dist/{mongo-auth-adapter-NJQUUCTP.js.map → mongo-auth-adapter-M7VV4LNB.js.map} +1 -1
  166. package/dist/mongodb/index.cjs +9 -8
  167. package/dist/mongodb/index.d.cts +6 -13
  168. package/dist/mongodb/index.d.ts +6 -13
  169. package/dist/mongodb/index.js +5 -4
  170. package/dist/postgres-auth-adapter-AFAPISH7.js +5 -0
  171. package/dist/{postgres-auth-adapter-3T2NKTSE.js.map → postgres-auth-adapter-AFAPISH7.js.map} +1 -1
  172. package/dist/postgres-auth-adapter-SFDTLONT.cjs +14 -0
  173. package/dist/{postgres-auth-adapter-7IEENCKQ.cjs.map → postgres-auth-adapter-SFDTLONT.cjs.map} +1 -1
  174. package/dist/redis-adapter-UQX4EE3B.cjs +13 -0
  175. package/dist/{redis-adapter-D2E2S3GB.cjs.map → redis-adapter-UQX4EE3B.cjs.map} +1 -1
  176. package/dist/redis-adapter-XALOGWY3.js +4 -0
  177. package/dist/{redis-adapter-VQXD7ESY.js.map → redis-adapter-XALOGWY3.js.map} +1 -1
  178. package/dist/rest/index.cjs +16 -15
  179. package/dist/rest/index.d.cts +4 -4
  180. package/dist/rest/index.d.ts +4 -4
  181. package/dist/rest/index.js +14 -13
  182. package/dist/{schema-37SE2F4B.cjs → schema-6QL3USNB.cjs} +15 -15
  183. package/dist/{schema-37SE2F4B.cjs.map → schema-6QL3USNB.cjs.map} +1 -1
  184. package/dist/{schema-5PHL5IVB.js → schema-FNNWEAAW.js} +4 -4
  185. package/dist/{schema-5PHL5IVB.js.map → schema-FNNWEAAW.js.map} +1 -1
  186. package/dist/sqlite-adapter-AQB5TCGV.cjs +13 -0
  187. package/dist/{sqlite-adapter-LVK5PS4T.cjs.map → sqlite-adapter-AQB5TCGV.cjs.map} +1 -1
  188. package/dist/sqlite-adapter-N5H6IM2X.js +4 -0
  189. package/dist/{sqlite-adapter-TR3U3W6Q.js.map → sqlite-adapter-N5H6IM2X.js.map} +1 -1
  190. package/dist/templates/index.cjs +134 -32
  191. package/dist/templates/index.d.cts +52 -9
  192. package/dist/templates/index.d.ts +52 -9
  193. package/dist/templates/index.js +4 -2
  194. package/dist/trpc/index.cjs +14 -13
  195. package/dist/trpc/index.d.cts +55 -49
  196. package/dist/trpc/index.d.ts +55 -49
  197. package/dist/trpc/index.js +5 -4
  198. package/dist/{types-D6ZLRGbH.d.cts → types-CpjuXbe7.d.cts} +2 -0
  199. package/dist/{types-D6ZLRGbH.d.ts → types-CpjuXbe7.d.ts} +2 -0
  200. package/dist/{types-VtjUxIMp.d.cts → types-DeSApf9T.d.cts} +36 -14
  201. package/dist/{types-VtjUxIMp.d.ts → types-DeSApf9T.d.ts} +36 -14
  202. package/dist/{types-J3R9nVsZ.d.cts → types-Dgzlftb7.d.ts} +32 -28
  203. package/dist/{types-Bs1up4yP.d.ts → types-Ds0tCA3L.d.cts} +32 -28
  204. package/dist/ws/index.cjs +6 -6
  205. package/dist/ws/index.js +2 -2
  206. package/package.json +22 -4
  207. package/dist/bootstrap-AKAUP6F6.cjs +0 -32
  208. package/dist/bootstrap-JCML6NFO.js +0 -7
  209. package/dist/chunk-2KVHZE6O.cjs.map +0 -1
  210. package/dist/chunk-2OL4O2TH.cjs.map +0 -1
  211. package/dist/chunk-35U3FROB.js.map +0 -1
  212. package/dist/chunk-3AJE4SEG.js.map +0 -1
  213. package/dist/chunk-3J4MFTI3.js +0 -3872
  214. package/dist/chunk-3J4MFTI3.js.map +0 -1
  215. package/dist/chunk-3TPQ2BU6.js.map +0 -1
  216. package/dist/chunk-3ZFYL34R.js.map +0 -1
  217. package/dist/chunk-4DA7QPLA.cjs.map +0 -1
  218. package/dist/chunk-57P6MJKC.js.map +0 -1
  219. package/dist/chunk-5KVM3WEY.cjs.map +0 -1
  220. package/dist/chunk-6IMPH6WV.cjs +0 -3897
  221. package/dist/chunk-6IMPH6WV.cjs.map +0 -1
  222. package/dist/chunk-ATBOUGQP.cjs +0 -513
  223. package/dist/chunk-ATBOUGQP.cjs.map +0 -1
  224. package/dist/chunk-DVD5P72E.cjs.map +0 -1
  225. package/dist/chunk-DXHRBMGB.js.map +0 -1
  226. package/dist/chunk-ES5HNFFT.js.map +0 -1
  227. package/dist/chunk-FXYP2HA6.js.map +0 -1
  228. package/dist/chunk-H727JIG7.js.map +0 -1
  229. package/dist/chunk-HXRD4B37.js.map +0 -1
  230. package/dist/chunk-I7HHI6QV.cjs.map +0 -1
  231. package/dist/chunk-IA6AU5PI.cjs.map +0 -1
  232. package/dist/chunk-IBG6V56E.cjs.map +0 -1
  233. package/dist/chunk-K7JPTH3G.cjs.map +0 -1
  234. package/dist/chunk-LINKCEG4.cjs.map +0 -1
  235. package/dist/chunk-OHVB4AJ7.js.map +0 -1
  236. package/dist/chunk-PDYFVNUX.cjs.map +0 -1
  237. package/dist/chunk-Q23JB3KL.js +0 -488
  238. package/dist/chunk-Q23JB3KL.js.map +0 -1
  239. package/dist/chunk-QPPDLRNR.js.map +0 -1
  240. package/dist/chunk-QUW2RZTM.cjs.map +0 -1
  241. package/dist/chunk-QXIQWPAP.js.map +0 -1
  242. package/dist/chunk-R3XIBBAW.cjs +0 -34
  243. package/dist/chunk-R3XIBBAW.cjs.map +0 -1
  244. package/dist/chunk-REK7AYOC.js.map +0 -1
  245. package/dist/chunk-SA7NSSIQ.cjs.map +0 -1
  246. package/dist/chunk-SDMNUYVU.js +0 -30
  247. package/dist/chunk-SDMNUYVU.js.map +0 -1
  248. package/dist/chunk-V3LKPM3O.cjs.map +0 -1
  249. package/dist/chunk-VJT6P4N6.cjs.map +0 -1
  250. package/dist/chunk-WOWUL7ZY.js.map +0 -1
  251. package/dist/chunk-WQBRWOQT.cjs.map +0 -1
  252. package/dist/chunk-Y3N7UUDO.js.map +0 -1
  253. package/dist/chunk-Y3QQN7PN.js.map +0 -1
  254. package/dist/chunk-YVUJBEXE.cjs.map +0 -1
  255. package/dist/index-CLp-DRKA.d.ts +0 -64
  256. package/dist/index-DfO7G4kN.d.cts +0 -64
  257. package/dist/media-GPPTZ43E.js +0 -4
  258. package/dist/mongo-auth-adapter-NHHUJHVH.cjs +0 -17
  259. package/dist/mongo-auth-adapter-NJQUUCTP.js +0 -4
  260. package/dist/postgres-auth-adapter-3T2NKTSE.js +0 -5
  261. package/dist/postgres-auth-adapter-7IEENCKQ.cjs +0 -14
  262. package/dist/redis-adapter-D2E2S3GB.cjs +0 -13
  263. package/dist/redis-adapter-VQXD7ESY.js +0 -4
  264. package/dist/sqlite-adapter-LVK5PS4T.cjs +0 -13
  265. package/dist/sqlite-adapter-TR3U3W6Q.js +0 -4
@@ -1,6 +1,6 @@
1
- import { B as BaseAdapter, R as Request, m as User, b as FindResult } from '../types-Bs1up4yP.js';
2
- import { i as createWebhookService } from '../WebhookService-118ZTFis.js';
3
- import '../types-VtjUxIMp.js';
1
+ import { B as BaseAdapter, R as Request, i as User, b as FindResult } from '../types-Dgzlftb7.js';
2
+ import { i as createWebhookService } from '../WebhookService-Ccf1j-IN.js';
3
+ import '../types-DeSApf9T.js';
4
4
 
5
5
  interface ApiKeyContext {
6
6
  userId: string;
@@ -30,6 +30,55 @@ declare function createContext(options: {
30
30
  settings?: Record<string, any>;
31
31
  }): Promise<KyroContext>;
32
32
 
33
+ declare function createFindProcedure(ctx: KyroContext): (input: {
34
+ collection: string;
35
+ where?: Record<string, any>;
36
+ sort?: string;
37
+ limit?: number;
38
+ page?: number;
39
+ depth?: number;
40
+ select?: string[];
41
+ draft?: boolean;
42
+ }) => Promise<FindResult<unknown>>;
43
+ declare function createFindByIDProcedure(ctx: KyroContext): (input: {
44
+ collection: string;
45
+ id: string;
46
+ depth?: number;
47
+ select?: string[];
48
+ draft?: boolean;
49
+ }) => Promise<{}>;
50
+ declare function createCreateProcedure(ctx: KyroContext): (input: {
51
+ collection: string;
52
+ data: Record<string, any>;
53
+ depth?: number;
54
+ select?: string[];
55
+ }) => Promise<{
56
+ doc: unknown;
57
+ }>;
58
+ declare function createUpdateProcedure(ctx: KyroContext): (input: {
59
+ collection: string;
60
+ id: string;
61
+ data: Record<string, any>;
62
+ depth?: number;
63
+ select?: string[];
64
+ baseUpdatedAt?: string;
65
+ }) => Promise<{
66
+ doc: unknown;
67
+ }>;
68
+ declare function createDeleteProcedure(ctx: KyroContext): (input: {
69
+ collection: string;
70
+ id: string;
71
+ }) => Promise<{
72
+ doc: unknown;
73
+ message: string;
74
+ }>;
75
+ declare function createCountProcedure(ctx: KyroContext): (input: {
76
+ collection: string;
77
+ where?: Record<string, any>;
78
+ }) => Promise<{
79
+ totalDocs: number;
80
+ }>;
81
+
33
82
  declare function createDynamicRouter(ctx: KyroContext): Record<string, any>;
34
83
  interface KyroRouter {
35
84
  [collectionSlug: string]: {
@@ -40,6 +89,7 @@ interface KyroRouter {
40
89
  page?: number;
41
90
  depth?: number;
42
91
  select?: string[];
92
+ draft?: boolean;
43
93
  }) => Promise<{
44
94
  docs: any[];
45
95
  totalDocs: number;
@@ -56,6 +106,7 @@ interface KyroRouter {
56
106
  id: string;
57
107
  depth?: number;
58
108
  select?: string[];
109
+ draft?: boolean;
59
110
  }) => Promise<any>;
60
111
  create: (input: {
61
112
  data: Record<string, any>;
@@ -69,6 +120,7 @@ interface KyroRouter {
69
120
  data: Record<string, any>;
70
121
  depth?: number;
71
122
  select?: string[];
123
+ baseUpdatedAt?: string;
72
124
  }) => Promise<{
73
125
  doc: any;
74
126
  }>;
@@ -87,50 +139,4 @@ interface KyroRouter {
87
139
  }
88
140
  declare function createKyroServer(ctx: KyroContext): KyroRouter;
89
141
 
90
- declare function createFindProcedure(ctx: KyroContext): (input: {
91
- collection: string;
92
- where?: Record<string, any>;
93
- sort?: string;
94
- limit?: number;
95
- page?: number;
96
- depth?: number;
97
- select?: string[];
98
- }) => Promise<FindResult<unknown>>;
99
- declare function createFindByIDProcedure(ctx: KyroContext): (input: {
100
- collection: string;
101
- id: string;
102
- depth?: number;
103
- select?: string[];
104
- }) => Promise<{}>;
105
- declare function createCreateProcedure(ctx: KyroContext): (input: {
106
- collection: string;
107
- data: Record<string, any>;
108
- depth?: number;
109
- select?: string[];
110
- }) => Promise<{
111
- doc: unknown;
112
- }>;
113
- declare function createUpdateProcedure(ctx: KyroContext): (input: {
114
- collection: string;
115
- id: string;
116
- data: Record<string, any>;
117
- depth?: number;
118
- select?: string[];
119
- }) => Promise<{
120
- doc: unknown;
121
- }>;
122
- declare function createDeleteProcedure(ctx: KyroContext): (input: {
123
- collection: string;
124
- id: string;
125
- }) => Promise<{
126
- doc: unknown;
127
- message: string;
128
- }>;
129
- declare function createCountProcedure(ctx: KyroContext): (input: {
130
- collection: string;
131
- where?: Record<string, any>;
132
- }) => Promise<{
133
- totalDocs: number;
134
- }>;
135
-
136
142
  export { type KyroContext, type KyroRouter, createContext, createCountProcedure, createCreateProcedure, createDeleteProcedure, createDynamicRouter, createFindByIDProcedure, createFindProcedure, createKyroServer, createUpdateProcedure };
@@ -1,6 +1,7 @@
1
- export { createContext, createCountProcedure, createCreateProcedure, createDeleteProcedure, createDynamicRouter, createFindByIDProcedure, createFindProcedure, createKyroServer, createUpdateProcedure } from '../chunk-3AJE4SEG.js';
2
- import '../chunk-QXIQWPAP.js';
3
- import '../chunk-SDMNUYVU.js';
4
- import '../chunk-Z6ZWNWWR.js';
1
+ export { createContext, createCountProcedure, createCreateProcedure, createDeleteProcedure, createDynamicRouter, createFindByIDProcedure, createFindProcedure, createKyroServer, createUpdateProcedure } from '../chunk-OHC6UHFY.js';
2
+ import '../chunk-3UK5XBVJ.js';
3
+ import '../chunk-CJONKRHJ.js';
4
+ import '../chunk-L4EZKIEX.js';
5
+ import '../chunk-4CV4JOE5.js';
5
6
  //# sourceMappingURL=index.js.map
6
7
  //# sourceMappingURL=index.js.map
@@ -37,6 +37,7 @@ interface AuthUser {
37
37
  email: string;
38
38
  passwordHash?: string;
39
39
  role: UserRole;
40
+ avatar?: string;
40
41
  tenantId?: string;
41
42
  emailVerified?: boolean;
42
43
  locked?: boolean;
@@ -96,6 +97,7 @@ interface AuthAdapter {
96
97
  password: string;
97
98
  name?: string;
98
99
  role?: UserRole;
100
+ avatar?: string;
99
101
  tenantId?: string;
100
102
  }): Promise<AuthUser>;
101
103
  findUserByEmail(email: string): Promise<AuthUser | null>;
@@ -37,6 +37,7 @@ interface AuthUser {
37
37
  email: string;
38
38
  passwordHash?: string;
39
39
  role: UserRole;
40
+ avatar?: string;
40
41
  tenantId?: string;
41
42
  emailVerified?: boolean;
42
43
  locked?: boolean;
@@ -96,6 +97,7 @@ interface AuthAdapter {
96
97
  password: string;
97
98
  name?: string;
98
99
  role?: UserRole;
100
+ avatar?: string;
99
101
  tenantId?: string;
100
102
  }): Promise<AuthUser>;
101
103
  findUserByEmail(email: string): Promise<AuthUser | null>;
@@ -1,15 +1,31 @@
1
+ /**
2
+ * Serializable condition for conditional field visibility.
3
+ * Unlike function conditions, these survive JSON serialization
4
+ * and can be used in admin configs that are built at compile time.
5
+ */
6
+ interface DeclarativeCondition {
7
+ /** The field name to evaluate (resolved from root form data) */
8
+ field: string;
9
+ /** Show the field when the target field equals this value */
10
+ equals?: string | number | boolean;
11
+ /** Show the field when the target field does NOT equal this value */
12
+ notEquals?: string | number | boolean;
13
+ /** Show the field when the target field's value is one of these */
14
+ in?: (string | number | boolean)[];
15
+ }
1
16
  interface FieldAdmin {
2
17
  description?: string;
3
18
  placeholder?: string;
4
- readOnly?: boolean;
5
- hidden?: boolean;
19
+ readOnly?: boolean | ((data: Record<string, any>, siblingData: Record<string, any>) => boolean);
20
+ hidden?: boolean | ((data: Record<string, any>, siblingData: Record<string, any>) => boolean);
6
21
  width?: string;
7
22
  position?: "sidebar" | "main";
8
23
  autoGenerate?: string;
9
24
  action?: string;
10
25
  method?: string;
11
26
  inline?: boolean;
12
- condition?: (data: Record<string, any>, siblingData: Record<string, any>) => boolean;
27
+ pickerMode?: "drawer" | "dropdown";
28
+ condition?: ((data: Record<string, any>, siblingData: Record<string, any>) => boolean) | DeclarativeCondition;
13
29
  }
14
30
  interface BaseField {
15
31
  name: string;
@@ -77,10 +93,11 @@ interface TextareaField extends BaseField {
77
93
  }
78
94
  interface SelectField extends BaseField {
79
95
  type: "select";
80
- options: Array<{
96
+ options?: Array<{
81
97
  label: string;
82
98
  value: string;
83
99
  }>;
100
+ dynamicOptions?: string;
84
101
  hasMany?: boolean;
85
102
  defaultValue?: string | string[];
86
103
  }
@@ -104,16 +121,10 @@ interface ImageField extends BaseField {
104
121
  allowedTypes?: string[];
105
122
  maxSize?: number;
106
123
  }
107
- interface RichTextBlock {
108
- type: string;
109
- data: Record<string, any>;
110
- children?: RichTextBlock[];
111
- }
124
+ type RichTextBlock = Record<string, any>;
112
125
  interface RichTextField extends BaseField {
113
126
  type: "richtext";
114
- editor?: "lexical" | "slate" | "blocks";
115
- hasBlocks?: boolean;
116
- defaultValue?: RichTextBlock[];
127
+ defaultValue?: Record<string, any>;
117
128
  localized?: boolean;
118
129
  }
119
130
  interface JSONField extends BaseField {
@@ -174,6 +185,7 @@ interface BlockImage {
174
185
  }
175
186
  interface BlockAdmin {
176
187
  group?: string;
188
+ description?: string;
177
189
  images?: {
178
190
  icon?: BlockImage | string;
179
191
  thumbnail?: BlockImage | string;
@@ -223,7 +235,17 @@ interface ButtonField extends BaseField {
223
235
  method?: string;
224
236
  inline?: boolean;
225
237
  }
226
- type Field = TextField | NumberField | CheckboxField | DateField | EmailField | PasswordField | TextareaField | SelectField | RadioField | ColorField | ImageField | RichTextField | JSONField | CodeField | UploadField | MarkdownField | RelationshipField | ArrayField | ListField | GroupField | BlocksField | RowField | CollapsibleField | TabsField | ButtonField;
238
+ interface ActionField extends BaseField {
239
+ type: "action";
240
+ label: string;
241
+ action?: string;
242
+ method?: string;
243
+ inline?: boolean;
244
+ }
245
+ interface SecretField extends BaseField {
246
+ type: "secret";
247
+ }
248
+ type Field = TextField | NumberField | CheckboxField | DateField | EmailField | PasswordField | TextareaField | SelectField | RadioField | ColorField | ImageField | RichTextField | JSONField | CodeField | UploadField | MarkdownField | RelationshipField | ArrayField | ListField | GroupField | BlocksField | RowField | CollapsibleField | TabsField | ButtonField | ActionField | SecretField;
227
249
  type FieldType = Field["type"];
228
250
  declare function isTextField(field: Field): field is TextField;
229
251
  declare function isNumberField(field: Field): field is NumberField;
@@ -243,4 +265,4 @@ declare const LAYOUT_FIELD_TYPES: readonly ["row", "collapsible", "tabs"];
243
265
  declare const ALL_FIELD_TYPES: readonly ["text", "number", "checkbox", "date", "email", "password", "textarea", "select", "radio", "color", "richtext", "json", "code", "upload", "image", "markdown", "relationship", "array", "group", "blocks", "row", "collapsible", "tabs"];
244
266
  declare function createRelationshipFieldConfig(name: string, relationTo: string | string[], options?: Partial<Omit<RelationshipField, "type" | "name" | "relationTo">>): RelationshipField;
245
267
 
246
- export { type ArrayField as A, type BaseField as B, type CheckboxField as C, type DateField as D, type EmailField as E, type Field as F, type GroupField as G, isRichTextField as H, type ImageField as I, type JSONField as J, isSelectField as K, LAYOUT_FIELD_TYPES as L, type MarkdownField as M, type NumberField as N, isTextField as O, type PasswordField as P, isUploadField as Q, type RadioField as R, type SelectField as S, type TabsField as T, type UploadField as U, type ValidateOptions as V, type ButtonField as W, type Hook as X, type ListField as Y, type TextFieldVariant as Z, createRelationshipFieldConfig as _, type Block as a, type BlockAdmin as b, type BlockImage as c, type BlocksField as d, type CodeField as e, type CollapsibleField as f, type ColorField as g, type FieldAdmin as h, type FieldType as i, type RelationshipField as j, type RichTextBlock as k, type RichTextField as l, type RowField as m, type TextField as n, type TextareaField as o, ALL_FIELD_TYPES as p, COMPLEX_FIELD_TYPES as q, PRIMITIVE_FIELD_TYPES as r, RELATIONAL_FIELD_TYPES as s, isArrayField as t, isBlocksField as u, isGroupField as v, isImageField as w, isLayoutField as x, isNumberField as y, isRelationshipField as z };
268
+ export { type ListField as $, type ArrayField as A, type BaseField as B, type CheckboxField as C, type DateField as D, type EmailField as E, type Field as F, type GroupField as G, isNumberField as H, type ImageField as I, type JSONField as J, isRelationshipField as K, LAYOUT_FIELD_TYPES as L, type MarkdownField as M, type NumberField as N, isRichTextField as O, type PasswordField as P, isSelectField as Q, type RadioField as R, type SecretField as S, type TabsField as T, type UploadField as U, type ValidateOptions as V, isTextField as W, isUploadField as X, type ActionField as Y, type ButtonField as Z, type Hook as _, type Block as a, type TextFieldVariant as a0, createRelationshipFieldConfig as a1, type BlockAdmin as b, type BlockImage as c, type BlocksField as d, type CodeField as e, type CollapsibleField as f, type ColorField as g, type DeclarativeCondition as h, type FieldAdmin as i, type FieldType as j, type RelationshipField as k, type RichTextBlock as l, type RichTextField as m, type RowField as n, type SelectField as o, type TextField as p, type TextareaField as q, ALL_FIELD_TYPES as r, COMPLEX_FIELD_TYPES as s, PRIMITIVE_FIELD_TYPES as t, RELATIONAL_FIELD_TYPES as u, isArrayField as v, isBlocksField as w, isGroupField as x, isImageField as y, isLayoutField as z };
@@ -1,15 +1,31 @@
1
+ /**
2
+ * Serializable condition for conditional field visibility.
3
+ * Unlike function conditions, these survive JSON serialization
4
+ * and can be used in admin configs that are built at compile time.
5
+ */
6
+ interface DeclarativeCondition {
7
+ /** The field name to evaluate (resolved from root form data) */
8
+ field: string;
9
+ /** Show the field when the target field equals this value */
10
+ equals?: string | number | boolean;
11
+ /** Show the field when the target field does NOT equal this value */
12
+ notEquals?: string | number | boolean;
13
+ /** Show the field when the target field's value is one of these */
14
+ in?: (string | number | boolean)[];
15
+ }
1
16
  interface FieldAdmin {
2
17
  description?: string;
3
18
  placeholder?: string;
4
- readOnly?: boolean;
5
- hidden?: boolean;
19
+ readOnly?: boolean | ((data: Record<string, any>, siblingData: Record<string, any>) => boolean);
20
+ hidden?: boolean | ((data: Record<string, any>, siblingData: Record<string, any>) => boolean);
6
21
  width?: string;
7
22
  position?: "sidebar" | "main";
8
23
  autoGenerate?: string;
9
24
  action?: string;
10
25
  method?: string;
11
26
  inline?: boolean;
12
- condition?: (data: Record<string, any>, siblingData: Record<string, any>) => boolean;
27
+ pickerMode?: "drawer" | "dropdown";
28
+ condition?: ((data: Record<string, any>, siblingData: Record<string, any>) => boolean) | DeclarativeCondition;
13
29
  }
14
30
  interface BaseField {
15
31
  name: string;
@@ -77,10 +93,11 @@ interface TextareaField extends BaseField {
77
93
  }
78
94
  interface SelectField extends BaseField {
79
95
  type: "select";
80
- options: Array<{
96
+ options?: Array<{
81
97
  label: string;
82
98
  value: string;
83
99
  }>;
100
+ dynamicOptions?: string;
84
101
  hasMany?: boolean;
85
102
  defaultValue?: string | string[];
86
103
  }
@@ -104,16 +121,10 @@ interface ImageField extends BaseField {
104
121
  allowedTypes?: string[];
105
122
  maxSize?: number;
106
123
  }
107
- interface RichTextBlock {
108
- type: string;
109
- data: Record<string, any>;
110
- children?: RichTextBlock[];
111
- }
124
+ type RichTextBlock = Record<string, any>;
112
125
  interface RichTextField extends BaseField {
113
126
  type: "richtext";
114
- editor?: "lexical" | "slate" | "blocks";
115
- hasBlocks?: boolean;
116
- defaultValue?: RichTextBlock[];
127
+ defaultValue?: Record<string, any>;
117
128
  localized?: boolean;
118
129
  }
119
130
  interface JSONField extends BaseField {
@@ -174,6 +185,7 @@ interface BlockImage {
174
185
  }
175
186
  interface BlockAdmin {
176
187
  group?: string;
188
+ description?: string;
177
189
  images?: {
178
190
  icon?: BlockImage | string;
179
191
  thumbnail?: BlockImage | string;
@@ -223,7 +235,17 @@ interface ButtonField extends BaseField {
223
235
  method?: string;
224
236
  inline?: boolean;
225
237
  }
226
- type Field = TextField | NumberField | CheckboxField | DateField | EmailField | PasswordField | TextareaField | SelectField | RadioField | ColorField | ImageField | RichTextField | JSONField | CodeField | UploadField | MarkdownField | RelationshipField | ArrayField | ListField | GroupField | BlocksField | RowField | CollapsibleField | TabsField | ButtonField;
238
+ interface ActionField extends BaseField {
239
+ type: "action";
240
+ label: string;
241
+ action?: string;
242
+ method?: string;
243
+ inline?: boolean;
244
+ }
245
+ interface SecretField extends BaseField {
246
+ type: "secret";
247
+ }
248
+ type Field = TextField | NumberField | CheckboxField | DateField | EmailField | PasswordField | TextareaField | SelectField | RadioField | ColorField | ImageField | RichTextField | JSONField | CodeField | UploadField | MarkdownField | RelationshipField | ArrayField | ListField | GroupField | BlocksField | RowField | CollapsibleField | TabsField | ButtonField | ActionField | SecretField;
227
249
  type FieldType = Field["type"];
228
250
  declare function isTextField(field: Field): field is TextField;
229
251
  declare function isNumberField(field: Field): field is NumberField;
@@ -243,4 +265,4 @@ declare const LAYOUT_FIELD_TYPES: readonly ["row", "collapsible", "tabs"];
243
265
  declare const ALL_FIELD_TYPES: readonly ["text", "number", "checkbox", "date", "email", "password", "textarea", "select", "radio", "color", "richtext", "json", "code", "upload", "image", "markdown", "relationship", "array", "group", "blocks", "row", "collapsible", "tabs"];
244
266
  declare function createRelationshipFieldConfig(name: string, relationTo: string | string[], options?: Partial<Omit<RelationshipField, "type" | "name" | "relationTo">>): RelationshipField;
245
267
 
246
- export { type ArrayField as A, type BaseField as B, type CheckboxField as C, type DateField as D, type EmailField as E, type Field as F, type GroupField as G, isRichTextField as H, type ImageField as I, type JSONField as J, isSelectField as K, LAYOUT_FIELD_TYPES as L, type MarkdownField as M, type NumberField as N, isTextField as O, type PasswordField as P, isUploadField as Q, type RadioField as R, type SelectField as S, type TabsField as T, type UploadField as U, type ValidateOptions as V, type ButtonField as W, type Hook as X, type ListField as Y, type TextFieldVariant as Z, createRelationshipFieldConfig as _, type Block as a, type BlockAdmin as b, type BlockImage as c, type BlocksField as d, type CodeField as e, type CollapsibleField as f, type ColorField as g, type FieldAdmin as h, type FieldType as i, type RelationshipField as j, type RichTextBlock as k, type RichTextField as l, type RowField as m, type TextField as n, type TextareaField as o, ALL_FIELD_TYPES as p, COMPLEX_FIELD_TYPES as q, PRIMITIVE_FIELD_TYPES as r, RELATIONAL_FIELD_TYPES as s, isArrayField as t, isBlocksField as u, isGroupField as v, isImageField as w, isLayoutField as x, isNumberField as y, isRelationshipField as z };
268
+ export { type ListField as $, type ArrayField as A, type BaseField as B, type CheckboxField as C, type DateField as D, type EmailField as E, type Field as F, type GroupField as G, isNumberField as H, type ImageField as I, type JSONField as J, isRelationshipField as K, LAYOUT_FIELD_TYPES as L, type MarkdownField as M, type NumberField as N, isRichTextField as O, type PasswordField as P, isSelectField as Q, type RadioField as R, type SecretField as S, type TabsField as T, type UploadField as U, type ValidateOptions as V, isTextField as W, isUploadField as X, type ActionField as Y, type ButtonField as Z, type Hook as _, type Block as a, type TextFieldVariant as a0, createRelationshipFieldConfig as a1, type BlockAdmin as b, type BlockImage as c, type BlocksField as d, type CodeField as e, type CollapsibleField as f, type ColorField as g, type DeclarativeCondition as h, type FieldAdmin as i, type FieldType as j, type RelationshipField as k, type RichTextBlock as l, type RichTextField as m, type RowField as n, type SelectField as o, type TextField as p, type TextareaField as q, ALL_FIELD_TYPES as r, COMPLEX_FIELD_TYPES as s, PRIMITIVE_FIELD_TYPES as t, RELATIONAL_FIELD_TYPES as u, isArrayField as v, isBlocksField as w, isGroupField as x, isImageField as y, isLayoutField as z };
@@ -1,4 +1,4 @@
1
- import { F as Field } from './types-VtjUxIMp.cjs';
1
+ import { F as Field } from './types-DeSApf9T.js';
2
2
 
3
3
  interface Request {
4
4
  body?: any;
@@ -97,6 +97,15 @@ declare function evaluateAccess(access: AccessControl, args: AccessArgs): Promis
97
97
  declare function mergeWhereClauses(...whereClauses: (WhereClause | boolean | undefined)[]): WhereClause;
98
98
  declare function getWhereClause(access: AccessControl, args: AccessArgs): Promise<WhereClause | undefined>;
99
99
 
100
+ interface TenantContext {
101
+ tenantId: string;
102
+ userId: string;
103
+ role?: string;
104
+ roles?: string[];
105
+ permissions?: string[];
106
+ isSuperAdmin?: boolean;
107
+ }
108
+
100
109
  interface AdminConfig {
101
110
  useAsTitle?: string;
102
111
  defaultColumns?: string[];
@@ -115,6 +124,17 @@ interface AdminConfig {
115
124
  };
116
125
  layout?: "split" | "single";
117
126
  }
127
+ /**
128
+ * Field overrides allow modifying specific field properties by path.
129
+ * Path uses dot notation: "fieldName" or "groupField.arrayField.targetField"
130
+ * Commonly used to extend relationship fields with additional collections.
131
+ */
132
+ interface FieldOverrides {
133
+ [fieldPath: string]: {
134
+ relationTo?: string | string[];
135
+ [key: string]: any;
136
+ };
137
+ }
118
138
  interface UploadConfig {
119
139
  staticDir?: string;
120
140
  staticURL?: string;
@@ -287,29 +307,6 @@ interface FindResult<T = any> {
287
307
  prevPage: number | null;
288
308
  nextPage: number | null;
289
309
  }
290
- interface DraftSnapshot<T = Record<string, any>> {
291
- id: string;
292
- collection: string;
293
- documentId: string;
294
- tenantID?: string;
295
- data: T;
296
- baseUpdatedAt?: string | null;
297
- draftUpdatedAt: string;
298
- createdAt: string;
299
- updatedAt: string;
300
- }
301
- interface DraftFindArgs {
302
- collection: string;
303
- documentId: string;
304
- tenantID?: string;
305
- }
306
- interface DraftUpsertArgs<T = Record<string, any>> extends DraftFindArgs {
307
- data: T;
308
- baseUpdatedAt?: string | null;
309
- draftUpdatedAt?: string;
310
- }
311
- interface DraftDeleteArgs extends DraftFindArgs {
312
- }
313
310
  interface CreateResult<T = any> {
314
311
  doc: T;
315
312
  errors?: Array<{
@@ -329,6 +326,7 @@ interface VersionRecord<T = Record<string, any>> {
329
326
  updatedAt: string;
330
327
  publishedAt?: string | null;
331
328
  changeDescription?: string;
329
+ autosave?: boolean;
332
330
  }
333
331
  interface CreateVersionArgs<T = Record<string, any>> {
334
332
  collection: string;
@@ -338,6 +336,8 @@ interface CreateVersionArgs<T = Record<string, any>> {
338
336
  createdBy?: string;
339
337
  changeDescription?: string;
340
338
  tenantID?: string;
339
+ /** When true, reuses a single version slot (find existing + update) */
340
+ autosave?: boolean;
341
341
  }
342
342
  interface FindVersionsArgs {
343
343
  collection: string;
@@ -378,14 +378,14 @@ interface BaseAdapter {
378
378
  keepLatest?: number;
379
379
  tenantID?: string;
380
380
  }): Promise<void>;
381
- findDraft<T = Record<string, any>>(args: DraftFindArgs): Promise<DraftSnapshot<T> | null>;
382
- upsertDraft<T = Record<string, any>>(args: DraftUpsertArgs<T>): Promise<DraftSnapshot<T>>;
383
- deleteDraft(args: DraftDeleteArgs): Promise<void>;
381
+ updateLatestVersion<T = Record<string, any>>(args: CreateVersionArgs<T>): Promise<VersionRecord<T>>;
384
382
  migrate?(): Promise<void>;
385
383
  rollback?(): Promise<void>;
386
384
  connect(): Promise<void>;
387
385
  disconnect(): Promise<void>;
388
386
  transaction?<T>(fn: (tx: any) => Promise<T>): Promise<T>;
387
+ setTenantContext(context: TenantContext | undefined): void;
388
+ getTenantContext(): TenantContext | undefined;
389
389
  }
390
390
  interface AdapterConfig {
391
391
  type: "drizzle" | "mongodb";
@@ -396,6 +396,7 @@ interface AdapterConfig {
396
396
  interface PluginConfig {
397
397
  name: string;
398
398
  version?: string;
399
+ description?: string;
399
400
  init?: (kyro: any) => void | Promise<void>;
400
401
  extendCollection?: (slug: string, config: CollectionConfig) => CollectionConfig;
401
402
  extendGlobal?: (slug: string, config: GlobalConfig) => GlobalConfig;
@@ -434,6 +435,9 @@ interface KyroConfig {
434
435
  disable?: boolean;
435
436
  indexRoute?: string;
436
437
  components?: Record<string, any>;
438
+ collectionOverrides?: Record<string, Partial<AdminConfig> & {
439
+ fields?: FieldOverrides;
440
+ }>;
437
441
  };
438
442
  upload?: {
439
443
  limits?: {
@@ -458,4 +462,4 @@ interface KyroConfig {
458
462
  debug?: boolean;
459
463
  }
460
464
 
461
- export { type AdminConfig as A, type BaseAdapter as B, type CollectionConfig as C, type DeleteArgs as D, mergeWhereClauses as E, type FindArgs as F, type GlobalConfig as G, type Hook as H, type ImageSize as I, runFieldHooks as J, type KyroConfig as K, runHooks as L, type PluginConfig as P, type Request as R, type UploadConfig as U, type VersionConfig as V, type WhereClause as W, type AuthConfig as a, type FindResult as b, type FindByIDArgs as c, type CreateArgs as d, type UpdateArgs as e, type FindVersionsArgs as f, type VersionRecord as g, type CreateVersionArgs as h, type DraftFindArgs as i, type DraftSnapshot as j, type DraftUpsertArgs as k, type DraftDeleteArgs as l, type User as m, type AccessArgs as n, type AccessControl as o, type AdapterConfig as p, type CollectionAccess as q, type CollectionHooks as r, type CreateResult as s, type FieldAccess as t, type FieldHooks as u, type GlobalAccess as v, type GlobalHooks as w, type HookArgs as x, evaluateAccess as y, getWhereClause as z };
465
+ export { type AdminConfig as A, type BaseAdapter as B, type CollectionConfig as C, type DeleteArgs as D, type FindArgs as F, type GlobalConfig as G, type Hook as H, type ImageSize as I, type KyroConfig as K, type PluginConfig as P, type Request as R, type TenantContext as T, type UploadConfig as U, type VersionConfig as V, type WhereClause as W, type AuthConfig as a, type FindResult as b, type FindByIDArgs as c, type CreateArgs as d, type UpdateArgs as e, type FindVersionsArgs as f, type VersionRecord as g, type CreateVersionArgs as h, type User as i, type AccessArgs as j, type AccessControl as k, type AdapterConfig as l, type CollectionAccess as m, type CollectionHooks as n, type CreateResult as o, type FieldAccess as p, type FieldHooks as q, type GlobalAccess as r, type GlobalHooks as s, type HookArgs as t, evaluateAccess as u, getWhereClause as v, mergeWhereClauses as w, runFieldHooks as x, runHooks as y };
@@ -1,4 +1,4 @@
1
- import { F as Field } from './types-VtjUxIMp.js';
1
+ import { F as Field } from './types-DeSApf9T.cjs';
2
2
 
3
3
  interface Request {
4
4
  body?: any;
@@ -97,6 +97,15 @@ declare function evaluateAccess(access: AccessControl, args: AccessArgs): Promis
97
97
  declare function mergeWhereClauses(...whereClauses: (WhereClause | boolean | undefined)[]): WhereClause;
98
98
  declare function getWhereClause(access: AccessControl, args: AccessArgs): Promise<WhereClause | undefined>;
99
99
 
100
+ interface TenantContext {
101
+ tenantId: string;
102
+ userId: string;
103
+ role?: string;
104
+ roles?: string[];
105
+ permissions?: string[];
106
+ isSuperAdmin?: boolean;
107
+ }
108
+
100
109
  interface AdminConfig {
101
110
  useAsTitle?: string;
102
111
  defaultColumns?: string[];
@@ -115,6 +124,17 @@ interface AdminConfig {
115
124
  };
116
125
  layout?: "split" | "single";
117
126
  }
127
+ /**
128
+ * Field overrides allow modifying specific field properties by path.
129
+ * Path uses dot notation: "fieldName" or "groupField.arrayField.targetField"
130
+ * Commonly used to extend relationship fields with additional collections.
131
+ */
132
+ interface FieldOverrides {
133
+ [fieldPath: string]: {
134
+ relationTo?: string | string[];
135
+ [key: string]: any;
136
+ };
137
+ }
118
138
  interface UploadConfig {
119
139
  staticDir?: string;
120
140
  staticURL?: string;
@@ -287,29 +307,6 @@ interface FindResult<T = any> {
287
307
  prevPage: number | null;
288
308
  nextPage: number | null;
289
309
  }
290
- interface DraftSnapshot<T = Record<string, any>> {
291
- id: string;
292
- collection: string;
293
- documentId: string;
294
- tenantID?: string;
295
- data: T;
296
- baseUpdatedAt?: string | null;
297
- draftUpdatedAt: string;
298
- createdAt: string;
299
- updatedAt: string;
300
- }
301
- interface DraftFindArgs {
302
- collection: string;
303
- documentId: string;
304
- tenantID?: string;
305
- }
306
- interface DraftUpsertArgs<T = Record<string, any>> extends DraftFindArgs {
307
- data: T;
308
- baseUpdatedAt?: string | null;
309
- draftUpdatedAt?: string;
310
- }
311
- interface DraftDeleteArgs extends DraftFindArgs {
312
- }
313
310
  interface CreateResult<T = any> {
314
311
  doc: T;
315
312
  errors?: Array<{
@@ -329,6 +326,7 @@ interface VersionRecord<T = Record<string, any>> {
329
326
  updatedAt: string;
330
327
  publishedAt?: string | null;
331
328
  changeDescription?: string;
329
+ autosave?: boolean;
332
330
  }
333
331
  interface CreateVersionArgs<T = Record<string, any>> {
334
332
  collection: string;
@@ -338,6 +336,8 @@ interface CreateVersionArgs<T = Record<string, any>> {
338
336
  createdBy?: string;
339
337
  changeDescription?: string;
340
338
  tenantID?: string;
339
+ /** When true, reuses a single version slot (find existing + update) */
340
+ autosave?: boolean;
341
341
  }
342
342
  interface FindVersionsArgs {
343
343
  collection: string;
@@ -378,14 +378,14 @@ interface BaseAdapter {
378
378
  keepLatest?: number;
379
379
  tenantID?: string;
380
380
  }): Promise<void>;
381
- findDraft<T = Record<string, any>>(args: DraftFindArgs): Promise<DraftSnapshot<T> | null>;
382
- upsertDraft<T = Record<string, any>>(args: DraftUpsertArgs<T>): Promise<DraftSnapshot<T>>;
383
- deleteDraft(args: DraftDeleteArgs): Promise<void>;
381
+ updateLatestVersion<T = Record<string, any>>(args: CreateVersionArgs<T>): Promise<VersionRecord<T>>;
384
382
  migrate?(): Promise<void>;
385
383
  rollback?(): Promise<void>;
386
384
  connect(): Promise<void>;
387
385
  disconnect(): Promise<void>;
388
386
  transaction?<T>(fn: (tx: any) => Promise<T>): Promise<T>;
387
+ setTenantContext(context: TenantContext | undefined): void;
388
+ getTenantContext(): TenantContext | undefined;
389
389
  }
390
390
  interface AdapterConfig {
391
391
  type: "drizzle" | "mongodb";
@@ -396,6 +396,7 @@ interface AdapterConfig {
396
396
  interface PluginConfig {
397
397
  name: string;
398
398
  version?: string;
399
+ description?: string;
399
400
  init?: (kyro: any) => void | Promise<void>;
400
401
  extendCollection?: (slug: string, config: CollectionConfig) => CollectionConfig;
401
402
  extendGlobal?: (slug: string, config: GlobalConfig) => GlobalConfig;
@@ -434,6 +435,9 @@ interface KyroConfig {
434
435
  disable?: boolean;
435
436
  indexRoute?: string;
436
437
  components?: Record<string, any>;
438
+ collectionOverrides?: Record<string, Partial<AdminConfig> & {
439
+ fields?: FieldOverrides;
440
+ }>;
437
441
  };
438
442
  upload?: {
439
443
  limits?: {
@@ -458,4 +462,4 @@ interface KyroConfig {
458
462
  debug?: boolean;
459
463
  }
460
464
 
461
- export { type AdminConfig as A, type BaseAdapter as B, type CollectionConfig as C, type DeleteArgs as D, mergeWhereClauses as E, type FindArgs as F, type GlobalConfig as G, type Hook as H, type ImageSize as I, runFieldHooks as J, type KyroConfig as K, runHooks as L, type PluginConfig as P, type Request as R, type UploadConfig as U, type VersionConfig as V, type WhereClause as W, type AuthConfig as a, type FindResult as b, type FindByIDArgs as c, type CreateArgs as d, type UpdateArgs as e, type FindVersionsArgs as f, type VersionRecord as g, type CreateVersionArgs as h, type DraftFindArgs as i, type DraftSnapshot as j, type DraftUpsertArgs as k, type DraftDeleteArgs as l, type User as m, type AccessArgs as n, type AccessControl as o, type AdapterConfig as p, type CollectionAccess as q, type CollectionHooks as r, type CreateResult as s, type FieldAccess as t, type FieldHooks as u, type GlobalAccess as v, type GlobalHooks as w, type HookArgs as x, evaluateAccess as y, getWhereClause as z };
465
+ export { type AdminConfig as A, type BaseAdapter as B, type CollectionConfig as C, type DeleteArgs as D, type FindArgs as F, type GlobalConfig as G, type Hook as H, type ImageSize as I, type KyroConfig as K, type PluginConfig as P, type Request as R, type TenantContext as T, type UploadConfig as U, type VersionConfig as V, type WhereClause as W, type AuthConfig as a, type FindResult as b, type FindByIDArgs as c, type CreateArgs as d, type UpdateArgs as e, type FindVersionsArgs as f, type VersionRecord as g, type CreateVersionArgs as h, type User as i, type AccessArgs as j, type AccessControl as k, type AdapterConfig as l, type CollectionAccess as m, type CollectionHooks as n, type CreateResult as o, type FieldAccess as p, type FieldHooks as q, type GlobalAccess as r, type GlobalHooks as s, type HookArgs as t, evaluateAccess as u, getWhereClause as v, mergeWhereClauses as w, runFieldHooks as x, runHooks as y };