@kyro-cms/core 0.12.71 → 0.13.1

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 (252) hide show
  1. package/README.md +150 -76
  2. package/dist/{WebhookService-DQyM9fVo.d.ts → WebhookService-BLi5Rz2m.d.ts} +1 -1
  3. package/dist/{WebhookService-bo1NrgBW.d.cts → WebhookService-BOJMgjBm.d.cts} +1 -1
  4. package/dist/WebhookService-BcuD8tnn.d.cts +143 -0
  5. package/dist/WebhookService-CFe6Zd0_.d.cts +143 -0
  6. package/dist/WebhookService-CGxHtw7E.d.cts +143 -0
  7. package/dist/WebhookService-CNC1lYz7.d.ts +143 -0
  8. package/dist/WebhookService-CVXmjbtQ.d.cts +143 -0
  9. package/dist/WebhookService-D5PSI5t6.d.cts +143 -0
  10. package/dist/WebhookService-DPCCn_12.d.ts +143 -0
  11. package/dist/WebhookService-Dk1lzSrG.d.cts +143 -0
  12. package/dist/WebhookService-Dncnbgm9.d.cts +143 -0
  13. package/dist/WebhookService-I6hdue2Y.d.ts +143 -0
  14. package/dist/WebhookService-KnQ2UDlW.d.ts +143 -0
  15. package/dist/WebhookService-UY5p89Bj.d.ts +143 -0
  16. package/dist/WebhookService-YZXBCRXA.d.ts +143 -0
  17. package/dist/WebhookService-fk0FGRlk.d.ts +143 -0
  18. package/dist/WebhookService-vsFnWrOh.d.ts +143 -0
  19. package/dist/WebhookService-zrDmAx7L.d.cts +143 -0
  20. package/dist/api-handler-graphql.cjs +1 -1
  21. package/dist/api-handler-graphql.js +1 -1
  22. package/dist/api-handler-trpc.cjs +1 -1
  23. package/dist/api-handler-trpc.js +1 -1
  24. package/dist/api-handler.cjs +1 -1
  25. package/dist/api-handler.js +1 -1
  26. package/dist/{base-urWvrsX8.d.cts → base-B--L0lCn.d.cts} +1 -1
  27. package/dist/base-B-i-tjm1.d.ts +218 -0
  28. package/dist/base-B-siit_y.d.cts +218 -0
  29. package/dist/base-B8SyZI4D.d.ts +218 -0
  30. package/dist/base-BCgFt3Yx.d.ts +218 -0
  31. package/dist/base-BHRGJ40F.d.cts +218 -0
  32. package/dist/base-BVoDPNjJ.d.cts +218 -0
  33. package/dist/base-BaOJ5uWd.d.cts +218 -0
  34. package/dist/base-BfPaVEAE.d.cts +218 -0
  35. package/dist/base-BxrX5EPU.d.cts +218 -0
  36. package/dist/base-CAb9EYQs.d.ts +218 -0
  37. package/dist/base-CcZIEll-.d.ts +218 -0
  38. package/dist/base-CyG7aF1e.d.cts +218 -0
  39. package/dist/{base-BcfNgOqZ.d.ts → base-DOImeJ-F.d.ts} +1 -1
  40. package/dist/base-DbnwE42-.d.cts +218 -0
  41. package/dist/base-NyiSsD-n.d.ts +218 -0
  42. package/dist/base-OYfoYPYP.d.ts +218 -0
  43. package/dist/base-xflndGDO.d.ts +218 -0
  44. package/dist/bootstrap-QQ6D3OYG.js +1 -0
  45. package/dist/bootstrap-QVKSKXJF.cjs +1 -0
  46. package/dist/bootstrap-RILR44UM.cjs +1 -0
  47. package/dist/bootstrap-ZRRUPRUR.js +1 -0
  48. package/dist/chunk-262YP5XA.cjs +1 -0
  49. package/dist/chunk-2FSOHXOU.cjs +56 -0
  50. package/dist/chunk-2OS5Y4LE.cjs +1 -0
  51. package/dist/chunk-2PXXQKN3.cjs +3 -0
  52. package/dist/{chunk-K6ZW5M6S.cjs → chunk-355R4LS5.cjs} +3 -3
  53. package/dist/chunk-35IVNLMA.js +122 -0
  54. package/dist/{chunk-FSWDDVLA.js → chunk-3GXLOYM3.js} +1 -1
  55. package/dist/chunk-3KZXF4US.js +2 -0
  56. package/dist/{chunk-H7PC2ENZ.cjs → chunk-3LAWUINR.cjs} +1 -1
  57. package/dist/chunk-3O3AVMWM.cjs +1 -0
  58. package/dist/chunk-3U6MKWET.cjs +120 -0
  59. package/dist/chunk-4BMWWGJN.js +384 -0
  60. package/dist/chunk-5A7E7N4B.cjs +431 -0
  61. package/dist/chunk-6DD4J7LI.js +2 -0
  62. package/dist/chunk-6GGPY7U2.js +4 -0
  63. package/dist/chunk-6MNLRAKM.cjs +121 -0
  64. package/dist/chunk-6NBZDW53.js +133 -0
  65. package/dist/{chunk-2HATK4C5.js → chunk-73Y63IPP.js} +4 -4
  66. package/dist/chunk-7K6ZUNJM.js +4 -0
  67. package/dist/chunk-7NKNSRCB.cjs +448 -0
  68. package/dist/chunk-A3IOQOV6.js +2 -0
  69. package/dist/chunk-A3XVL6ED.cjs +3 -0
  70. package/dist/{chunk-LKQHIOPW.cjs → chunk-APDQ6ZTG.cjs} +1 -1
  71. package/dist/chunk-ATI2UZ7U.js +2 -0
  72. package/dist/chunk-B4AC23SG.js +122 -0
  73. package/dist/chunk-BD6XHMMM.cjs +2 -0
  74. package/dist/chunk-CH4TZZI5.js +449 -0
  75. package/dist/{chunk-26KFM3P6.js → chunk-CNHUCCQJ.js} +1 -1
  76. package/dist/chunk-CRP6PSCE.js +2 -0
  77. package/dist/chunk-DI6TCZSE.js +122 -0
  78. package/dist/chunk-DORUYZQV.cjs +1 -0
  79. package/dist/chunk-E4H3ZZ7U.js +4 -0
  80. package/dist/chunk-EFKEVWAD.js +4 -0
  81. package/dist/chunk-EI7FRSNY.js +57 -0
  82. package/dist/chunk-EON4XLKQ.cjs +1 -0
  83. package/dist/chunk-EUQAOYEO.cjs +121 -0
  84. package/dist/chunk-EVAUBT7H.js +57 -0
  85. package/dist/chunk-EYHD7HZE.cjs +1 -0
  86. package/dist/chunk-EYYIPA5N.js +432 -0
  87. package/dist/chunk-F2O4QO5N.cjs +383 -0
  88. package/dist/chunk-FBWLSWZ4.js +122 -0
  89. package/dist/chunk-FDKU7HJX.js +2 -0
  90. package/dist/chunk-FGN6IMPY.cjs +3 -0
  91. package/dist/chunk-FK2BG4HU.js +3 -0
  92. package/dist/chunk-GV2IB4WQ.cjs +56 -0
  93. package/dist/chunk-GWIZT2P5.js +57 -0
  94. package/dist/chunk-H3FJ54KB.cjs +121 -0
  95. package/dist/chunk-HY3EAWB2.js +4 -0
  96. package/dist/chunk-I6UJVO2P.js +57 -0
  97. package/dist/chunk-IQSF6XRV.js +57 -0
  98. package/dist/chunk-IXGDTAES.js +4 -0
  99. package/dist/chunk-JA44K75G.js +2 -0
  100. package/dist/chunk-JZ7Z6WC2.cjs +3 -0
  101. package/dist/chunk-K5XGP57D.cjs +19 -0
  102. package/dist/chunk-KEITOXIP.js +2 -0
  103. package/dist/chunk-LPFRMQFQ.js +121 -0
  104. package/dist/chunk-LYU44UNN.cjs +56 -0
  105. package/dist/chunk-MDLJTZLV.cjs +1 -0
  106. package/dist/chunk-MFNN5DYG.cjs +1 -0
  107. package/dist/chunk-MJAODEFC.cjs +121 -0
  108. package/dist/chunk-MYHNTJLR.cjs +56 -0
  109. package/dist/chunk-N2YHO2WI.cjs +3 -0
  110. package/dist/chunk-N4FXLQE3.cjs +132 -0
  111. package/dist/chunk-NPBXLPOP.js +3 -0
  112. package/dist/chunk-ON5XJEPO.cjs +3 -0
  113. package/dist/chunk-OT2Z4XBD.cjs +1 -0
  114. package/dist/chunk-PFTBTWSC.cjs +1 -0
  115. package/dist/chunk-PTPVFLET.js +20 -0
  116. package/dist/chunk-PZDLPRJF.js +4 -0
  117. package/dist/chunk-Q5TFO66G.cjs +1 -0
  118. package/dist/chunk-QUTYCUST.js +4 -0
  119. package/dist/chunk-REKKBAQX.cjs +56 -0
  120. package/dist/chunk-REQ622YC.js +3 -0
  121. package/dist/chunk-RTNQP6BV.js +2 -0
  122. package/dist/chunk-RUJW47ZJ.js +2 -0
  123. package/dist/chunk-RXYCFZJC.cjs +121 -0
  124. package/dist/chunk-RYHOWZLK.js +2 -0
  125. package/dist/chunk-S2MZNEBQ.cjs +1 -0
  126. package/dist/chunk-S73YERS2.js +57 -0
  127. package/dist/chunk-SBNMXQNO.cjs +2 -0
  128. package/dist/chunk-SMQ6736Y.js +57 -0
  129. package/dist/chunk-T3DJ3UTP.cjs +121 -0
  130. package/dist/chunk-TJZO7ZSX.cjs +3 -0
  131. package/dist/chunk-TKUNRCRH.js +4 -0
  132. package/dist/chunk-TQLCOMKC.js +4 -0
  133. package/dist/chunk-TRXYDWGE.cjs +1 -0
  134. package/dist/chunk-TS55CUNJ.js +57 -0
  135. package/dist/chunk-UFBJ3WOZ.js +2 -0
  136. package/dist/chunk-UQRVQUVR.js +2 -0
  137. package/dist/chunk-UW5W35NP.js +122 -0
  138. package/dist/chunk-VI7WCO2J.cjs +3 -0
  139. package/dist/chunk-W2GPP6RB.js +122 -0
  140. package/dist/chunk-WHOA7YJU.cjs +1 -0
  141. package/dist/chunk-WNRUPL26.js +2 -0
  142. package/dist/chunk-WXT2XW7T.js +13 -0
  143. package/dist/chunk-XFYSADHV.cjs +2 -0
  144. package/dist/chunk-XIAJQLGS.js +2 -0
  145. package/dist/chunk-XK6UB77Q.js +4 -0
  146. package/dist/chunk-Y2VHO66Q.cjs +3 -0
  147. package/dist/chunk-Y5O2OD7J.cjs +3 -0
  148. package/dist/chunk-YARB43JG.cjs +56 -0
  149. package/dist/chunk-YLCEMVYY.cjs +56 -0
  150. package/dist/chunk-YSOM57GK.cjs +3 -0
  151. package/dist/chunk-Z3UVDGYS.cjs +56 -0
  152. package/dist/chunk-ZTLGK6R4.cjs +12 -0
  153. package/dist/chunk-ZUBJ6RLQ.cjs +1 -0
  154. package/dist/cli/index.cjs +1 -1
  155. package/dist/cli/index.js +1 -1
  156. package/dist/client.cjs +10 -10
  157. package/dist/client.d.cts +1265 -0
  158. package/dist/client.d.ts +1265 -0
  159. package/dist/client.js +10 -10
  160. package/dist/drizzle/index.cjs +1 -1
  161. package/dist/drizzle/index.d.cts +3 -3
  162. package/dist/drizzle/index.d.ts +3 -3
  163. package/dist/drizzle/index.js +1 -1
  164. package/dist/fields/index.cjs +1 -1
  165. package/dist/fields/index.d.cts +2 -2
  166. package/dist/fields/index.d.ts +2 -2
  167. package/dist/fields/index.js +1 -1
  168. package/dist/graphql/index.d.cts +3 -3
  169. package/dist/graphql/index.d.ts +3 -3
  170. package/dist/index-8Ino7vKq.d.ts +105 -0
  171. package/dist/{index-d1m_oup7.d.cts → index-B9BFNOHd.d.cts} +1 -1
  172. package/dist/index-BMcYFpTv.d.cts +105 -0
  173. package/dist/index-BttsFZDa.d.ts +105 -0
  174. package/dist/index-ByOM1Y5x.d.ts +105 -0
  175. package/dist/index-C6xmtRio.d.cts +105 -0
  176. package/dist/index-CTI3K_uq.d.cts +105 -0
  177. package/dist/index-CTL4zv_u.d.ts +105 -0
  178. package/dist/index-CaDbioSg.d.ts +105 -0
  179. package/dist/index-CxA9uOv0.d.ts +105 -0
  180. package/dist/{index-4cH-BjtP.d.ts → index-D6AXbuPI.d.ts} +1 -1
  181. package/dist/index-DF0KDBaM.d.cts +105 -0
  182. package/dist/index-DG4Xu7gA.d.cts +105 -0
  183. package/dist/index-DS3DpJli.d.cts +105 -0
  184. package/dist/index-NGnJpSgf.d.ts +105 -0
  185. package/dist/index-Zrg3sZ6R.d.cts +105 -0
  186. package/dist/index-eHex8Iwj.d.ts +105 -0
  187. package/dist/index-rm7uyOK1.d.cts +105 -0
  188. package/dist/index.cjs +32 -32
  189. package/dist/index.d.cts +73 -11
  190. package/dist/index.d.ts +73 -11
  191. package/dist/index.js +32 -32
  192. package/dist/lib-A2D63VXD.cjs +1 -0
  193. package/dist/lib-JQD2JAOO.js +2 -0
  194. package/dist/local-KR3AIGVA.cjs +1 -0
  195. package/dist/local-T7GISZBL.js +1 -0
  196. package/dist/mongo-auth-adapter-GR2CFFEA.js +1 -0
  197. package/dist/mongo-auth-adapter-UOO2LZUJ.cjs +1 -0
  198. package/dist/mongodb/index.cjs +1 -1
  199. package/dist/mongodb/index.d.cts +4 -3
  200. package/dist/mongodb/index.d.ts +4 -3
  201. package/dist/mongodb/index.js +1 -1
  202. package/dist/nodemailer-transport-3VWVUBM5.cjs +1 -0
  203. package/dist/nodemailer-transport-7RHATUKL.js +1 -0
  204. package/dist/nodemailer-transport-CHO2WKIY.js +1 -0
  205. package/dist/nodemailer-transport-ED2IXNGW.cjs +1 -0
  206. package/dist/rest/index.cjs +1 -1
  207. package/dist/rest/index.d.cts +4 -4
  208. package/dist/rest/index.d.ts +4 -4
  209. package/dist/rest/index.js +1 -1
  210. package/dist/templates/index.cjs +1 -1
  211. package/dist/templates/index.d.cts +2 -2
  212. package/dist/templates/index.d.ts +2 -2
  213. package/dist/templates/index.js +1 -1
  214. package/dist/trpc/index.cjs +1 -1
  215. package/dist/trpc/index.d.cts +3 -3
  216. package/dist/trpc/index.d.ts +3 -3
  217. package/dist/trpc/index.js +1 -1
  218. package/dist/types-6ShQp2EM.d.cts +839 -0
  219. package/dist/types-B5Qz1svz.d.cts +822 -0
  220. package/dist/types-B9oXBEKI.d.cts +330 -0
  221. package/dist/types-B9oXBEKI.d.ts +330 -0
  222. package/dist/types-BCOhfwHC.d.ts +839 -0
  223. package/dist/types-BRDBNacn.d.ts +839 -0
  224. package/dist/types-Bii0bhUV.d.cts +329 -0
  225. package/dist/types-Bii0bhUV.d.ts +329 -0
  226. package/dist/{types-BADIMVGF.d.ts → types-Bt2_ycUO.d.ts} +36 -1
  227. package/dist/types-C4wXHImf.d.ts +822 -0
  228. package/dist/types-C8yIAV6K.d.cts +839 -0
  229. package/dist/types-CORUQhY-.d.ts +839 -0
  230. package/dist/types-Cdssrcbz.d.cts +839 -0
  231. package/dist/types-CjGqxBd3.d.cts +330 -0
  232. package/dist/types-CjGqxBd3.d.ts +330 -0
  233. package/dist/types-DBGR-eQl.d.cts +839 -0
  234. package/dist/types-DCWgPFmi.d.cts +822 -0
  235. package/dist/types-DROqAsr0.d.cts +330 -0
  236. package/dist/types-DROqAsr0.d.ts +330 -0
  237. package/dist/{types-YAVR0H9Z.d.cts → types-DsF64Wrc.d.cts} +36 -1
  238. package/dist/types-DxaK39ix.d.cts +330 -0
  239. package/dist/types-DxaK39ix.d.ts +330 -0
  240. package/dist/types-IeKFn7Ky.d.ts +839 -0
  241. package/dist/types-QglJ7PwT.d.cts +839 -0
  242. package/dist/types-ZrjEVWfi.d.ts +811 -0
  243. package/dist/types-dEy5JxvN.d.ts +822 -0
  244. package/dist/types-tVJc9YbX.d.cts +811 -0
  245. package/dist/types-zt5qIvje.d.ts +839 -0
  246. package/dist/ws/index.cjs +1 -1
  247. package/dist/ws/index.d.cts +121 -1
  248. package/dist/ws/index.d.ts +121 -1
  249. package/dist/ws/index.js +1 -1
  250. package/package.json +2 -2
  251. package/dist/chunk-5M3FKE2V.js +0 -2
  252. package/dist/chunk-WCFHS7EZ.cjs +0 -1
@@ -403,6 +403,9 @@ interface AdminConfig {
403
403
  description?: string;
404
404
  hideAPIURL?: boolean;
405
405
  group?: string;
406
+ folder?: string;
407
+ parentFolder?: string;
408
+ treeHierarchy?: boolean;
406
409
  icon?: string;
407
410
  order?: number;
408
411
  preview?: (doc: Record<string, unknown>, options: {
@@ -417,6 +420,33 @@ interface AdminConfig {
417
420
  };
418
421
  layout?: "split" | "single";
419
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
+ }
420
450
  interface FieldOverrides {
421
451
  [fieldPath: string]: any;
422
452
  }
@@ -520,6 +550,8 @@ interface CollectionConfig {
520
550
  tenantField?: string;
521
551
  upload?: UploadConfig;
522
552
  versions?: VersionConfig;
553
+ folder?: string;
554
+ hierarchy?: HierarchyConfig;
523
555
  auth?: boolean | AuthConfig;
524
556
  graphQL?: {
525
557
  singularName?: string;
@@ -540,6 +572,7 @@ interface CollectionConfig {
540
572
  interface GlobalConfig {
541
573
  slug: string;
542
574
  label?: string;
575
+ folder?: string;
543
576
  admin?: AdminConfig;
544
577
  fields: Field[];
545
578
  access?: GlobalAccess;
@@ -718,6 +751,8 @@ interface AdapterConfig {
718
751
  interface KyroConfig {
719
752
  collections?: CollectionConfig[];
720
753
  globals?: GlobalConfig[];
754
+ projects?: ProjectConfig[];
755
+ organizations?: OrganizationConfig[];
721
756
  adapter: BaseAdapter;
722
757
  storage?: StorageProvider;
723
758
  plugins?: KyroPlugin[];
@@ -773,4 +808,4 @@ interface KyroConfig {
773
808
  debug?: boolean;
774
809
  }
775
810
 
776
- export { runFieldHooks 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 Hook as H, type ImageSize as I, ReviewsPlugin as J, KyroPlugin as K, SEOPlugin as L, type UploadConfig as M, type VersionConfig as N, WishlistPlugin as O, PluginManager as P, evaluateAccess as Q, type Request as R, type StorageConfig as S, type TenantContext as T, type UpdateArgs as U, type VersionRecord as V, type WhereClause as W, getWhereClause as X, mergeWhereClauses as Y, presetPlugins as Z, resolveProvider as _, type StorageProvider as a, runHooks as a0, 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 HookArgs as x, type PluginAPI as y, type PluginHooks as z };
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 };
@@ -0,0 +1,330 @@
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
+ type DeclarativeCondition = {
7
+ /** The field name to evaluate (resolved from root form data, supports dot-notation) */
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
+ /** Show the field when the target field's value is greater than this */
16
+ greaterThan?: number;
17
+ } | {
18
+ and: DeclarativeCondition[];
19
+ } | {
20
+ or: DeclarativeCondition[];
21
+ };
22
+ interface FieldAdmin {
23
+ description?: string;
24
+ placeholder?: string;
25
+ readOnly?: boolean | ((data: Record<string, unknown>, siblingData: Record<string, unknown>) => boolean);
26
+ hidden?: boolean | ((data: Record<string, unknown>, siblingData: Record<string, unknown>) => boolean);
27
+ width?: string;
28
+ position?: "sidebar" | "main";
29
+ autoGenerate?: string;
30
+ action?: string;
31
+ method?: string;
32
+ inline?: boolean;
33
+ compact?: boolean;
34
+ display?: "pills" | "default";
35
+ collapsible?: boolean;
36
+ initCollapsed?: boolean;
37
+ pickerMode?: "drawer" | "dropdown";
38
+ condition?: ((data: Record<string, unknown>, siblingData: Record<string, unknown>) => boolean) | DeclarativeCondition;
39
+ }
40
+ interface FieldAccess {
41
+ read?: (args: {
42
+ user: any;
43
+ req?: Request;
44
+ doc?: any;
45
+ data?: any;
46
+ siblingData?: any;
47
+ }) => boolean | Promise<boolean>;
48
+ update?: (args: {
49
+ user: any;
50
+ req?: Request;
51
+ doc?: any;
52
+ data?: any;
53
+ siblingData?: any;
54
+ }) => boolean | Promise<boolean>;
55
+ create?: (args: {
56
+ user: any;
57
+ req?: Request;
58
+ doc?: any;
59
+ data?: any;
60
+ siblingData?: any;
61
+ }) => boolean | Promise<boolean>;
62
+ }
63
+ interface BaseField {
64
+ name: string;
65
+ label?: string;
66
+ required?: boolean;
67
+ unique?: boolean;
68
+ indexed?: boolean;
69
+ defaultValue?: any;
70
+ admin?: FieldAdmin;
71
+ access?: FieldAccess;
72
+ validate?: (value: any, options: ValidateOptions) => string | true | Promise<string | true>;
73
+ hooks?: {
74
+ beforeValidate?: Hook[];
75
+ beforeChange?: Hook[];
76
+ afterChange?: Hook[];
77
+ afterRead?: Hook[];
78
+ };
79
+ }
80
+ interface ValidateOptions {
81
+ data?: Record<string, any>;
82
+ siblingData?: Record<string, any>;
83
+ user?: unknown;
84
+ operation?: string;
85
+ required?: boolean;
86
+ }
87
+ type Hook = (args: any) => Promise<any> | any;
88
+ type TextFieldVariant = "text" | "email" | "password" | "url" | "id";
89
+ interface TextField extends BaseField {
90
+ type: "text";
91
+ variant?: TextFieldVariant;
92
+ minLength?: number;
93
+ maxLength?: number;
94
+ pattern?: string;
95
+ hasMany?: boolean;
96
+ localized?: boolean;
97
+ }
98
+ interface NumberField extends BaseField {
99
+ type: "number";
100
+ min?: number;
101
+ max?: number;
102
+ step?: number;
103
+ integer?: boolean;
104
+ hasMany?: boolean;
105
+ }
106
+ interface CheckboxField extends BaseField {
107
+ type: "checkbox";
108
+ }
109
+ interface DateField extends BaseField {
110
+ type: "date";
111
+ minDate?: string;
112
+ maxDate?: string;
113
+ time?: boolean;
114
+ }
115
+ interface EmailField extends BaseField {
116
+ type: "email";
117
+ }
118
+ interface PasswordField extends BaseField {
119
+ type: "password";
120
+ }
121
+ interface TextareaField extends BaseField {
122
+ type: "textarea";
123
+ minLength?: number;
124
+ maxLength?: number;
125
+ rows?: number;
126
+ localized?: boolean;
127
+ }
128
+ interface SelectField extends BaseField {
129
+ type: "select";
130
+ options?: Array<{
131
+ label: string;
132
+ value: string;
133
+ }> | ((args: {
134
+ data: any;
135
+ siblingData: any;
136
+ }) => Array<{
137
+ label: string;
138
+ value: string;
139
+ }>);
140
+ dynamicOptions?: string;
141
+ hasMany?: boolean;
142
+ defaultValue?: string | string[];
143
+ }
144
+ interface RadioField extends BaseField {
145
+ type: "radio";
146
+ options: Array<{
147
+ label: string;
148
+ value: string;
149
+ }> | ((args: {
150
+ data: any;
151
+ siblingData: any;
152
+ }) => Array<{
153
+ label: string;
154
+ value: string;
155
+ }>);
156
+ defaultValue?: string;
157
+ }
158
+ interface ColorField extends BaseField {
159
+ type: "color";
160
+ format?: "hex" | "rgb" | "hsl";
161
+ defaultValue?: string;
162
+ }
163
+ interface ImageField extends BaseField {
164
+ type: "image";
165
+ minCount?: number;
166
+ maxCount?: number;
167
+ allowedTypes?: string[];
168
+ maxSize?: number;
169
+ }
170
+ type RichTextBlock = Record<string, any>;
171
+ interface RichTextField extends BaseField {
172
+ type: "richtext";
173
+ defaultValue?: Record<string, any>;
174
+ localized?: boolean;
175
+ }
176
+ interface JSONField extends BaseField {
177
+ type: "json";
178
+ defaultValue?: Record<string, any>;
179
+ }
180
+ interface CodeField extends BaseField {
181
+ type: "code";
182
+ language?: string;
183
+ defaultValue?: string;
184
+ }
185
+ interface UploadField extends BaseField {
186
+ type: "upload";
187
+ relationTo: string;
188
+ hasMany?: boolean;
189
+ maxDepth?: number;
190
+ defaultValue?: string;
191
+ }
192
+ interface MarkdownField extends BaseField {
193
+ type: "markdown";
194
+ localized?: boolean;
195
+ defaultValue?: string;
196
+ }
197
+ interface RelationshipField extends BaseField {
198
+ type: "relationship";
199
+ /**
200
+ * The collection slug(s) to relate to.
201
+ * Use "*" to allow relating to ANY registered collection.
202
+ */
203
+ relationTo: string | string[];
204
+ hasMany?: boolean;
205
+ maxDepth?: number;
206
+ filterOptions?: (args: {
207
+ data: any;
208
+ user: any;
209
+ }) => Record<string, any>;
210
+ defaultValue?: string | string[];
211
+ }
212
+ interface ArrayField extends BaseField {
213
+ type: "array";
214
+ fields: Field[];
215
+ minRows?: number;
216
+ maxRows?: number;
217
+ labels?: {
218
+ singular?: string;
219
+ plural?: string;
220
+ };
221
+ defaultValue?: Record<string, any>[];
222
+ }
223
+ interface ListField extends BaseField {
224
+ type: "list";
225
+ defaultValue?: string[];
226
+ }
227
+ interface GroupField extends BaseField {
228
+ type: "group";
229
+ fields: Field[];
230
+ defaultValue?: Record<string, any>;
231
+ }
232
+ interface BlockImage {
233
+ url: string;
234
+ alt?: string;
235
+ }
236
+ interface BlockAdmin {
237
+ group?: string;
238
+ description?: string;
239
+ images?: {
240
+ icon?: BlockImage | string;
241
+ thumbnail?: BlockImage | string;
242
+ };
243
+ }
244
+ interface Block {
245
+ slug: string;
246
+ label: string;
247
+ fields: Field[];
248
+ imageURL?: string;
249
+ admin?: BlockAdmin;
250
+ }
251
+ interface BlocksField extends BaseField {
252
+ type: "blocks";
253
+ blocks?: Block[];
254
+ minRows?: number;
255
+ maxRows?: number;
256
+ defaultValue?: Array<{
257
+ blockType: string;
258
+ [key: string]: any;
259
+ }>;
260
+ }
261
+ interface RowField extends Omit<BaseField, "name"> {
262
+ type: "row";
263
+ fields: Field[];
264
+ name?: string;
265
+ }
266
+ interface CollapsibleField extends Omit<BaseField, "name"> {
267
+ type: "collapsible";
268
+ fields: Field[];
269
+ label: string;
270
+ name?: string;
271
+ }
272
+ interface TabsField extends Omit<BaseField, "name"> {
273
+ type: "tabs";
274
+ tabs: Array<{
275
+ label: string;
276
+ fields: Field[];
277
+ name?: string;
278
+ }>;
279
+ name?: string;
280
+ }
281
+ interface ButtonField extends BaseField {
282
+ type: "button";
283
+ label: string;
284
+ action?: string;
285
+ method?: string;
286
+ inline?: boolean;
287
+ }
288
+ interface ActionField extends BaseField {
289
+ type: "action";
290
+ label: string;
291
+ action?: string;
292
+ method?: string;
293
+ inline?: boolean;
294
+ }
295
+ interface SecretField extends BaseField {
296
+ type: "secret";
297
+ }
298
+ interface IconField extends BaseField {
299
+ type: "icon";
300
+ }
301
+ interface EmbeddingField extends BaseField {
302
+ type: "embedding";
303
+ sourceField: string;
304
+ provider?: "openai" | "cohere" | "groq" | "local-fastembed";
305
+ model?: string;
306
+ dimensions?: number;
307
+ }
308
+ 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 | IconField | EmbeddingField;
309
+ type FieldType = Field["type"];
310
+ declare function isTextField(field: Field): field is TextField;
311
+ declare function isNumberField(field: Field): field is NumberField;
312
+ declare function isRelationshipField(field: Field): field is RelationshipField;
313
+ declare function isArrayField(field: Field): field is ArrayField;
314
+ declare function isGroupField(field: Field): field is GroupField;
315
+ declare function isBlocksField(field: Field): field is BlocksField;
316
+ declare function isUploadField(field: Field): field is UploadField;
317
+ declare function isImageField(field: Field): field is ImageField;
318
+ declare function isRichTextField(field: Field): field is RichTextField;
319
+ declare function isSelectField(field: Field): field is SelectField;
320
+ declare function isLayoutField(field: Field): field is RowField | CollapsibleField | TabsField;
321
+ declare function isIconField(field: Field): field is IconField;
322
+ declare function isEmbeddingField(field: Field): field is EmbeddingField;
323
+ declare const PRIMITIVE_FIELD_TYPES: readonly ["text", "number", "checkbox", "date", "email", "password", "textarea", "select", "radio", "color", "icon"];
324
+ declare const COMPLEX_FIELD_TYPES: readonly ["richtext", "json", "code", "upload", "image", "markdown", "embedding"];
325
+ declare const RELATIONAL_FIELD_TYPES: readonly ["relationship", "array", "group", "blocks"];
326
+ declare const LAYOUT_FIELD_TYPES: readonly ["row", "collapsible", "tabs"];
327
+ declare const ALL_FIELD_TYPES: readonly ["text", "number", "checkbox", "date", "email", "password", "textarea", "select", "radio", "color", "icon", "richtext", "json", "code", "upload", "image", "markdown", "embedding", "relationship", "array", "group", "blocks", "row", "collapsible", "tabs"];
328
+ declare function createRelationshipFieldConfig(name: string, relationTo: string | string[], options?: Partial<Omit<RelationshipField, "type" | "name" | "relationTo">>): RelationshipField;
329
+
330
+ export { isImageField as $, ALL_FIELD_TYPES as A, type BaseField as B, COMPLEX_FIELD_TYPES as C, type DateField as D, type EmailField as E, type Field as F, type GroupField as G, type Hook as H, type IconField as I, type JSONField as J, type TextFieldVariant as K, LAYOUT_FIELD_TYPES as L, type MarkdownField as M, type NumberField as N, type TextareaField as O, PRIMITIVE_FIELD_TYPES as P, createRelationshipFieldConfig as Q, RELATIONAL_FIELD_TYPES as R, type SecretField as S, type TabsField as T, type UploadField as U, type ValidateOptions as V, isArrayField as W, isBlocksField as X, isEmbeddingField as Y, isGroupField as Z, isIconField as _, type ActionField as a, isLayoutField as a0, isNumberField as a1, isRelationshipField as a2, isRichTextField as a3, isSelectField as a4, isTextField as a5, isUploadField as a6, type ArrayField as b, type Block as c, type BlockAdmin as d, type BlockImage as e, type BlocksField as f, type ButtonField as g, type CheckboxField as h, type CodeField as i, type CollapsibleField as j, type ColorField as k, type DeclarativeCondition as l, type EmbeddingField as m, type FieldAccess as n, type FieldAdmin as o, type FieldType as p, type ImageField as q, type ListField as r, type PasswordField as s, type RadioField as t, type RelationshipField as u, type RichTextBlock as v, type RichTextField as w, type RowField as x, type SelectField as y, type TextField as z };