@kyro-cms/core 0.9.0 → 0.9.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 (248) hide show
  1. package/README.md +57 -589
  2. package/dist/{WebhookService-118ZTFis.d.ts → WebhookService-CUTb9XOy.d.ts} +1 -1
  3. package/dist/{WebhookService-AefJfqX0.d.cts → WebhookService-Yg2UEOB4.d.cts} +1 -1
  4. package/dist/api-handler-graphql.cjs +44 -0
  5. package/dist/api-handler-graphql.cjs.map +1 -0
  6. package/dist/api-handler-graphql.d.cts +6 -0
  7. package/dist/api-handler-graphql.d.ts +6 -0
  8. package/dist/api-handler-graphql.js +41 -0
  9. package/dist/api-handler-graphql.js.map +1 -0
  10. package/dist/api-handler-trpc.cjs +38 -0
  11. package/dist/api-handler-trpc.cjs.map +1 -0
  12. package/dist/api-handler-trpc.d.cts +5 -0
  13. package/dist/api-handler-trpc.d.ts +5 -0
  14. package/dist/api-handler-trpc.js +36 -0
  15. package/dist/api-handler-trpc.js.map +1 -0
  16. package/dist/api-handler.cjs +31 -97
  17. package/dist/api-handler.cjs.map +1 -1
  18. package/dist/api-handler.d.cts +2 -1
  19. package/dist/api-handler.d.ts +2 -1
  20. package/dist/api-handler.js +19 -95
  21. package/dist/api-handler.js.map +1 -1
  22. package/dist/{tenant-B1YB0Jy8.d.ts → base-B71y_EAF.d.cts} +6 -12
  23. package/dist/{tenant-Cpeveji6.d.cts → base-DaqY2GhA.d.ts} +6 -12
  24. package/dist/bootstrap-5NLASFOG.cjs +32 -0
  25. package/dist/{bootstrap-AKAUP6F6.cjs.map → bootstrap-5NLASFOG.cjs.map} +1 -1
  26. package/dist/bootstrap-T5BK77LD.js +7 -0
  27. package/dist/{bootstrap-JCML6NFO.js.map → bootstrap-T5BK77LD.js.map} +1 -1
  28. package/dist/{chunk-35U3FROB.js → chunk-22M4O4ZJ.js} +607 -63
  29. package/dist/chunk-22M4O4ZJ.js.map +1 -0
  30. package/dist/chunk-2HZRBATX.cjs +253 -0
  31. package/dist/chunk-2HZRBATX.cjs.map +1 -0
  32. package/dist/{chunk-VJT6P4N6.cjs → chunk-3HR772HI.cjs} +199 -32
  33. package/dist/chunk-3HR772HI.cjs.map +1 -0
  34. package/dist/chunk-3KTWGODI.cjs +178 -0
  35. package/dist/chunk-3KTWGODI.cjs.map +1 -0
  36. package/dist/{chunk-QXIQWPAP.js → chunk-3UK5XBVJ.js} +4 -134
  37. package/dist/chunk-3UK5XBVJ.js.map +1 -0
  38. package/dist/{chunk-FXYP2HA6.js → chunk-4AO3A3JM.js} +48 -4
  39. package/dist/chunk-4AO3A3JM.js.map +1 -0
  40. package/dist/chunk-4M7X5HAB.cjs +173 -0
  41. package/dist/chunk-4M7X5HAB.cjs.map +1 -0
  42. package/dist/chunk-5EPFQUQD.js +3243 -0
  43. package/dist/chunk-5EPFQUQD.js.map +1 -0
  44. package/dist/{chunk-Y3N7UUDO.js → chunk-7OGPN7MP.js} +5 -2
  45. package/dist/chunk-7OGPN7MP.js.map +1 -0
  46. package/dist/{chunk-WOWUL7ZY.js → chunk-AL5KX63J.js} +4 -3
  47. package/dist/chunk-AL5KX63J.js.map +1 -0
  48. package/dist/{chunk-2OL4O2TH.cjs → chunk-C36TMDTY.cjs} +66 -61
  49. package/dist/chunk-C36TMDTY.cjs.map +1 -0
  50. package/dist/{chunk-ES5HNFFT.js → chunk-CF7OL6HR.js} +4 -2
  51. package/dist/chunk-CF7OL6HR.js.map +1 -0
  52. package/dist/chunk-CJONKRHJ.js +162 -0
  53. package/dist/chunk-CJONKRHJ.js.map +1 -0
  54. package/dist/{chunk-2KVHZE6O.cjs → chunk-COIASRDK.cjs} +202 -46
  55. package/dist/chunk-COIASRDK.cjs.map +1 -0
  56. package/dist/chunk-DEVFAKCQ.cjs +3291 -0
  57. package/dist/chunk-DEVFAKCQ.cjs.map +1 -0
  58. package/dist/{chunk-3ZFYL34R.js → chunk-DYTZ6FQ7.js} +12 -185
  59. package/dist/chunk-DYTZ6FQ7.js.map +1 -0
  60. package/dist/{chunk-QPPDLRNR.js → chunk-EJN2PAOE.js} +197 -41
  61. package/dist/chunk-EJN2PAOE.js.map +1 -0
  62. package/dist/chunk-FAXU7BMP.js +220 -0
  63. package/dist/chunk-FAXU7BMP.js.map +1 -0
  64. package/dist/{chunk-OHVB4AJ7.js → chunk-FOPGUM27.js} +22 -17
  65. package/dist/chunk-FOPGUM27.js.map +1 -0
  66. package/dist/chunk-GAOXD3XT.js +175 -0
  67. package/dist/chunk-GAOXD3XT.js.map +1 -0
  68. package/dist/{chunk-4DA7QPLA.cjs → chunk-GXFOGU7N.cjs} +5 -2
  69. package/dist/chunk-GXFOGU7N.cjs.map +1 -0
  70. package/dist/{chunk-I7HHI6QV.cjs → chunk-IDVRRRAK.cjs} +17 -9
  71. package/dist/chunk-IDVRRRAK.cjs.map +1 -0
  72. package/dist/{chunk-WQBRWOQT.cjs → chunk-JOPVMWTM.cjs} +3 -2
  73. package/dist/chunk-JOPVMWTM.cjs.map +1 -0
  74. package/dist/chunk-KC2GDBLS.cjs +84 -0
  75. package/dist/chunk-KC2GDBLS.cjs.map +1 -0
  76. package/dist/{chunk-K7JPTH3G.cjs → chunk-KNRSROWB.cjs} +132 -74
  77. package/dist/chunk-KNRSROWB.cjs.map +1 -0
  78. package/dist/{chunk-3AJE4SEG.js → chunk-KPA4AN4R.js} +125 -67
  79. package/dist/chunk-KPA4AN4R.js.map +1 -0
  80. package/dist/{chunk-QUW2RZTM.cjs → chunk-L46ROHUS.cjs} +51 -7
  81. package/dist/chunk-L46ROHUS.cjs.map +1 -0
  82. package/dist/chunk-L4EZKIEX.js +185 -0
  83. package/dist/chunk-L4EZKIEX.js.map +1 -0
  84. package/dist/{chunk-REK7AYOC.js → chunk-L5UKKZQN.js} +199 -32
  85. package/dist/chunk-L5UKKZQN.js.map +1 -0
  86. package/dist/chunk-NKPKR5BW.cjs +188 -0
  87. package/dist/chunk-NKPKR5BW.cjs.map +1 -0
  88. package/dist/{chunk-Y3QQN7PN.js → chunk-P2HKJ7P5.js} +13 -4
  89. package/dist/chunk-P2HKJ7P5.js.map +1 -0
  90. package/dist/{chunk-SA7NSSIQ.cjs → chunk-PI73NNOK.cjs} +13 -187
  91. package/dist/chunk-PI73NNOK.cjs.map +1 -0
  92. package/dist/{chunk-HXRD4B37.js → chunk-PU2Z5VWF.js} +1279 -556
  93. package/dist/chunk-PU2Z5VWF.js.map +1 -0
  94. package/dist/{chunk-H727JIG7.js → chunk-Q72BOAPK.js} +16 -8
  95. package/dist/chunk-Q72BOAPK.js.map +1 -0
  96. package/dist/{chunk-IBG6V56E.cjs → chunk-QFLB4EIJ.cjs} +2 -139
  97. package/dist/chunk-QFLB4EIJ.cjs.map +1 -0
  98. package/dist/{chunk-YVUJBEXE.cjs → chunk-RAMGUDJN.cjs} +16 -7
  99. package/dist/chunk-RAMGUDJN.cjs.map +1 -0
  100. package/dist/{chunk-LINKCEG4.cjs → chunk-ROJHKAQ4.cjs} +617 -73
  101. package/dist/chunk-ROJHKAQ4.cjs.map +1 -0
  102. package/dist/{chunk-5KVM3WEY.cjs → chunk-RSF3UU7H.cjs} +1330 -602
  103. package/dist/chunk-RSF3UU7H.cjs.map +1 -0
  104. package/dist/{chunk-V3LKPM3O.cjs → chunk-SHTTJMLT.cjs} +4 -2
  105. package/dist/chunk-SHTTJMLT.cjs.map +1 -0
  106. package/dist/chunk-SPBTLUN6.js +92 -0
  107. package/dist/chunk-SPBTLUN6.js.map +1 -0
  108. package/dist/{chunk-57P6MJKC.js → chunk-TXSZFA4G.js} +3 -3
  109. package/dist/chunk-TXSZFA4G.js.map +1 -0
  110. package/dist/chunk-UERVXYVK.cjs +99 -0
  111. package/dist/chunk-UERVXYVK.cjs.map +1 -0
  112. package/dist/{chunk-PDYFVNUX.cjs → chunk-V2TVSCV5.cjs} +16 -23
  113. package/dist/chunk-V2TVSCV5.cjs.map +1 -0
  114. package/dist/{chunk-DXHRBMGB.js → chunk-VO35MNPH.js} +12 -19
  115. package/dist/chunk-VO35MNPH.js.map +1 -0
  116. package/dist/{chunk-IA6AU5PI.cjs → chunk-WNCYAKF3.cjs} +3 -3
  117. package/dist/chunk-WNCYAKF3.cjs.map +1 -0
  118. package/dist/chunk-XEB7PH2E.js +81 -0
  119. package/dist/chunk-XEB7PH2E.js.map +1 -0
  120. package/dist/cli/index.cjs +5 -5
  121. package/dist/cli/index.cjs.map +1 -1
  122. package/dist/cli/index.js +5 -5
  123. package/dist/cli/index.js.map +1 -1
  124. package/dist/client.cjs +3 -3
  125. package/dist/client.d.cts +3 -3
  126. package/dist/client.d.ts +3 -3
  127. package/dist/client.js +1 -1
  128. package/dist/drizzle/index.cjs +14 -13
  129. package/dist/drizzle/index.d.cts +9 -7
  130. package/dist/drizzle/index.d.ts +9 -7
  131. package/dist/drizzle/index.js +5 -4
  132. package/dist/fields/index.cjs +21 -37
  133. package/dist/fields/index.d.cts +2 -22
  134. package/dist/fields/index.d.ts +2 -22
  135. package/dist/fields/index.js +1 -1
  136. package/dist/graphql/index.cjs +5 -4
  137. package/dist/graphql/index.d.cts +5 -3
  138. package/dist/graphql/index.d.ts +5 -3
  139. package/dist/graphql/index.js +3 -2
  140. package/dist/index-CJXPB_ot.d.ts +276 -0
  141. package/dist/index-CaTNnLGd.d.cts +276 -0
  142. package/dist/index.cjs +304 -162
  143. package/dist/index.cjs.map +1 -1
  144. package/dist/index.d.cts +129 -205
  145. package/dist/index.d.ts +129 -205
  146. package/dist/index.js +172 -33
  147. package/dist/index.js.map +1 -1
  148. package/dist/integration.cjs +2 -2
  149. package/dist/integration.js +1 -1
  150. package/dist/mongo-auth-adapter-ISOM7FSS.cjs +17 -0
  151. package/dist/{mongo-auth-adapter-NHHUJHVH.cjs.map → mongo-auth-adapter-ISOM7FSS.cjs.map} +1 -1
  152. package/dist/mongo-auth-adapter-MO6STCV3.js +4 -0
  153. package/dist/{mongo-auth-adapter-NJQUUCTP.js.map → mongo-auth-adapter-MO6STCV3.js.map} +1 -1
  154. package/dist/mongodb/index.cjs +8 -7
  155. package/dist/mongodb/index.d.cts +5 -7
  156. package/dist/mongodb/index.d.ts +5 -7
  157. package/dist/mongodb/index.js +4 -3
  158. package/dist/postgres-auth-adapter-DWDR7P5G.js +5 -0
  159. package/dist/{postgres-auth-adapter-3T2NKTSE.js.map → postgres-auth-adapter-DWDR7P5G.js.map} +1 -1
  160. package/dist/postgres-auth-adapter-WRWSJD4E.cjs +14 -0
  161. package/dist/{postgres-auth-adapter-7IEENCKQ.cjs.map → postgres-auth-adapter-WRWSJD4E.cjs.map} +1 -1
  162. package/dist/redis-adapter-HGTPWIGV.js +4 -0
  163. package/dist/{redis-adapter-VQXD7ESY.js.map → redis-adapter-HGTPWIGV.js.map} +1 -1
  164. package/dist/redis-adapter-KJ3YOOT6.cjs +13 -0
  165. package/dist/{redis-adapter-D2E2S3GB.cjs.map → redis-adapter-KJ3YOOT6.cjs.map} +1 -1
  166. package/dist/rest/index.cjs +15 -14
  167. package/dist/rest/index.d.cts +4 -4
  168. package/dist/rest/index.d.ts +4 -4
  169. package/dist/rest/index.js +13 -12
  170. package/dist/{schema-5PHL5IVB.js → schema-6I5OFR4Z.js} +3 -3
  171. package/dist/{schema-5PHL5IVB.js.map → schema-6I5OFR4Z.js.map} +1 -1
  172. package/dist/{schema-37SE2F4B.cjs → schema-TTFE4467.cjs} +14 -14
  173. package/dist/{schema-37SE2F4B.cjs.map → schema-TTFE4467.cjs.map} +1 -1
  174. package/dist/sqlite-adapter-6GEUSVXQ.js +4 -0
  175. package/dist/{sqlite-adapter-TR3U3W6Q.js.map → sqlite-adapter-6GEUSVXQ.js.map} +1 -1
  176. package/dist/sqlite-adapter-CSIZE5SX.cjs +13 -0
  177. package/dist/{sqlite-adapter-LVK5PS4T.cjs.map → sqlite-adapter-CSIZE5SX.cjs.map} +1 -1
  178. package/dist/templates/index.cjs +133 -31
  179. package/dist/templates/index.d.cts +52 -9
  180. package/dist/templates/index.d.ts +52 -9
  181. package/dist/templates/index.js +3 -1
  182. package/dist/trpc/index.cjs +13 -12
  183. package/dist/trpc/index.d.cts +55 -49
  184. package/dist/trpc/index.d.ts +55 -49
  185. package/dist/trpc/index.js +4 -3
  186. package/dist/{types-D6ZLRGbH.d.cts → types-CpjuXbe7.d.cts} +2 -0
  187. package/dist/{types-D6ZLRGbH.d.ts → types-CpjuXbe7.d.ts} +2 -0
  188. package/dist/{types-Bs1up4yP.d.ts → types-CyCQ6SAI.d.ts} +28 -2
  189. package/dist/{types-J3R9nVsZ.d.cts → types-DJxD9394.d.cts} +28 -2
  190. package/dist/{types-VtjUxIMp.d.cts → types-Z6FBiqa2.d.cts} +35 -14
  191. package/dist/{types-VtjUxIMp.d.ts → types-Z6FBiqa2.d.ts} +35 -14
  192. package/package.json +22 -4
  193. package/dist/bootstrap-AKAUP6F6.cjs +0 -32
  194. package/dist/bootstrap-JCML6NFO.js +0 -7
  195. package/dist/chunk-2KVHZE6O.cjs.map +0 -1
  196. package/dist/chunk-2OL4O2TH.cjs.map +0 -1
  197. package/dist/chunk-35U3FROB.js.map +0 -1
  198. package/dist/chunk-3AJE4SEG.js.map +0 -1
  199. package/dist/chunk-3J4MFTI3.js +0 -3872
  200. package/dist/chunk-3J4MFTI3.js.map +0 -1
  201. package/dist/chunk-3ZFYL34R.js.map +0 -1
  202. package/dist/chunk-4DA7QPLA.cjs.map +0 -1
  203. package/dist/chunk-57P6MJKC.js.map +0 -1
  204. package/dist/chunk-5KVM3WEY.cjs.map +0 -1
  205. package/dist/chunk-6IMPH6WV.cjs +0 -3897
  206. package/dist/chunk-6IMPH6WV.cjs.map +0 -1
  207. package/dist/chunk-ATBOUGQP.cjs +0 -513
  208. package/dist/chunk-ATBOUGQP.cjs.map +0 -1
  209. package/dist/chunk-DXHRBMGB.js.map +0 -1
  210. package/dist/chunk-ES5HNFFT.js.map +0 -1
  211. package/dist/chunk-FXYP2HA6.js.map +0 -1
  212. package/dist/chunk-H727JIG7.js.map +0 -1
  213. package/dist/chunk-HXRD4B37.js.map +0 -1
  214. package/dist/chunk-I7HHI6QV.cjs.map +0 -1
  215. package/dist/chunk-IA6AU5PI.cjs.map +0 -1
  216. package/dist/chunk-IBG6V56E.cjs.map +0 -1
  217. package/dist/chunk-K7JPTH3G.cjs.map +0 -1
  218. package/dist/chunk-LINKCEG4.cjs.map +0 -1
  219. package/dist/chunk-OHVB4AJ7.js.map +0 -1
  220. package/dist/chunk-PDYFVNUX.cjs.map +0 -1
  221. package/dist/chunk-Q23JB3KL.js +0 -488
  222. package/dist/chunk-Q23JB3KL.js.map +0 -1
  223. package/dist/chunk-QPPDLRNR.js.map +0 -1
  224. package/dist/chunk-QUW2RZTM.cjs.map +0 -1
  225. package/dist/chunk-QXIQWPAP.js.map +0 -1
  226. package/dist/chunk-R3XIBBAW.cjs +0 -34
  227. package/dist/chunk-R3XIBBAW.cjs.map +0 -1
  228. package/dist/chunk-REK7AYOC.js.map +0 -1
  229. package/dist/chunk-SA7NSSIQ.cjs.map +0 -1
  230. package/dist/chunk-SDMNUYVU.js +0 -30
  231. package/dist/chunk-SDMNUYVU.js.map +0 -1
  232. package/dist/chunk-V3LKPM3O.cjs.map +0 -1
  233. package/dist/chunk-VJT6P4N6.cjs.map +0 -1
  234. package/dist/chunk-WOWUL7ZY.js.map +0 -1
  235. package/dist/chunk-WQBRWOQT.cjs.map +0 -1
  236. package/dist/chunk-Y3N7UUDO.js.map +0 -1
  237. package/dist/chunk-Y3QQN7PN.js.map +0 -1
  238. package/dist/chunk-YVUJBEXE.cjs.map +0 -1
  239. package/dist/index-CLp-DRKA.d.ts +0 -64
  240. package/dist/index-DfO7G4kN.d.cts +0 -64
  241. package/dist/mongo-auth-adapter-NHHUJHVH.cjs +0 -17
  242. package/dist/mongo-auth-adapter-NJQUUCTP.js +0 -4
  243. package/dist/postgres-auth-adapter-3T2NKTSE.js +0 -5
  244. package/dist/postgres-auth-adapter-7IEENCKQ.cjs +0 -14
  245. package/dist/redis-adapter-D2E2S3GB.cjs +0 -13
  246. package/dist/redis-adapter-VQXD7ESY.js +0 -4
  247. package/dist/sqlite-adapter-LVK5PS4T.cjs +0 -13
  248. package/dist/sqlite-adapter-TR3U3W6Q.js +0 -4
@@ -0,0 +1,276 @@
1
+ import { C as CollectionConfig, G as GlobalConfig, P as PluginConfig } from './types-CyCQ6SAI.js';
2
+ import { F as Field } from './types-Z6FBiqa2.js';
3
+ import { ZodTypeAny } from 'zod';
4
+
5
+ interface S3CompatibleConfig {
6
+ bucket?: string;
7
+ region?: string;
8
+ accessKeyId?: string;
9
+ secretAccessKey?: string;
10
+ endpoint?: string;
11
+ cdnUrl?: string;
12
+ prefix?: string;
13
+ }
14
+ interface R2Config {
15
+ accountId?: string;
16
+ accessKeyId?: string;
17
+ secretAccessKey?: string;
18
+ bucket?: string;
19
+ cdnUrl?: string;
20
+ prefix?: string;
21
+ publicDevUrl?: string;
22
+ }
23
+ interface GCSConfig {
24
+ bucket?: string;
25
+ projectId?: string;
26
+ clientEmail?: string;
27
+ privateKey?: string;
28
+ cdnUrl?: string;
29
+ prefix?: string;
30
+ }
31
+ interface BackblazeConfig {
32
+ bucket?: string;
33
+ accountId?: string;
34
+ applicationKeyId?: string;
35
+ applicationKey?: string;
36
+ cdnUrl?: string;
37
+ prefix?: string;
38
+ }
39
+ interface BunnyConfig {
40
+ storageZone?: string;
41
+ apiKey?: string;
42
+ cdnUrl?: string;
43
+ prefix?: string;
44
+ }
45
+ interface FTPConfig {
46
+ host?: string;
47
+ port?: number;
48
+ user?: string;
49
+ password?: string;
50
+ secure?: boolean;
51
+ baseUrl?: string;
52
+ prefix?: string;
53
+ }
54
+ interface StorageConfig {
55
+ type: string;
56
+ s3: S3CompatibleConfig;
57
+ r2: R2Config;
58
+ gcs: GCSConfig;
59
+ digitalocean: S3CompatibleConfig;
60
+ backblaze: BackblazeConfig;
61
+ wasabi: S3CompatibleConfig;
62
+ bunny: BunnyConfig;
63
+ ftp: FTPConfig;
64
+ cloudinary: {
65
+ cloudName?: string;
66
+ apiKey?: string;
67
+ apiSecret?: string;
68
+ folder?: string;
69
+ };
70
+ imgix: {
71
+ domain?: string;
72
+ signKey?: string;
73
+ };
74
+ local: {
75
+ uploadDir?: string;
76
+ baseUrl?: string;
77
+ };
78
+ }
79
+ interface EmailConfig {
80
+ provider?: string;
81
+ host?: string;
82
+ port?: number;
83
+ secure?: boolean;
84
+ user?: string;
85
+ pass?: string;
86
+ from?: string;
87
+ fromName?: string;
88
+ replyTo?: string;
89
+ }
90
+ declare class ConfigService {
91
+ private db;
92
+ private cache;
93
+ private static readonly SENSITIVE_KEYS;
94
+ constructor(db: any);
95
+ /**
96
+ * Initialize the service by loading all settings from the database
97
+ */
98
+ load(): Promise<void>;
99
+ private ensureSettingsTable;
100
+ /**
101
+ * Load settings from the _globals_storage-settings table (SQLite fallback)
102
+ * Maps nested global structure to flat key-value cache
103
+ */
104
+ private loadFromGlobals;
105
+ /**
106
+ * Get a settings value with environment fallback
107
+ */
108
+ get(key: string, envKey?: string, defaultValue?: string): string | undefined;
109
+ /**
110
+ * Get storage configuration
111
+ */
112
+ getStorageConfig(): StorageConfig;
113
+ /**
114
+ * Get email configuration
115
+ */
116
+ getEmailConfig(): EmailConfig;
117
+ /**
118
+ * Mask sensitive values for display
119
+ */
120
+ maskSensitive(key: string, value: string | undefined): string | undefined;
121
+ /**
122
+ * Update a setting in the database
123
+ */
124
+ set(key: string, value: string, description?: string): Promise<void>;
125
+ }
126
+
127
+ interface UploadOptions {
128
+ folder?: string;
129
+ filename?: string;
130
+ mimeType?: string;
131
+ metadata?: Record<string, unknown>;
132
+ }
133
+ interface UploadedFile {
134
+ id: string;
135
+ filename: string;
136
+ originalName: string;
137
+ mimeType: string;
138
+ size: number;
139
+ url: string;
140
+ thumbnailUrl?: string;
141
+ width?: number;
142
+ height?: number;
143
+ folder?: string;
144
+ provider: string;
145
+ metadata?: Record<string, unknown>;
146
+ createdAt: string;
147
+ }
148
+ interface ImageTransforms {
149
+ width?: number;
150
+ height?: number;
151
+ fit?: "clip" | "crop" | "fill" | "fillmax" | "scale" | "max" | "min";
152
+ format?: "webp" | "avif" | "jpeg" | "jpg" | "png" | "gif";
153
+ quality?: number;
154
+ blur?: number;
155
+ sharpen?: number;
156
+ }
157
+ interface StorageProvider {
158
+ name: string;
159
+ displayName: string;
160
+ supportsDynamicResize: boolean;
161
+ upload(file: File, options?: UploadOptions): Promise<UploadedFile>;
162
+ uploadFromUrl(url: string, options?: UploadOptions): Promise<UploadedFile>;
163
+ delete(url: string): Promise<void>;
164
+ rename(oldUrl: string, newKey: string): Promise<string>;
165
+ getImageUrl(url: string, transforms?: ImageTransforms): string;
166
+ generateThumbnail(file: UploadedFile, size: {
167
+ width: number;
168
+ height: number;
169
+ }): Promise<string>;
170
+ list(prefix?: string): Promise<UploadedFile[]>;
171
+ exists(url: string): Promise<boolean>;
172
+ createFolder?(folder: string): Promise<void>;
173
+ deleteFolder?(folder: string): Promise<void>;
174
+ }
175
+
176
+ declare function resolveProvider(configService: ConfigService): Promise<StorageProvider>;
177
+
178
+ interface StorageProviderRegistration {
179
+ type: string;
180
+ displayName: string;
181
+ pluginName?: string;
182
+ configFields: Field[];
183
+ configKey?: string;
184
+ extractConfig: (storageConfig: StorageConfig, configKey: string) => any;
185
+ extractRawConfig: (config: any) => any;
186
+ factory: (config: any) => StorageProvider;
187
+ }
188
+ declare class StorageProviderRegistry {
189
+ private providers;
190
+ private providerToPlugin;
191
+ private disabledPlugins;
192
+ constructor();
193
+ private registerLocal;
194
+ private registerImgix;
195
+ private registerBunny;
196
+ register(registration: StorageProviderRegistration): void;
197
+ unregister(type: string): void;
198
+ get(type: string): StorageProviderRegistration | undefined;
199
+ getAll(): StorageProviderRegistration[];
200
+ getAllAvailable(isPluginEnabled?: (name: string) => boolean): StorageProviderRegistration[];
201
+ has(type: string): boolean;
202
+ resolve(type: string, storageConfig: StorageConfig): Promise<StorageProvider>;
203
+ resolveWithConfig(type: string, config: any): Promise<StorageProvider>;
204
+ getProviderPluginName(type: string): string | undefined;
205
+ getAllPluginNames(): string[];
206
+ setPluginEnabled(name: string, enabled: boolean): void;
207
+ isPluginEnabled(name: string): boolean;
208
+ }
209
+
210
+ declare class Registry {
211
+ storageProviders: StorageProviderRegistry;
212
+ private collections;
213
+ private globals;
214
+ private plugins;
215
+ private schemaCache;
216
+ private initialized;
217
+ addCollection(config: CollectionConfig): void;
218
+ addCollections(configs: CollectionConfig[]): void;
219
+ getCollection(slug: string): CollectionConfig | undefined;
220
+ getCollections(): CollectionConfig[];
221
+ getCollectionSlugs(): string[];
222
+ hasCollection(slug: string): boolean;
223
+ removeCollection(slug: string): boolean;
224
+ addGlobal(config: GlobalConfig): void;
225
+ /**
226
+ * Add a global after the registry is already initialized.
227
+ * Only for internal use (e.g. storage settings form built at startup).
228
+ */
229
+ addGlobalPostInit(config: GlobalConfig): void;
230
+ private _addGlobalUnsafe;
231
+ addGlobals(configs: GlobalConfig[]): void;
232
+ getGlobal(slug: string): GlobalConfig | undefined;
233
+ getGlobals(): GlobalConfig[];
234
+ getGlobalSlugs(): string[];
235
+ hasGlobal(slug: string): boolean;
236
+ removeGlobal(slug: string): boolean;
237
+ addPlugin(plugin: PluginConfig): void;
238
+ getPlugins(): PluginConfig[];
239
+ getZodSchema(slug: string): ZodTypeAny;
240
+ getCreateZodSchema(slug: string): ZodTypeAny;
241
+ getUpdateZodSchema(slug: string): ZodTypeAny;
242
+ getWhereZodSchema(slug: string): ZodTypeAny;
243
+ getFieldZodSchema(field: Field): ZodTypeAny;
244
+ private clearSchemaCache;
245
+ private applyFieldDefaults;
246
+ getFields(slug: string): Field[];
247
+ getFieldMap(slug: string): Map<string, Field>;
248
+ getVisibleFields(slug: string): Field[];
249
+ validate(): void;
250
+ init(): Promise<void>;
251
+ isInitialized(): boolean;
252
+ getPaginationDefaults(slug: string): {
253
+ defaultLimit: number;
254
+ limits: number[];
255
+ };
256
+ getDefaultSort(slug: string): string;
257
+ getDefaultColumns(slug: string): string[];
258
+ getAdminTitle(slug: string): string;
259
+ getAdminLabel(slug: string): string;
260
+ getAdminGroup(slug: string): string | undefined;
261
+ getStats(): {
262
+ collections: number;
263
+ globals: number;
264
+ plugins: number;
265
+ fields: number;
266
+ };
267
+ toJSON(): {
268
+ collections: CollectionConfig[];
269
+ globals: GlobalConfig[];
270
+ };
271
+ }
272
+ declare function getRegistry(): Registry;
273
+ declare function resetRegistry(): void;
274
+ declare function createRegistry(): Registry;
275
+
276
+ export { ConfigService as C, type EmailConfig as E, Registry as R, type StorageProvider as S, type StorageConfig as a, resolveProvider as b, createRegistry as c, getRegistry as g, resetRegistry as r };
@@ -0,0 +1,276 @@
1
+ import { C as CollectionConfig, G as GlobalConfig, P as PluginConfig } from './types-DJxD9394.cjs';
2
+ import { F as Field } from './types-Z6FBiqa2.cjs';
3
+ import { ZodTypeAny } from 'zod';
4
+
5
+ interface S3CompatibleConfig {
6
+ bucket?: string;
7
+ region?: string;
8
+ accessKeyId?: string;
9
+ secretAccessKey?: string;
10
+ endpoint?: string;
11
+ cdnUrl?: string;
12
+ prefix?: string;
13
+ }
14
+ interface R2Config {
15
+ accountId?: string;
16
+ accessKeyId?: string;
17
+ secretAccessKey?: string;
18
+ bucket?: string;
19
+ cdnUrl?: string;
20
+ prefix?: string;
21
+ publicDevUrl?: string;
22
+ }
23
+ interface GCSConfig {
24
+ bucket?: string;
25
+ projectId?: string;
26
+ clientEmail?: string;
27
+ privateKey?: string;
28
+ cdnUrl?: string;
29
+ prefix?: string;
30
+ }
31
+ interface BackblazeConfig {
32
+ bucket?: string;
33
+ accountId?: string;
34
+ applicationKeyId?: string;
35
+ applicationKey?: string;
36
+ cdnUrl?: string;
37
+ prefix?: string;
38
+ }
39
+ interface BunnyConfig {
40
+ storageZone?: string;
41
+ apiKey?: string;
42
+ cdnUrl?: string;
43
+ prefix?: string;
44
+ }
45
+ interface FTPConfig {
46
+ host?: string;
47
+ port?: number;
48
+ user?: string;
49
+ password?: string;
50
+ secure?: boolean;
51
+ baseUrl?: string;
52
+ prefix?: string;
53
+ }
54
+ interface StorageConfig {
55
+ type: string;
56
+ s3: S3CompatibleConfig;
57
+ r2: R2Config;
58
+ gcs: GCSConfig;
59
+ digitalocean: S3CompatibleConfig;
60
+ backblaze: BackblazeConfig;
61
+ wasabi: S3CompatibleConfig;
62
+ bunny: BunnyConfig;
63
+ ftp: FTPConfig;
64
+ cloudinary: {
65
+ cloudName?: string;
66
+ apiKey?: string;
67
+ apiSecret?: string;
68
+ folder?: string;
69
+ };
70
+ imgix: {
71
+ domain?: string;
72
+ signKey?: string;
73
+ };
74
+ local: {
75
+ uploadDir?: string;
76
+ baseUrl?: string;
77
+ };
78
+ }
79
+ interface EmailConfig {
80
+ provider?: string;
81
+ host?: string;
82
+ port?: number;
83
+ secure?: boolean;
84
+ user?: string;
85
+ pass?: string;
86
+ from?: string;
87
+ fromName?: string;
88
+ replyTo?: string;
89
+ }
90
+ declare class ConfigService {
91
+ private db;
92
+ private cache;
93
+ private static readonly SENSITIVE_KEYS;
94
+ constructor(db: any);
95
+ /**
96
+ * Initialize the service by loading all settings from the database
97
+ */
98
+ load(): Promise<void>;
99
+ private ensureSettingsTable;
100
+ /**
101
+ * Load settings from the _globals_storage-settings table (SQLite fallback)
102
+ * Maps nested global structure to flat key-value cache
103
+ */
104
+ private loadFromGlobals;
105
+ /**
106
+ * Get a settings value with environment fallback
107
+ */
108
+ get(key: string, envKey?: string, defaultValue?: string): string | undefined;
109
+ /**
110
+ * Get storage configuration
111
+ */
112
+ getStorageConfig(): StorageConfig;
113
+ /**
114
+ * Get email configuration
115
+ */
116
+ getEmailConfig(): EmailConfig;
117
+ /**
118
+ * Mask sensitive values for display
119
+ */
120
+ maskSensitive(key: string, value: string | undefined): string | undefined;
121
+ /**
122
+ * Update a setting in the database
123
+ */
124
+ set(key: string, value: string, description?: string): Promise<void>;
125
+ }
126
+
127
+ interface UploadOptions {
128
+ folder?: string;
129
+ filename?: string;
130
+ mimeType?: string;
131
+ metadata?: Record<string, unknown>;
132
+ }
133
+ interface UploadedFile {
134
+ id: string;
135
+ filename: string;
136
+ originalName: string;
137
+ mimeType: string;
138
+ size: number;
139
+ url: string;
140
+ thumbnailUrl?: string;
141
+ width?: number;
142
+ height?: number;
143
+ folder?: string;
144
+ provider: string;
145
+ metadata?: Record<string, unknown>;
146
+ createdAt: string;
147
+ }
148
+ interface ImageTransforms {
149
+ width?: number;
150
+ height?: number;
151
+ fit?: "clip" | "crop" | "fill" | "fillmax" | "scale" | "max" | "min";
152
+ format?: "webp" | "avif" | "jpeg" | "jpg" | "png" | "gif";
153
+ quality?: number;
154
+ blur?: number;
155
+ sharpen?: number;
156
+ }
157
+ interface StorageProvider {
158
+ name: string;
159
+ displayName: string;
160
+ supportsDynamicResize: boolean;
161
+ upload(file: File, options?: UploadOptions): Promise<UploadedFile>;
162
+ uploadFromUrl(url: string, options?: UploadOptions): Promise<UploadedFile>;
163
+ delete(url: string): Promise<void>;
164
+ rename(oldUrl: string, newKey: string): Promise<string>;
165
+ getImageUrl(url: string, transforms?: ImageTransforms): string;
166
+ generateThumbnail(file: UploadedFile, size: {
167
+ width: number;
168
+ height: number;
169
+ }): Promise<string>;
170
+ list(prefix?: string): Promise<UploadedFile[]>;
171
+ exists(url: string): Promise<boolean>;
172
+ createFolder?(folder: string): Promise<void>;
173
+ deleteFolder?(folder: string): Promise<void>;
174
+ }
175
+
176
+ declare function resolveProvider(configService: ConfigService): Promise<StorageProvider>;
177
+
178
+ interface StorageProviderRegistration {
179
+ type: string;
180
+ displayName: string;
181
+ pluginName?: string;
182
+ configFields: Field[];
183
+ configKey?: string;
184
+ extractConfig: (storageConfig: StorageConfig, configKey: string) => any;
185
+ extractRawConfig: (config: any) => any;
186
+ factory: (config: any) => StorageProvider;
187
+ }
188
+ declare class StorageProviderRegistry {
189
+ private providers;
190
+ private providerToPlugin;
191
+ private disabledPlugins;
192
+ constructor();
193
+ private registerLocal;
194
+ private registerImgix;
195
+ private registerBunny;
196
+ register(registration: StorageProviderRegistration): void;
197
+ unregister(type: string): void;
198
+ get(type: string): StorageProviderRegistration | undefined;
199
+ getAll(): StorageProviderRegistration[];
200
+ getAllAvailable(isPluginEnabled?: (name: string) => boolean): StorageProviderRegistration[];
201
+ has(type: string): boolean;
202
+ resolve(type: string, storageConfig: StorageConfig): Promise<StorageProvider>;
203
+ resolveWithConfig(type: string, config: any): Promise<StorageProvider>;
204
+ getProviderPluginName(type: string): string | undefined;
205
+ getAllPluginNames(): string[];
206
+ setPluginEnabled(name: string, enabled: boolean): void;
207
+ isPluginEnabled(name: string): boolean;
208
+ }
209
+
210
+ declare class Registry {
211
+ storageProviders: StorageProviderRegistry;
212
+ private collections;
213
+ private globals;
214
+ private plugins;
215
+ private schemaCache;
216
+ private initialized;
217
+ addCollection(config: CollectionConfig): void;
218
+ addCollections(configs: CollectionConfig[]): void;
219
+ getCollection(slug: string): CollectionConfig | undefined;
220
+ getCollections(): CollectionConfig[];
221
+ getCollectionSlugs(): string[];
222
+ hasCollection(slug: string): boolean;
223
+ removeCollection(slug: string): boolean;
224
+ addGlobal(config: GlobalConfig): void;
225
+ /**
226
+ * Add a global after the registry is already initialized.
227
+ * Only for internal use (e.g. storage settings form built at startup).
228
+ */
229
+ addGlobalPostInit(config: GlobalConfig): void;
230
+ private _addGlobalUnsafe;
231
+ addGlobals(configs: GlobalConfig[]): void;
232
+ getGlobal(slug: string): GlobalConfig | undefined;
233
+ getGlobals(): GlobalConfig[];
234
+ getGlobalSlugs(): string[];
235
+ hasGlobal(slug: string): boolean;
236
+ removeGlobal(slug: string): boolean;
237
+ addPlugin(plugin: PluginConfig): void;
238
+ getPlugins(): PluginConfig[];
239
+ getZodSchema(slug: string): ZodTypeAny;
240
+ getCreateZodSchema(slug: string): ZodTypeAny;
241
+ getUpdateZodSchema(slug: string): ZodTypeAny;
242
+ getWhereZodSchema(slug: string): ZodTypeAny;
243
+ getFieldZodSchema(field: Field): ZodTypeAny;
244
+ private clearSchemaCache;
245
+ private applyFieldDefaults;
246
+ getFields(slug: string): Field[];
247
+ getFieldMap(slug: string): Map<string, Field>;
248
+ getVisibleFields(slug: string): Field[];
249
+ validate(): void;
250
+ init(): Promise<void>;
251
+ isInitialized(): boolean;
252
+ getPaginationDefaults(slug: string): {
253
+ defaultLimit: number;
254
+ limits: number[];
255
+ };
256
+ getDefaultSort(slug: string): string;
257
+ getDefaultColumns(slug: string): string[];
258
+ getAdminTitle(slug: string): string;
259
+ getAdminLabel(slug: string): string;
260
+ getAdminGroup(slug: string): string | undefined;
261
+ getStats(): {
262
+ collections: number;
263
+ globals: number;
264
+ plugins: number;
265
+ fields: number;
266
+ };
267
+ toJSON(): {
268
+ collections: CollectionConfig[];
269
+ globals: GlobalConfig[];
270
+ };
271
+ }
272
+ declare function getRegistry(): Registry;
273
+ declare function resetRegistry(): void;
274
+ declare function createRegistry(): Registry;
275
+
276
+ export { ConfigService as C, type EmailConfig as E, Registry as R, type StorageProvider as S, type StorageConfig as a, resolveProvider as b, createRegistry as c, getRegistry as g, resetRegistry as r };