@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
@@ -0,0 +1,329 @@
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
+ collapsible?: boolean;
35
+ initCollapsed?: boolean;
36
+ pickerMode?: "drawer" | "dropdown";
37
+ condition?: ((data: Record<string, unknown>, siblingData: Record<string, unknown>) => boolean) | DeclarativeCondition;
38
+ }
39
+ interface FieldAccess {
40
+ read?: (args: {
41
+ user: any;
42
+ req?: Request;
43
+ doc?: any;
44
+ data?: any;
45
+ siblingData?: any;
46
+ }) => boolean | Promise<boolean>;
47
+ update?: (args: {
48
+ user: any;
49
+ req?: Request;
50
+ doc?: any;
51
+ data?: any;
52
+ siblingData?: any;
53
+ }) => boolean | Promise<boolean>;
54
+ create?: (args: {
55
+ user: any;
56
+ req?: Request;
57
+ doc?: any;
58
+ data?: any;
59
+ siblingData?: any;
60
+ }) => boolean | Promise<boolean>;
61
+ }
62
+ interface BaseField {
63
+ name: string;
64
+ label?: string;
65
+ required?: boolean;
66
+ unique?: boolean;
67
+ indexed?: boolean;
68
+ defaultValue?: any;
69
+ admin?: FieldAdmin;
70
+ access?: FieldAccess;
71
+ validate?: (value: any, options: ValidateOptions) => string | true | Promise<string | true>;
72
+ hooks?: {
73
+ beforeValidate?: Hook[];
74
+ beforeChange?: Hook[];
75
+ afterChange?: Hook[];
76
+ afterRead?: Hook[];
77
+ };
78
+ }
79
+ interface ValidateOptions {
80
+ data?: Record<string, any>;
81
+ siblingData?: Record<string, any>;
82
+ user?: unknown;
83
+ operation?: string;
84
+ required?: boolean;
85
+ }
86
+ type Hook = (args: any) => Promise<any> | any;
87
+ type TextFieldVariant = "text" | "email" | "password" | "url" | "id";
88
+ interface TextField extends BaseField {
89
+ type: "text";
90
+ variant?: TextFieldVariant;
91
+ minLength?: number;
92
+ maxLength?: number;
93
+ pattern?: string;
94
+ hasMany?: boolean;
95
+ localized?: boolean;
96
+ }
97
+ interface NumberField extends BaseField {
98
+ type: "number";
99
+ min?: number;
100
+ max?: number;
101
+ step?: number;
102
+ integer?: boolean;
103
+ hasMany?: boolean;
104
+ }
105
+ interface CheckboxField extends BaseField {
106
+ type: "checkbox";
107
+ }
108
+ interface DateField extends BaseField {
109
+ type: "date";
110
+ minDate?: string;
111
+ maxDate?: string;
112
+ time?: boolean;
113
+ }
114
+ interface EmailField extends BaseField {
115
+ type: "email";
116
+ }
117
+ interface PasswordField extends BaseField {
118
+ type: "password";
119
+ }
120
+ interface TextareaField extends BaseField {
121
+ type: "textarea";
122
+ minLength?: number;
123
+ maxLength?: number;
124
+ rows?: number;
125
+ localized?: boolean;
126
+ }
127
+ interface SelectField extends BaseField {
128
+ type: "select";
129
+ options?: Array<{
130
+ label: string;
131
+ value: string;
132
+ }> | ((args: {
133
+ data: any;
134
+ siblingData: any;
135
+ }) => Array<{
136
+ label: string;
137
+ value: string;
138
+ }>);
139
+ dynamicOptions?: string;
140
+ hasMany?: boolean;
141
+ defaultValue?: string | string[];
142
+ }
143
+ interface RadioField extends BaseField {
144
+ type: "radio";
145
+ options: Array<{
146
+ label: string;
147
+ value: string;
148
+ }> | ((args: {
149
+ data: any;
150
+ siblingData: any;
151
+ }) => Array<{
152
+ label: string;
153
+ value: string;
154
+ }>);
155
+ defaultValue?: string;
156
+ }
157
+ interface ColorField extends BaseField {
158
+ type: "color";
159
+ format?: "hex" | "rgb" | "hsl";
160
+ defaultValue?: string;
161
+ }
162
+ interface ImageField extends BaseField {
163
+ type: "image";
164
+ minCount?: number;
165
+ maxCount?: number;
166
+ allowedTypes?: string[];
167
+ maxSize?: number;
168
+ }
169
+ type RichTextBlock = Record<string, any>;
170
+ interface RichTextField extends BaseField {
171
+ type: "richtext";
172
+ defaultValue?: Record<string, any>;
173
+ localized?: boolean;
174
+ }
175
+ interface JSONField extends BaseField {
176
+ type: "json";
177
+ defaultValue?: Record<string, any>;
178
+ }
179
+ interface CodeField extends BaseField {
180
+ type: "code";
181
+ language?: string;
182
+ defaultValue?: string;
183
+ }
184
+ interface UploadField extends BaseField {
185
+ type: "upload";
186
+ relationTo: string;
187
+ hasMany?: boolean;
188
+ maxDepth?: number;
189
+ defaultValue?: string;
190
+ }
191
+ interface MarkdownField extends BaseField {
192
+ type: "markdown";
193
+ localized?: boolean;
194
+ defaultValue?: string;
195
+ }
196
+ interface RelationshipField extends BaseField {
197
+ type: "relationship";
198
+ /**
199
+ * The collection slug(s) to relate to.
200
+ * Use "*" to allow relating to ANY registered collection.
201
+ */
202
+ relationTo: string | string[];
203
+ hasMany?: boolean;
204
+ maxDepth?: number;
205
+ filterOptions?: (args: {
206
+ data: any;
207
+ user: any;
208
+ }) => Record<string, any>;
209
+ defaultValue?: string | string[];
210
+ }
211
+ interface ArrayField extends BaseField {
212
+ type: "array";
213
+ fields: Field[];
214
+ minRows?: number;
215
+ maxRows?: number;
216
+ labels?: {
217
+ singular?: string;
218
+ plural?: string;
219
+ };
220
+ defaultValue?: Record<string, any>[];
221
+ }
222
+ interface ListField extends BaseField {
223
+ type: "list";
224
+ defaultValue?: string[];
225
+ }
226
+ interface GroupField extends BaseField {
227
+ type: "group";
228
+ fields: Field[];
229
+ defaultValue?: Record<string, any>;
230
+ }
231
+ interface BlockImage {
232
+ url: string;
233
+ alt?: string;
234
+ }
235
+ interface BlockAdmin {
236
+ group?: string;
237
+ description?: string;
238
+ images?: {
239
+ icon?: BlockImage | string;
240
+ thumbnail?: BlockImage | string;
241
+ };
242
+ }
243
+ interface Block {
244
+ slug: string;
245
+ label: string;
246
+ fields: Field[];
247
+ imageURL?: string;
248
+ admin?: BlockAdmin;
249
+ }
250
+ interface BlocksField extends BaseField {
251
+ type: "blocks";
252
+ blocks?: Block[];
253
+ minRows?: number;
254
+ maxRows?: number;
255
+ defaultValue?: Array<{
256
+ blockType: string;
257
+ [key: string]: any;
258
+ }>;
259
+ }
260
+ interface RowField extends Omit<BaseField, "name"> {
261
+ type: "row";
262
+ fields: Field[];
263
+ name?: string;
264
+ }
265
+ interface CollapsibleField extends Omit<BaseField, "name"> {
266
+ type: "collapsible";
267
+ fields: Field[];
268
+ label: string;
269
+ name?: string;
270
+ }
271
+ interface TabsField extends Omit<BaseField, "name"> {
272
+ type: "tabs";
273
+ tabs: Array<{
274
+ label: string;
275
+ fields: Field[];
276
+ name?: string;
277
+ }>;
278
+ name?: string;
279
+ }
280
+ interface ButtonField extends BaseField {
281
+ type: "button";
282
+ label: string;
283
+ action?: string;
284
+ method?: string;
285
+ inline?: boolean;
286
+ }
287
+ interface ActionField extends BaseField {
288
+ type: "action";
289
+ label: string;
290
+ action?: string;
291
+ method?: string;
292
+ inline?: boolean;
293
+ }
294
+ interface SecretField extends BaseField {
295
+ type: "secret";
296
+ }
297
+ interface IconField extends BaseField {
298
+ type: "icon";
299
+ }
300
+ interface EmbeddingField extends BaseField {
301
+ type: "embedding";
302
+ sourceField: string;
303
+ provider?: "openai" | "cohere" | "groq" | "local-fastembed";
304
+ model?: string;
305
+ dimensions?: number;
306
+ }
307
+ 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;
308
+ type FieldType = Field["type"];
309
+ declare function isTextField(field: Field): field is TextField;
310
+ declare function isNumberField(field: Field): field is NumberField;
311
+ declare function isRelationshipField(field: Field): field is RelationshipField;
312
+ declare function isArrayField(field: Field): field is ArrayField;
313
+ declare function isGroupField(field: Field): field is GroupField;
314
+ declare function isBlocksField(field: Field): field is BlocksField;
315
+ declare function isUploadField(field: Field): field is UploadField;
316
+ declare function isImageField(field: Field): field is ImageField;
317
+ declare function isRichTextField(field: Field): field is RichTextField;
318
+ declare function isSelectField(field: Field): field is SelectField;
319
+ declare function isLayoutField(field: Field): field is RowField | CollapsibleField | TabsField;
320
+ declare function isIconField(field: Field): field is IconField;
321
+ declare function isEmbeddingField(field: Field): field is EmbeddingField;
322
+ declare const PRIMITIVE_FIELD_TYPES: readonly ["text", "number", "checkbox", "date", "email", "password", "textarea", "select", "radio", "color", "icon"];
323
+ declare const COMPLEX_FIELD_TYPES: readonly ["richtext", "json", "code", "upload", "image", "markdown", "embedding"];
324
+ declare const RELATIONAL_FIELD_TYPES: readonly ["relationship", "array", "group", "blocks"];
325
+ declare const LAYOUT_FIELD_TYPES: readonly ["row", "collapsible", "tabs"];
326
+ 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"];
327
+ declare function createRelationshipFieldConfig(name: string, relationTo: string | string[], options?: Partial<Omit<RelationshipField, "type" | "name" | "relationTo">>): RelationshipField;
328
+
329
+ 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 };
@@ -0,0 +1,329 @@
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
+ collapsible?: boolean;
35
+ initCollapsed?: boolean;
36
+ pickerMode?: "drawer" | "dropdown";
37
+ condition?: ((data: Record<string, unknown>, siblingData: Record<string, unknown>) => boolean) | DeclarativeCondition;
38
+ }
39
+ interface FieldAccess {
40
+ read?: (args: {
41
+ user: any;
42
+ req?: Request;
43
+ doc?: any;
44
+ data?: any;
45
+ siblingData?: any;
46
+ }) => boolean | Promise<boolean>;
47
+ update?: (args: {
48
+ user: any;
49
+ req?: Request;
50
+ doc?: any;
51
+ data?: any;
52
+ siblingData?: any;
53
+ }) => boolean | Promise<boolean>;
54
+ create?: (args: {
55
+ user: any;
56
+ req?: Request;
57
+ doc?: any;
58
+ data?: any;
59
+ siblingData?: any;
60
+ }) => boolean | Promise<boolean>;
61
+ }
62
+ interface BaseField {
63
+ name: string;
64
+ label?: string;
65
+ required?: boolean;
66
+ unique?: boolean;
67
+ indexed?: boolean;
68
+ defaultValue?: any;
69
+ admin?: FieldAdmin;
70
+ access?: FieldAccess;
71
+ validate?: (value: any, options: ValidateOptions) => string | true | Promise<string | true>;
72
+ hooks?: {
73
+ beforeValidate?: Hook[];
74
+ beforeChange?: Hook[];
75
+ afterChange?: Hook[];
76
+ afterRead?: Hook[];
77
+ };
78
+ }
79
+ interface ValidateOptions {
80
+ data?: Record<string, any>;
81
+ siblingData?: Record<string, any>;
82
+ user?: unknown;
83
+ operation?: string;
84
+ required?: boolean;
85
+ }
86
+ type Hook = (args: any) => Promise<any> | any;
87
+ type TextFieldVariant = "text" | "email" | "password" | "url" | "id";
88
+ interface TextField extends BaseField {
89
+ type: "text";
90
+ variant?: TextFieldVariant;
91
+ minLength?: number;
92
+ maxLength?: number;
93
+ pattern?: string;
94
+ hasMany?: boolean;
95
+ localized?: boolean;
96
+ }
97
+ interface NumberField extends BaseField {
98
+ type: "number";
99
+ min?: number;
100
+ max?: number;
101
+ step?: number;
102
+ integer?: boolean;
103
+ hasMany?: boolean;
104
+ }
105
+ interface CheckboxField extends BaseField {
106
+ type: "checkbox";
107
+ }
108
+ interface DateField extends BaseField {
109
+ type: "date";
110
+ minDate?: string;
111
+ maxDate?: string;
112
+ time?: boolean;
113
+ }
114
+ interface EmailField extends BaseField {
115
+ type: "email";
116
+ }
117
+ interface PasswordField extends BaseField {
118
+ type: "password";
119
+ }
120
+ interface TextareaField extends BaseField {
121
+ type: "textarea";
122
+ minLength?: number;
123
+ maxLength?: number;
124
+ rows?: number;
125
+ localized?: boolean;
126
+ }
127
+ interface SelectField extends BaseField {
128
+ type: "select";
129
+ options?: Array<{
130
+ label: string;
131
+ value: string;
132
+ }> | ((args: {
133
+ data: any;
134
+ siblingData: any;
135
+ }) => Array<{
136
+ label: string;
137
+ value: string;
138
+ }>);
139
+ dynamicOptions?: string;
140
+ hasMany?: boolean;
141
+ defaultValue?: string | string[];
142
+ }
143
+ interface RadioField extends BaseField {
144
+ type: "radio";
145
+ options: Array<{
146
+ label: string;
147
+ value: string;
148
+ }> | ((args: {
149
+ data: any;
150
+ siblingData: any;
151
+ }) => Array<{
152
+ label: string;
153
+ value: string;
154
+ }>);
155
+ defaultValue?: string;
156
+ }
157
+ interface ColorField extends BaseField {
158
+ type: "color";
159
+ format?: "hex" | "rgb" | "hsl";
160
+ defaultValue?: string;
161
+ }
162
+ interface ImageField extends BaseField {
163
+ type: "image";
164
+ minCount?: number;
165
+ maxCount?: number;
166
+ allowedTypes?: string[];
167
+ maxSize?: number;
168
+ }
169
+ type RichTextBlock = Record<string, any>;
170
+ interface RichTextField extends BaseField {
171
+ type: "richtext";
172
+ defaultValue?: Record<string, any>;
173
+ localized?: boolean;
174
+ }
175
+ interface JSONField extends BaseField {
176
+ type: "json";
177
+ defaultValue?: Record<string, any>;
178
+ }
179
+ interface CodeField extends BaseField {
180
+ type: "code";
181
+ language?: string;
182
+ defaultValue?: string;
183
+ }
184
+ interface UploadField extends BaseField {
185
+ type: "upload";
186
+ relationTo: string;
187
+ hasMany?: boolean;
188
+ maxDepth?: number;
189
+ defaultValue?: string;
190
+ }
191
+ interface MarkdownField extends BaseField {
192
+ type: "markdown";
193
+ localized?: boolean;
194
+ defaultValue?: string;
195
+ }
196
+ interface RelationshipField extends BaseField {
197
+ type: "relationship";
198
+ /**
199
+ * The collection slug(s) to relate to.
200
+ * Use "*" to allow relating to ANY registered collection.
201
+ */
202
+ relationTo: string | string[];
203
+ hasMany?: boolean;
204
+ maxDepth?: number;
205
+ filterOptions?: (args: {
206
+ data: any;
207
+ user: any;
208
+ }) => Record<string, any>;
209
+ defaultValue?: string | string[];
210
+ }
211
+ interface ArrayField extends BaseField {
212
+ type: "array";
213
+ fields: Field[];
214
+ minRows?: number;
215
+ maxRows?: number;
216
+ labels?: {
217
+ singular?: string;
218
+ plural?: string;
219
+ };
220
+ defaultValue?: Record<string, any>[];
221
+ }
222
+ interface ListField extends BaseField {
223
+ type: "list";
224
+ defaultValue?: string[];
225
+ }
226
+ interface GroupField extends BaseField {
227
+ type: "group";
228
+ fields: Field[];
229
+ defaultValue?: Record<string, any>;
230
+ }
231
+ interface BlockImage {
232
+ url: string;
233
+ alt?: string;
234
+ }
235
+ interface BlockAdmin {
236
+ group?: string;
237
+ description?: string;
238
+ images?: {
239
+ icon?: BlockImage | string;
240
+ thumbnail?: BlockImage | string;
241
+ };
242
+ }
243
+ interface Block {
244
+ slug: string;
245
+ label: string;
246
+ fields: Field[];
247
+ imageURL?: string;
248
+ admin?: BlockAdmin;
249
+ }
250
+ interface BlocksField extends BaseField {
251
+ type: "blocks";
252
+ blocks?: Block[];
253
+ minRows?: number;
254
+ maxRows?: number;
255
+ defaultValue?: Array<{
256
+ blockType: string;
257
+ [key: string]: any;
258
+ }>;
259
+ }
260
+ interface RowField extends Omit<BaseField, "name"> {
261
+ type: "row";
262
+ fields: Field[];
263
+ name?: string;
264
+ }
265
+ interface CollapsibleField extends Omit<BaseField, "name"> {
266
+ type: "collapsible";
267
+ fields: Field[];
268
+ label: string;
269
+ name?: string;
270
+ }
271
+ interface TabsField extends Omit<BaseField, "name"> {
272
+ type: "tabs";
273
+ tabs: Array<{
274
+ label: string;
275
+ fields: Field[];
276
+ name?: string;
277
+ }>;
278
+ name?: string;
279
+ }
280
+ interface ButtonField extends BaseField {
281
+ type: "button";
282
+ label: string;
283
+ action?: string;
284
+ method?: string;
285
+ inline?: boolean;
286
+ }
287
+ interface ActionField extends BaseField {
288
+ type: "action";
289
+ label: string;
290
+ action?: string;
291
+ method?: string;
292
+ inline?: boolean;
293
+ }
294
+ interface SecretField extends BaseField {
295
+ type: "secret";
296
+ }
297
+ interface IconField extends BaseField {
298
+ type: "icon";
299
+ }
300
+ interface EmbeddingField extends BaseField {
301
+ type: "embedding";
302
+ sourceField: string;
303
+ provider?: "openai" | "cohere" | "groq" | "local-fastembed";
304
+ model?: string;
305
+ dimensions?: number;
306
+ }
307
+ 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;
308
+ type FieldType = Field["type"];
309
+ declare function isTextField(field: Field): field is TextField;
310
+ declare function isNumberField(field: Field): field is NumberField;
311
+ declare function isRelationshipField(field: Field): field is RelationshipField;
312
+ declare function isArrayField(field: Field): field is ArrayField;
313
+ declare function isGroupField(field: Field): field is GroupField;
314
+ declare function isBlocksField(field: Field): field is BlocksField;
315
+ declare function isUploadField(field: Field): field is UploadField;
316
+ declare function isImageField(field: Field): field is ImageField;
317
+ declare function isRichTextField(field: Field): field is RichTextField;
318
+ declare function isSelectField(field: Field): field is SelectField;
319
+ declare function isLayoutField(field: Field): field is RowField | CollapsibleField | TabsField;
320
+ declare function isIconField(field: Field): field is IconField;
321
+ declare function isEmbeddingField(field: Field): field is EmbeddingField;
322
+ declare const PRIMITIVE_FIELD_TYPES: readonly ["text", "number", "checkbox", "date", "email", "password", "textarea", "select", "radio", "color", "icon"];
323
+ declare const COMPLEX_FIELD_TYPES: readonly ["richtext", "json", "code", "upload", "image", "markdown", "embedding"];
324
+ declare const RELATIONAL_FIELD_TYPES: readonly ["relationship", "array", "group", "blocks"];
325
+ declare const LAYOUT_FIELD_TYPES: readonly ["row", "collapsible", "tabs"];
326
+ 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"];
327
+ declare function createRelationshipFieldConfig(name: string, relationTo: string | string[], options?: Partial<Omit<RelationshipField, "type" | "name" | "relationTo">>): RelationshipField;
328
+
329
+ 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 };