@kyro-cms/core 0.13.3 → 0.13.6

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 (563) 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 +2 -2
  5. package/dist/api-handler-trpc.cjs +1 -1
  6. package/dist/api-handler-trpc.js +2 -2
  7. package/dist/api-handler.cjs +1 -1
  8. package/dist/api-handler.js +1 -1
  9. package/dist/auth-session-4WJUKESW.js +1 -0
  10. package/dist/auth-session-VHUHDBCL.cjs +1 -0
  11. package/dist/{base-A9AJPCG5.d.ts → base-C2DOe8wD.d.ts} +2 -2
  12. package/dist/{base-C6wyX2nC.d.cts → base-DIpT2Vuz.d.cts} +2 -2
  13. package/dist/bootstrap-JYAUQ52D.cjs +1 -0
  14. package/dist/bootstrap-TTMLNQM3.js +1 -0
  15. package/dist/chunk-23RSKVJP.cjs +1 -0
  16. package/dist/chunk-24W5I6SJ.cjs +2 -0
  17. package/dist/{chunk-CH4TZZI5.js → chunk-2I2AXTKY.cjs} +38 -39
  18. package/dist/chunk-34LCWI5X.cjs +1 -0
  19. package/dist/chunk-3A5UO6OQ.cjs +114 -0
  20. package/dist/chunk-3N34WXBS.js +2 -0
  21. package/dist/chunk-5BUAWCU6.js +91 -0
  22. package/dist/{chunk-7NKNSRCB.cjs → chunk-5I3BM5TV.js} +33 -32
  23. package/dist/chunk-5RBGM5N5.js +3 -0
  24. package/dist/chunk-7EY3GXRA.js +2 -0
  25. package/dist/chunk-7KTPBTH5.cjs +1 -0
  26. package/dist/chunk-A4XM33WO.js +109 -0
  27. package/dist/chunk-A7763NCF.cjs +19 -0
  28. package/dist/chunk-AQWTJGML.cjs +1 -0
  29. package/dist/chunk-CIWLQXB2.js +2 -0
  30. package/dist/chunk-DCFOVCJX.cjs +1 -0
  31. package/dist/chunk-DCKJT247.cjs +1 -0
  32. package/dist/chunk-EG4SRTYS.cjs +2 -0
  33. package/dist/chunk-FAG2645P.js +2 -0
  34. package/dist/chunk-FIVTKI25.cjs +3 -0
  35. package/dist/chunk-FU76HURF.cjs +1 -0
  36. package/dist/chunk-GDLMPZKD.cjs +2 -0
  37. package/dist/chunk-GS4CMYKS.cjs +1 -0
  38. package/dist/chunk-GTAKGVUY.js +2 -0
  39. package/dist/chunk-GWUHIIPO.cjs +132 -0
  40. package/dist/chunk-H2IJDTA2.cjs +1 -0
  41. package/dist/chunk-HACW42ZZ.cjs +108 -0
  42. package/dist/chunk-HCM2G674.cjs +20 -0
  43. package/dist/chunk-I22MSXGL.js +2 -0
  44. package/dist/chunk-IIPSXKNV.js +115 -0
  45. package/dist/{chunk-WNU76M2C.js → chunk-IIVBEZC2.js} +6 -6
  46. package/dist/chunk-JHFD3IAU.cjs +1 -0
  47. package/dist/chunk-JJY2F6NL.cjs +3 -0
  48. package/dist/chunk-JQ4V2MGJ.cjs +2 -0
  49. package/dist/chunk-JXJTFBHG.js +3 -0
  50. package/dist/chunk-KOSR7235.cjs +1 -0
  51. package/dist/chunk-KUY4QDAL.js +2 -0
  52. package/dist/chunk-LGUHXOEW.js +3 -0
  53. package/dist/chunk-LXTVMP5F.cjs +6 -0
  54. package/dist/chunk-N25DOGLQ.js +5 -0
  55. package/dist/chunk-N2BMGZIX.cjs +90 -0
  56. package/dist/chunk-N7CDHWQH.cjs +2 -0
  57. package/dist/chunk-NBBAMC2X.cjs +1 -0
  58. package/dist/chunk-NGNXOXI5.js +2 -0
  59. package/dist/chunk-O4PPZOVI.cjs +1 -0
  60. package/dist/chunk-O4RKZQYQ.js +2 -0
  61. package/dist/chunk-OJBL4CXK.cjs +2 -0
  62. package/dist/chunk-OPKZYQV7.js +3 -0
  63. package/dist/chunk-OXEJCIOA.cjs +1 -0
  64. package/dist/chunk-OXH6CANN.js +2 -0
  65. package/dist/{chunk-EQN3HDES.cjs → chunk-PW6Y5MQL.cjs} +5 -5
  66. package/dist/chunk-RLW6AQF2.js +2 -0
  67. package/dist/chunk-SBFVITY2.js +7 -0
  68. package/dist/chunk-SEJ7LMYY.js +4 -0
  69. package/dist/chunk-SZY25KAE.js +21 -0
  70. package/dist/chunk-TG5YQ4PB.cjs +4 -0
  71. package/dist/chunk-TJ6N5ZPZ.js +133 -0
  72. package/dist/chunk-V2RMDMWN.js +2 -0
  73. package/dist/chunk-V4SR7DU5.js +3 -0
  74. package/dist/chunk-VLFM66BZ.js +4 -0
  75. package/dist/chunk-VPBGZW4P.cjs +1 -0
  76. package/dist/chunk-VQWOCGJ2.cjs +1 -0
  77. package/dist/chunk-VWXHW74B.js +3 -0
  78. package/dist/chunk-W5GDZG64.js +2 -0
  79. package/dist/chunk-WLSVS3NC.js +2 -0
  80. package/dist/chunk-YLP3EKTQ.js +2 -0
  81. package/dist/chunk-YNSKDTFG.js +2 -0
  82. package/dist/chunk-YOJOVQIH.cjs +1 -0
  83. package/dist/chunk-ZE2X3FBU.js +20 -0
  84. package/dist/chunk-ZMH35QYG.js +2 -0
  85. package/dist/cli/index.cjs +53 -182
  86. package/dist/cli/index.js +54 -183
  87. package/dist/drizzle/index.cjs +1 -1
  88. package/dist/drizzle/index.d.cts +3 -3
  89. package/dist/drizzle/index.d.ts +3 -3
  90. package/dist/drizzle/index.js +1 -1
  91. package/dist/fields/index.cjs +1 -1
  92. package/dist/fields/index.d.cts +2 -2
  93. package/dist/fields/index.d.ts +2 -2
  94. package/dist/fields/index.js +1 -1
  95. package/dist/graphql/index.cjs +1 -1
  96. package/dist/graphql/index.d.cts +3 -3
  97. package/dist/graphql/index.d.ts +3 -3
  98. package/dist/graphql/index.js +1 -1
  99. package/dist/{index-BttsFZDa.d.ts → index-C9uBoJtm.d.ts} +2 -2
  100. package/dist/{index-BMcYFpTv.d.cts → index-Ci7aUrmN.d.cts} +2 -2
  101. package/dist/index.cjs +30 -30
  102. package/dist/index.d.cts +10 -10
  103. package/dist/index.d.ts +10 -10
  104. package/dist/index.js +31 -31
  105. package/dist/integration.cjs +1 -1
  106. package/dist/integration.js +1 -1
  107. package/dist/local-DKP43BWQ.cjs +1 -0
  108. package/dist/local-TF5ZMHWW.js +1 -0
  109. package/dist/media-M3EIZ4QS.cjs +1 -0
  110. package/dist/media-WYEILC6K.js +1 -0
  111. package/dist/mongo-auth-adapter-33M5ENM7.cjs +1 -0
  112. package/dist/mongo-auth-adapter-4ITULS2P.js +1 -0
  113. package/dist/mongodb/index.cjs +1 -1
  114. package/dist/mongodb/index.d.cts +3 -3
  115. package/dist/mongodb/index.d.ts +3 -3
  116. package/dist/mongodb/index.js +1 -1
  117. package/dist/nodemailer-transport-7F3VLLBW.js +1 -0
  118. package/dist/nodemailer-transport-WAPZD3SJ.cjs +1 -0
  119. package/dist/postgres-auth-adapter-7BCPXNBO.js +1 -0
  120. package/dist/postgres-auth-adapter-HMXFUM5W.cjs +1 -0
  121. package/dist/redis-adapter-2E5AWMMA.cjs +1 -0
  122. package/dist/redis-adapter-GFH74CF4.js +1 -0
  123. package/dist/rest/index.cjs +1 -1
  124. package/dist/rest/index.d.cts +4 -4
  125. package/dist/rest/index.d.ts +4 -4
  126. package/dist/rest/index.js +1 -1
  127. package/dist/schema-FNIDQKIJ.cjs +1 -0
  128. package/dist/schema-KD736QFN.js +1 -0
  129. package/dist/sqlite-adapter-HL53RLSN.cjs +1 -0
  130. package/dist/sqlite-adapter-TT6ZASDG.js +1 -0
  131. package/dist/templates/index.cjs +1 -1
  132. package/dist/templates/index.d.cts +2 -2
  133. package/dist/templates/index.d.ts +2 -2
  134. package/dist/templates/index.js +1 -1
  135. package/dist/trpc/index.cjs +1 -1
  136. package/dist/trpc/index.d.cts +3 -3
  137. package/dist/trpc/index.d.ts +3 -3
  138. package/dist/trpc/index.js +1 -1
  139. package/dist/{types-DxaK39ix.d.cts → types-C3QFX0l6.d.cts} +4 -0
  140. package/dist/{types-DxaK39ix.d.ts → types-C3QFX0l6.d.ts} +4 -0
  141. package/dist/{types-6ShQp2EM.d.cts → types-CKWnrUAh.d.ts} +23 -2
  142. package/dist/{types-BCOhfwHC.d.ts → types-CdwfDpyW.d.cts} +23 -2
  143. package/dist/ws/index.cjs +1 -1
  144. package/dist/ws/index.js +1 -1
  145. package/package.json +3 -11
  146. package/dist/WebhookService-BcuD8tnn.d.cts +0 -143
  147. package/dist/WebhookService-CFe6Zd0_.d.cts +0 -143
  148. package/dist/WebhookService-CGxHtw7E.d.cts +0 -143
  149. package/dist/WebhookService-CNC1lYz7.d.ts +0 -143
  150. package/dist/WebhookService-CVXmjbtQ.d.cts +0 -143
  151. package/dist/WebhookService-D5PSI5t6.d.cts +0 -143
  152. package/dist/WebhookService-DPCCn_12.d.ts +0 -143
  153. package/dist/WebhookService-Dk1lzSrG.d.cts +0 -143
  154. package/dist/WebhookService-Dncnbgm9.d.cts +0 -143
  155. package/dist/WebhookService-I6hdue2Y.d.ts +0 -143
  156. package/dist/WebhookService-KnQ2UDlW.d.ts +0 -143
  157. package/dist/WebhookService-UY5p89Bj.d.ts +0 -143
  158. package/dist/WebhookService-YZXBCRXA.d.ts +0 -143
  159. package/dist/WebhookService-fk0FGRlk.d.ts +0 -143
  160. package/dist/WebhookService-vsFnWrOh.d.ts +0 -143
  161. package/dist/WebhookService-zrDmAx7L.d.cts +0 -143
  162. package/dist/auth-session-DHVGXHOH.cjs +0 -1
  163. package/dist/auth-session-O7IIH7EP.js +0 -1
  164. package/dist/base-B--L0lCn.d.cts +0 -218
  165. package/dist/base-B-i-tjm1.d.ts +0 -218
  166. package/dist/base-B-siit_y.d.cts +0 -218
  167. package/dist/base-B8SyZI4D.d.ts +0 -218
  168. package/dist/base-BCgFt3Yx.d.ts +0 -218
  169. package/dist/base-BHRGJ40F.d.cts +0 -218
  170. package/dist/base-BVoDPNjJ.d.cts +0 -218
  171. package/dist/base-BaOJ5uWd.d.cts +0 -218
  172. package/dist/base-BfPaVEAE.d.cts +0 -218
  173. package/dist/base-BxrX5EPU.d.cts +0 -218
  174. package/dist/base-CAb9EYQs.d.ts +0 -218
  175. package/dist/base-CcZIEll-.d.ts +0 -218
  176. package/dist/base-CyG7aF1e.d.cts +0 -218
  177. package/dist/base-DOImeJ-F.d.ts +0 -218
  178. package/dist/base-DbnwE42-.d.cts +0 -218
  179. package/dist/base-NyiSsD-n.d.ts +0 -218
  180. package/dist/base-OYfoYPYP.d.ts +0 -218
  181. package/dist/base-xflndGDO.d.ts +0 -218
  182. package/dist/bcryptjs-WIQSWJGK.cjs +0 -1
  183. package/dist/bcryptjs-ZEEHSMAG.js +0 -2
  184. package/dist/better-sqlite3-5IISPX34.cjs +0 -1
  185. package/dist/better-sqlite3-B34RIU4C.js +0 -2
  186. package/dist/bootstrap-E24SGUJP.cjs +0 -1
  187. package/dist/bootstrap-PG2LGDLB.js +0 -1
  188. package/dist/bootstrap-QQ6D3OYG.js +0 -1
  189. package/dist/bootstrap-QVKSKXJF.cjs +0 -1
  190. package/dist/bootstrap-RILR44UM.cjs +0 -1
  191. package/dist/bootstrap-YD3GLTWX.cjs +0 -1
  192. package/dist/bootstrap-YFVE7MRG.js +0 -1
  193. package/dist/bootstrap-ZRRUPRUR.js +0 -1
  194. package/dist/bowser-SB3ZUPO4.js +0 -11
  195. package/dist/bowser-VX6B6ZSE.cjs +0 -10
  196. package/dist/chokidar-5RVQZVHP.cjs +0 -5
  197. package/dist/chokidar-BOYGRT4Q.js +0 -6
  198. package/dist/chunk-22RXJ442.js +0 -57
  199. package/dist/chunk-262YP5XA.cjs +0 -1
  200. package/dist/chunk-2FSOHXOU.cjs +0 -56
  201. package/dist/chunk-2HA6EKXX.js +0 -24
  202. package/dist/chunk-2OS5Y4LE.cjs +0 -1
  203. package/dist/chunk-2PXXQKN3.cjs +0 -3
  204. package/dist/chunk-2SPWRQ5O.js +0 -122
  205. package/dist/chunk-32QY56XF.js +0 -122
  206. package/dist/chunk-355R4LS5.cjs +0 -56
  207. package/dist/chunk-35IVNLMA.js +0 -122
  208. package/dist/chunk-35PGCW3S.cjs +0 -1
  209. package/dist/chunk-3GXLOYM3.js +0 -2
  210. package/dist/chunk-3KZXF4US.js +0 -2
  211. package/dist/chunk-3LAWUINR.cjs +0 -1
  212. package/dist/chunk-3NSZZCOJ.js +0 -2
  213. package/dist/chunk-3O3AVMWM.cjs +0 -1
  214. package/dist/chunk-3TAUNYEM.js +0 -8
  215. package/dist/chunk-3U6MKWET.cjs +0 -120
  216. package/dist/chunk-3VXEK5ZW.cjs +0 -1
  217. package/dist/chunk-47CXBWMA.js +0 -2
  218. package/dist/chunk-4BMWWGJN.js +0 -384
  219. package/dist/chunk-4NTIK6DF.cjs +0 -2
  220. package/dist/chunk-4YCI3HBD.js +0 -3
  221. package/dist/chunk-4ZWLNGLS.js +0 -2
  222. package/dist/chunk-5A7E7N4B.cjs +0 -431
  223. package/dist/chunk-5ZEYOFAK.js +0 -2
  224. package/dist/chunk-6DD4J7LI.js +0 -2
  225. package/dist/chunk-6E44MQQ5.js +0 -115
  226. package/dist/chunk-6GGPY7U2.js +0 -4
  227. package/dist/chunk-6LWF5MPL.js +0 -20
  228. package/dist/chunk-6MNLRAKM.cjs +0 -121
  229. package/dist/chunk-6NBZDW53.js +0 -133
  230. package/dist/chunk-6TPICJ2L.js +0 -7
  231. package/dist/chunk-73D2PNHD.cjs +0 -7
  232. package/dist/chunk-73Y63IPP.js +0 -57
  233. package/dist/chunk-7ACHOBWY.cjs +0 -13
  234. package/dist/chunk-7DUKWHRN.cjs +0 -1
  235. package/dist/chunk-7GGZA5YU.cjs +0 -2
  236. package/dist/chunk-7JWQ2PZP.cjs +0 -1
  237. package/dist/chunk-7K6ZUNJM.js +0 -4
  238. package/dist/chunk-7KLEANTO.cjs +0 -1
  239. package/dist/chunk-7LLCXY5O.cjs +0 -19
  240. package/dist/chunk-7MNDQU6K.js +0 -8
  241. package/dist/chunk-7NH7H3WA.js +0 -10
  242. package/dist/chunk-7WMMKGEO.cjs +0 -1
  243. package/dist/chunk-A35ZP72D.cjs +0 -132
  244. package/dist/chunk-A3IOQOV6.js +0 -2
  245. package/dist/chunk-A3XVL6ED.cjs +0 -3
  246. package/dist/chunk-A7LZ6T42.cjs +0 -1
  247. package/dist/chunk-APDQ6ZTG.cjs +0 -120
  248. package/dist/chunk-ATI2UZ7U.js +0 -2
  249. package/dist/chunk-AWQGDMOE.js +0 -3
  250. package/dist/chunk-B3BSVEFC.cjs +0 -3
  251. package/dist/chunk-B4AC23SG.js +0 -122
  252. package/dist/chunk-BAVN7VDR.cjs +0 -1
  253. package/dist/chunk-BCEE4NBZ.cjs +0 -2
  254. package/dist/chunk-BD6XHMMM.cjs +0 -2
  255. package/dist/chunk-BUNLC3II.cjs +0 -1
  256. package/dist/chunk-C7QCZX7X.js +0 -2
  257. package/dist/chunk-CHYVUWZ3.js +0 -2
  258. package/dist/chunk-CIVA6SKW.js +0 -2
  259. package/dist/chunk-CNHUCCQJ.js +0 -121
  260. package/dist/chunk-CRP6PSCE.js +0 -2
  261. package/dist/chunk-D6SDGHY6.js +0 -2
  262. package/dist/chunk-DI6TCZSE.js +0 -122
  263. package/dist/chunk-DORUYZQV.cjs +0 -1
  264. package/dist/chunk-DSHKQL3R.cjs +0 -121
  265. package/dist/chunk-DVWYO3KK.cjs +0 -1
  266. package/dist/chunk-E4H3ZZ7U.js +0 -4
  267. package/dist/chunk-EFKEVWAD.js +0 -4
  268. package/dist/chunk-EHWUALGH.cjs +0 -1
  269. package/dist/chunk-EI7FRSNY.js +0 -57
  270. package/dist/chunk-ELFQKQLL.js +0 -2
  271. package/dist/chunk-EML5FDUU.js +0 -2
  272. package/dist/chunk-EN65ZEK2.cjs +0 -2
  273. package/dist/chunk-EON4XLKQ.cjs +0 -1
  274. package/dist/chunk-EUQAOYEO.cjs +0 -121
  275. package/dist/chunk-EVAUBT7H.js +0 -57
  276. package/dist/chunk-EW424IBO.cjs +0 -1
  277. package/dist/chunk-EYHD7HZE.cjs +0 -1
  278. package/dist/chunk-EYYIPA5N.js +0 -432
  279. package/dist/chunk-EZIDQBXI.cjs +0 -1
  280. package/dist/chunk-F2O4QO5N.cjs +0 -383
  281. package/dist/chunk-F4ITQ6XQ.cjs +0 -3
  282. package/dist/chunk-FBWLSWZ4.js +0 -122
  283. package/dist/chunk-FDKU7HJX.js +0 -2
  284. package/dist/chunk-FG3IFGJP.cjs +0 -1
  285. package/dist/chunk-FGN6IMPY.cjs +0 -3
  286. package/dist/chunk-FK2BG4HU.js +0 -3
  287. package/dist/chunk-FLMUMPDE.js +0 -2
  288. package/dist/chunk-FLS2FJM6.cjs +0 -431
  289. package/dist/chunk-FP5UK272.cjs +0 -1
  290. package/dist/chunk-FSL3NLRT.cjs +0 -2
  291. package/dist/chunk-FUFS65Q5.js +0 -133
  292. package/dist/chunk-GIS6X43A.cjs +0 -3
  293. package/dist/chunk-GNEVCEJU.cjs +0 -3
  294. package/dist/chunk-GNOSG3PK.cjs +0 -1
  295. package/dist/chunk-GQGFNTDZ.js +0 -2
  296. package/dist/chunk-GTR7JAKP.cjs +0 -3
  297. package/dist/chunk-GV2IB4WQ.cjs +0 -56
  298. package/dist/chunk-GWIZT2P5.js +0 -57
  299. package/dist/chunk-H3FJ54KB.cjs +0 -121
  300. package/dist/chunk-HPIJI7TM.js +0 -3
  301. package/dist/chunk-HPYH7GTS.cjs +0 -1
  302. package/dist/chunk-HRAY65XH.js +0 -3
  303. package/dist/chunk-HTYVI2HK.cjs +0 -9
  304. package/dist/chunk-HY3EAWB2.js +0 -4
  305. package/dist/chunk-I6UJVO2P.js +0 -57
  306. package/dist/chunk-IKGVPXMK.js +0 -3
  307. package/dist/chunk-IQSF6XRV.js +0 -57
  308. package/dist/chunk-IXGDTAES.js +0 -4
  309. package/dist/chunk-J6V573PE.cjs +0 -1
  310. package/dist/chunk-JA44K75G.js +0 -2
  311. package/dist/chunk-JB4WG2YJ.cjs +0 -121
  312. package/dist/chunk-JCEJ4VTN.js +0 -20
  313. package/dist/chunk-JRUQ5ABB.js +0 -4
  314. package/dist/chunk-JV4HJBXW.js +0 -14
  315. package/dist/chunk-JZ7Z6WC2.cjs +0 -3
  316. package/dist/chunk-K5XGP57D.cjs +0 -19
  317. package/dist/chunk-K73HOMQY.cjs +0 -56
  318. package/dist/chunk-KEITOXIP.js +0 -2
  319. package/dist/chunk-KMFLHGD5.cjs +0 -1
  320. package/dist/chunk-KZHXYXSH.cjs +0 -10
  321. package/dist/chunk-L3Q64RUX.js +0 -3
  322. package/dist/chunk-LBLFU6KI.js +0 -57
  323. package/dist/chunk-LEBM6ZSZ.cjs +0 -10
  324. package/dist/chunk-LP3HRZGK.js +0 -57
  325. package/dist/chunk-LPFRMQFQ.js +0 -121
  326. package/dist/chunk-LQ3YZTPU.cjs +0 -15
  327. package/dist/chunk-LVBHOZZF.js +0 -4
  328. package/dist/chunk-LWM4WABU.js +0 -3
  329. package/dist/chunk-LY7N3UHH.cjs +0 -23
  330. package/dist/chunk-LYU44UNN.cjs +0 -56
  331. package/dist/chunk-M75VGFCI.js +0 -3
  332. package/dist/chunk-MCIZG4A3.cjs +0 -1
  333. package/dist/chunk-MDLJTZLV.cjs +0 -1
  334. package/dist/chunk-MFNN5DYG.cjs +0 -1
  335. package/dist/chunk-MJAODEFC.cjs +0 -121
  336. package/dist/chunk-MLCBSEBU.js +0 -2
  337. package/dist/chunk-MSC4G2HF.cjs +0 -2
  338. package/dist/chunk-MYHNTJLR.cjs +0 -56
  339. package/dist/chunk-N2YHO2WI.cjs +0 -3
  340. package/dist/chunk-N4FXLQE3.cjs +0 -132
  341. package/dist/chunk-N5POANYV.js +0 -2
  342. package/dist/chunk-N6MNQIQU.js +0 -123
  343. package/dist/chunk-NGNJSUGL.cjs +0 -1
  344. package/dist/chunk-NPBXLPOP.js +0 -3
  345. package/dist/chunk-NRE6VKL6.cjs +0 -121
  346. package/dist/chunk-O4YE57OS.cjs +0 -6
  347. package/dist/chunk-O7CBGP4N.cjs +0 -1
  348. package/dist/chunk-OBYAIJVU.js +0 -11
  349. package/dist/chunk-OJ3H4AQ2.cjs +0 -56
  350. package/dist/chunk-OLRCZ6E3.js +0 -2
  351. package/dist/chunk-ON5XJEPO.cjs +0 -3
  352. package/dist/chunk-OOVNTOZC.cjs +0 -56
  353. package/dist/chunk-OPTVCCQQ.cjs +0 -122
  354. package/dist/chunk-OT2Z4XBD.cjs +0 -1
  355. package/dist/chunk-P6JITOFF.js +0 -4
  356. package/dist/chunk-PFKVHUOT.js +0 -432
  357. package/dist/chunk-PFTBTWSC.cjs +0 -1
  358. package/dist/chunk-PITMDQYN.cjs +0 -18
  359. package/dist/chunk-PTPVFLET.js +0 -20
  360. package/dist/chunk-PYUWSKKP.js +0 -57
  361. package/dist/chunk-PZDLPRJF.js +0 -4
  362. package/dist/chunk-Q5TFO66G.cjs +0 -1
  363. package/dist/chunk-QC4YXUBT.cjs +0 -383
  364. package/dist/chunk-QO5ZWQA3.cjs +0 -74
  365. package/dist/chunk-QUTYCUST.js +0 -4
  366. package/dist/chunk-QYN6C3FZ.cjs +0 -114
  367. package/dist/chunk-REKKBAQX.cjs +0 -56
  368. package/dist/chunk-REQ622YC.js +0 -3
  369. package/dist/chunk-RPRGGGIW.js +0 -11
  370. package/dist/chunk-RTNQP6BV.js +0 -2
  371. package/dist/chunk-RUJW47ZJ.js +0 -2
  372. package/dist/chunk-RVBSJ4UQ.cjs +0 -7
  373. package/dist/chunk-RXYCFZJC.cjs +0 -121
  374. package/dist/chunk-RYHOWZLK.js +0 -2
  375. package/dist/chunk-RYXLEFS5.js +0 -2
  376. package/dist/chunk-S2MZNEBQ.cjs +0 -1
  377. package/dist/chunk-S5HTTLN7.cjs +0 -2
  378. package/dist/chunk-S73YERS2.js +0 -57
  379. package/dist/chunk-SBNMXQNO.cjs +0 -2
  380. package/dist/chunk-SLMIYECU.js +0 -2
  381. package/dist/chunk-SMQ6736Y.js +0 -57
  382. package/dist/chunk-SRIXRJHL.js +0 -4
  383. package/dist/chunk-T3DJ3UTP.cjs +0 -121
  384. package/dist/chunk-TBHNE4VV.js +0 -2
  385. package/dist/chunk-TCFL3UWT.cjs +0 -2
  386. package/dist/chunk-TEY5LZ26.cjs +0 -56
  387. package/dist/chunk-TJZO7ZSX.cjs +0 -3
  388. package/dist/chunk-TKUNRCRH.js +0 -4
  389. package/dist/chunk-TQLCOMKC.js +0 -4
  390. package/dist/chunk-TRXYDWGE.cjs +0 -1
  391. package/dist/chunk-TS55CUNJ.js +0 -57
  392. package/dist/chunk-TYQYKKWJ.js +0 -16
  393. package/dist/chunk-U6KFONKM.js +0 -2
  394. package/dist/chunk-UFBJ3WOZ.js +0 -2
  395. package/dist/chunk-UNYXWPLZ.cjs +0 -2
  396. package/dist/chunk-UQRVQUVR.js +0 -2
  397. package/dist/chunk-UW5W35NP.js +0 -122
  398. package/dist/chunk-UWHWSWDE.js +0 -2
  399. package/dist/chunk-UWVBFRCW.js +0 -2
  400. package/dist/chunk-UZWYFEUN.js +0 -122
  401. package/dist/chunk-V4FAL7AG.js +0 -2
  402. package/dist/chunk-VI7WCO2J.cjs +0 -3
  403. package/dist/chunk-VOYPKTID.cjs +0 -1
  404. package/dist/chunk-VQ53TFYA.cjs +0 -1
  405. package/dist/chunk-VRZC4TTF.cjs +0 -1
  406. package/dist/chunk-VTOL3URF.js +0 -4
  407. package/dist/chunk-VVVCCB6R.js +0 -2
  408. package/dist/chunk-W2GPP6RB.js +0 -122
  409. package/dist/chunk-W45TLOOT.js +0 -2
  410. package/dist/chunk-WAVGRSE6.js +0 -2
  411. package/dist/chunk-WHOA7YJU.cjs +0 -1
  412. package/dist/chunk-WNRUPL26.js +0 -2
  413. package/dist/chunk-WPM6LFCY.js +0 -2
  414. package/dist/chunk-WXT2XW7T.js +0 -13
  415. package/dist/chunk-X473JI7Z.js +0 -75
  416. package/dist/chunk-X6HUA6EF.cjs +0 -20
  417. package/dist/chunk-XBQ6HV3T.cjs +0 -114
  418. package/dist/chunk-XDPLVJRO.js +0 -21
  419. package/dist/chunk-XDQVYCIR.cjs +0 -1
  420. package/dist/chunk-XFYSADHV.cjs +0 -2
  421. package/dist/chunk-XIAJQLGS.js +0 -2
  422. package/dist/chunk-XK6UB77Q.js +0 -4
  423. package/dist/chunk-XOR64WUQ.cjs +0 -19
  424. package/dist/chunk-XP7BXFXT.cjs +0 -121
  425. package/dist/chunk-Y2VHO66Q.cjs +0 -3
  426. package/dist/chunk-Y2YAKDEQ.js +0 -2
  427. package/dist/chunk-Y5O2OD7J.cjs +0 -3
  428. package/dist/chunk-YARB43JG.cjs +0 -56
  429. package/dist/chunk-YENNL5HG.js +0 -2
  430. package/dist/chunk-YGI5W4RS.js +0 -2
  431. package/dist/chunk-YLCEMVYY.cjs +0 -56
  432. package/dist/chunk-YSOM57GK.cjs +0 -3
  433. package/dist/chunk-YUUXFD73.js +0 -19
  434. package/dist/chunk-Z2SN2MYP.js +0 -122
  435. package/dist/chunk-Z3UVDGYS.cjs +0 -56
  436. package/dist/chunk-ZAKYTBEN.js +0 -3
  437. package/dist/chunk-ZHA446FA.cjs +0 -1
  438. package/dist/chunk-ZO3YB5DK.cjs +0 -1
  439. package/dist/chunk-ZOVH6QT5.cjs +0 -1
  440. package/dist/chunk-ZRIBWDYJ.js +0 -384
  441. package/dist/chunk-ZTLGK6R4.cjs +0 -12
  442. package/dist/chunk-ZUBJ6RLQ.cjs +0 -1
  443. package/dist/chunk-ZWDBPEXL.js +0 -115
  444. package/dist/client.d.cts +0 -1266
  445. package/dist/client.d.ts +0 -1266
  446. package/dist/d1-5ZQJOFDX.cjs +0 -1
  447. package/dist/d1-HPB6B253.js +0 -2
  448. package/dist/dist-es-3SSNUZST.cjs +0 -1
  449. package/dist/dist-es-64F22JL2.js +0 -2
  450. package/dist/dist-es-A5OF2STN.cjs +0 -2
  451. package/dist/dist-es-BOW5V247.cjs +0 -6
  452. package/dist/dist-es-CRIMATLL.cjs +0 -2
  453. package/dist/dist-es-DL3VLVP6.cjs +0 -1
  454. package/dist/dist-es-F2ZR55UK.js +0 -4
  455. package/dist/dist-es-IPSSZNFP.js +0 -1
  456. package/dist/dist-es-M2F7M27Y.js +0 -2
  457. package/dist/dist-es-M66JKZF5.js +0 -7
  458. package/dist/dist-es-OKLLRYI3.js +0 -2
  459. package/dist/dist-es-P25IKLBI.cjs +0 -1
  460. package/dist/dist-es-SRPWSAF4.cjs +0 -1
  461. package/dist/dist-es-SVHZDVUF.js +0 -3
  462. package/dist/dist-es-T2H2W5BX.cjs +0 -3
  463. package/dist/dist-es-WFI55HKT.js +0 -3
  464. package/dist/drizzle-orm-47ELDEM6.cjs +0 -1
  465. package/dist/drizzle-orm-XRTSOQJS.js +0 -1
  466. package/dist/event-streams-7NAWZW2I.js +0 -1
  467. package/dist/event-streams-JBMWCI2O.cjs +0 -1
  468. package/dist/fs-KWBRQ6T6.js +0 -1
  469. package/dist/fs-ZQYOJOIO.cjs +0 -1
  470. package/dist/index-8Ino7vKq.d.ts +0 -105
  471. package/dist/index-B9BFNOHd.d.cts +0 -105
  472. package/dist/index-ByOM1Y5x.d.ts +0 -105
  473. package/dist/index-C6xmtRio.d.cts +0 -105
  474. package/dist/index-CTI3K_uq.d.cts +0 -105
  475. package/dist/index-CTL4zv_u.d.ts +0 -105
  476. package/dist/index-CaDbioSg.d.ts +0 -105
  477. package/dist/index-CxA9uOv0.d.ts +0 -105
  478. package/dist/index-D6AXbuPI.d.ts +0 -105
  479. package/dist/index-DF0KDBaM.d.cts +0 -105
  480. package/dist/index-DG4Xu7gA.d.cts +0 -105
  481. package/dist/index-DS3DpJli.d.cts +0 -105
  482. package/dist/index-NGnJpSgf.d.ts +0 -105
  483. package/dist/index-Zrg3sZ6R.d.cts +0 -105
  484. package/dist/index-eHex8Iwj.d.ts +0 -105
  485. package/dist/index-rm7uyOK1.d.cts +0 -105
  486. package/dist/jsonwebtoken-DFB6ZBZA.cjs +0 -8
  487. package/dist/jsonwebtoken-OD67R5JS.js +0 -9
  488. package/dist/lib-5QYYN6ML.cjs +0 -12
  489. package/dist/lib-A2D63VXD.cjs +0 -1
  490. package/dist/lib-JQD2JAOO.js +0 -2
  491. package/dist/lib-XXYYUPMW.js +0 -13
  492. package/dist/loadSso-JY4WDQPS.cjs +0 -2
  493. package/dist/loadSso-UQR6545M.js +0 -3
  494. package/dist/local-6UUGBZ4M.js +0 -1
  495. package/dist/local-DPLKZQA3.js +0 -1
  496. package/dist/local-KR3AIGVA.cjs +0 -1
  497. package/dist/local-S5VA7IXE.cjs +0 -1
  498. package/dist/local-T7GISZBL.js +0 -1
  499. package/dist/local-ZYHV3J2K.cjs +0 -1
  500. package/dist/media-3Z6YW5J4.cjs +0 -1
  501. package/dist/media-E762GEHL.js +0 -1
  502. package/dist/mongo-auth-adapter-2H2AXDRH.cjs +0 -1
  503. package/dist/mongo-auth-adapter-EUHAYWJ6.cjs +0 -1
  504. package/dist/mongo-auth-adapter-FW7ATYQ6.js +0 -1
  505. package/dist/mongo-auth-adapter-GR2CFFEA.js +0 -1
  506. package/dist/mongo-auth-adapter-UOO2LZUJ.cjs +0 -1
  507. package/dist/mongo-auth-adapter-YWMEOC42.js +0 -1
  508. package/dist/nodemailer-IDML4L6W.cjs +0 -53
  509. package/dist/nodemailer-NITB45SS.js +0 -54
  510. package/dist/nodemailer-transport-3VWVUBM5.cjs +0 -1
  511. package/dist/nodemailer-transport-7RHATUKL.js +0 -1
  512. package/dist/nodemailer-transport-CHO2WKIY.js +0 -1
  513. package/dist/nodemailer-transport-ED2IXNGW.cjs +0 -1
  514. package/dist/postgres-auth-adapter-QKBNXVPT.js +0 -1
  515. package/dist/postgres-auth-adapter-SK3N3OSS.js +0 -1
  516. package/dist/postgres-auth-adapter-WMLM4UUC.cjs +0 -1
  517. package/dist/postgres-auth-adapter-ZO6HK5AK.cjs +0 -1
  518. package/dist/postgres-js-7YBZKGXG.cjs +0 -1
  519. package/dist/postgres-js-JLFIWOBH.js +0 -1
  520. package/dist/redis-adapter-EGMUN65D.cjs +0 -1
  521. package/dist/redis-adapter-EVK2SMKH.cjs +0 -1
  522. package/dist/redis-adapter-LY2NBSAG.js +0 -1
  523. package/dist/redis-adapter-QPCTMF55.js +0 -1
  524. package/dist/schema-RT6WSUYC.cjs +0 -1
  525. package/dist/schema-YFMSJK2P.js +0 -2
  526. package/dist/signin-N3T2KF5Q.js +0 -3
  527. package/dist/signin-VFBLX7EL.cjs +0 -2
  528. package/dist/sqlite-adapter-52PL52VU.js +0 -1
  529. package/dist/sqlite-adapter-KPSISY6E.cjs +0 -1
  530. package/dist/sqlite-adapter-MNNZZXGX.cjs +0 -1
  531. package/dist/sqlite-adapter-PI6SIY7O.js +0 -1
  532. package/dist/src-6LAUXXDM.cjs +0 -1
  533. package/dist/src-QBADSZV4.js +0 -1
  534. package/dist/sso-oidc-54BIRYR6.cjs +0 -2
  535. package/dist/sso-oidc-UB7G4END.js +0 -3
  536. package/dist/sts-WAA6I22C.js +0 -3
  537. package/dist/sts-YLXXIB3X.cjs +0 -2
  538. package/dist/types-B5Qz1svz.d.cts +0 -822
  539. package/dist/types-B9oXBEKI.d.cts +0 -330
  540. package/dist/types-B9oXBEKI.d.ts +0 -330
  541. package/dist/types-BRDBNacn.d.ts +0 -839
  542. package/dist/types-Bii0bhUV.d.cts +0 -329
  543. package/dist/types-Bii0bhUV.d.ts +0 -329
  544. package/dist/types-Bt2_ycUO.d.ts +0 -811
  545. package/dist/types-C4wXHImf.d.ts +0 -822
  546. package/dist/types-C8yIAV6K.d.cts +0 -839
  547. package/dist/types-CORUQhY-.d.ts +0 -839
  548. package/dist/types-Cdssrcbz.d.cts +0 -839
  549. package/dist/types-CjGqxBd3.d.cts +0 -330
  550. package/dist/types-CjGqxBd3.d.ts +0 -330
  551. package/dist/types-DBGR-eQl.d.cts +0 -839
  552. package/dist/types-DCWgPFmi.d.cts +0 -822
  553. package/dist/types-DROqAsr0.d.cts +0 -330
  554. package/dist/types-DROqAsr0.d.ts +0 -330
  555. package/dist/types-DlGSbh7I.d.cts +0 -297
  556. package/dist/types-DlGSbh7I.d.ts +0 -297
  557. package/dist/types-DsF64Wrc.d.cts +0 -811
  558. package/dist/types-IeKFn7Ky.d.ts +0 -839
  559. package/dist/types-QglJ7PwT.d.cts +0 -839
  560. package/dist/types-ZrjEVWfi.d.ts +0 -811
  561. package/dist/types-dEy5JxvN.d.ts +0 -822
  562. package/dist/types-tVJc9YbX.d.cts +0 -811
  563. package/dist/types-zt5qIvje.d.ts +0 -839
@@ -1 +0,0 @@
1
- 'use strict';var chunkQ5TFO66G_cjs=require('./chunk-Q5TFO66G.cjs'),chunk7NKNSRCB_cjs=require('./chunk-7NKNSRCB.cjs'),chunkEQN3HDES_cjs=require('./chunk-EQN3HDES.cjs'),chunkBUNLC3II_cjs=require('./chunk-BUNLC3II.cjs');chunkBUNLC3II_cjs.h();async function g(t){let{adminEmail:e,adminPassword:r,adminRole:a="super_admin",tenantId:n,emailConfig:o,sendWelcomeEmail:c=false}=t,s=t.authAdapter||new chunkEQN3HDES_cjs.a({path:t.authDbPath||"./data/auth.db"});try{await s.connect?.();}catch{return {success:false,error:"Failed to connect to auth storage"}}let u=new chunkQ5TFO66G_cjs.a().validate(r);if(!u.valid)return await s.disconnect?.(),{success:false,error:`Invalid password: ${u.errors.join(", ")}`};if(await s.findUserByEmail(e))return await s.disconnect?.(),{success:false,error:"Admin user already exists"};try{let i=await s.createUser({name:"Super Admin",email:e,password:r,role:a||"admin",tenantId:n});if(await s.updateUser?.(i.id,{emailVerified:!0}),c&&o){let l=new chunk7NKNSRCB_cjs.q(o),A=l.getTemplates().welcome(e.split("@")[0]);await l.send({to:e,...A});}return await s.disconnect?.(),{success:!0,user:i}}catch(i){return await s.disconnect?.(),{success:false,error:i instanceof Error?i.message:"Failed to create admin user"}}}async function U(t,e){return !await t.findUserByEmail(e)}function w(t){let e=t.KYRO_ADMIN_EMAIL,r=t.KYRO_ADMIN_PASSWORD;return !e||!r?null:{authDbPath:t.KYRO_AUTH_DB_PATH||"./data/auth.db",adminEmail:e,adminPassword:r,adminRole:t.KYRO_ADMIN_ROLE||"super_admin",tenantId:t.KYRO_ADMIN_TENANT_ID,emailConfig:t.SMTP_HOST?{provider:"smtp",smtp:{host:t.SMTP_HOST,port:parseInt(t.SMTP_PORT||"587",10),secure:t.SMTP_SECURE==="true",auth:{user:t.SMTP_USER||"",pass:t.SMTP_PASS||""}},from:t.SMTP_FROM||"noreply@example.com",fromName:t.SMTP_FROM_NAME}:void 0,sendWelcomeEmail:t.KYRO_ADMIN_SEND_WELCOME==="true"}}function h(){return w(process.env)}async function E(){try{let{env:t}=await import('cloudflare:workers');if(t){let e=w(t);if(e)return e}}catch{}return null}async function M(t){let e=h()||await E();if(!e)return null;t&&(e.authAdapter=t);try{if(await e.authAdapter?.connect?.(),await e.authAdapter?.findUserByEmail(e.adminEmail))return await e.authAdapter?.disconnect?.(),{success:!1,error:"Admin user already exists"}}catch{}let r=await g(e);return r.success||console.error(`Bootstrap failed: ${r.error}`),r}async function x(t,e=3,r=2e3){let a="";for(let n=0;n<e;n++){let o=await g(t);if(o.success||(a=o.error||"Unknown error",a.includes("already exists")))return o;n<e-1&&await new Promise(c=>setTimeout(c,r));}return {success:false,error:`Failed after ${e} retries: ${a}`}}exports.a=g;exports.b=U;exports.c=w;exports.d=h;exports.e=M;exports.f=x;
@@ -1 +0,0 @@
1
- 'use strict';var chunkHTYVI2HK_cjs=require('./chunk-HTYVI2HK.cjs'),chunkBUNLC3II_cjs=require('./chunk-BUNLC3II.cjs'),crypto=require('crypto');chunkBUNLC3II_cjs.h();var c=chunkBUNLC3II_cjs.e(chunkHTYVI2HK_cjs.a(),1);var g=class{db;adapter;prefix;sessionTTL;refreshTokenTTL;indexesEnsured=false;constructor(e){this.db=e.db,this.adapter=e.adapter,this.prefix=e.collectionPrefix||"",this.sessionTTL=e.sessionTTL||86400,this.refreshTokenTTL=e.refreshTokenTTL||604800;}getDatabase(){let e=typeof this.db=="function"?this.db():this.db;if(!e&&this.adapter&&(this.adapter.db?e=this.adapter.db:this.adapter.client&&(this.adapter.db=this.adapter.client.db(this.adapter.database||"kyro_cms"),e=this.adapter.db)),!e&&globalThis.__KYRO_INSTANCE__?.db){let s=globalThis.__KYRO_INSTANCE__.db;s.db?e=s.db:s.client&&(s.db=s.client.db(s.database||"kyro_cms"),e=s.db);}if(!e)throw new Error("MongoDB database not initialized");return e}col(e){return this.getDatabase().collection(`${this.prefix}${e}`)}async connect(){this.adapter&&!this.adapter.connected&&await this.adapter.connect(),this.indexesEnsured||await this.ensureIndexes();}async disconnect(){}async ensureIndexes(){await this.col("users").createIndex({email:1},{unique:true}),await this.col("users").createIndex({tenantId:1}),await this.col("users").createIndex({role:1}),await this.col("sessions").createIndex({token:1},{unique:true}),await this.col("sessions").createIndex({refreshToken:1}),await this.col("sessions").createIndex({userId:1}),await this.col("sessions").createIndex({expiresAt:1},{expireAfterSeconds:0}),await this.col("audit_logs").createIndex({timestamp:-1}),await this.col("audit_logs").createIndex({userId:1}),await this.col("audit_logs").createIndex({action:1}),await this.col("audit_logs").createIndex({resource:1}),await this.col("password_history").createIndex({userId:1,createdAt:-1}),await this.col("lockouts").createIndex({userId:1},{unique:true}),await this.col("lockouts").createIndex({lockedUntil:1}),this.indexesEnsured=true;}async createUser(e){let s=crypto.randomUUID(),t=new Date,i=await this.hashPassword(e.password),r={_id:s,name:e.name||null,email:e.email.toLowerCase(),passwordHash:i,role:e.role||"customer",avatar:e.avatar||null,tenantId:e.tenantId||null,emailVerified:false,locked:false,lastLogin:null,failedLoginAttempts:0,createdAt:t,updatedAt:t};return await this.col("users").insertOne(r),this.docToAuthUser(r)}async findUserByEmail(e){let s=await this.col("users").findOne({email:e.toLowerCase()});return s?this.docToAuthUser(s):null}async findUserById(e){let s=await this.col("users").findOne({_id:e});return s?this.docToAuthUser(s):null}async updateUser(e,s){let t={updatedAt:new Date};s.name!==void 0&&(t.name=s.name),s.email!==void 0&&(t.email=s.email),s.passwordHash!==void 0&&(t.passwordHash=s.passwordHash),s.role!==void 0&&(t.role=s.role),s.avatar!==void 0&&(t.avatar=s.avatar),s.tenantId!==void 0&&(t.tenantId=s.tenantId),s.emailVerified!==void 0&&(t.emailVerified=s.emailVerified),s.locked!==void 0&&(t.locked=s.locked),s.lastLogin!==void 0&&(t.lastLogin=s.lastLogin?new Date(s.lastLogin):null),s.failedLoginAttempts!==void 0&&(t.failedLoginAttempts=s.failedLoginAttempts);let i=await this.col("users").findOneAndUpdate({_id:e},{$set:t},{returnDocument:"after"});return i?this.docToAuthUser(i):null}async deleteUser(e){return (await this.col("users").deleteOne({_id:e})).deletedCount>0}async verifyPassword(e,s){let t=await this.findUserByEmail(e);if(!t)return null;let i=await this.col("users").findOne({email:e.toLowerCase()},{projection:{passwordHash:1}});return i?.passwordHash&&await c.default.compare(s,i.passwordHash)?t:null}async hashPassword(e){return c.default.hash(e,12)}async createSession(e,s){let t=crypto.randomUUID(),i=crypto.randomBytes(32).toString("base64url"),r=crypto.randomBytes(32).toString("base64url"),o=new Date,u=new Date(o.getTime()+this.sessionTTL*1e3),d={_id:t,userId:e,token:i,refreshToken:r,ipAddress:s?.ipAddress||null,userAgent:s?.userAgent||null,expiresAt:u,createdAt:o};return await this.col("sessions").insertOne(d),this.docToSession(d)}async findSessionByToken(e){let s=await this.col("sessions").findOne({token:e,expiresAt:{$gt:new Date}});return s?this.docToSession(s):null}async findSessionByRefreshToken(e){let s=await this.col("sessions").findOne({refreshToken:e,expiresAt:{$gt:new Date}});return s?this.docToSession(s):null}async deleteSession(e){return (await this.col("sessions").deleteOne({_id:e})).deletedCount>0}async deleteUserSessions(e){return (await this.col("sessions").deleteMany({userId:e})).deletedCount}async hasAnyUsers(){return await this.col("users").countDocuments()>0}async addPasswordToHistory(e,s){await this.col("password_history").insertOne({userId:e,passwordHash:s,createdAt:new Date});}async getPasswordHistory(e,s=5){return (await this.col("password_history").find({userId:e}).sort({createdAt:-1}).limit(s).toArray()).map(i=>i.passwordHash)}async isPasswordInHistory(e,s,t=5){let i=await this.getPasswordHistory(s,t);for(let r of i)if(await c.default.compare(e,r))return true;return false}async findAuditLogs(e){let{limit:s=50,offset:t=0,userId:i,action:r,resource:o,resourceId:u,success:d,startDate:f,endDate:h}=e,a={};i&&(a.userId=i),r&&(Array.isArray(r)?a.action={$in:r}:a.action=r),o&&(a.resource=o),u&&(a.resourceId=u),d!==void 0&&(a.success=d),(f||h)&&(a.timestamp={},f&&(a.timestamp.$gte=f),h&&(a.timestamp.$lte=h));let w=await this.col("audit_logs").countDocuments(a);return {logs:(await this.col("audit_logs").find(a).sort({timestamp:-1}).skip(t).limit(s).toArray()).map(n=>({id:n._id,timestamp:n.timestamp,action:n.action,userId:n.userId||void 0,userEmail:n.userEmail||void 0,role:n.role||void 0,resource:n.resource,resourceId:n.resourceId||void 0,changes:n.changes||void 0,ipAddress:n.ipAddress||void 0,userAgent:n.userAgent||void 0,success:n.success,error:n.error||void 0,metadata:n.metadata||void 0})),total:w}}async createAuditLog(e){let s=crypto.randomUUID(),t=new Date;return await this.col("audit_logs").insertOne({_id:s,action:e.action,userId:e.userId||null,userEmail:e.userEmail||null,role:e.role||null,resource:e.resource,resourceId:e.resourceId||null,changes:e.changes||null,ipAddress:e.ipAddress||null,userAgent:e.userAgent||null,success:e.success,error:e.error||null,metadata:e.metadata||null,timestamp:t}),{...e,id:s,timestamp:t}}docToAuthUser(e){return {id:e._id,name:e.name||void 0,email:e.email,passwordHash:e.passwordHash||void 0,role:e.role,tenantId:e.tenantId||void 0,avatar:e.avatar||void 0,emailVerified:e.emailVerified||false,locked:e.locked||false,lastLogin:e.lastLogin?.toISOString?.()||e.lastLogin||void 0,failedLoginAttempts:e.failedLoginAttempts||0,createdAt:e.createdAt?.toISOString?.()||e.createdAt,updatedAt:e.updatedAt?.toISOString?.()||e.updatedAt}}docToSession(e){return {id:e._id,userId:e.userId,token:e.token,refreshToken:e.refreshToken||void 0,expiresAt:e.expiresAt?.toISOString?.()||e.expiresAt,createdAt:e.createdAt?.toISOString?.()||e.createdAt,ipAddress:e.ipAddress||void 0,userAgent:e.userAgent||void 0}}async createEmailVerificationToken(e){let s=crypto.randomBytes(32).toString("hex"),t=new Date(Date.now()+1440*60*1e3),i=await import('./lib-A2D63VXD.cjs'),r=i.ObjectId??i.default?.ObjectId;return await this.db.collection("email_verifications").insertOne({userId:new r(e),token:s,expiresAt:t,createdAt:new Date}),{token:s,expiresAt:t}}async verifyEmailToken(e){let s=await this.db.collection("email_verifications").findOne({token:e});return s?s.expiresAt<new Date?{success:false,error:"Verification token has expired"}:(await this.db.collection("users").updateOne({_id:s.userId},{$set:{emailVerified:true}}),await this.db.collection("email_verifications").deleteOne({_id:s._id}),{success:true,userId:s.userId.toString()}):{success:false,error:"Invalid verification token"}}async createPasswordResetToken(e){let s=await this.findUserByEmail(e);if(!s)return {token:"",expiresAt:new Date,error:"User not found"};let t=crypto.randomBytes(32).toString("hex"),i=new Date(Date.now()+3600*1e3),r=await import('./lib-A2D63VXD.cjs'),o=r.ObjectId??r.default?.ObjectId;return await this.db.collection("password_resets").insertOne({userId:new o(s.id),token:t,expiresAt:i,createdAt:new Date}),{token:t,expiresAt:i}}async resetPasswordWithToken(e,s){let t=await this.db.collection("password_resets").findOne({token:e});if(!t)return {success:false,error:"Invalid reset token"};if(t.expiresAt<new Date)return {success:false,error:"Reset token has expired"};if(t.usedAt)return {success:false,error:"Reset token has already been used"};let i=await this.hashPassword(s);return await this.db.collection("users").updateOne({_id:t.userId},{$set:{passwordHash:i,updatedAt:new Date}}),await this.db.collection("password_resets").updateOne({_id:t._id},{$set:{usedAt:new Date}}),await this.db.collection("sessions").deleteMany({userId:t.userId}),{success:true}}};exports.a=g;
@@ -1,432 +0,0 @@
1
- import {a}from'./chunk-OLRCZ6E3.js';import {g as g$1}from'./chunk-Y2YAKDEQ.js';if (typeof window === "undefined") { const { createRequire } = await import(/* @vite-ignore */ 'module'); createRequire(import.meta.url); }
2
- g$1();g$1();g$1();function g(o){let{brand:e,title:t,previewText:r=t,bodyHtml:s,ctaText:i,ctaUrl:a,secondaryCtaText:n,secondaryCtaUrl:l}=o,p=e?.siteName||"Kyro CMS",u=e?.logoUrl||"https://kyro-cms.com/logo.svg",f=e?.logoDarkUrl||e?.logoUrl||"https://kyro-cms.com/logo-white.svg",h=e?.appUrl||"https://kyro-cms.com";return `<!DOCTYPE html>
3
- <html lang="en">
4
- <head>
5
- <meta charset="UTF-8">
6
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
- <meta name="color-scheme" content="light dark">
8
- <meta name="supported-color-schemes" content="light dark">
9
- <title>${t}</title>
10
- <style>
11
- :root {
12
- color-scheme: light dark;
13
- supported-color-schemes: light dark;
14
- }
15
- @media (prefers-color-scheme: dark) {
16
- .email-body { background-color: #09090b !important; color: #f4f4f5 !important; }
17
- .email-card { background-color: #121215 !important; border-color: #27272a !important; box-shadow: none !important; }
18
- .email-header { background-color: #18181b !important; border-color: #27272a !important; }
19
- .email-brand-text { color: #ffffff !important; }
20
- .email-title { color: #ffffff !important; }
21
- .email-text { color: #a1a1aa !important; }
22
- .email-strong { color: #ffffff !important; }
23
- .email-table { background-color: #18181b !important; border-color: #27272a !important; }
24
- .email-td-border { border-color: #27272a !important; }
25
- .email-label { color: #a1a1aa !important; }
26
- .email-value { color: #f4f4f5 !important; }
27
- .email-code-box { background-color: #18181b !important; border-color: #27272a !important; color: #ffffff !important; }
28
- .email-btn-primary { background-color: #ffffff !important; color: #09090b !important; }
29
- .email-btn-secondary { background-color: #18181b !important; border-color: #27272a !important; color: #f4f4f5 !important; }
30
- .email-footer { background-color: #09090b !important; border-color: #27272a !important; }
31
- .email-footer-text { color: #71717a !important; }
32
- .email-footer-link { color: #a1a1aa !important; }
33
- .logo-light { display: none !important; }
34
- .logo-dark { display: inline-block !important; }
35
- }
36
- </style>
37
- </head>
38
- <body class="email-body" style="margin: 0; padding: 24px 12px; background-color: #fafafa; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; color: #09090b; -webkit-font-smoothing: antialiased;">
39
- <!-- Preview Text -->
40
- <div style="display: none; max-height: 0; overflow: hidden;">${r}</div>
41
-
42
- <table role="presentation" width="100%" border="0" cellspacing="0" cellpadding="0" class="email-card" style="max-width: 480px; margin: 0 auto; background-color: #ffffff; border: 1px solid #f4f4f5; border-radius: 16px; overflow: hidden; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);">
43
- <!-- Header Bar -->
44
- <tr>
45
- <td class="email-header" style="padding: 16px 24px; border-bottom: 1px solid #fafafa; background-color: #ffffff;">
46
- <table role="presentation" width="100%" border="0" cellspacing="0" cellpadding="0">
47
- <tr>
48
- <td align="center" valign="middle">
49
- <a href="${h}" target="_blank" style="text-decoration: none; display: inline-flex; align-items: center; gap: 8px;">
50
- <!-- Light Mode Logo -->
51
- <img src="${u}" alt="${p} Logo" class="logo-light" height="22" style="display: inline-block; border: 0; max-height: 22px; vertical-align: middle;" />
52
- <!-- Dark Mode Logo -->
53
- <img src="${f}" alt="${p} Logo" class="logo-dark" height="22" style="display: none; border: 0; max-height: 22px; vertical-align: middle;" />
54
- <span class="email-brand-text" style="font-size: 15px; font-weight: 600; color: #09090b; letter-spacing: -0.2px; vertical-align: middle;">${p}</span>
55
- </a>
56
- </td>
57
- </tr>
58
- </table>
59
- </td>
60
- </tr>
61
-
62
- <!-- Body Section -->
63
- <tr>
64
- <td style="padding: 24px;">
65
- <h1 class="email-title" style="margin: 0 0 8px; font-size: 18px; font-weight: 600; color: #09090b; letter-spacing: -0.2px; text-align: center;">
66
- ${t}
67
- </h1>
68
-
69
- ${s}
70
-
71
- ${i&&a?`
72
- <!-- Action Buttons -->
73
- <table role="presentation" width="100%" border="0" cellspacing="0" cellpadding="0" style="margin-top: 20px;">
74
- <tr>
75
- <td align="center">
76
- <a href="${a}" target="_blank" class="email-btn-primary" style="display: inline-block; padding: 10px 18px; background-color: #09090b; color: #ffffff; font-size: 13px; font-weight: 500; text-decoration: none; border-radius: 8px;">
77
- ${i} \u2192
78
- </a>
79
- ${n&&l?`<a href="${l}" target="_blank" class="email-btn-secondary" style="display: inline-block; padding: 10px 16px; margin-left: 8px; background-color: #ffffff; border: 1px solid #e4e4e7; color: #09090b; font-size: 13px; font-weight: 500; text-decoration: none; border-radius: 8px;">
80
- ${n}
81
- </a>`:""}
82
- </td>
83
- </tr>
84
- </table>`:""}
85
- </td>
86
- </tr>
87
-
88
- <!-- Footer -->
89
- <tr>
90
- <td class="email-footer" style="padding: 16px 24px; border-top: 1px solid #fafafa; background-color: #fdfdfd; text-align: center;">
91
- <p style="margin: 0; font-size: 12px; color: #a1a1aa;">
92
- <a href="${h}" target="_blank" class="email-footer-link" style="color: #71717a; text-decoration: none; font-weight: 500;">${h.replace(/^https?:\/\//,"")}</a> &nbsp;\u2022&nbsp;
93
- <a href="${h}/docs" target="_blank" class="email-footer-link" style="color: #71717a; text-decoration: none; font-weight: 500;">Docs</a>
94
- </p>
95
- </td>
96
- </tr>
97
- </table>
98
- </body>
99
- </html>`}g$1();function x(o,e="User",t){let r="Confirm your email address \u2014 Kyro CMS",s=`
100
- <p class="email-text" style="margin: 0 0 16px; font-size: 14px; line-height: 1.6; color: #52525b;">
101
- Hello <strong class="email-strong" style="color: #09090b;">${e}</strong>,
102
- </p>
103
- <p class="email-text" style="margin: 0 0 20px; font-size: 14px; line-height: 1.6; color: #52525b;">
104
- Thank you for registering. Please confirm your email address by clicking the verification button below to activate your account.
105
- </p>
106
-
107
- <!-- Verification Token Link Card -->
108
- <table role="presentation" width="100%" border="0" cellspacing="0" cellpadding="0" class="email-table" style="background-color: #fafafa; border: 1px solid #e4e4e7; border-radius: 8px; margin-bottom: 20px; padding: 14px; border-collapse: separate;">
109
- <tr>
110
- <td style="font-size: 12px; color: #71717a; line-height: 1.5; word-break: break-all;">
111
- <strong>Direct link:</strong><br />
112
- <a href="${o}" style="color: #09090b; text-decoration: underline;" class="email-value">${o}</a>
113
- </td>
114
- </tr>
115
- </table>
116
-
117
- <p class="email-text" style="margin: 0 0 8px; font-size: 12px; color: #71717a;">
118
- This verification link will expire in 24 hours. If you did not create an account, you can safely ignore this email.
119
- </p>
120
- `,i=g({brand:t,title:"Confirm Your Email Address",previewText:"Please confirm your email address to activate your Kyro CMS account.",bodyHtml:s,ctaText:"Confirm Email Address",ctaUrl:o,secondaryCtaText:"Documentation",secondaryCtaUrl:"https://kyro-cms.com/docs"}),a=`Welcome, ${e}!
121
-
122
- Please verify your email address by visiting:
123
- ${o}
124
-
125
- This link expires in 24 hours.
126
-
127
- Kyro CMS \u2014 https://kyro-cms.com`;return {subject:r,html:i,text:a}}g$1();function _(o,e="User",t){let r="Reset your password \u2014 Kyro CMS",s=`
128
- <p class="email-text" style="margin: 0 0 16px; font-size: 14px; line-height: 1.6; color: #52525b;">
129
- Hello <strong class="email-strong" style="color: #09090b;">${e}</strong>,
130
- </p>
131
- <p class="email-text" style="margin: 0 0 20px; font-size: 14px; line-height: 1.6; color: #52525b;">
132
- We received a request to reset the password for your account. Click the button below to choose a new password.
133
- </p>
134
-
135
- <!-- Reset Link Box -->
136
- <table role="presentation" width="100%" border="0" cellspacing="0" cellpadding="0" class="email-table" style="background-color: #fafafa; border: 1px solid #e4e4e7; border-radius: 8px; margin-bottom: 20px; padding: 14px; border-collapse: separate;">
137
- <tr>
138
- <td style="font-size: 12px; color: #71717a; line-height: 1.5; word-break: break-all;">
139
- <strong>Reset URL:</strong><br />
140
- <a href="${o}" style="color: #09090b; text-decoration: underline;" class="email-value">${o}</a>
141
- </td>
142
- </tr>
143
- </table>
144
-
145
- <p class="email-text" style="margin: 0 0 8px; font-size: 12px; color: #71717a;">
146
- For security reasons, this link will expire in 1 hour. If you did not request a password reset, no further action is required.
147
- </p>
148
- `,i=g({brand:t,title:"Reset Your Password",previewText:"Use this secure link to reset your Kyro CMS password.",bodyHtml:s,ctaText:"Reset Password",ctaUrl:o}),a=`Hello ${e},
149
-
150
- Reset your password using the following link:
151
- ${o}
152
-
153
- This link will expire in 1 hour.
154
-
155
- Kyro CMS \u2014 https://kyro-cms.com`;return {subject:r,html:i,text:a}}g$1();function w(o="User",e="https://kyro-cms.com",t){let r="Welcome to Kyro CMS!",s=`
156
- <p class="email-text" style="margin: 0 0 16px; font-size: 14px; line-height: 1.6; color: #52525b;">
157
- Welcome <strong class="email-strong" style="color: #09090b;">${o}</strong>,
158
- </p>
159
- <p class="email-text" style="margin: 0 0 20px; font-size: 14px; line-height: 1.6; color: #52525b;">
160
- Your Kyro CMS account is now set up and ready to go. You can access your admin dashboard, build content collections, and manage schema endpoints.
161
- </p>
162
-
163
- <!-- Key Capabilities List -->
164
- <table role="presentation" width="100%" border="0" cellspacing="0" cellpadding="0" class="email-table" style="background-color: #fafafa; border: 1px solid #e4e4e7; border-radius: 8px; margin-bottom: 24px; padding: 16px; border-collapse: separate;">
165
- <tr>
166
- <td style="font-size: 13px; color: #09090b; line-height: 1.6;" class="email-value">
167
- \u{1F680} <strong>What you can do next:</strong>
168
- <ul style="margin: 8px 0 0; padding-left: 20px; color: #52525b;">
169
- <li>Define collections & custom field schemas in <code style="font-family: monospace;">kyro.config.ts</code></li>
170
- <li>Explore auto-generated REST, GraphQL, tRPC & WebSocket endpoints</li>
171
- <li>Customize your visual Admin dashboard & branding settings</li>
172
- </ul>
173
- </td>
174
- </tr>
175
- </table>
176
- `,i=g({brand:t,title:"Welcome to Kyro CMS",previewText:"Your account is verified and ready. Start building content applications.",bodyHtml:s,ctaText:"Open Dashboard",ctaUrl:e,secondaryCtaText:"Documentation",secondaryCtaUrl:"https://kyro-cms.com/docs"}),a=`Welcome to Kyro CMS, ${o}!
177
-
178
- Your account is active. Log in at ${e} to start building.
179
-
180
- Documentation: https://kyro-cms.com/docs`;return {subject:r,html:i,text:a}}g$1();function S(o="User",e,t,r){let s="Security Alert: Password Changed \u2014 Kyro CMS",i=new Date().toUTCString(),a=`
181
- <p class="email-text" style="margin: 0 0 16px; font-size: 14px; line-height: 1.6; color: #52525b; text-align: center;">
182
- Hello <strong class="email-strong" style="color: #09090b;">${o}</strong>,
183
- </p>
184
- <p class="email-text" style="margin: 0 0 20px; font-size: 14px; line-height: 1.6; color: #52525b; text-align: center;">
185
- This email confirms that the password for your Kyro CMS account was successfully updated on <strong>${i}</strong>.
186
- </p>
187
-
188
- <!-- Security Warning Card -->
189
- <table role="presentation" width="100%" border="0" cellspacing="0" cellpadding="0" class="email-table" style="background-color: #fef2f2; border: 1px solid #fecaca; border-radius: 12px; margin-bottom: 20px; padding: 16px; border-collapse: separate;">
190
- <tr>
191
- <td style="font-size: 13px; color: #991b1b; line-height: 1.5; text-align: center;">
192
- \u26A0\uFE0F <strong>Did not request this change?</strong><br />
193
- If you did not initiate this change, your account may be compromised. Reset your password immediately and contact an administrator.
194
- </td>
195
- </tr>
196
- </table>
197
-
198
- ${t||r?`
199
- <table role="presentation" width="100%" border="0" cellspacing="0" cellpadding="0" class="email-table" style="background-color: #fafafa; border: 1px solid #f4f4f5; border-radius: 12px; margin-bottom: 20px; padding: 16px; border-collapse: separate;">
200
- <tr>
201
- <td style="font-size: 13px; color: #09090b; line-height: 1.6;" class="email-value">
202
- <strong>Action IP:</strong> ${t||"Unknown"}<br />
203
- <strong>Device:</strong> ${r||"Unknown"}
204
- </td>
205
- </tr>
206
- </table>`:""}
207
- `,n=g({brand:e,title:"Password Updated",previewText:"Your Kyro CMS account password was updated.",bodyHtml:a,ctaText:"Account Security",ctaUrl:"https://kyro-cms.com"}),l=`Security Alert: Your Kyro CMS password was updated at ${i}.
208
-
209
- If you did not make this change, please reset your password immediately.
210
-
211
- Kyro CMS \u2014 https://kyro-cms.com`;return {subject:s,html:n,text:l}}g$1();function C(o,e,t="User",r){let s="Your one-time login link \u2014 Kyro CMS",i=`
212
- <p class="email-text" style="margin: 0 0 16px; font-size: 14px; line-height: 1.6; color: #52525b;">
213
- Hello <strong class="email-strong" style="color: #09090b;">${t}</strong>,
214
- </p>
215
- <p class="email-text" style="margin: 0 0 20px; font-size: 14px; line-height: 1.6; color: #52525b;">
216
- Click the button below to sign in to your Kyro CMS account without entering a password.
217
- </p>
218
-
219
- ${e?`
220
- <!-- One-Time Passcode Box -->
221
- <table role="presentation" width="100%" border="0" cellspacing="0" cellpadding="0" class="email-table" style="background-color: #fafafa; border: 1px solid #e4e4e7; border-radius: 8px; margin-bottom: 20px; padding: 16px; text-align: center;">
222
- <tr>
223
- <td style="font-size: 12px; color: #71717a; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px;">
224
- One-Time Passcode
225
- </td>
226
- </tr>
227
- <tr>
228
- <td style="font-size: 28px; font-weight: 800; font-family: monospace; color: #09090b; letter-spacing: 4px;" class="email-code-box">
229
- ${e}
230
- </td>
231
- </tr>
232
- </table>`:""}
233
-
234
- <p class="email-text" style="margin: 0 0 8px; font-size: 12px; color: #71717a;">
235
- This single-use link will expire in 10 minutes. Never share authentication links with anyone.
236
- </p>
237
- `,a=g({brand:r,title:"Sign in to Kyro CMS",previewText:"Your secure magic login link for Kyro CMS.",bodyHtml:i,ctaText:"Sign In Now",ctaUrl:o}),n=`Hello ${t},
238
-
239
- Sign in to Kyro CMS using the link below:
240
- ${o}${e?`
241
-
242
- Or enter code: ${e}`:""}
243
-
244
- This link expires in 10 minutes.
245
-
246
- Kyro CMS \u2014 https://kyro-cms.com`;return {subject:s,html:a,text:n}}g$1();function T(o,e,t="User",r,s,i){let a="Security Alert: Account Temporarily Locked \u2014 Kyro CMS",n=`
247
- <p class="email-text" style="margin: 0 0 16px; font-size: 14px; line-height: 1.6; color: #52525b; text-align: center;">
248
- Hello <strong class="email-strong" style="color: #09090b;">${t}</strong>,
249
- </p>
250
- <p class="email-text" style="margin: 0 0 20px; font-size: 14px; line-height: 1.6; color: #52525b; text-align: center;">
251
- Your Kyro CMS account was temporarily locked after <strong>${o} failed login attempts</strong>.
252
- </p>
253
-
254
- <!-- Lockout Notice Card -->
255
- <table role="presentation" width="100%" border="0" cellspacing="0" cellpadding="0" class="email-table" style="background-color: #fffbeb; border: 1px solid #fde68a; border-radius: 12px; margin-bottom: 20px; padding: 16px; border-collapse: separate;">
256
- <tr>
257
- <td style="font-size: 13px; color: #b45309; line-height: 1.5; text-align: center;">
258
- \u{1F512} <strong>Lockout duration:</strong> ${e} minutes.<br />
259
- You may try logging in again after the cooling-off period expires.
260
- </td>
261
- </tr>
262
- </table>
263
-
264
- ${s||i?`
265
- <table role="presentation" width="100%" border="0" cellspacing="0" cellpadding="0" class="email-table" style="background-color: #fafafa; border: 1px solid #f4f4f5; border-radius: 12px; margin-bottom: 20px; padding: 16px; border-collapse: separate;">
266
- <tr>
267
- <td style="font-size: 13px; color: #09090b; line-height: 1.6;" class="email-value">
268
- <strong>Failed Attempts IP:</strong> ${s||"Unknown"}<br />
269
- <strong>Device:</strong> ${i||"Unknown"}
270
- </td>
271
- </tr>
272
- </table>`:""}
273
- `,l=g({brand:r,title:"Account Temporarily Locked",previewText:"Your Kyro CMS account was locked due to multiple failed login attempts.",bodyHtml:n,ctaText:"Unlock Instructions",ctaUrl:"https://kyro-cms.com/docs"}),p=`Security Alert: Account temporarily locked for ${t} after ${o} failed login attempts. Unlocks in ${e} minutes.
274
-
275
- Kyro CMS \u2014 https://kyro-cms.com`;return {subject:a,html:l,text:p}}g$1();function k(o,e="Editor",t="An Administrator",r){let s="You're invited to join Kyro CMS",i=`
276
- <p class="email-text" style="margin: 0 0 16px; font-size: 14px; line-height: 1.6; color: #52525b;">
277
- Hello,
278
- </p>
279
- <p class="email-text" style="margin: 0 0 20px; font-size: 14px; line-height: 1.6; color: #52525b;">
280
- <strong class="email-strong" style="color: #09090b;">${t}</strong> has invited you to join their team workspace as an <strong>${e}</strong> in Kyro CMS.
281
- </p>
282
-
283
- <!-- Invite Details Card -->
284
- <table role="presentation" width="100%" border="0" cellspacing="0" cellpadding="0" class="email-table" style="background-color: #fafafa; border: 1px solid #e4e4e7; border-radius: 8px; margin-bottom: 20px; padding: 14px; border-collapse: separate;">
285
- <tr>
286
- <td style="font-size: 13px; color: #09090b; line-height: 1.6;" class="email-value">
287
- <strong>Assigned Role:</strong> ${e}<br />
288
- <strong>Invited By:</strong> ${t}
289
- </td>
290
- </tr>
291
- </table>
292
- `,a=g({brand:r,title:"Workspace Invitation",previewText:`You have been invited to join Kyro CMS as an ${e}.`,bodyHtml:i,ctaText:"Accept Invitation",ctaUrl:o,secondaryCtaText:"Documentation",secondaryCtaUrl:"https://kyro-cms.com/docs"}),n=`You're invited to join Kyro CMS as an ${e} by ${t}.
293
-
294
- Accept your invitation here:
295
- ${o}
296
-
297
- Kyro CMS \u2014 https://kyro-cms.com`;return {subject:s,html:a,text:n}}g$1();function E(o,e,t="User",r,s="Unknown Device"){let i="Security Alert: New Sign-in to Kyro CMS",a=`
298
- <p class="email-text" style="margin: 0 0 16px; font-size: 14px; line-height: 1.6; color: #52525b; text-align: center;">
299
- Hello <strong class="email-strong" style="color: #09090b;">${t}</strong>,
300
- </p>
301
- <p class="email-text" style="margin: 0 0 20px; font-size: 14px; line-height: 1.6; color: #52525b; text-align: center;">
302
- A new sign-in to your Kyro CMS account was detected.
303
- </p>
304
-
305
- <!-- Sign-in Details -->
306
- <table role="presentation" width="100%" border="0" cellspacing="0" cellpadding="0" class="email-table" style="background-color: #fafafa; border: 1px solid #f4f4f5; border-radius: 12px; margin-bottom: 20px; padding: 16px; border-collapse: separate;">
307
- <tr>
308
- <td style="font-size: 13px; color: #09090b; line-height: 1.6;" class="email-value">
309
- <strong>Time:</strong> ${e}<br />
310
- <strong>Location/IP:</strong> ${o}<br />
311
- <strong>Device:</strong> ${s}
312
- </td>
313
- </tr>
314
- </table>
315
-
316
- <!-- Security Warning Card -->
317
- <table role="presentation" width="100%" border="0" cellspacing="0" cellpadding="0" class="email-table" style="background-color: #fef2f2; border: 1px solid #fecaca; border-radius: 12px; margin-bottom: 20px; padding: 16px; border-collapse: separate;">
318
- <tr>
319
- <td style="font-size: 13px; color: #991b1b; line-height: 1.5; text-align: center;">
320
- \u26A0\uFE0F <strong>Don't recognize this activity?</strong><br />
321
- If you did not sign in recently, your account may be compromised. Please reset your password immediately and contact an administrator.
322
- </td>
323
- </tr>
324
- </table>
325
- `,n=g({brand:r,title:"New Sign-in Detected",previewText:"A new sign-in was detected on your Kyro CMS account.",bodyHtml:a,ctaText:"Review Account Security",ctaUrl:"https://kyro-cms.com"}),l=`Security Alert: New Sign-in to Kyro CMS
326
-
327
- Hello ${t},
328
-
329
- A new sign-in to your account was detected at ${e} from ${o} using ${s}.
330
-
331
- If you did not sign in recently, please reset your password immediately.
332
-
333
- Kyro CMS \u2014 https://kyro-cms.com`;return {subject:i,html:n,text:l}}g$1();function v(o,e="Customer",t,r,s){let i=`Order Confirmation #${o}`,a=`
334
- <p class="email-text" style="margin: 0 0 16px; font-size: 14px; line-height: 1.6; color: #52525b;">
335
- Hi <strong class="email-strong" style="color: #09090b;">${e}</strong>,
336
- </p>
337
- <p class="email-text" style="margin: 0 0 20px; font-size: 14px; line-height: 1.6; color: #52525b;">
338
- Thank you for your order! We've received your order <strong>#${o}</strong> and are getting it ready for shipment.
339
- </p>
340
-
341
- <table role="presentation" width="100%" border="0" cellspacing="0" cellpadding="0" class="email-table" style="background-color: #fafafa; border: 1px solid #e4e4e7; border-radius: 8px; margin-bottom: 24px; padding: 16px; border-collapse: separate;">
342
- <tr>
343
- <td style="font-size: 13px; color: #09090b; line-height: 1.6;" class="email-value">
344
- \u{1F6D2} <strong>Order Summary:</strong><br/>
345
- Order Total: <strong>${t}</strong>
346
- </td>
347
- </tr>
348
- </table>
349
- `,n=g({brand:s,title:"Order Confirmed",previewText:`Your order #${o} has been confirmed.`,bodyHtml:a,ctaText:"View Order",ctaUrl:r||"https://kyro-cms.com"}),l=`Hi ${e},
350
-
351
- Thank you for your order #${o}!
352
-
353
- Order Total: ${t}
354
-
355
- View your order here: ${r||"https://kyro-cms.com"}`;return {subject:i,html:n,text:l}}g$1();function A(o,e="Customer",t,r,s){let i=`Your Order #${o} is on the way!`,a=`
356
- <p class="email-text" style="margin: 0 0 16px; font-size: 14px; line-height: 1.6; color: #52525b;">
357
- Great news, <strong class="email-strong" style="color: #09090b;">${e}</strong>!
358
- </p>
359
- <p class="email-text" style="margin: 0 0 20px; font-size: 14px; line-height: 1.6; color: #52525b;">
360
- Your order <strong>#${o}</strong> has been shipped and is on its way to you.
361
- </p>
362
-
363
- <table role="presentation" width="100%" border="0" cellspacing="0" cellpadding="0" class="email-table" style="background-color: #fafafa; border: 1px solid #e4e4e7; border-radius: 8px; margin-bottom: 24px; padding: 16px; border-collapse: separate;">
364
- <tr>
365
- <td style="font-size: 13px; color: #09090b; line-height: 1.6;" class="email-value">
366
- \u{1F4E6} <strong>Tracking Number:</strong> ${t}
367
- </td>
368
- </tr>
369
- </table>
370
- `,n=g({brand:s,title:"Order Shipped",previewText:`Your order #${o} has shipped. Track your package now.`,bodyHtml:a,ctaText:"Track Package",ctaUrl:r}),l=`Hi ${e},
371
-
372
- Your order #${o} has been shipped!
373
-
374
- Tracking Number: ${t}
375
- Track it here: ${r}`;return {subject:i,html:n,text:l}}g$1();function R(o,e="Customer",t,r){let s=`Your Order #${o} has been delivered`,i=`
376
- <p class="email-text" style="margin: 0 0 16px; font-size: 14px; line-height: 1.6; color: #52525b;">
377
- Hi <strong class="email-strong" style="color: #09090b;">${e}</strong>,
378
- </p>
379
- <p class="email-text" style="margin: 0 0 20px; font-size: 14px; line-height: 1.6; color: #52525b;">
380
- Good news! Your order <strong>#${o}</strong> has been successfully delivered. We hope you love it!
381
- </p>
382
- <p class="email-text" style="margin: 0 0 20px; font-size: 14px; line-height: 1.6; color: #52525b;">
383
- We'd love to hear your thoughts. If you have a minute, please leave a review for your items.
384
- </p>
385
- `,a=g({brand:r,title:"Order Delivered",previewText:`Your order #${o} has arrived!`,bodyHtml:i,ctaText:"Leave a Review",ctaUrl:t}),n=`Hi ${e},
386
-
387
- Your order #${o} has been delivered!
388
-
389
- Leave a review here: ${t}`;return {subject:s,html:a,text:n}}g$1();function I(o,e="Customer",t,r){let s=`Refund Processed for Order #${o}`,i=`
390
- <p class="email-text" style="margin: 0 0 16px; font-size: 14px; line-height: 1.6; color: #52525b;">
391
- Hi <strong class="email-strong" style="color: #09090b;">${e}</strong>,
392
- </p>
393
- <p class="email-text" style="margin: 0 0 20px; font-size: 14px; line-height: 1.6; color: #52525b;">
394
- We have processed a refund for your order <strong>#${o}</strong>. It may take 3-5 business days for the funds to appear on your original payment method.
395
- </p>
396
-
397
- <table role="presentation" width="100%" border="0" cellspacing="0" cellpadding="0" class="email-table" style="background-color: #fafafa; border: 1px solid #e4e4e7; border-radius: 8px; margin-bottom: 24px; padding: 16px; border-collapse: separate;">
398
- <tr>
399
- <td style="font-size: 13px; color: #09090b; line-height: 1.6;" class="email-value">
400
- \u{1F4B8} <strong>Refund Amount:</strong> ${t}
401
- </td>
402
- </tr>
403
- </table>
404
- `,a=g({brand:r,title:"Refund Processed",previewText:`We have processed a refund of ${t} for order #${o}.`,bodyHtml:i,ctaText:"View Store",ctaUrl:"https://kyro-cms.com"}),n=`Hi ${e},
405
-
406
- We have processed a refund of ${t} for order #${o}.
407
-
408
- View store: https://kyro-cms.com`;return {subject:s,html:a,text:n}}g$1();function O(o="Customer",e,t){let r="You left something behind...",s=`
409
- <p class="email-text" style="margin: 0 0 16px; font-size: 14px; line-height: 1.6; color: #52525b;">
410
- Hi <strong class="email-strong" style="color: #09090b;">${o}</strong>,
411
- </p>
412
- <p class="email-text" style="margin: 0 0 20px; font-size: 14px; line-height: 1.6; color: #52525b;">
413
- We noticed you left some great items in your shopping cart. They are still waiting for you, but they might sell out soon!
414
- </p>
415
- `,i=g({brand:t,title:"Complete Your Purchase",previewText:"Your shopping cart is waiting for you. Complete your purchase now.",bodyHtml:s,ctaText:"Return to Checkout",ctaUrl:e}),a=`Hi ${o},
416
-
417
- You left some items in your cart! Complete your purchase here: ${e}`;return {subject:r,html:i,text:a}}function K(o){return {verifyEmail:(e,t)=>x(e,t,o),resetPassword:(e,t)=>_(e,t,o),welcome:(e,t)=>w(e,t,o),passwordChanged:e=>S(e,o),magicLink:(e,t,r)=>C(e,t,r,o),accountLocked:(e,t,r)=>T(e,t,r,o),newLogin:(e,t,r)=>E(e,t,r,o),userInvite:(e,t,r)=>k(e,t,r,o),orderConfirmation:(e,t,r,s)=>v(e,t,r||"0.00",s,o),orderShipped:(e,t,r,s)=>A(e,t,r||"",s||"",o),orderDelivered:(e,t,r)=>R(e,t,r||"",o),orderRefunded:(e,t,r)=>I(e,t,r||"0.00",o),abandonedCart:(e,t)=>O(e,t||"",o)}}g$1();var $=false,b=class o{db;cache={};loaded=false;static SENSITIVE_KEYS=["storage.s3.secret_access_key","storage.r2.secret_access_key","storage.gcs.private_key","storage.backblaze.application_key","storage.wasabi.secret_access_key","storage.ftp.password","storage.bunny.api_key","storage.cloudinary.api_secret","storage.imgix.sign_key","email.smtp.pass","auth.jwt_secret","auth.github_secret","auth.google_secret","auth.app_secret","database.url","redis.url","auth.admin_password"];constructor(e){this.db=e;}async load(){if(!this.loaded){await this.ensureSettingsTable();try{if(typeof this.db?.select=="function"){let e=await this.db.select().from(a);this.cache=e.reduce((t,r)=>(t[r.key]=r.value,t),{});}await this.loadFromGlobals();}catch{console.warn("ConfigService: Could not load settings from database, using environment fallbacks.");}this.loaded=true;}}async ensureSettingsTable(){if(!$)try{if(typeof this.db?.execute=="function"){let{sql:e}=await import('./drizzle-orm-XRTSOQJS.js');await this.db.execute(e`
418
- CREATE TABLE IF NOT EXISTS "settings" (
419
- "key" VARCHAR(255) PRIMARY KEY,
420
- "value" TEXT NOT NULL,
421
- "description" TEXT,
422
- "updated_at" TIMESTAMP DEFAULT NOW()
423
- )
424
- `),$=!0;}else typeof this.db?.exec=="function"&&(this.db.exec(`
425
- CREATE TABLE IF NOT EXISTS settings (
426
- key TEXT PRIMARY KEY,
427
- value TEXT NOT NULL,
428
- description TEXT,
429
- updated_at TEXT
430
- )
431
- `),$=!0);}catch{}}async loadFromGlobals(){try{let e=null;if(typeof this.db?.findOne=="function")try{let s=await this.db.findOne({collection:"_globals_storage-settings",where:{},draft:!0});s&&(e=s);}catch{}if(!e&&typeof this.db?.execute=="function"){let{sql:s}=await import('./drizzle-orm-XRTSOQJS.js'),i=['"_globals_storage-settings"','"_globals_storage_settings"','"global_storage_settings"'];for(let a of i)try{let n=await this.db.execute(s`SELECT * FROM ${s.raw(a)} LIMIT 1`);if(e=Array.isArray(n)?n[0]:n?.rows?n.rows[0]:null,e)break}catch{}}else if(!e&&typeof this.db?.prepare=="function"){let s=['"_globals_storage-settings"','"_globals_storage_settings"','"global_storage_settings"'];for(let i of s)try{if(e=this.db.prepare(`SELECT * FROM ${i} LIMIT 1`).get(),e)break}catch{}}if(!e)return;let t=s=>{if(!s)return null;if(typeof s=="string")try{return JSON.parse(s)}catch{return null}return s},r=e.provider||"local";if(this.cache["storage.type"]=r,r==="local"){let s=t(e.local);this.cache["storage.local.dir"]=s?.uploadDir||"./public/uploads",this.cache["storage.local.url"]=s?.baseUrl||"/uploads";}if(r==="aws"){let s=t(e.aws);this.cache["storage.s3.bucket"]=s?.bucket||"",this.cache["storage.s3.region"]=s?.region||"us-east-1",this.cache["storage.s3.access_key_id"]=s?.accessKeyId||"",this.cache["storage.s3.secret_access_key"]=s?.secretAccessKey||"",this.cache["storage.s3.endpoint"]=s?.endpoint||"",this.cache["storage.s3.cdn_url"]=s?.cdnUrl||"",this.cache["storage.s3.prefix"]=s?.prefix||"";}if(r==="r2"){let s=t(e.r2);this.cache["storage.r2.account_id"]=s?.accountId||"",this.cache["storage.r2.access_key_id"]=s?.accessKeyId||"",this.cache["storage.r2.secret_access_key"]=s?.secretAccessKey||"",this.cache["storage.r2.bucket"]=s?.bucket||"",this.cache["storage.r2.cdn_url"]=s?.cdnUrl||"",this.cache["storage.r2.prefix"]=s?.prefix||"";}if(r==="cloudinary"){let s=t(e.cloudinary);this.cache["storage.cloudinary.cloud_name"]=s?.cloudName||"",this.cache["storage.cloudinary.api_key"]=s?.apiKey||"",this.cache["storage.cloudinary.api_secret"]=s?.apiSecret||"",this.cache["storage.cloudinary.folder"]=s?.folder||"";}if(r==="ftp"){let s=t(e.ftp);this.cache["storage.ftp.host"]=s?.host||"",this.cache["storage.ftp.port"]=String(s?.port||"21"),this.cache["storage.ftp.user"]=s?.user||"",this.cache["storage.ftp.password"]=s?.password||"",this.cache["storage.ftp.secure"]=s?.secure?"true":"false",this.cache["storage.ftp.base_url"]=s?.baseUrl||"",this.cache["storage.ftp.prefix"]=s?.prefix||"";}}catch(e){console.warn("ConfigService: Could not load storage settings from globals table:",e);}try{let e=null;if(typeof this.db?.findOne=="function")try{let t=await this.db.findOne({collection:"_globals_email-settings",where:{},draft:!0});t&&(e=t);}catch{}if(!e&&typeof this.db?.execute=="function"){let{sql:t}=await import('./drizzle-orm-XRTSOQJS.js'),r=['"_globals_email-settings"','"_globals_email_settings"','"global_email_settings"'];for(let s of r)try{let i=await this.db.execute(t`SELECT * FROM ${t.raw(s)} LIMIT 1`);if(e=Array.isArray(i)?i[0]:i?.rows?i.rows[0]:null,e)break}catch{}}else if(!e&&typeof this.db?.prepare=="function"){let t=['"_globals_email-settings"','"_globals_email_settings"','"global_email_settings"'];for(let r of t)try{if(e=this.db.prepare(`SELECT * FROM ${r} LIMIT 1`).get(),e)break}catch{}}if(e){let t=r=>{if(!r)return null;if(typeof r=="string")try{return JSON.parse(r)}catch{return null}return r};if(this.cache["email.provider"]=e.provider||"smtp",this.cache["email.smtp.from"]=e.fromEmail||"",this.cache["email.smtp.from_name"]=e.fromName||"",this.cache["email.smtp.reply_to"]=e.replyTo||"",e.provider==="smtp"){let r=t(e.smtp);this.cache["email.smtp.host"]=r?.host||"",this.cache["email.smtp.port"]=String(r?.port||"587"),this.cache["email.smtp.user"]=r?.username||"",this.cache["email.smtp.pass"]=r?.password||"",this.cache["email.smtp.secure"]=r?.secure?"true":"false";}else if(e.provider==="resend"){let r=t(e.resend);this.cache["email.smtp.pass"]=r?.apiKey||"";}else if(e.provider==="sendgrid"){let r=t(e.sendgrid);this.cache["email.smtp.pass"]=r?.apiKey||"";}else if(e.provider==="mailgun"){let r=t(e.mailgun);this.cache["email.smtp.pass"]=r?.apiKey||"";}else if(e.provider==="ses"){let r=t(e.ses);this.cache["email.smtp.user"]=r?.accessKeyId||"",this.cache["email.smtp.pass"]=r?.secretAccessKey||"";}}}catch(e){console.warn("ConfigService: Could not load email settings from globals table:",e);}}get(e,t,r){return this.cache[e]?this.cache[e]:t&&process.env[t]?process.env[t]:r}getStorageConfig(){let e="local";return typeof globalThis.STORAGE_BUCKET<"u"&&(e="cloudflare_r2"),{type:this.get("storage.type","STORAGE_TYPE",e),s3:{bucket:this.get("storage.s3.bucket","STORAGE_BUCKET"),region:this.get("storage.s3.region","STORAGE_REGION","us-east-1"),accessKeyId:this.get("storage.s3.access_key_id","STORAGE_ACCESS_KEY_ID"),secretAccessKey:this.get("storage.s3.secret_access_key","STORAGE_SECRET_ACCESS_KEY"),endpoint:this.get("storage.s3.endpoint","STORAGE_ENDPOINT"),cdnUrl:this.get("storage.s3.cdn_url","STORAGE_CDN_URL"),prefix:this.get("storage.s3.prefix","STORAGE_PREFIX")},r2:{accountId:this.get("storage.r2.account_id","R2_ACCOUNT_ID"),accessKeyId:this.get("storage.r2.access_key_id","R2_ACCESS_KEY_ID"),secretAccessKey:this.get("storage.r2.secret_access_key","R2_SECRET_ACCESS_KEY"),bucket:this.get("storage.r2.bucket","R2_BUCKET"),cdnUrl:this.get("storage.r2.cdn_url","R2_CDN_URL"),prefix:this.get("storage.r2.prefix","R2_PREFIX")},gcs:{bucket:this.get("storage.gcs.bucket","GCS_BUCKET"),projectId:this.get("storage.gcs.project_id","GCS_PROJECT_ID"),clientEmail:this.get("storage.gcs.client_email","GCS_CLIENT_EMAIL"),privateKey:this.get("storage.gcs.private_key","GCS_PRIVATE_KEY"),cdnUrl:this.get("storage.gcs.cdn_url","GCS_CDN_URL"),prefix:this.get("storage.gcs.prefix","GCS_PREFIX")},digitalocean:{bucket:this.get("storage.digitalocean.bucket","DO_BUCKET"),region:this.get("storage.digitalocean.region","DO_REGION","nyc3"),accessKeyId:this.get("storage.digitalocean.access_key_id","DO_ACCESS_KEY_ID"),secretAccessKey:this.get("storage.digitalocean.secret_access_key","DO_SECRET_ACCESS_KEY"),cdnUrl:this.get("storage.digitalocean.cdn_url","DO_CDN_URL"),prefix:this.get("storage.digitalocean.prefix","DO_PREFIX")},backblaze:{bucket:this.get("storage.backblaze.bucket","BB_BUCKET"),accountId:this.get("storage.backblaze.account_id","BB_ACCOUNT_ID"),applicationKeyId:this.get("storage.backblaze.application_key_id","BB_APPLICATION_KEY_ID"),applicationKey:this.get("storage.backblaze.application_key","BB_APPLICATION_KEY"),cdnUrl:this.get("storage.backblaze.cdn_url","BB_CDN_URL"),prefix:this.get("storage.backblaze.prefix","BB_PREFIX")},wasabi:{bucket:this.get("storage.wasabi.bucket","WASABI_BUCKET"),region:this.get("storage.wasabi.region","WASABI_REGION","us-east-1"),accessKeyId:this.get("storage.wasabi.access_key_id","WASABI_ACCESS_KEY_ID"),secretAccessKey:this.get("storage.wasabi.secret_access_key","WASABI_SECRET_ACCESS_KEY"),cdnUrl:this.get("storage.wasabi.cdn_url","WASABI_CDN_URL"),prefix:this.get("storage.wasabi.prefix","WASABI_PREFIX")},bunny:{storageZone:this.get("storage.bunny.storage_zone","BUNNY_STORAGE_ZONE"),apiKey:this.get("storage.bunny.api_key","BUNNY_API_KEY"),cdnUrl:this.get("storage.bunny.cdn_url","BUNNY_CDN_URL"),prefix:this.get("storage.bunny.prefix","BUNNY_PREFIX")},ftp:{host:this.get("storage.ftp.host","FTP_HOST"),port:parseInt(this.get("storage.ftp.port","FTP_PORT","21"),10),user:this.get("storage.ftp.user","FTP_USER"),password:this.get("storage.ftp.password","FTP_PASSWORD"),secure:this.get("storage.ftp.secure","FTP_SECURE")==="true",baseUrl:this.get("storage.ftp.base_url","FTP_BASE_URL"),prefix:this.get("storage.ftp.prefix","FTP_PREFIX")},cloudinary:{cloudName:this.get("storage.cloudinary.cloud_name","CLOUDINARY_CLOUD_NAME"),apiKey:this.get("storage.cloudinary.api_key","CLOUDINARY_API_KEY"),apiSecret:this.get("storage.cloudinary.api_secret","CLOUDINARY_API_SECRET"),folder:this.get("storage.cloudinary.folder","CLOUDINARY_FOLDER")},imgix:{domain:this.get("storage.imgix.domain","IMGIX_DOMAIN"),signKey:this.get("storage.imgix.sign_key","IMGIX_SIGN_KEY")},local:{uploadDir:this.get("storage.local.dir","STORAGE_LOCAL_DIR","./public/uploads"),baseUrl:this.get("storage.local.url","STORAGE_LOCAL_URL","/uploads")}}}getEmailConfig(){return {provider:this.get("email.provider","EMAIL_PROVIDER","smtp"),host:this.get("email.smtp.host","SMTP_HOST"),port:parseInt(this.get("email.smtp.port","SMTP_PORT","587"),10),secure:this.get("email.smtp.secure","SMTP_SECURE")==="true",user:this.get("email.smtp.user","SMTP_USER"),pass:this.get("email.smtp.pass","SMTP_PASS"),from:this.get("email.smtp.from","SMTP_FROM","noreply@example.com"),fromName:this.get("email.smtp.from_name","SMTP_FROM_NAME","Kyro CMS"),replyTo:this.get("email.smtp.reply_to","SMTP_REPLY_TO")}}maskSensitive(e,t){return t&&(o.SENSITIVE_KEYS.includes(e)?"********":t)}async set(e,t,r){await this.db.insert(a).values({key:e,value:t,description:r,updatedAt:new Date}).onConflictDoUpdate({target:[a.key],set:{value:t,description:r,updatedAt:new Date}}),this.cache[e]=t;}};var U=class o{transporter;config;templates;transporterInitialized=false;constructor(e,t){this.config=e,this.templates={...K(e.brand),...t};}async ensureTransporter(){if(this.transporterInitialized)return this.transporter;let{default:e}=await import('./nodemailer-NITB45SS.js');return this.config.provider==="smtp"&&this.config.smtp?this.transporter=e.createTransport({host:this.config.smtp.host,port:this.config.smtp.port,secure:this.config.smtp.secure,auth:this.config.smtp.auth}):this.config.provider==="ses"&&this.config.ses&&(this.transporter=e.createTransport({host:`email-smtp.${this.config.ses.region}.amazonaws.com`,port:587,secure:false,auth:{user:this.config.ses.accessKeyId,pass:this.config.ses.secretAccessKey}})),this.transporterInitialized=true,this.transporter}async send(e){let{provider:t,from:r,fromName:s,replyTo:i}=this.config,a=`"${s||"Kyro CMS"}" <${r}>`,n=e.replyTo||i;try{let l;switch(t){case "smtp":case "ses":{let p=await this.ensureTransporter();if(!p)throw new Error(`${t} transporter not initialized`);l=await p.sendMail({from:a,to:Array.isArray(e.to)?e.to.join(", "):e.to,subject:e.subject,html:e.html,text:e.text,replyTo:n});}break;case "resend":l=await this.sendViaResend(a,e,n);break;case "sendgrid":l=await this.sendViaSendGrid(a,e,n);break;case "mailgun":l=await this.sendViaMailgun(a,e,n);break;default:throw new Error(`Unsupported email provider: ${t}`)}return l}catch(l){throw console.error("[EmailTransport] FAILED to send email:",l.message),l.response&&console.error("[EmailTransport] Provider Error Detail:",JSON.stringify(l.response,null,2)),l}}async sendViaResend(e,t,r){let s=this.config.resend?.apiKey;if(!s)throw new Error("Resend API Key missing");let i={from:e,to:t.to,subject:t.subject,html:t.html,text:t.text,reply_to:r},a=await fetch("https://api.resend.com/emails",{method:"POST",headers:{Authorization:`Bearer ${s}`,"Content-Type":"application/json"},body:JSON.stringify(i)});if(!a.ok){let n=await a.json();throw new Error(`Resend Error: ${JSON.stringify(n)}`)}return a.json()}async sendViaSendGrid(e,t,r){let s=this.config.sendgrid?.apiKey;if(!s)throw new Error("SendGrid API Key missing");let i={personalizations:[{to:Array.isArray(t.to)?t.to.map(n=>({email:n})):[{email:t.to}]}],from:{email:e.match(/<(.+)>/)?.[1]||e,name:e.match(/"(.+)"/)?.[1]},subject:t.subject,content:[{type:"text/plain",value:t.text||""},{type:"text/html",value:t.html}],reply_to:r?{email:r}:void 0},a=await fetch("https://api.sendgrid.com/v3/mail/send",{method:"POST",headers:{Authorization:`Bearer ${s}`,"Content-Type":"application/json"},body:JSON.stringify(i)});if(!a.ok){let n=await a.json();throw new Error(`SendGrid Error: ${JSON.stringify(n)}`)}return {success:true}}async sendViaMailgun(e,t,r){let{apiKey:s,domain:i,region:a}=this.config.mailgun||{};if(!s||!i)throw new Error("Mailgun config missing");let n=a==="eu"?"api.eu.mailgun.net":"api.mailgun.net",l=btoa(`api:${s}`),p=new URLSearchParams;p.append("from",e);let u=Array.isArray(t.to)?t.to.join(", "):t.to;p.append("to",u),p.append("subject",t.subject),p.append("html",t.html),t.text&&p.append("text",t.text),r&&p.append("h:Reply-To",r);let f=await fetch(`https://${n}/v3/${i}/messages`,{method:"POST",headers:{Authorization:`Basic ${l}`,"Content-Type":"application/x-www-form-urlencoded"},body:p});if(!f.ok){let h=await f.json();throw new Error(`Mailgun Error: ${JSON.stringify(h)}`)}return f.json()}getTemplates(){return this.templates}async verifyConnection(){if(this.config.provider==="smtp"||this.config.provider==="ses")try{let e=await this.ensureTransporter();if(e)return await e.verify(),!0}catch{return false}return !!(this.config.resend?.apiKey||this.config.sendgrid?.apiKey||this.config.mailgun?.apiKey)}static async fetchBrandConfig(e){let t="Kyro CMS",r="https://kyro-cms.com/logo.svg",s="https://kyro-cms.com/logo-white.svg";try{let i=null,a=null;if(typeof e?.findOne=="function")i=await e.findOne({collection:"_globals_store-settings",where:{},draft:!0}),a=await e.findOne({collection:"_globals_brand-settings",where:{},draft:!0});else if(typeof e?.execute=="function"){let{sql:n}=await import('./drizzle-orm-XRTSOQJS.js');try{let l=await e.execute(n`SELECT * FROM "_globals_store-settings" LIMIT 1`);i=Array.isArray(l)?l[0]:l?.rows?l.rows[0]:null;}catch{}try{let l=await e.execute(n`SELECT * FROM "_globals_brand-settings" LIMIT 1`);a=Array.isArray(l)?l[0]:l?.rows?l.rows[0]:null;}catch{}}else if(typeof e?.prepare=="function"){try{i=e.prepare('SELECT * FROM "_globals_store-settings" LIMIT 1').get();}catch{}try{a=e.prepare('SELECT * FROM "_globals_brand-settings" LIMIT 1').get();}catch{}}if(i?.storeName&&(t=i.storeName),a?.identity){let n=typeof a.identity=="string"?JSON.parse(a.identity):a.identity,l=async p=>{if(typeof e?.findOne=="function")return (await e.findOne({collection:"media",where:{id:{equals:p}}}))?.url;if(typeof e?.execute=="function"){let{sql:u}=await import('./drizzle-orm-XRTSOQJS.js');try{let f=await e.execute(u`SELECT url FROM "media" WHERE id = ${p}`);return (Array.isArray(f)?f[0]:f?.rows?f.rows[0]:null)?.url}catch{}}else if(typeof e?.prepare=="function")try{return e.prepare('SELECT url FROM "media" WHERE id = ?').get(p)?.url}catch{}};if(n.primaryLogo){let p=await l(n.primaryLogo);p&&(r=p);}if(n.darkLogo){let p=await l(n.darkLogo);p&&(s=p);}}}catch{}return {siteName:t,logoUrl:r,logoDarkUrl:s,appUrl:process.env.PUBLIC_URL||"https://kyro-cms.com"}}static async fromConfig(e){let t=new b(e);await t.load();let r=t.getEmailConfig();if(!r.provider)return this.fromEnv();let i={brand:await this.fetchBrandConfig(e),provider:r.provider||"smtp",from:r.from||"noreply@example.com",fromName:r.fromName,replyTo:r.replyTo,smtp:r.provider==="smtp"?{host:r.host||"",port:r.port||587,secure:r.secure||false,auth:{user:r.user||"",pass:r.pass||""}}:void 0,resend:r.provider==="resend"?{apiKey:r.pass||""}:void 0,sendgrid:r.provider==="sendgrid"?{apiKey:r.pass||""}:void 0,mailgun:r.provider==="mailgun"?{apiKey:r.pass||"",domain:r.host||"",region:r.secure?"eu":"us"}:void 0,ses:r.provider==="ses"?{accessKeyId:r.user||"",secretAccessKey:r.pass||"",region:r.host||"us-east-1"}:void 0};return new o(i)}static fromEnv(){let e=process.env.EMAIL_PROVIDER||"smtp",t=process.env.SMTP_FROM||process.env.DEFAULT_FROM||"noreply@example.com",r=process.env.SMTP_FROM_NAME||"Kyro CMS",s=process.env.SMTP_REPLY_TO;if(e==="smtp"){let i=process.env.SMTP_HOST,a=process.env.SMTP_USER,n=process.env.SMTP_PASS;return !i||!a||!n?null:new o({provider:"smtp",from:t,fromName:r,replyTo:s,smtp:{host:i,port:parseInt(process.env.SMTP_PORT||"587",10),secure:process.env.SMTP_SECURE==="true",auth:{user:a,pass:n}}})}if(e==="resend"){let i=process.env.RESEND_API_KEY||process.env.SMTP_PASS;return i?new o({provider:"resend",from:t,fromName:r,replyTo:s,resend:{apiKey:i}}):null}if(e==="sendgrid"){let i=process.env.SENDGRID_API_KEY||process.env.SMTP_PASS;return i?new o({provider:"sendgrid",from:t,fromName:r,replyTo:s,sendgrid:{apiKey:i}}):null}if(e==="mailgun"){let i=process.env.MAILGUN_API_KEY||process.env.SMTP_PASS,a=process.env.MAILGUN_DOMAIN||process.env.SMTP_HOST;return !i||!a?null:new o({provider:"mailgun",from:t,fromName:r,replyTo:s,mailgun:{apiKey:i,domain:a,region:process.env.MAILGUN_REGION||(process.env.SMTP_SECURE==="true"?"eu":"us")}})}if(e==="ses"){let i=process.env.AWS_ACCESS_KEY_ID||process.env.SMTP_USER,a=process.env.AWS_SECRET_ACCESS_KEY||process.env.SMTP_PASS,n=process.env.AWS_REGION||process.env.SMTP_HOST||"us-east-1";return !i||!a?null:new o({provider:"ses",from:t,fromName:r,replyTo:s,ses:{accessKeyId:i,secretAccessKey:a,region:n}})}return null}};
432
- export{g as a,x as b,_ as c,w as d,S as e,C as f,T as g,k as h,E as i,v as j,A as k,R as l,I as m,O as n,K as o,b as p,U as q};
@@ -1 +0,0 @@
1
- 'use strict';var chunkLQ3YZTPU_cjs=require('./chunk-LQ3YZTPU.cjs'),chunkBUNLC3II_cjs=require('./chunk-BUNLC3II.cjs'),H=require('zlib'),stream=require('stream'),crypto=require('crypto');function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var H__namespace=/*#__PURE__*/_interopNamespace(H);chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();var C=new Uint32Array(256);for(let n=0;n<256;++n){let e=n;for(let t=0;t<8;++t)e=e&1?3988292384^e>>>1:e>>>1;C[n]=e>>>0;}var L=4294967295,g=class{digestLength=4;checksum=L;update(e){for(let t=0;t<e.length;++t)this.checksum=this.checksum>>>8^C[(this.checksum^e[t])&255];}digestSync(){return (this.checksum^L)>>>0}async digest(){let e=this.digestSync(),t=new Uint8Array(4);return new DataView(t.buffer).setUint32(0,e,false),t}reset(){this.checksum=L;}};var M=typeof H__namespace.crc32=="function"?H__namespace.crc32:void 0,v=M?K(M):g;function K(n){return class{digestLength=4;value=0;update(t){this.value=n(t,this.value);}digestSync(){return this.value>>>0}async digest(){let t=new Uint8Array(4);return new DataView(t.buffer).setUint32(0,this.digestSync(),false),t}reset(){this.value=0;}}}chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();var w=class extends stream.Writable{hash;constructor(e,t){super(t),this.hash=e;}_write(e,t,r){try{this.hash.update(chunkLQ3YZTPU_cjs.v(e));}catch(s){return r(s)}r();}};chunkBUNLC3II_cjs.h();var J=(n,e)=>{if(e.readableFlowing!==null)throw new Error("Unable to calculate hash for flowing readable stream");let t=new n,r=new w(t);return e.pipe(r),new Promise((s,f)=>{e.on("error",h=>{r.end(),f(h);}),r.on("error",f),r.on("finish",()=>{t.digest().then(s).catch(f);});})};chunkBUNLC3II_cjs.h();var A=class{digestLength=16;state=Uint32Array.from(E);writeBuffer=new DataView(new ArrayBuffer(64));bufferLength=0;bytesHashed=0;update(e){let t=chunkLQ3YZTPU_cjs.v(e),r=0,s=t.byteLength;for(this.bytesHashed+=s;s>0;)this.writeBuffer.setUint8(this.bufferLength++,t[r++]),--s,this.bufferLength===64&&(N(this.state,this.writeBuffer),this.bufferLength=0);}async digest(){let e=Uint32Array.from(this.state),t=new DataView(this.writeBuffer.buffer.slice(0)),r=this.bufferLength,s=this.bytesHashed*8;if(t.setUint8(r++,128),this.bufferLength%64>=56){for(let i=r;i<64;++i)t.setUint8(i,0);N(e,t),r=0;}for(let i=r;i<56;++i)t.setUint8(i,0);t.setUint32(56,s>>>0,true),t.setUint32(60,Math.floor(s/2**32),true),N(e,t);let f=new Uint8Array(16),h=new DataView(f.buffer);for(let i=0;i<4;++i)h.setUint32(i*4,e[i],true);return f}reset(){this.state.set(E),this.writeBuffer=new DataView(new ArrayBuffer(64)),this.bufferLength=0,this.bytesHashed=0;}},E=[1732584193,4023233417,2562383102,271733878],l=4294967295,_=Uint8Array.of(7,12,17,22,5,9,14,20,4,11,16,23,6,10,15,21),R=Array.from({length:64},(n,e)=>Math.abs(Math.sin(e+1))*2**32>>>0);function N(n,e){let t=n[0],r=n[1],s=n[2],f=n[3];for(let h=0;h<64;++h){let i,c;h<16?(i=r&s|~r&f,c=h):h<32?(i=f&r|s&~f,c=(5*h+1)%16):h<48?(i=r^s^f,c=(3*h+5)%16):(i=s^(r|~f),c=7*h%16);let y=e.getUint32(c*4,true),m=f;f=s,s=r;let p=_[(h>>4)*4+(h&3)],a=(t+i&l)+(y+R[h]&l)&l;r=r+((a<<p|a>>>32-p)>>>0)&l,t=m;}n[0]=n[0]+t&l,n[1]=n[1]+r&l,n[2]=n[2]+s&l,n[3]=n[3]+f&l;}chunkBUNLC3II_cjs.h();var F=(()=>{try{return crypto.createHash("md5"),!0}catch{return false}})(),I=F?P():A;function P(){return class{digestLength=16;hash=crypto.createHash("md5");update(e){this.hash.update(chunkLQ3YZTPU_cjs.v(e));}async digest(){let e=this.hash.copy().digest();return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}reset(){this.hash=crypto.createHash("md5");}}}chunkBUNLC3II_cjs.h();var u=64,D=32,X=2**53-1,U=class n{digestLength=D;state=Int32Array.from(V);w;buffer=new Uint8Array(64);bufferLength=0;bytesHashed=0;finished=false;inner;outer;constructor(e){if(e){let t=n.normalizeKey(e);this.inner=new n,this.outer=new n;let{inner:r,outer:s}=this,f=new Uint8Array(u*2);for(let h=0;h<u;++h)f[h]=54^t[h],f[h+u]=92^t[h];r.update(f.subarray(0,u)),s.update(f.subarray(u));}}update(e){if(this.finished)throw new Error("Attempted to update an already finished HMAC.");if(this.inner){this.inner.update(e);return}let t=chunkLQ3YZTPU_cjs.v(e),r=0,{byteLength:s}=t;if(this.bytesHashed+=s,this.bytesHashed*8>X)throw new Error("Cannot hash more than 2^53 - 1 bits");for(;s>0;)this.buffer[this.bufferLength++]=t[r++],s--,this.bufferLength===u&&(this.hashBuffer(),this.bufferLength=0);}async digest(){let{inner:e,outer:t}=this;if(e&&t){if(this.finished)throw new Error("Attempted to digest an already finished HMAC.");this.finished=true;let r=e.digestSync();return t.update(r),t.digestSync()}return this.digestSync()}reset(){this.state=Int32Array.from(V),this.buffer=new Uint8Array(64),this.bufferLength=0,this.bytesHashed=0;}digestSync(){let e=this.state.slice(),t=this.buffer.slice(),r=this.bufferLength,s=this.bytesHashed*8,f=new DataView(t.buffer,t.byteOffset,t.byteLength);if(f.setUint8(r++,128),(r-1)%u>=u-8){for(let i=r;i<u;++i)f.setUint8(i,0);this.hashBufferWith(e,t),r=0;}for(let i=r;i<u-8;++i)f.setUint8(i,0);f.setUint32(u-8,Math.floor(s/4294967296),false),f.setUint32(u-4,s,false),this.hashBufferWith(e,t);let h=new Uint8Array(D);for(let i=0;i<8;++i)h[i*4]=e[i]>>>24&255,h[i*4+1]=e[i]>>>16&255,h[i*4+2]=e[i]>>>8&255,h[i*4+3]=e[i]>>>0&255;return h}static normalizeKey(e){let t=chunkLQ3YZTPU_cjs.v(e);if(t.byteLength>u){let r=new n;r.update(t);let s=r.digestSync(),f=new Uint8Array(u);return f.set(s),f}if(t.byteLength<u){let r=new Uint8Array(u);return r.set(t),r}return t}hashBuffer(){this.hashBufferWith(this.state,this.buffer);}hashBufferWith(e,t){let r=this.w??=new Int32Array(64),s=e[0],f=e[1],h=e[2],i=e[3],c=e[4],y=e[5],m=e[6],p=e[7];for(let a=0;a<u;++a){if(a<16)r[a]=(t[a*4]&255)<<24|(t[a*4+1]&255)<<16|(t[a*4+2]&255)<<8|t[a*4+3]&255;else {let d=r[a-2],O=(d>>>17|d<<15)^(d>>>19|d<<13)^d>>>10;d=r[a-15];let W=(d>>>7|d<<25)^(d>>>18|d<<14)^d>>>3;r[a]=(O+r[a-7]|0)+(W+r[a-16]|0);}let B=(((c>>>6|c<<26)^(c>>>11|c<<21)^(c>>>25|c<<7))+(c&y^~c&m)|0)+(p+(q[a]+r[a]|0)|0)|0,z=((s>>>2|s<<30)^(s>>>13|s<<19)^(s>>>22|s<<10))+(s&f^s&h^f&h)|0;p=m,m=y,y=c,c=i+B|0,i=h,h=f,f=s,s=B+z|0;}e[0]+=s,e[1]+=f,e[2]+=h,e[3]+=i,e[4]+=c,e[5]+=y,e[6]+=m,e[7]+=p;}},V=new Int32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),q=new Int32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);chunkBUNLC3II_cjs.h();var Y=(()=>{try{return crypto.createHash("sha256"),!0}catch{return false}})(),T=Y?Z():U;function Z(){return class{digestLength=32;secret;hash;isHmac;finished=false;constructor(e){this.secret=e,this.isHmac=!!e,this.hash=this.createHash();}update(e){if(this.finished)throw new Error("Attempted to update an already finished hash.");this.hash.update(e);}async digest(){let e;return this.isHmac?(this.finished=true,e=this.hash.digest()):e=this.hash.copy().digest(),new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}reset(){this.hash=this.createHash(),this.finished=false;}createHash(){return this.secret?crypto.createHmac("sha256",$(this.secret)):crypto.createHash("sha256")}}}function $(n){return typeof n=="string"?n:ArrayBuffer.isView(n)?Buffer.from(n.buffer,n.byteOffset,n.byteLength):Buffer.from(n)}exports.a=J;exports.b=I;exports.c=v;exports.d=T;