@kyro-cms/core 0.13.3 → 0.13.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (266) hide show
  1. package/dist/{WebhookService-BOJMgjBm.d.cts → WebhookService-BJTCP3cU.d.cts} +1 -1
  2. package/dist/{WebhookService-BLi5Rz2m.d.ts → WebhookService-Bqr_66lK.d.ts} +1 -1
  3. package/dist/api-handler-graphql.cjs +1 -1
  4. package/dist/api-handler-graphql.js +1 -1
  5. package/dist/api-handler-trpc.cjs +1 -1
  6. package/dist/api-handler-trpc.js +1 -1
  7. package/dist/api-handler.cjs +1 -1
  8. package/dist/api-handler.js +1 -1
  9. package/dist/{base-BCgFt3Yx.d.ts → base-C2DOe8wD.d.ts} +3 -2
  10. package/dist/{base-B-i-tjm1.d.ts → base-DIpT2Vuz.d.cts} +3 -2
  11. package/dist/chunk-2TYITUOC.js +122 -0
  12. package/dist/{chunk-K73HOMQY.cjs → chunk-3CIMGC2F.cjs} +3 -3
  13. package/dist/{chunk-DSHKQL3R.cjs → chunk-6YS6XLOD.cjs} +13 -13
  14. package/dist/{chunk-ELFQKQLL.js → chunk-ALTU3FDG.js} +1 -1
  15. package/dist/{chunk-O7CBGP4N.cjs → chunk-LKRI5X2V.cjs} +1 -1
  16. package/dist/{chunk-22RXJ442.js → chunk-YIFKTA5N.js} +1 -1
  17. package/dist/cli/index.cjs +86 -86
  18. package/dist/cli/index.js +87 -87
  19. package/dist/client.d.cts +25 -0
  20. package/dist/client.d.ts +25 -0
  21. package/dist/drizzle/index.d.cts +3 -3
  22. package/dist/drizzle/index.d.ts +3 -3
  23. package/dist/fields/index.d.cts +2 -2
  24. package/dist/fields/index.d.ts +2 -2
  25. package/dist/graphql/index.d.cts +3 -3
  26. package/dist/graphql/index.d.ts +3 -3
  27. package/dist/{index-BttsFZDa.d.ts → index-C9uBoJtm.d.ts} +2 -2
  28. package/dist/{index-8Ino7vKq.d.ts → index-Ci7aUrmN.d.cts} +2 -2
  29. package/dist/index.cjs +4 -4
  30. package/dist/index.d.cts +10 -10
  31. package/dist/index.d.ts +10 -10
  32. package/dist/index.js +3 -3
  33. package/dist/mongodb/index.d.cts +3 -3
  34. package/dist/mongodb/index.d.ts +3 -3
  35. package/dist/rest/index.cjs +1 -1
  36. package/dist/rest/index.d.cts +4 -4
  37. package/dist/rest/index.d.ts +4 -4
  38. package/dist/rest/index.js +1 -1
  39. package/dist/templates/index.d.cts +2 -2
  40. package/dist/templates/index.d.ts +2 -2
  41. package/dist/trpc/index.d.cts +3 -3
  42. package/dist/trpc/index.d.ts +3 -3
  43. package/dist/{types-Bii0bhUV.d.ts → types-C3QFX0l6.d.cts} +5 -0
  44. package/dist/{types-B9oXBEKI.d.cts → types-C3QFX0l6.d.ts} +5 -1
  45. package/dist/{types-Cdssrcbz.d.cts → types-CKWnrUAh.d.ts} +23 -2
  46. package/dist/{types-BRDBNacn.d.ts → types-CdwfDpyW.d.cts} +23 -2
  47. package/package.json +2 -2
  48. package/dist/WebhookService-BcuD8tnn.d.cts +0 -143
  49. package/dist/WebhookService-CFe6Zd0_.d.cts +0 -143
  50. package/dist/WebhookService-CVXmjbtQ.d.cts +0 -143
  51. package/dist/WebhookService-D5PSI5t6.d.cts +0 -143
  52. package/dist/WebhookService-DPCCn_12.d.ts +0 -143
  53. package/dist/WebhookService-Dk1lzSrG.d.cts +0 -143
  54. package/dist/WebhookService-Dncnbgm9.d.cts +0 -143
  55. package/dist/WebhookService-I6hdue2Y.d.ts +0 -143
  56. package/dist/WebhookService-KnQ2UDlW.d.ts +0 -143
  57. package/dist/WebhookService-UY5p89Bj.d.ts +0 -143
  58. package/dist/WebhookService-YZXBCRXA.d.ts +0 -143
  59. package/dist/WebhookService-fk0FGRlk.d.ts +0 -143
  60. package/dist/WebhookService-vsFnWrOh.d.ts +0 -143
  61. package/dist/WebhookService-zrDmAx7L.d.cts +0 -143
  62. package/dist/base-B--L0lCn.d.cts +0 -218
  63. package/dist/base-B-siit_y.d.cts +0 -218
  64. package/dist/base-B8SyZI4D.d.ts +0 -218
  65. package/dist/base-BHRGJ40F.d.cts +0 -218
  66. package/dist/base-BVoDPNjJ.d.cts +0 -218
  67. package/dist/base-BaOJ5uWd.d.cts +0 -218
  68. package/dist/base-BfPaVEAE.d.cts +0 -218
  69. package/dist/base-BxrX5EPU.d.cts +0 -218
  70. package/dist/base-CAb9EYQs.d.ts +0 -218
  71. package/dist/base-CcZIEll-.d.ts +0 -218
  72. package/dist/base-CyG7aF1e.d.cts +0 -218
  73. package/dist/base-DOImeJ-F.d.ts +0 -218
  74. package/dist/base-DbnwE42-.d.cts +0 -218
  75. package/dist/base-NyiSsD-n.d.ts +0 -218
  76. package/dist/base-OYfoYPYP.d.ts +0 -218
  77. package/dist/base-xflndGDO.d.ts +0 -218
  78. package/dist/bootstrap-E24SGUJP.cjs +0 -1
  79. package/dist/bootstrap-QQ6D3OYG.js +0 -1
  80. package/dist/bootstrap-QVKSKXJF.cjs +0 -1
  81. package/dist/bootstrap-RILR44UM.cjs +0 -1
  82. package/dist/bootstrap-YFVE7MRG.js +0 -1
  83. package/dist/bootstrap-ZRRUPRUR.js +0 -1
  84. package/dist/chunk-2FSOHXOU.cjs +0 -56
  85. package/dist/chunk-2OS5Y4LE.cjs +0 -1
  86. package/dist/chunk-2PXXQKN3.cjs +0 -3
  87. package/dist/chunk-32QY56XF.js +0 -122
  88. package/dist/chunk-355R4LS5.cjs +0 -56
  89. package/dist/chunk-35IVNLMA.js +0 -122
  90. package/dist/chunk-3GXLOYM3.js +0 -2
  91. package/dist/chunk-3LAWUINR.cjs +0 -1
  92. package/dist/chunk-3O3AVMWM.cjs +0 -1
  93. package/dist/chunk-3U6MKWET.cjs +0 -120
  94. package/dist/chunk-4YCI3HBD.js +0 -3
  95. package/dist/chunk-4ZWLNGLS.js +0 -2
  96. package/dist/chunk-5A7E7N4B.cjs +0 -431
  97. package/dist/chunk-5ZEYOFAK.js +0 -2
  98. package/dist/chunk-6DD4J7LI.js +0 -2
  99. package/dist/chunk-6GGPY7U2.js +0 -4
  100. package/dist/chunk-6MNLRAKM.cjs +0 -121
  101. package/dist/chunk-73Y63IPP.js +0 -57
  102. package/dist/chunk-7DUKWHRN.cjs +0 -1
  103. package/dist/chunk-7K6ZUNJM.js +0 -4
  104. package/dist/chunk-7LLCXY5O.cjs +0 -19
  105. package/dist/chunk-A35ZP72D.cjs +0 -132
  106. package/dist/chunk-A3IOQOV6.js +0 -2
  107. package/dist/chunk-A3XVL6ED.cjs +0 -3
  108. package/dist/chunk-A7LZ6T42.cjs +0 -1
  109. package/dist/chunk-APDQ6ZTG.cjs +0 -120
  110. package/dist/chunk-ATI2UZ7U.js +0 -2
  111. package/dist/chunk-AWQGDMOE.js +0 -3
  112. package/dist/chunk-B3BSVEFC.cjs +0 -3
  113. package/dist/chunk-B4AC23SG.js +0 -122
  114. package/dist/chunk-BD6XHMMM.cjs +0 -2
  115. package/dist/chunk-CHYVUWZ3.js +0 -2
  116. package/dist/chunk-CIVA6SKW.js +0 -2
  117. package/dist/chunk-CNHUCCQJ.js +0 -121
  118. package/dist/chunk-CRP6PSCE.js +0 -2
  119. package/dist/chunk-DI6TCZSE.js +0 -122
  120. package/dist/chunk-DORUYZQV.cjs +0 -1
  121. package/dist/chunk-E4H3ZZ7U.js +0 -4
  122. package/dist/chunk-EFKEVWAD.js +0 -4
  123. package/dist/chunk-EI7FRSNY.js +0 -57
  124. package/dist/chunk-EON4XLKQ.cjs +0 -1
  125. package/dist/chunk-EUQAOYEO.cjs +0 -121
  126. package/dist/chunk-EVAUBT7H.js +0 -57
  127. package/dist/chunk-EYHD7HZE.cjs +0 -1
  128. package/dist/chunk-EYYIPA5N.js +0 -432
  129. package/dist/chunk-FBWLSWZ4.js +0 -122
  130. package/dist/chunk-FDKU7HJX.js +0 -2
  131. package/dist/chunk-FG3IFGJP.cjs +0 -1
  132. package/dist/chunk-FGN6IMPY.cjs +0 -3
  133. package/dist/chunk-FLS2FJM6.cjs +0 -431
  134. package/dist/chunk-FP5UK272.cjs +0 -1
  135. package/dist/chunk-FSL3NLRT.cjs +0 -2
  136. package/dist/chunk-FUFS65Q5.js +0 -133
  137. package/dist/chunk-GV2IB4WQ.cjs +0 -56
  138. package/dist/chunk-GWIZT2P5.js +0 -57
  139. package/dist/chunk-H3FJ54KB.cjs +0 -121
  140. package/dist/chunk-HY3EAWB2.js +0 -4
  141. package/dist/chunk-I6UJVO2P.js +0 -57
  142. package/dist/chunk-IQSF6XRV.js +0 -57
  143. package/dist/chunk-IXGDTAES.js +0 -4
  144. package/dist/chunk-JB4WG2YJ.cjs +0 -121
  145. package/dist/chunk-JCEJ4VTN.js +0 -20
  146. package/dist/chunk-JZ7Z6WC2.cjs +0 -3
  147. package/dist/chunk-K5XGP57D.cjs +0 -19
  148. package/dist/chunk-LBLFU6KI.js +0 -57
  149. package/dist/chunk-LP3HRZGK.js +0 -57
  150. package/dist/chunk-LPFRMQFQ.js +0 -121
  151. package/dist/chunk-LYU44UNN.cjs +0 -56
  152. package/dist/chunk-M75VGFCI.js +0 -3
  153. package/dist/chunk-MFNN5DYG.cjs +0 -1
  154. package/dist/chunk-MJAODEFC.cjs +0 -121
  155. package/dist/chunk-MLCBSEBU.js +0 -2
  156. package/dist/chunk-MSC4G2HF.cjs +0 -2
  157. package/dist/chunk-MYHNTJLR.cjs +0 -56
  158. package/dist/chunk-N2YHO2WI.cjs +0 -3
  159. package/dist/chunk-N6MNQIQU.js +0 -123
  160. package/dist/chunk-NPBXLPOP.js +0 -3
  161. package/dist/chunk-OJ3H4AQ2.cjs +0 -56
  162. package/dist/chunk-ON5XJEPO.cjs +0 -3
  163. package/dist/chunk-OPTVCCQQ.cjs +0 -122
  164. package/dist/chunk-OT2Z4XBD.cjs +0 -1
  165. package/dist/chunk-PFKVHUOT.js +0 -432
  166. package/dist/chunk-PFTBTWSC.cjs +0 -1
  167. package/dist/chunk-PTPVFLET.js +0 -20
  168. package/dist/chunk-PZDLPRJF.js +0 -4
  169. package/dist/chunk-QC4YXUBT.cjs +0 -383
  170. package/dist/chunk-QUTYCUST.js +0 -4
  171. package/dist/chunk-REKKBAQX.cjs +0 -56
  172. package/dist/chunk-RTNQP6BV.js +0 -2
  173. package/dist/chunk-RUJW47ZJ.js +0 -2
  174. package/dist/chunk-RXYCFZJC.cjs +0 -121
  175. package/dist/chunk-S2MZNEBQ.cjs +0 -1
  176. package/dist/chunk-S5HTTLN7.cjs +0 -2
  177. package/dist/chunk-S73YERS2.js +0 -57
  178. package/dist/chunk-SMQ6736Y.js +0 -57
  179. package/dist/chunk-T3DJ3UTP.cjs +0 -121
  180. package/dist/chunk-TEY5LZ26.cjs +0 -56
  181. package/dist/chunk-TJZO7ZSX.cjs +0 -3
  182. package/dist/chunk-TKUNRCRH.js +0 -4
  183. package/dist/chunk-TQLCOMKC.js +0 -4
  184. package/dist/chunk-TRXYDWGE.cjs +0 -1
  185. package/dist/chunk-TS55CUNJ.js +0 -57
  186. package/dist/chunk-UFBJ3WOZ.js +0 -2
  187. package/dist/chunk-UQRVQUVR.js +0 -2
  188. package/dist/chunk-UW5W35NP.js +0 -122
  189. package/dist/chunk-UWVBFRCW.js +0 -2
  190. package/dist/chunk-UZWYFEUN.js +0 -122
  191. package/dist/chunk-VI7WCO2J.cjs +0 -3
  192. package/dist/chunk-VOYPKTID.cjs +0 -1
  193. package/dist/chunk-VTOL3URF.js +0 -4
  194. package/dist/chunk-VVVCCB6R.js +0 -2
  195. package/dist/chunk-W2GPP6RB.js +0 -122
  196. package/dist/chunk-WHOA7YJU.cjs +0 -1
  197. package/dist/chunk-WNRUPL26.js +0 -2
  198. package/dist/chunk-XBQ6HV3T.cjs +0 -114
  199. package/dist/chunk-XIAJQLGS.js +0 -2
  200. package/dist/chunk-XK6UB77Q.js +0 -4
  201. package/dist/chunk-XP7BXFXT.cjs +0 -121
  202. package/dist/chunk-Y2VHO66Q.cjs +0 -3
  203. package/dist/chunk-Y5O2OD7J.cjs +0 -3
  204. package/dist/chunk-YARB43JG.cjs +0 -56
  205. package/dist/chunk-YLCEMVYY.cjs +0 -56
  206. package/dist/chunk-YSOM57GK.cjs +0 -3
  207. package/dist/chunk-Z2SN2MYP.js +0 -122
  208. package/dist/chunk-Z3UVDGYS.cjs +0 -56
  209. package/dist/chunk-ZO3YB5DK.cjs +0 -1
  210. package/dist/chunk-ZOVH6QT5.cjs +0 -1
  211. package/dist/chunk-ZRIBWDYJ.js +0 -384
  212. package/dist/chunk-ZWDBPEXL.js +0 -115
  213. package/dist/index-B9BFNOHd.d.cts +0 -105
  214. package/dist/index-BMcYFpTv.d.cts +0 -105
  215. package/dist/index-ByOM1Y5x.d.ts +0 -105
  216. package/dist/index-C6xmtRio.d.cts +0 -105
  217. package/dist/index-CTI3K_uq.d.cts +0 -105
  218. package/dist/index-CTL4zv_u.d.ts +0 -105
  219. package/dist/index-CaDbioSg.d.ts +0 -105
  220. package/dist/index-CxA9uOv0.d.ts +0 -105
  221. package/dist/index-D6AXbuPI.d.ts +0 -105
  222. package/dist/index-DF0KDBaM.d.cts +0 -105
  223. package/dist/index-DG4Xu7gA.d.cts +0 -105
  224. package/dist/index-DS3DpJli.d.cts +0 -105
  225. package/dist/index-eHex8Iwj.d.ts +0 -105
  226. package/dist/index-rm7uyOK1.d.cts +0 -105
  227. package/dist/lib-5QYYN6ML.cjs +0 -12
  228. package/dist/lib-XXYYUPMW.js +0 -13
  229. package/dist/local-DPLKZQA3.js +0 -1
  230. package/dist/local-KR3AIGVA.cjs +0 -1
  231. package/dist/local-S5VA7IXE.cjs +0 -1
  232. package/dist/local-T7GISZBL.js +0 -1
  233. package/dist/mongo-auth-adapter-EUHAYWJ6.cjs +0 -1
  234. package/dist/mongo-auth-adapter-FW7ATYQ6.js +0 -1
  235. package/dist/mongo-auth-adapter-GR2CFFEA.js +0 -1
  236. package/dist/mongo-auth-adapter-UOO2LZUJ.cjs +0 -1
  237. package/dist/nodemailer-transport-CHO2WKIY.js +0 -1
  238. package/dist/nodemailer-transport-ED2IXNGW.cjs +0 -1
  239. package/dist/postgres-auth-adapter-SK3N3OSS.js +0 -1
  240. package/dist/postgres-auth-adapter-ZO6HK5AK.cjs +0 -1
  241. package/dist/redis-adapter-EGMUN65D.cjs +0 -1
  242. package/dist/redis-adapter-QPCTMF55.js +0 -1
  243. package/dist/sqlite-adapter-52PL52VU.js +0 -1
  244. package/dist/sqlite-adapter-MNNZZXGX.cjs +0 -1
  245. package/dist/types-6ShQp2EM.d.cts +0 -839
  246. package/dist/types-B5Qz1svz.d.cts +0 -822
  247. package/dist/types-B9oXBEKI.d.ts +0 -330
  248. package/dist/types-Bii0bhUV.d.cts +0 -329
  249. package/dist/types-Bt2_ycUO.d.ts +0 -811
  250. package/dist/types-C4wXHImf.d.ts +0 -822
  251. package/dist/types-C8yIAV6K.d.cts +0 -839
  252. package/dist/types-CORUQhY-.d.ts +0 -839
  253. package/dist/types-CjGqxBd3.d.cts +0 -330
  254. package/dist/types-CjGqxBd3.d.ts +0 -330
  255. package/dist/types-DBGR-eQl.d.cts +0 -839
  256. package/dist/types-DCWgPFmi.d.cts +0 -822
  257. package/dist/types-DROqAsr0.d.cts +0 -330
  258. package/dist/types-DROqAsr0.d.ts +0 -330
  259. package/dist/types-DlGSbh7I.d.cts +0 -297
  260. package/dist/types-DlGSbh7I.d.ts +0 -297
  261. package/dist/types-DsF64Wrc.d.cts +0 -811
  262. package/dist/types-IeKFn7Ky.d.ts +0 -839
  263. package/dist/types-ZrjEVWfi.d.ts +0 -811
  264. package/dist/types-dEy5JxvN.d.ts +0 -822
  265. package/dist/types-tVJc9YbX.d.cts +0 -811
  266. package/dist/types-zt5qIvje.d.ts +0 -839
@@ -1,297 +0,0 @@
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 BaseField {
40
- name: string;
41
- label?: string;
42
- required?: boolean;
43
- unique?: boolean;
44
- indexed?: boolean;
45
- defaultValue?: any;
46
- admin?: FieldAdmin;
47
- validate?: (value: any, options: ValidateOptions) => string | true | Promise<string | true>;
48
- hooks?: {
49
- beforeValidate?: Hook[];
50
- beforeChange?: Hook[];
51
- afterChange?: Hook[];
52
- afterRead?: Hook[];
53
- };
54
- }
55
- interface ValidateOptions {
56
- data?: Record<string, any>;
57
- siblingData?: Record<string, any>;
58
- user?: unknown;
59
- operation?: string;
60
- required?: boolean;
61
- }
62
- type Hook = (args: any) => Promise<any> | any;
63
- type TextFieldVariant = "text" | "email" | "password" | "url" | "id";
64
- interface TextField extends BaseField {
65
- type: "text";
66
- variant?: TextFieldVariant;
67
- minLength?: number;
68
- maxLength?: number;
69
- pattern?: string;
70
- hasMany?: boolean;
71
- localized?: boolean;
72
- }
73
- interface NumberField extends BaseField {
74
- type: "number";
75
- min?: number;
76
- max?: number;
77
- step?: number;
78
- integer?: boolean;
79
- hasMany?: boolean;
80
- }
81
- interface CheckboxField extends BaseField {
82
- type: "checkbox";
83
- }
84
- interface DateField extends BaseField {
85
- type: "date";
86
- minDate?: string;
87
- maxDate?: string;
88
- time?: boolean;
89
- }
90
- interface EmailField extends BaseField {
91
- type: "email";
92
- }
93
- interface PasswordField extends BaseField {
94
- type: "password";
95
- }
96
- interface TextareaField extends BaseField {
97
- type: "textarea";
98
- minLength?: number;
99
- maxLength?: number;
100
- rows?: number;
101
- localized?: boolean;
102
- }
103
- interface SelectField extends BaseField {
104
- type: "select";
105
- options?: Array<{
106
- label: string;
107
- value: string;
108
- }> | ((args: {
109
- data: any;
110
- siblingData: any;
111
- }) => Array<{
112
- label: string;
113
- value: string;
114
- }>);
115
- dynamicOptions?: string;
116
- hasMany?: boolean;
117
- defaultValue?: string | string[];
118
- }
119
- interface RadioField extends BaseField {
120
- type: "radio";
121
- options: Array<{
122
- label: string;
123
- value: string;
124
- }> | ((args: {
125
- data: any;
126
- siblingData: any;
127
- }) => Array<{
128
- label: string;
129
- value: string;
130
- }>);
131
- defaultValue?: string;
132
- }
133
- interface ColorField extends BaseField {
134
- type: "color";
135
- format?: "hex" | "rgb" | "hsl";
136
- defaultValue?: string;
137
- }
138
- interface ImageField extends BaseField {
139
- type: "image";
140
- minCount?: number;
141
- maxCount?: number;
142
- allowedTypes?: string[];
143
- maxSize?: number;
144
- }
145
- type RichTextBlock = Record<string, any>;
146
- interface RichTextField extends BaseField {
147
- type: "richtext";
148
- defaultValue?: Record<string, any>;
149
- localized?: boolean;
150
- }
151
- interface JSONField extends BaseField {
152
- type: "json";
153
- defaultValue?: Record<string, any>;
154
- }
155
- interface CodeField extends BaseField {
156
- type: "code";
157
- language?: string;
158
- defaultValue?: string;
159
- }
160
- interface UploadField extends BaseField {
161
- type: "upload";
162
- relationTo: string;
163
- hasMany?: boolean;
164
- maxDepth?: number;
165
- defaultValue?: string;
166
- }
167
- interface MarkdownField extends BaseField {
168
- type: "markdown";
169
- localized?: boolean;
170
- defaultValue?: string;
171
- }
172
- interface RelationshipField extends BaseField {
173
- type: "relationship";
174
- /**
175
- * The collection slug(s) to relate to.
176
- * Use "*" to allow relating to ANY registered collection.
177
- */
178
- relationTo: string | string[];
179
- hasMany?: boolean;
180
- maxDepth?: number;
181
- filterOptions?: (args: {
182
- data: any;
183
- user: any;
184
- }) => Record<string, any>;
185
- defaultValue?: string | string[];
186
- }
187
- interface ArrayField extends BaseField {
188
- type: "array";
189
- fields: Field[];
190
- minRows?: number;
191
- maxRows?: number;
192
- labels?: {
193
- singular?: string;
194
- plural?: string;
195
- };
196
- defaultValue?: Record<string, any>[];
197
- }
198
- interface ListField extends BaseField {
199
- type: "list";
200
- defaultValue?: string[];
201
- }
202
- interface GroupField extends BaseField {
203
- type: "group";
204
- fields: Field[];
205
- defaultValue?: Record<string, any>;
206
- }
207
- interface BlockImage {
208
- url: string;
209
- alt?: string;
210
- }
211
- interface BlockAdmin {
212
- group?: string;
213
- description?: string;
214
- images?: {
215
- icon?: BlockImage | string;
216
- thumbnail?: BlockImage | string;
217
- };
218
- }
219
- interface Block {
220
- slug: string;
221
- label: string;
222
- fields: Field[];
223
- imageURL?: string;
224
- admin?: BlockAdmin;
225
- }
226
- interface BlocksField extends BaseField {
227
- type: "blocks";
228
- blocks?: Block[];
229
- minRows?: number;
230
- maxRows?: number;
231
- defaultValue?: Array<{
232
- blockType: string;
233
- [key: string]: any;
234
- }>;
235
- }
236
- interface RowField extends Omit<BaseField, "name"> {
237
- type: "row";
238
- fields: Field[];
239
- name?: string;
240
- }
241
- interface CollapsibleField extends Omit<BaseField, "name"> {
242
- type: "collapsible";
243
- fields: Field[];
244
- label: string;
245
- name?: string;
246
- }
247
- interface TabsField extends Omit<BaseField, "name"> {
248
- type: "tabs";
249
- tabs: Array<{
250
- label: string;
251
- fields: Field[];
252
- name?: string;
253
- }>;
254
- name?: string;
255
- }
256
- interface ButtonField extends BaseField {
257
- type: "button";
258
- label: string;
259
- action?: string;
260
- method?: string;
261
- inline?: boolean;
262
- }
263
- interface ActionField extends BaseField {
264
- type: "action";
265
- label: string;
266
- action?: string;
267
- method?: string;
268
- inline?: boolean;
269
- }
270
- interface SecretField extends BaseField {
271
- type: "secret";
272
- }
273
- interface IconField extends BaseField {
274
- type: "icon";
275
- }
276
- 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;
277
- type FieldType = Field["type"];
278
- declare function isTextField(field: Field): field is TextField;
279
- declare function isNumberField(field: Field): field is NumberField;
280
- declare function isRelationshipField(field: Field): field is RelationshipField;
281
- declare function isArrayField(field: Field): field is ArrayField;
282
- declare function isGroupField(field: Field): field is GroupField;
283
- declare function isBlocksField(field: Field): field is BlocksField;
284
- declare function isUploadField(field: Field): field is UploadField;
285
- declare function isImageField(field: Field): field is ImageField;
286
- declare function isRichTextField(field: Field): field is RichTextField;
287
- declare function isSelectField(field: Field): field is SelectField;
288
- declare function isLayoutField(field: Field): field is RowField | CollapsibleField | TabsField;
289
- declare function isIconField(field: Field): field is IconField;
290
- declare const PRIMITIVE_FIELD_TYPES: readonly ["text", "number", "checkbox", "date", "email", "password", "textarea", "select", "radio", "color", "icon"];
291
- declare const COMPLEX_FIELD_TYPES: readonly ["richtext", "json", "code", "upload", "image", "markdown"];
292
- declare const RELATIONAL_FIELD_TYPES: readonly ["relationship", "array", "group", "blocks"];
293
- declare const LAYOUT_FIELD_TYPES: readonly ["row", "collapsible", "tabs"];
294
- declare const ALL_FIELD_TYPES: readonly ["text", "number", "checkbox", "date", "email", "password", "textarea", "select", "radio", "color", "icon", "richtext", "json", "code", "upload", "image", "markdown", "relationship", "array", "group", "blocks", "row", "collapsible", "tabs"];
295
- declare function createRelationshipFieldConfig(name: string, relationTo: string | string[], options?: Partial<Omit<RelationshipField, "type" | "name" | "relationTo">>): RelationshipField;
296
-
297
- export { isRelationshipField 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, createRelationshipFieldConfig as K, LAYOUT_FIELD_TYPES as L, type MarkdownField as M, type NumberField as N, isArrayField as O, PRIMITIVE_FIELD_TYPES as P, isBlocksField as Q, RELATIONAL_FIELD_TYPES as R, type SecretField as S, type TabsField as T, type UploadField as U, type ValidateOptions as V, isGroupField as W, isIconField as X, isImageField as Y, isLayoutField as Z, isNumberField as _, type ActionField as a, isRichTextField as a0, isSelectField as a1, isTextField as a2, isUploadField as a3, 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 FieldAdmin as m, type FieldType as n, type ImageField as o, type ListField as p, type PasswordField as q, type RadioField as r, type RelationshipField as s, type RichTextBlock as t, type RichTextField as u, type RowField as v, type SelectField as w, type TextField as x, type TextFieldVariant as y, type TextareaField as z };
@@ -1,297 +0,0 @@
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 BaseField {
40
- name: string;
41
- label?: string;
42
- required?: boolean;
43
- unique?: boolean;
44
- indexed?: boolean;
45
- defaultValue?: any;
46
- admin?: FieldAdmin;
47
- validate?: (value: any, options: ValidateOptions) => string | true | Promise<string | true>;
48
- hooks?: {
49
- beforeValidate?: Hook[];
50
- beforeChange?: Hook[];
51
- afterChange?: Hook[];
52
- afterRead?: Hook[];
53
- };
54
- }
55
- interface ValidateOptions {
56
- data?: Record<string, any>;
57
- siblingData?: Record<string, any>;
58
- user?: unknown;
59
- operation?: string;
60
- required?: boolean;
61
- }
62
- type Hook = (args: any) => Promise<any> | any;
63
- type TextFieldVariant = "text" | "email" | "password" | "url" | "id";
64
- interface TextField extends BaseField {
65
- type: "text";
66
- variant?: TextFieldVariant;
67
- minLength?: number;
68
- maxLength?: number;
69
- pattern?: string;
70
- hasMany?: boolean;
71
- localized?: boolean;
72
- }
73
- interface NumberField extends BaseField {
74
- type: "number";
75
- min?: number;
76
- max?: number;
77
- step?: number;
78
- integer?: boolean;
79
- hasMany?: boolean;
80
- }
81
- interface CheckboxField extends BaseField {
82
- type: "checkbox";
83
- }
84
- interface DateField extends BaseField {
85
- type: "date";
86
- minDate?: string;
87
- maxDate?: string;
88
- time?: boolean;
89
- }
90
- interface EmailField extends BaseField {
91
- type: "email";
92
- }
93
- interface PasswordField extends BaseField {
94
- type: "password";
95
- }
96
- interface TextareaField extends BaseField {
97
- type: "textarea";
98
- minLength?: number;
99
- maxLength?: number;
100
- rows?: number;
101
- localized?: boolean;
102
- }
103
- interface SelectField extends BaseField {
104
- type: "select";
105
- options?: Array<{
106
- label: string;
107
- value: string;
108
- }> | ((args: {
109
- data: any;
110
- siblingData: any;
111
- }) => Array<{
112
- label: string;
113
- value: string;
114
- }>);
115
- dynamicOptions?: string;
116
- hasMany?: boolean;
117
- defaultValue?: string | string[];
118
- }
119
- interface RadioField extends BaseField {
120
- type: "radio";
121
- options: Array<{
122
- label: string;
123
- value: string;
124
- }> | ((args: {
125
- data: any;
126
- siblingData: any;
127
- }) => Array<{
128
- label: string;
129
- value: string;
130
- }>);
131
- defaultValue?: string;
132
- }
133
- interface ColorField extends BaseField {
134
- type: "color";
135
- format?: "hex" | "rgb" | "hsl";
136
- defaultValue?: string;
137
- }
138
- interface ImageField extends BaseField {
139
- type: "image";
140
- minCount?: number;
141
- maxCount?: number;
142
- allowedTypes?: string[];
143
- maxSize?: number;
144
- }
145
- type RichTextBlock = Record<string, any>;
146
- interface RichTextField extends BaseField {
147
- type: "richtext";
148
- defaultValue?: Record<string, any>;
149
- localized?: boolean;
150
- }
151
- interface JSONField extends BaseField {
152
- type: "json";
153
- defaultValue?: Record<string, any>;
154
- }
155
- interface CodeField extends BaseField {
156
- type: "code";
157
- language?: string;
158
- defaultValue?: string;
159
- }
160
- interface UploadField extends BaseField {
161
- type: "upload";
162
- relationTo: string;
163
- hasMany?: boolean;
164
- maxDepth?: number;
165
- defaultValue?: string;
166
- }
167
- interface MarkdownField extends BaseField {
168
- type: "markdown";
169
- localized?: boolean;
170
- defaultValue?: string;
171
- }
172
- interface RelationshipField extends BaseField {
173
- type: "relationship";
174
- /**
175
- * The collection slug(s) to relate to.
176
- * Use "*" to allow relating to ANY registered collection.
177
- */
178
- relationTo: string | string[];
179
- hasMany?: boolean;
180
- maxDepth?: number;
181
- filterOptions?: (args: {
182
- data: any;
183
- user: any;
184
- }) => Record<string, any>;
185
- defaultValue?: string | string[];
186
- }
187
- interface ArrayField extends BaseField {
188
- type: "array";
189
- fields: Field[];
190
- minRows?: number;
191
- maxRows?: number;
192
- labels?: {
193
- singular?: string;
194
- plural?: string;
195
- };
196
- defaultValue?: Record<string, any>[];
197
- }
198
- interface ListField extends BaseField {
199
- type: "list";
200
- defaultValue?: string[];
201
- }
202
- interface GroupField extends BaseField {
203
- type: "group";
204
- fields: Field[];
205
- defaultValue?: Record<string, any>;
206
- }
207
- interface BlockImage {
208
- url: string;
209
- alt?: string;
210
- }
211
- interface BlockAdmin {
212
- group?: string;
213
- description?: string;
214
- images?: {
215
- icon?: BlockImage | string;
216
- thumbnail?: BlockImage | string;
217
- };
218
- }
219
- interface Block {
220
- slug: string;
221
- label: string;
222
- fields: Field[];
223
- imageURL?: string;
224
- admin?: BlockAdmin;
225
- }
226
- interface BlocksField extends BaseField {
227
- type: "blocks";
228
- blocks?: Block[];
229
- minRows?: number;
230
- maxRows?: number;
231
- defaultValue?: Array<{
232
- blockType: string;
233
- [key: string]: any;
234
- }>;
235
- }
236
- interface RowField extends Omit<BaseField, "name"> {
237
- type: "row";
238
- fields: Field[];
239
- name?: string;
240
- }
241
- interface CollapsibleField extends Omit<BaseField, "name"> {
242
- type: "collapsible";
243
- fields: Field[];
244
- label: string;
245
- name?: string;
246
- }
247
- interface TabsField extends Omit<BaseField, "name"> {
248
- type: "tabs";
249
- tabs: Array<{
250
- label: string;
251
- fields: Field[];
252
- name?: string;
253
- }>;
254
- name?: string;
255
- }
256
- interface ButtonField extends BaseField {
257
- type: "button";
258
- label: string;
259
- action?: string;
260
- method?: string;
261
- inline?: boolean;
262
- }
263
- interface ActionField extends BaseField {
264
- type: "action";
265
- label: string;
266
- action?: string;
267
- method?: string;
268
- inline?: boolean;
269
- }
270
- interface SecretField extends BaseField {
271
- type: "secret";
272
- }
273
- interface IconField extends BaseField {
274
- type: "icon";
275
- }
276
- 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;
277
- type FieldType = Field["type"];
278
- declare function isTextField(field: Field): field is TextField;
279
- declare function isNumberField(field: Field): field is NumberField;
280
- declare function isRelationshipField(field: Field): field is RelationshipField;
281
- declare function isArrayField(field: Field): field is ArrayField;
282
- declare function isGroupField(field: Field): field is GroupField;
283
- declare function isBlocksField(field: Field): field is BlocksField;
284
- declare function isUploadField(field: Field): field is UploadField;
285
- declare function isImageField(field: Field): field is ImageField;
286
- declare function isRichTextField(field: Field): field is RichTextField;
287
- declare function isSelectField(field: Field): field is SelectField;
288
- declare function isLayoutField(field: Field): field is RowField | CollapsibleField | TabsField;
289
- declare function isIconField(field: Field): field is IconField;
290
- declare const PRIMITIVE_FIELD_TYPES: readonly ["text", "number", "checkbox", "date", "email", "password", "textarea", "select", "radio", "color", "icon"];
291
- declare const COMPLEX_FIELD_TYPES: readonly ["richtext", "json", "code", "upload", "image", "markdown"];
292
- declare const RELATIONAL_FIELD_TYPES: readonly ["relationship", "array", "group", "blocks"];
293
- declare const LAYOUT_FIELD_TYPES: readonly ["row", "collapsible", "tabs"];
294
- declare const ALL_FIELD_TYPES: readonly ["text", "number", "checkbox", "date", "email", "password", "textarea", "select", "radio", "color", "icon", "richtext", "json", "code", "upload", "image", "markdown", "relationship", "array", "group", "blocks", "row", "collapsible", "tabs"];
295
- declare function createRelationshipFieldConfig(name: string, relationTo: string | string[], options?: Partial<Omit<RelationshipField, "type" | "name" | "relationTo">>): RelationshipField;
296
-
297
- export { isRelationshipField 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, createRelationshipFieldConfig as K, LAYOUT_FIELD_TYPES as L, type MarkdownField as M, type NumberField as N, isArrayField as O, PRIMITIVE_FIELD_TYPES as P, isBlocksField as Q, RELATIONAL_FIELD_TYPES as R, type SecretField as S, type TabsField as T, type UploadField as U, type ValidateOptions as V, isGroupField as W, isIconField as X, isImageField as Y, isLayoutField as Z, isNumberField as _, type ActionField as a, isRichTextField as a0, isSelectField as a1, isTextField as a2, isUploadField as a3, 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 FieldAdmin as m, type FieldType as n, type ImageField as o, type ListField as p, type PasswordField as q, type RadioField as r, type RelationshipField as s, type RichTextBlock as t, type RichTextField as u, type RowField as v, type SelectField as w, type TextField as x, type TextFieldVariant as y, type TextareaField as z };