@arch-cadre/core 0.0.55 → 0.0.57

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 (297) hide show
  1. package/dist/_virtual/_rolldown/runtime.cjs +1 -0
  2. package/dist/_virtual/_rolldown/runtime.mjs +1 -0
  3. package/dist/core/auth/augment.cjs +1 -0
  4. package/dist/core/auth/augment.d.cts +20 -0
  5. package/dist/core/auth/augment.d.cts.map +1 -0
  6. package/dist/core/auth/augment.d.mts +20 -0
  7. package/dist/core/auth/augment.d.mts.map +1 -0
  8. package/dist/core/auth/augment.mjs +2 -0
  9. package/dist/core/auth/augment.mjs.map +1 -0
  10. package/dist/core/auth/email-verification.cjs +1 -0
  11. package/dist/core/auth/email-verification.d.cts +62 -0
  12. package/dist/core/auth/email-verification.d.cts.map +1 -0
  13. package/dist/core/auth/email-verification.d.mts +62 -0
  14. package/dist/core/auth/email-verification.d.mts.map +1 -0
  15. package/dist/core/auth/email-verification.mjs +2 -0
  16. package/dist/core/auth/email-verification.mjs.map +1 -0
  17. package/dist/core/auth/logic.cjs +1 -0
  18. package/dist/core/auth/logic.d.cts +110 -0
  19. package/dist/core/auth/logic.d.cts.map +1 -0
  20. package/dist/core/auth/logic.d.mts +110 -0
  21. package/dist/core/auth/logic.d.mts.map +1 -0
  22. package/dist/core/auth/logic.mjs +2 -0
  23. package/dist/core/auth/logic.mjs.map +1 -0
  24. package/dist/core/auth/password-reset.cjs +1 -0
  25. package/dist/core/auth/password-reset.d.cts +39 -0
  26. package/dist/core/auth/password-reset.d.cts.map +1 -0
  27. package/dist/core/auth/password-reset.d.mts +39 -0
  28. package/dist/core/auth/password-reset.d.mts.map +1 -0
  29. package/dist/core/auth/password-reset.mjs +2 -0
  30. package/dist/core/auth/password-reset.mjs.map +1 -0
  31. package/dist/core/auth/rbac.cjs +1 -0
  32. package/dist/core/auth/rbac.d.cts +61 -0
  33. package/dist/core/auth/rbac.d.cts.map +1 -0
  34. package/dist/core/auth/rbac.d.mts +61 -0
  35. package/dist/core/auth/rbac.d.mts.map +1 -0
  36. package/dist/core/auth/rbac.mjs +2 -0
  37. package/dist/core/auth/rbac.mjs.map +1 -0
  38. package/dist/core/auth/session.cjs +1 -0
  39. package/dist/core/auth/session.d.cts +54 -0
  40. package/dist/core/auth/session.d.cts.map +1 -0
  41. package/dist/core/auth/session.d.mts +54 -0
  42. package/dist/core/auth/session.d.mts.map +1 -0
  43. package/dist/core/auth/session.mjs +2 -0
  44. package/dist/core/auth/session.mjs.map +1 -0
  45. package/dist/core/auth/types.d.cts +55 -0
  46. package/dist/core/auth/types.d.cts.map +1 -0
  47. package/dist/core/auth/types.d.mts +55 -0
  48. package/dist/core/auth/types.d.mts.map +1 -0
  49. package/dist/core/auth/utils/encode.cjs +1 -0
  50. package/dist/core/auth/utils/encode.d.cts +15 -0
  51. package/dist/core/auth/utils/encode.d.cts.map +1 -0
  52. package/dist/core/auth/utils/encode.d.mts +15 -0
  53. package/dist/core/auth/utils/encode.d.mts.map +1 -0
  54. package/dist/core/auth/utils/encode.mjs +2 -0
  55. package/dist/core/auth/utils/encode.mjs.map +1 -0
  56. package/dist/core/auth/utils/encryption.cjs +1 -0
  57. package/dist/core/auth/utils/{encryption.d.ts → encryption.d.cts} +8 -5
  58. package/dist/core/auth/utils/encryption.d.cts.map +1 -0
  59. package/dist/core/auth/utils/encryption.d.mts +28 -0
  60. package/dist/core/auth/utils/encryption.d.mts.map +1 -0
  61. package/dist/core/auth/utils/encryption.mjs +2 -0
  62. package/dist/core/auth/utils/encryption.mjs.map +1 -0
  63. package/dist/core/auth/validation.cjs +1 -0
  64. package/dist/core/auth/validation.d.cts +48 -0
  65. package/dist/core/auth/validation.d.cts.map +1 -0
  66. package/dist/core/auth/validation.d.mts +48 -0
  67. package/dist/core/auth/validation.d.mts.map +1 -0
  68. package/dist/core/auth/validation.mjs +2 -0
  69. package/dist/core/auth/validation.mjs.map +1 -0
  70. package/dist/core/bootstrap.cjs +1 -0
  71. package/dist/core/bootstrap.d.cts +5 -0
  72. package/dist/core/bootstrap.d.cts.map +1 -0
  73. package/dist/core/bootstrap.d.mts +5 -0
  74. package/dist/core/bootstrap.d.mts.map +1 -0
  75. package/dist/core/bootstrap.mjs +2 -0
  76. package/dist/core/bootstrap.mjs.map +1 -0
  77. package/dist/core/config.cjs +1 -0
  78. package/dist/core/config.d.cts +11 -0
  79. package/dist/core/config.d.cts.map +1 -0
  80. package/dist/core/config.d.mts +11 -0
  81. package/dist/core/config.d.mts.map +1 -0
  82. package/dist/core/config.mjs +2 -0
  83. package/dist/core/config.mjs.map +1 -0
  84. package/dist/core/config.server.cjs +1 -0
  85. package/dist/core/config.server.d.cts +16 -0
  86. package/dist/core/config.server.d.cts.map +1 -0
  87. package/dist/core/config.server.d.mts +16 -0
  88. package/dist/core/config.server.d.mts.map +1 -0
  89. package/dist/core/config.server.mjs +2 -0
  90. package/dist/core/config.server.mjs.map +1 -0
  91. package/dist/core/event-bus.cjs +1 -0
  92. package/dist/core/event-bus.d.cts +17 -0
  93. package/dist/core/event-bus.d.cts.map +1 -0
  94. package/dist/core/event-bus.d.mts +17 -0
  95. package/dist/core/event-bus.d.mts.map +1 -0
  96. package/dist/core/event-bus.mjs +2 -0
  97. package/dist/core/event-bus.mjs.map +1 -0
  98. package/dist/core/filesystem/index.cjs +1 -0
  99. package/dist/core/filesystem/index.mjs +2 -0
  100. package/dist/core/filesystem/index.mjs.map +1 -0
  101. package/dist/core/filesystem/providers/local.cjs +1 -0
  102. package/dist/core/filesystem/providers/local.mjs +2 -0
  103. package/dist/core/filesystem/providers/local.mjs.map +1 -0
  104. package/dist/core/filesystem/service.cjs +1 -0
  105. package/dist/core/filesystem/service.d.cts +19 -0
  106. package/dist/core/filesystem/service.d.cts.map +1 -0
  107. package/dist/core/filesystem/service.d.mts +19 -0
  108. package/dist/core/filesystem/service.d.mts.map +1 -0
  109. package/dist/core/filesystem/service.mjs +2 -0
  110. package/dist/core/filesystem/service.mjs.map +1 -0
  111. package/dist/core/filesystem/types.d.cts +22 -0
  112. package/dist/core/filesystem/types.d.cts.map +1 -0
  113. package/dist/core/filesystem/types.d.mts +22 -0
  114. package/dist/core/filesystem/types.d.mts.map +1 -0
  115. package/dist/core/notifications/actions.cjs +1 -0
  116. package/dist/core/notifications/actions.d.cts +58 -0
  117. package/dist/core/notifications/actions.d.cts.map +1 -0
  118. package/dist/core/notifications/actions.d.mts +58 -0
  119. package/dist/core/notifications/actions.d.mts.map +1 -0
  120. package/dist/core/notifications/actions.mjs +2 -0
  121. package/dist/core/notifications/actions.mjs.map +1 -0
  122. package/dist/core/notifications/index.cjs +1 -0
  123. package/dist/core/notifications/index.mjs +1 -0
  124. package/dist/core/notifications/service.cjs +1 -0
  125. package/dist/core/notifications/service.d.cts +9 -0
  126. package/dist/core/notifications/service.d.cts.map +1 -0
  127. package/dist/core/notifications/service.d.mts +9 -0
  128. package/dist/core/notifications/service.d.mts.map +1 -0
  129. package/dist/core/notifications/service.mjs +2 -0
  130. package/dist/core/notifications/service.mjs.map +1 -0
  131. package/dist/core/notifications/types.d.cts +21 -0
  132. package/dist/core/notifications/types.d.cts.map +1 -0
  133. package/dist/core/notifications/types.d.mts +21 -0
  134. package/dist/core/notifications/types.d.mts.map +1 -0
  135. package/dist/core/setup.cjs +1 -0
  136. package/dist/core/setup.d.cts +9 -0
  137. package/dist/core/setup.d.cts.map +1 -0
  138. package/dist/core/setup.d.mts +9 -0
  139. package/dist/core/setup.d.mts.map +1 -0
  140. package/dist/core/setup.mjs +2 -0
  141. package/dist/core/setup.mjs.map +1 -0
  142. package/dist/core/types.d.cts +13 -0
  143. package/dist/core/types.d.cts.map +1 -0
  144. package/dist/core/types.d.mts +13 -0
  145. package/dist/core/types.d.mts.map +1 -0
  146. package/dist/index.cjs +1 -0
  147. package/dist/index.d.cts +8 -0
  148. package/dist/index.d.mts +8 -0
  149. package/dist/index.mjs +1 -0
  150. package/dist/server/auth/email.cjs +1 -0
  151. package/dist/server/auth/email.d.cts +13 -0
  152. package/dist/server/auth/email.d.cts.map +1 -0
  153. package/dist/server/auth/email.d.mts +13 -0
  154. package/dist/server/auth/email.d.mts.map +1 -0
  155. package/dist/server/auth/email.mjs +2 -0
  156. package/dist/server/auth/email.mjs.map +1 -0
  157. package/dist/server/auth/password.cjs +1 -0
  158. package/dist/server/auth/{password.d.ts → password.d.cts} +7 -4
  159. package/dist/server/auth/password.d.cts.map +1 -0
  160. package/dist/server/auth/{password.js → password.d.mts} +7 -14
  161. package/dist/server/auth/password.d.mts.map +1 -0
  162. package/dist/server/auth/password.mjs +2 -0
  163. package/dist/server/auth/password.mjs.map +1 -0
  164. package/dist/server/auth/user.cjs +1 -0
  165. package/dist/server/auth/user.d.cts +58 -0
  166. package/dist/server/auth/user.d.cts.map +1 -0
  167. package/dist/server/auth/user.d.mts +58 -0
  168. package/dist/server/auth/user.d.mts.map +1 -0
  169. package/dist/server/auth/user.mjs +2 -0
  170. package/dist/server/auth/user.mjs.map +1 -0
  171. package/dist/server/database/inject.cjs +1 -0
  172. package/dist/server/database/inject.d.cts +15 -0
  173. package/dist/server/database/inject.d.cts.map +1 -0
  174. package/dist/server/database/inject.d.mts +15 -0
  175. package/dist/server/database/inject.d.mts.map +1 -0
  176. package/dist/server/database/inject.mjs +2 -0
  177. package/dist/server/database/inject.mjs.map +1 -0
  178. package/dist/server/database/schema.cjs +1 -0
  179. package/dist/server/database/schema.d.cts +3065 -0
  180. package/dist/server/database/{schema.d.ts.map → schema.d.cts.map} +1 -1
  181. package/dist/server/database/schema.d.mts +3065 -0
  182. package/dist/server/database/schema.d.mts.map +1 -0
  183. package/dist/server/database/schema.mjs +2 -0
  184. package/dist/server/database/schema.mjs.map +1 -0
  185. package/dist/server/emails/index.cjs +1 -0
  186. package/dist/server/emails/index.d.cts +26 -0
  187. package/dist/server/emails/index.d.cts.map +1 -0
  188. package/dist/server/emails/index.d.mts +26 -0
  189. package/dist/server/emails/index.d.mts.map +1 -0
  190. package/dist/server/emails/index.mjs +2 -0
  191. package/dist/server/emails/index.mjs.map +1 -0
  192. package/dist/server.cjs +1 -0
  193. package/dist/server.d.cts +26 -0
  194. package/dist/server.d.mts +26 -0
  195. package/dist/server.mjs +1 -0
  196. package/package.json +15 -7
  197. package/dist/core/auth/augment.d.ts +0 -18
  198. package/dist/core/auth/augment.d.ts.map +0 -1
  199. package/dist/core/auth/augment.js +0 -45
  200. package/dist/core/auth/email-verification.d.ts +0 -58
  201. package/dist/core/auth/email-verification.d.ts.map +0 -1
  202. package/dist/core/auth/email-verification.js +0 -105
  203. package/dist/core/auth/events.d.ts +0 -53
  204. package/dist/core/auth/events.d.ts.map +0 -1
  205. package/dist/core/auth/events.js +0 -1
  206. package/dist/core/auth/logic.d.ts +0 -106
  207. package/dist/core/auth/logic.d.ts.map +0 -1
  208. package/dist/core/auth/logic.js +0 -245
  209. package/dist/core/auth/password-reset.d.ts +0 -35
  210. package/dist/core/auth/password-reset.d.ts.map +0 -1
  211. package/dist/core/auth/password-reset.js +0 -122
  212. package/dist/core/auth/rbac.d.ts +0 -56
  213. package/dist/core/auth/rbac.d.ts.map +0 -1
  214. package/dist/core/auth/rbac.js +0 -134
  215. package/dist/core/auth/session.d.ts +0 -50
  216. package/dist/core/auth/session.d.ts.map +0 -1
  217. package/dist/core/auth/session.js +0 -152
  218. package/dist/core/auth/types.d.ts +0 -52
  219. package/dist/core/auth/types.d.ts.map +0 -1
  220. package/dist/core/auth/types.js +0 -1
  221. package/dist/core/auth/utils/encode.d.ts +0 -12
  222. package/dist/core/auth/utils/encode.d.ts.map +0 -1
  223. package/dist/core/auth/utils/encode.js +0 -20
  224. package/dist/core/auth/utils/encryption.d.ts.map +0 -1
  225. package/dist/core/auth/utils/encryption.js +0 -62
  226. package/dist/core/auth/validation.d.ts +0 -44
  227. package/dist/core/auth/validation.d.ts.map +0 -1
  228. package/dist/core/auth/validation.js +0 -41
  229. package/dist/core/bootstrap.d.ts +0 -2
  230. package/dist/core/bootstrap.d.ts.map +0 -1
  231. package/dist/core/bootstrap.js +0 -51
  232. package/dist/core/config.d.ts +0 -9
  233. package/dist/core/config.d.ts.map +0 -1
  234. package/dist/core/config.js +0 -3
  235. package/dist/core/config.server.d.ts +0 -12
  236. package/dist/core/config.server.d.ts.map +0 -1
  237. package/dist/core/config.server.js +0 -61
  238. package/dist/core/event-bus.d.ts +0 -14
  239. package/dist/core/event-bus.d.ts.map +0 -1
  240. package/dist/core/event-bus.js +0 -51
  241. package/dist/core/filesystem/index.d.ts +0 -4
  242. package/dist/core/filesystem/index.d.ts.map +0 -1
  243. package/dist/core/filesystem/index.js +0 -10
  244. package/dist/core/filesystem/providers/local.d.ts +0 -8
  245. package/dist/core/filesystem/providers/local.d.ts.map +0 -1
  246. package/dist/core/filesystem/providers/local.js +0 -42
  247. package/dist/core/filesystem/service.d.ts +0 -16
  248. package/dist/core/filesystem/service.d.ts.map +0 -1
  249. package/dist/core/filesystem/service.js +0 -51
  250. package/dist/core/filesystem/types.d.ts +0 -19
  251. package/dist/core/filesystem/types.d.ts.map +0 -1
  252. package/dist/core/filesystem/types.js +0 -1
  253. package/dist/core/notifications/actions.d.ts +0 -54
  254. package/dist/core/notifications/actions.d.ts.map +0 -1
  255. package/dist/core/notifications/actions.js +0 -43
  256. package/dist/core/notifications/index.d.ts +0 -4
  257. package/dist/core/notifications/index.d.ts.map +0 -1
  258. package/dist/core/notifications/index.js +0 -3
  259. package/dist/core/notifications/service.d.ts +0 -7
  260. package/dist/core/notifications/service.d.ts.map +0 -1
  261. package/dist/core/notifications/service.js +0 -32
  262. package/dist/core/notifications/types.d.ts +0 -17
  263. package/dist/core/notifications/types.d.ts.map +0 -1
  264. package/dist/core/notifications/types.js +0 -1
  265. package/dist/core/setup.d.ts +0 -6
  266. package/dist/core/setup.d.ts.map +0 -1
  267. package/dist/core/setup.js +0 -25
  268. package/dist/core/types.d.ts +0 -10
  269. package/dist/core/types.d.ts.map +0 -1
  270. package/dist/core/types.js +0 -1
  271. package/dist/index.d.ts +0 -8
  272. package/dist/index.d.ts.map +0 -1
  273. package/dist/index.js +0 -16
  274. package/dist/server/auth/email.d.ts +0 -10
  275. package/dist/server/auth/email.d.ts.map +0 -1
  276. package/dist/server/auth/email.js +0 -20
  277. package/dist/server/auth/password.d.ts.map +0 -1
  278. package/dist/server/auth/types.d.ts +0 -13
  279. package/dist/server/auth/types.d.ts.map +0 -1
  280. package/dist/server/auth/types.js +0 -1
  281. package/dist/server/auth/user.d.ts +0 -54
  282. package/dist/server/auth/user.d.ts.map +0 -1
  283. package/dist/server/auth/user.js +0 -222
  284. package/dist/server/database/inject.d.ts +0 -11
  285. package/dist/server/database/inject.d.ts.map +0 -1
  286. package/dist/server/database/inject.js +0 -29
  287. package/dist/server/database/schema.d.ts +0 -2953
  288. package/dist/server/database/schema.js +0 -192
  289. package/dist/server/database/types.d.ts +0 -12
  290. package/dist/server/database/types.d.ts.map +0 -1
  291. package/dist/server/database/types.js +0 -1
  292. package/dist/server/emails/index.d.ts +0 -23
  293. package/dist/server/emails/index.d.ts.map +0 -1
  294. package/dist/server/emails/index.js +0 -67
  295. package/dist/server.d.ts +0 -25
  296. package/dist/server.d.ts.map +0 -1
  297. package/dist/server.js +0 -32
@@ -0,0 +1,48 @@
1
+ import { z } from "zod";
2
+
3
+ //#region src/core/auth/validation.d.ts
4
+ declare const loginSchema: z.ZodObject<{
5
+ email: z.ZodString;
6
+ password: z.ZodString;
7
+ remember: z.ZodOptional<z.ZodBoolean>;
8
+ }, z.core.$strip>;
9
+ declare const registerSchema: z.ZodObject<{
10
+ username: z.ZodString;
11
+ email: z.ZodString;
12
+ password: z.ZodString;
13
+ terms: z.ZodBoolean;
14
+ }, z.core.$strip>;
15
+ declare const forgotPasswordSchema: z.ZodObject<{
16
+ email: z.ZodString;
17
+ }, z.core.$strip>;
18
+ declare const resetPasswordSchema: z.ZodObject<{
19
+ password: z.ZodString;
20
+ confirm: z.ZodString;
21
+ }, z.core.$strip>;
22
+ declare const verifyEmailSchema: z.ZodObject<{
23
+ code: z.ZodString;
24
+ }, z.core.$strip>;
25
+ declare const totpSetupSchema: z.ZodObject<{
26
+ code: z.ZodString;
27
+ }, z.core.$strip>;
28
+ declare const totpVerifySchema: z.ZodObject<{
29
+ code: z.ZodString;
30
+ }, z.core.$strip>;
31
+ declare const passkeysSetupSchema: z.ZodObject<{
32
+ name: z.ZodString;
33
+ }, z.core.$strip>;
34
+ declare const recoveryCodeVerifySchema: z.ZodObject<{
35
+ code: z.ZodString;
36
+ }, z.core.$strip>;
37
+ type LoginInput = z.infer<typeof loginSchema>;
38
+ type RegisterInput = z.infer<typeof registerSchema>;
39
+ type ForgotPasswordInput = z.infer<typeof forgotPasswordSchema>;
40
+ type ResetPasswordInput = z.infer<typeof resetPasswordSchema>;
41
+ type TOTPSetupInput = z.infer<typeof totpSetupSchema>;
42
+ type TOTPVerifyInput = z.infer<typeof totpVerifySchema>;
43
+ type PasskeysSetupInput = z.infer<typeof passkeysSetupSchema>;
44
+ type VerifyEmailInput = z.infer<typeof verifyEmailSchema>;
45
+ type RecoveryVerifyInput = z.infer<typeof recoveryCodeVerifySchema>;
46
+ //#endregion
47
+ export { ForgotPasswordInput, LoginInput, PasskeysSetupInput, RecoveryVerifyInput, RegisterInput, ResetPasswordInput, TOTPSetupInput, TOTPVerifyInput, VerifyEmailInput, forgotPasswordSchema, loginSchema, passkeysSetupSchema, recoveryCodeVerifySchema, registerSchema, resetPasswordSchema, totpSetupSchema, totpVerifySchema, verifyEmailSchema };
48
+ //# sourceMappingURL=validation.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validation.d.cts","names":[],"sources":["../../../src/core/auth/validation.ts"],"mappings":";;;cAGa,WAAA,EAAW,CAAA,CAAA,SAAA;;;;;cAMX,cAAA,EAAc,CAAA,CAAA,SAAA;;;;;;cAOd,oBAAA,EAAoB,CAAA,CAAA,SAAA;;;cAIpB,mBAAA,EAAmB,CAAA,CAAA,SAAA;;;;cAUnB,iBAAA,EAAiB,CAAA,CAAA,SAAA;;;cAKjB,eAAA,EAAe,CAAA,CAAA,SAAA;;;cAIf,gBAAA,EAAgB,CAAA,CAAA,SAAA;;;cAIhB,mBAAA,EAAmB,CAAA,CAAA,SAAA;;;cAInB,wBAAA,EAAwB,CAAA,CAAA,SAAA;;;KAKzB,UAAA,GAAa,CAAA,CAAE,KAAA,QAAa,WAAA;AAAA,KAC5B,aAAA,GAAgB,CAAA,CAAE,KAAA,QAAa,cAAA;AAAA,KAC/B,mBAAA,GAAsB,CAAA,CAAE,KAAA,QAAa,oBAAA;AAAA,KACrC,kBAAA,GAAqB,CAAA,CAAE,KAAA,QAAa,mBAAA;AAAA,KACpC,cAAA,GAAiB,CAAA,CAAE,KAAA,QAAa,eAAA;AAAA,KAChC,eAAA,GAAkB,CAAA,CAAE,KAAA,QAAa,gBAAA;AAAA,KACjC,kBAAA,GAAqB,CAAA,CAAE,KAAA,QAAa,mBAAA;AAAA,KACpC,gBAAA,GAAmB,CAAA,CAAE,KAAA,QAAa,iBAAA;AAAA,KAClC,mBAAA,GAAsB,CAAA,CAAE,KAAA,QAAa,wBAAA"}
@@ -0,0 +1,48 @@
1
+ import { z } from "zod";
2
+
3
+ //#region src/core/auth/validation.d.ts
4
+ declare const loginSchema: z.ZodObject<{
5
+ email: z.ZodString;
6
+ password: z.ZodString;
7
+ remember: z.ZodOptional<z.ZodBoolean>;
8
+ }, z.core.$strip>;
9
+ declare const registerSchema: z.ZodObject<{
10
+ username: z.ZodString;
11
+ email: z.ZodString;
12
+ password: z.ZodString;
13
+ terms: z.ZodBoolean;
14
+ }, z.core.$strip>;
15
+ declare const forgotPasswordSchema: z.ZodObject<{
16
+ email: z.ZodString;
17
+ }, z.core.$strip>;
18
+ declare const resetPasswordSchema: z.ZodObject<{
19
+ password: z.ZodString;
20
+ confirm: z.ZodString;
21
+ }, z.core.$strip>;
22
+ declare const verifyEmailSchema: z.ZodObject<{
23
+ code: z.ZodString;
24
+ }, z.core.$strip>;
25
+ declare const totpSetupSchema: z.ZodObject<{
26
+ code: z.ZodString;
27
+ }, z.core.$strip>;
28
+ declare const totpVerifySchema: z.ZodObject<{
29
+ code: z.ZodString;
30
+ }, z.core.$strip>;
31
+ declare const passkeysSetupSchema: z.ZodObject<{
32
+ name: z.ZodString;
33
+ }, z.core.$strip>;
34
+ declare const recoveryCodeVerifySchema: z.ZodObject<{
35
+ code: z.ZodString;
36
+ }, z.core.$strip>;
37
+ type LoginInput = z.infer<typeof loginSchema>;
38
+ type RegisterInput = z.infer<typeof registerSchema>;
39
+ type ForgotPasswordInput = z.infer<typeof forgotPasswordSchema>;
40
+ type ResetPasswordInput = z.infer<typeof resetPasswordSchema>;
41
+ type TOTPSetupInput = z.infer<typeof totpSetupSchema>;
42
+ type TOTPVerifyInput = z.infer<typeof totpVerifySchema>;
43
+ type PasskeysSetupInput = z.infer<typeof passkeysSetupSchema>;
44
+ type VerifyEmailInput = z.infer<typeof verifyEmailSchema>;
45
+ type RecoveryVerifyInput = z.infer<typeof recoveryCodeVerifySchema>;
46
+ //#endregion
47
+ export { ForgotPasswordInput, LoginInput, PasskeysSetupInput, RecoveryVerifyInput, RegisterInput, ResetPasswordInput, TOTPSetupInput, TOTPVerifyInput, VerifyEmailInput, forgotPasswordSchema, loginSchema, passkeysSetupSchema, recoveryCodeVerifySchema, registerSchema, resetPasswordSchema, totpSetupSchema, totpVerifySchema, verifyEmailSchema };
48
+ //# sourceMappingURL=validation.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validation.d.mts","names":[],"sources":["../../../src/core/auth/validation.ts"],"mappings":";;;cAGa,WAAA,EAAW,CAAA,CAAA,SAAA;;;;;cAMX,cAAA,EAAc,CAAA,CAAA,SAAA;;;;;;cAOd,oBAAA,EAAoB,CAAA,CAAA,SAAA;;;cAIpB,mBAAA,EAAmB,CAAA,CAAA,SAAA;;;;cAUnB,iBAAA,EAAiB,CAAA,CAAA,SAAA;;;cAKjB,eAAA,EAAe,CAAA,CAAA,SAAA;;;cAIf,gBAAA,EAAgB,CAAA,CAAA,SAAA;;;cAIhB,mBAAA,EAAmB,CAAA,CAAA,SAAA;;;cAInB,wBAAA,EAAwB,CAAA,CAAA,SAAA;;;KAKzB,UAAA,GAAa,CAAA,CAAE,KAAA,QAAa,WAAA;AAAA,KAC5B,aAAA,GAAgB,CAAA,CAAE,KAAA,QAAa,cAAA;AAAA,KAC/B,mBAAA,GAAsB,CAAA,CAAE,KAAA,QAAa,oBAAA;AAAA,KACrC,kBAAA,GAAqB,CAAA,CAAE,KAAA,QAAa,mBAAA;AAAA,KACpC,cAAA,GAAiB,CAAA,CAAE,KAAA,QAAa,eAAA;AAAA,KAChC,eAAA,GAAkB,CAAA,CAAE,KAAA,QAAa,gBAAA;AAAA,KACjC,kBAAA,GAAqB,CAAA,CAAE,KAAA,QAAa,mBAAA;AAAA,KACpC,gBAAA,GAAmB,CAAA,CAAE,KAAA,QAAa,iBAAA;AAAA,KAClC,mBAAA,GAAsB,CAAA,CAAE,KAAA,QAAa,wBAAA"}
@@ -0,0 +1,2 @@
1
+ import{z as e}from"zod";const t=e.object({email:e.string().email(`Invalid email address`),password:e.string().min(8),remember:e.boolean().optional()}),n=e.object({username:e.string().min(2,`Name must be at least 2 characters`),email:e.string().email(`Invalid email address`),password:e.string().min(8,`Password must be at least 8 characters`),terms:e.boolean().refine(e=>e===!0,`You must accept the terms`)}),r=e.object({email:e.string().email(`Invalid email address`)}),i=e.object({password:e.string().min(8,`Password must be at least 8 characters`),confirm:e.string()}).refine(e=>e.password===e.confirm,{message:`Passwords do not match`,path:[`confirm`]}),a=e.object({code:e.string().min(6).max(6)}),o=e.object({code:e.string().regex(/^\d{6}$/,`Code must be 6 digits`)}),s=e.object({code:e.string().regex(/^\d{6}$/,`Code must be 6 digits`)}),c=e.object({name:e.string().min(1,`Passkey name is required`)}),l=e.object({code:e.string().min(16,`Recovery code is required`).max(16)});export{r as forgotPasswordSchema,t as loginSchema,c as passkeysSetupSchema,l as recoveryCodeVerifySchema,n as registerSchema,i as resetPasswordSchema,o as totpSetupSchema,s as totpVerifySchema,a as verifyEmailSchema};
2
+ //# sourceMappingURL=validation.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validation.mjs","names":[],"sources":["../../../src/core/auth/validation.ts"],"sourcesContent":["import { z } from \"zod\";\n\n// Auth validation schemas - CLEAN (No DB dependencies for client-side)\nexport const loginSchema = z.object({\n email: z.string().email(\"Invalid email address\"),\n password: z.string().min(8),\n remember: z.boolean().optional(),\n});\n\nexport const registerSchema = z.object({\n username: z.string().min(2, \"Name must be at least 2 characters\"),\n email: z.string().email(\"Invalid email address\"),\n password: z.string().min(8, \"Password must be at least 8 characters\"),\n terms: z.boolean().refine((val) => val === true, \"You must accept the terms\"),\n});\n\nexport const forgotPasswordSchema = z.object({\n email: z.string().email(\"Invalid email address\"),\n});\n\nexport const resetPasswordSchema = z\n .object({\n password: z.string().min(8, \"Password must be at least 8 characters\"),\n confirm: z.string(),\n })\n .refine((data) => data.password === data.confirm, {\n message: \"Passwords do not match\",\n path: [\"confirm\"],\n });\n\nexport const verifyEmailSchema = z.object({\n code: z.string().min(6).max(6),\n});\n\n// mfa validation schemas\nexport const totpSetupSchema = z.object({\n code: z.string().regex(/^\\d{6}$/, \"Code must be 6 digits\"),\n});\n\nexport const totpVerifySchema = z.object({\n code: z.string().regex(/^\\d{6}$/, \"Code must be 6 digits\"),\n});\n\nexport const passkeysSetupSchema = z.object({\n name: z.string().min(1, \"Passkey name is required\"),\n});\n\nexport const recoveryCodeVerifySchema = z.object({\n code: z.string().min(16, \"Recovery code is required\").max(16),\n});\n\n// Type exports for use in components\nexport type LoginInput = z.infer<typeof loginSchema>;\nexport type RegisterInput = z.infer<typeof registerSchema>;\nexport type ForgotPasswordInput = z.infer<typeof forgotPasswordSchema>;\nexport type ResetPasswordInput = z.infer<typeof resetPasswordSchema>;\nexport type TOTPSetupInput = z.infer<typeof totpSetupSchema>;\nexport type TOTPVerifyInput = z.infer<typeof totpVerifySchema>;\nexport type PasskeysSetupInput = z.infer<typeof passkeysSetupSchema>;\nexport type VerifyEmailInput = z.infer<typeof verifyEmailSchema>;\nexport type RecoveryVerifyInput = z.infer<typeof recoveryCodeVerifySchema>;\n"],"mappings":"wBAGA,MAAa,EAAc,EAAE,OAAO,CAClC,MAAO,EAAE,QAAQ,CAAC,MAAM,wBAAwB,CAChD,SAAU,EAAE,QAAQ,CAAC,IAAI,EAAE,CAC3B,SAAU,EAAE,SAAS,CAAC,UAAU,CACjC,CAAC,CAEW,EAAiB,EAAE,OAAO,CACrC,SAAU,EAAE,QAAQ,CAAC,IAAI,EAAG,qCAAqC,CACjE,MAAO,EAAE,QAAQ,CAAC,MAAM,wBAAwB,CAChD,SAAU,EAAE,QAAQ,CAAC,IAAI,EAAG,yCAAyC,CACrE,MAAO,EAAE,SAAS,CAAC,OAAQ,GAAQ,IAAQ,GAAM,4BAA4B,CAC9E,CAAC,CAEW,EAAuB,EAAE,OAAO,CAC3C,MAAO,EAAE,QAAQ,CAAC,MAAM,wBAAwB,CACjD,CAAC,CAEW,EAAsB,EAChC,OAAO,CACN,SAAU,EAAE,QAAQ,CAAC,IAAI,EAAG,yCAAyC,CACrE,QAAS,EAAE,QAAQ,CACpB,CAAC,CACD,OAAQ,GAAS,EAAK,WAAa,EAAK,QAAS,CAChD,QAAS,yBACT,KAAM,CAAC,UAAU,CAClB,CAAC,CAES,EAAoB,EAAE,OAAO,CACxC,KAAM,EAAE,QAAQ,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,CAC/B,CAAC,CAGW,EAAkB,EAAE,OAAO,CACtC,KAAM,EAAE,QAAQ,CAAC,MAAM,UAAW,wBAAwB,CAC3D,CAAC,CAEW,EAAmB,EAAE,OAAO,CACvC,KAAM,EAAE,QAAQ,CAAC,MAAM,UAAW,wBAAwB,CAC3D,CAAC,CAEW,EAAsB,EAAE,OAAO,CAC1C,KAAM,EAAE,QAAQ,CAAC,IAAI,EAAG,2BAA2B,CACpD,CAAC,CAEW,EAA2B,EAAE,OAAO,CAC/C,KAAM,EAAE,QAAQ,CAAC,IAAI,GAAI,4BAA4B,CAAC,IAAI,GAAG,CAC9D,CAAC"}
@@ -0,0 +1 @@
1
+ const e=require(`./event-bus.cjs`),t=require(`../server/database/inject.cjs`),n=require(`./auth/email-verification.cjs`),r=require(`./notifications/service.cjs`),i=require(`./filesystem/providers/local.cjs`),a=require(`./filesystem/service.cjs`);require(`./filesystem/index.cjs`);const o=require(`./setup.cjs`);async function s(s){if(typeof window<`u`)return;let c=globalThis;if(s&&t.injectDb(s),!c.__KRYO_INITIALIZED__&&!c.__KRYO_INITIALIZING__){c.__KRYO_INITIALIZING__=!0;try{if(console.log(`[Kryo:Bootstrap] Starting system initialization...`),c.__KRYO_DB__||console.warn(`[Kryo:Bootstrap] DB not detected during bootstrap start. Trying to continue...`),await o.isSystemInstalled()){r.notificationService.init(),await n.initEmailVerification();let e=new i.LocalFileProvider;a.filesystemService.registerProvider(e),a.filesystemService.setDefaultProvider(e.id)}else console.log(`[Kryo:Bootstrap] System not installed. Skipping module initialization.`);await e.eventBus.publish(`system:start`,{runtime:`nodejs`}),console.log(`[Kryo:Bootstrap] System initialized successfully.`),c.__KRYO_INITIALIZED__=!0}catch(e){console.error(`[Kryo:Bootstrap] Initialization failed:`,e)}finally{c.__KRYO_INITIALIZING__=!1}}}exports.ensureSystemInitialized=s;
@@ -0,0 +1,5 @@
1
+ //#region src/core/bootstrap.d.ts
2
+ declare function ensureSystemInitialized(providedDb?: any): Promise<void>;
3
+ //#endregion
4
+ export { ensureSystemInitialized };
5
+ //# sourceMappingURL=bootstrap.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bootstrap.d.cts","names":[],"sources":["../../src/core/bootstrap.ts"],"mappings":";iBAQsB,uBAAA,CAAwB,UAAA,SAAgB,OAAA"}
@@ -0,0 +1,5 @@
1
+ //#region src/core/bootstrap.d.ts
2
+ declare function ensureSystemInitialized(providedDb?: any): Promise<void>;
3
+ //#endregion
4
+ export { ensureSystemInitialized };
5
+ //# sourceMappingURL=bootstrap.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bootstrap.d.mts","names":[],"sources":["../../src/core/bootstrap.ts"],"mappings":";iBAQsB,uBAAA,CAAwB,UAAA,SAAgB,OAAA"}
@@ -0,0 +1,2 @@
1
+ import{eventBus as e}from"./event-bus.mjs";import{injectDb as t}from"../server/database/inject.mjs";import{initEmailVerification as n}from"./auth/email-verification.mjs";import{notificationService as r}from"./notifications/service.mjs";import{LocalFileProvider as i}from"./filesystem/providers/local.mjs";import{filesystemService as a}from"./filesystem/service.mjs";import"./filesystem/index.mjs";import{isSystemInstalled as o}from"./setup.mjs";async function s(s){if(typeof window<`u`)return;let c=globalThis;if(s&&t(s),!c.__KRYO_INITIALIZED__&&!c.__KRYO_INITIALIZING__){c.__KRYO_INITIALIZING__=!0;try{if(console.log(`[Kryo:Bootstrap] Starting system initialization...`),c.__KRYO_DB__||console.warn(`[Kryo:Bootstrap] DB not detected during bootstrap start. Trying to continue...`),await o()){r.init(),await n();let e=new i;a.registerProvider(e),a.setDefaultProvider(e.id)}else console.log(`[Kryo:Bootstrap] System not installed. Skipping module initialization.`);await e.publish(`system:start`,{runtime:`nodejs`}),console.log(`[Kryo:Bootstrap] System initialized successfully.`),c.__KRYO_INITIALIZED__=!0}catch(e){console.error(`[Kryo:Bootstrap] Initialization failed:`,e)}finally{c.__KRYO_INITIALIZING__=!1}}}export{s as ensureSystemInitialized};
2
+ //# sourceMappingURL=bootstrap.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bootstrap.mjs","names":[],"sources":["../../src/core/bootstrap.ts"],"sourcesContent":["import { injectDb } from \"../server/database/inject\";\nimport { initEmailVerification } from \"./auth/email-verification\";\nimport { eventBus } from \"./event-bus\";\nimport { filesystemService } from \"./filesystem/index\";\nimport { LocalFileProvider } from \"./filesystem/providers/local\";\nimport { notificationService } from \"./notifications/service\";\nimport { isSystemInstalled } from \"./setup\";\n\nexport async function ensureSystemInitialized(providedDb?: any) {\n if (typeof window !== \"undefined\") return;\n\n const g = globalThis as any;\n\n // 1. Immediate injection if provided\n if (providedDb) {\n injectDb(providedDb);\n }\n\n // 2. Prevent infinite recursion and double initialization\n if (g.__KRYO_INITIALIZED__) return;\n if (g.__KRYO_INITIALIZING__) return; // Already in progress, don't block/deadlock\n\n g.__KRYO_INITIALIZING__ = true;\n\n try {\n console.log(\"[Kryo:Bootstrap] Starting system initialization...\");\n\n // Check if we have DB after any possible injection\n if (!g.__KRYO_DB__) {\n console.warn(\n \"[Kryo:Bootstrap] DB not detected during bootstrap start. Trying to continue...\",\n );\n }\n\n // Check if system is installed before initializing modules\n if (await isSystemInstalled()) {\n // Order matters: services first, then modules (which use services)\n notificationService.init();\n await initEmailVerification();\n\n // Auto-register local filesystem provider as a fallback\n const local = new LocalFileProvider();\n\n filesystemService.registerProvider(local);\n filesystemService.setDefaultProvider(local.id);\n } else {\n console.log(\n \"[Kryo:Bootstrap] System not installed. Skipping module initialization.\",\n );\n }\n\n await eventBus.publish(\"system:start\", { runtime: \"nodejs\" });\n\n console.log(\"[Kryo:Bootstrap] System initialized successfully.\");\n g.__KRYO_INITIALIZED__ = true;\n } catch (error) {\n console.error(\"[Kryo:Bootstrap] Initialization failed:\", error);\n } finally {\n g.__KRYO_INITIALIZING__ = false;\n }\n}\n"],"mappings":"6bAQA,eAAsB,EAAwB,EAAkB,CAC9D,GAAI,OAAO,OAAW,IAAa,OAEnC,IAAM,EAAI,WAGV,GAAI,GACF,EAAS,EAAW,CAIlB,GAAE,sBACF,GAAE,sBAEN,GAAE,sBAAwB,GAE1B,GAAI,CAWF,GAVA,QAAQ,IAAI,qDAAqD,CAG5D,EAAE,aACL,QAAQ,KACN,iFACD,CAIC,MAAM,GAAmB,CAAE,CAE7B,EAAoB,MAAM,CAC1B,MAAM,GAAuB,CAG7B,IAAM,EAAQ,IAAI,EAElB,EAAkB,iBAAiB,EAAM,CACzC,EAAkB,mBAAmB,EAAM,GAAG,MAE9C,QAAQ,IACN,yEACD,CAGH,MAAM,EAAS,QAAQ,eAAgB,CAAE,QAAS,SAAU,CAAC,CAE7D,QAAQ,IAAI,oDAAoD,CAChE,EAAE,qBAAuB,SAClB,EAAO,CACd,QAAQ,MAAM,0CAA2C,EAAM,QACvD,CACR,EAAE,sBAAwB"}
@@ -0,0 +1 @@
1
+ const e={modulesDirectory:`modules`};exports.DEFAULT_CONFIG=e;
@@ -0,0 +1,11 @@
1
+ //#region src/core/config.d.ts
2
+ interface KryoConfig {
3
+ /**
4
+ * Path to the directory with local modules.
5
+ * Default: "./modules"
6
+ */
7
+ modulesDirectory?: string;
8
+ }
9
+ //#endregion
10
+ export { KryoConfig };
11
+ //# sourceMappingURL=config.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.cts","names":[],"sources":["../../src/core/config.ts"],"mappings":";UAAiB,UAAA;EAAA;;;;EAKf,gBAAA;AAAA"}
@@ -0,0 +1,11 @@
1
+ //#region src/core/config.d.ts
2
+ interface KryoConfig {
3
+ /**
4
+ * Path to the directory with local modules.
5
+ * Default: "./modules"
6
+ */
7
+ modulesDirectory?: string;
8
+ }
9
+ //#endregion
10
+ export { KryoConfig };
11
+ //# sourceMappingURL=config.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.mts","names":[],"sources":["../../src/core/config.ts"],"mappings":";UAAiB,UAAA;EAAA;;;;EAKf,gBAAA;AAAA"}
@@ -0,0 +1,2 @@
1
+ const e={modulesDirectory:`modules`};export{e as DEFAULT_CONFIG};
2
+ //# sourceMappingURL=config.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.mjs","names":[],"sources":["../../src/core/config.ts"],"sourcesContent":["export interface KryoConfig {\n /**\n * Path to the directory with local modules.\n * Default: \"./modules\"\n */\n modulesDirectory?: string;\n}\n\nexport const DEFAULT_CONFIG: KryoConfig = {\n modulesDirectory: \"modules\",\n};\n"],"mappings":"AAQA,MAAa,EAA6B,CACxC,iBAAkB,UACnB"}
@@ -0,0 +1 @@
1
+ const e=require(`../_virtual/_rolldown/runtime.cjs`),t=require(`./config.cjs`);let n=require(`node:fs`);n=e.__toESM(n);let r=require(`node:path`);r=e.__toESM(r);let i=null;async function a(){if(typeof window<`u`)throw Error(`getKryoConfig can only be called on the server.`);if(process.env.NODE_ENV===`production`&&i)return i;let e=process.cwd(),a=r.default.join(e,`kryo.config.ts`),o=r.default.join(e,`kryo.config`),s=r.default.join(e,`kryo.config.mjs`),c={};try{let{createJiti:t}=await import(`jiti`),r=t(e,{fsCache:!1,moduleCache:!1});if(n.default.existsSync(a)){let e=`?t=${Date.now()}`,t=await r.import(`file://${a}${e}`,{default:!0});c=t.default||t}else if(n.default.existsSync(s)){let e=await r.import(s,{default:!0});c=e.default||e}else if(n.default.existsSync(o)){let e=await r.import(o,{default:!0});c=e.default||e}}catch(e){console.warn(`[Kryo:Config] Could not load kryo.config.ts, using defaults.`,e)}let l={...t.DEFAULT_CONFIG,...c};return process.env.NODE_ENV===`production`&&(i=l),l}async function o(){let e=(await a()).modulesDirectory||`modules`;return r.default.isAbsolute(e)?e:r.default.join(process.cwd(),e)}exports.getKryoConfig=a,exports.getModulesDir=o;
@@ -0,0 +1,16 @@
1
+ import { KryoConfig } from "./config.cjs";
2
+
3
+ //#region src/core/config.server.d.ts
4
+ /**
5
+ * Loads the Kryo configuration from kryo.config.ts or kryo.config in the current working directory.
6
+ * SERVER ONLY.
7
+ */
8
+ declare function getKryoConfig(): Promise<KryoConfig>;
9
+ /**
10
+ * Helper returning the absolute path to the modules directory.
11
+ * SERVER ONLY.
12
+ */
13
+ declare function getModulesDir(): Promise<string>;
14
+ //#endregion
15
+ export { getKryoConfig, getModulesDir };
16
+ //# sourceMappingURL=config.server.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.server.d.cts","names":[],"sources":["../../src/core/config.server.ts"],"mappings":";;;;;AAUA;;iBAAsB,aAAA,CAAA,GAAiB,OAAA,CAAQ,UAAA;;;AA4D/C;;iBAAsB,aAAA,CAAA,GAAiB,OAAA"}
@@ -0,0 +1,16 @@
1
+ import { KryoConfig } from "./config.mjs";
2
+
3
+ //#region src/core/config.server.d.ts
4
+ /**
5
+ * Loads the Kryo configuration from kryo.config.ts or kryo.config in the current working directory.
6
+ * SERVER ONLY.
7
+ */
8
+ declare function getKryoConfig(): Promise<KryoConfig>;
9
+ /**
10
+ * Helper returning the absolute path to the modules directory.
11
+ * SERVER ONLY.
12
+ */
13
+ declare function getModulesDir(): Promise<string>;
14
+ //#endregion
15
+ export { getKryoConfig, getModulesDir };
16
+ //# sourceMappingURL=config.server.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.server.d.mts","names":[],"sources":["../../src/core/config.server.ts"],"mappings":";;;;;AAUA;;iBAAsB,aAAA,CAAA,GAAiB,OAAA,CAAQ,UAAA;;;AA4D/C;;iBAAsB,aAAA,CAAA,GAAiB,OAAA"}
@@ -0,0 +1,2 @@
1
+ import{DEFAULT_CONFIG as e}from"./config.mjs";import t from"node:fs";import n from"node:path";let r=null;async function i(){if(typeof window<`u`)throw Error(`getKryoConfig can only be called on the server.`);if(process.env.NODE_ENV===`production`&&r)return r;let i=process.cwd(),a=n.join(i,`kryo.config.ts`),o=n.join(i,`kryo.config`),s=n.join(i,`kryo.config.mjs`),c={};try{let{createJiti:e}=await import(`jiti`),n=e(i,{fsCache:!1,moduleCache:!1});if(t.existsSync(a)){let e=`?t=${Date.now()}`,t=await n.import(`file://${a}${e}`,{default:!0});c=t.default||t}else if(t.existsSync(s)){let e=await n.import(s,{default:!0});c=e.default||e}else if(t.existsSync(o)){let e=await n.import(o,{default:!0});c=e.default||e}}catch(e){console.warn(`[Kryo:Config] Could not load kryo.config.ts, using defaults.`,e)}let l={...e,...c};return process.env.NODE_ENV===`production`&&(r=l),l}async function a(){let e=(await i()).modulesDirectory||`modules`;return n.isAbsolute(e)?e:n.join(process.cwd(),e)}export{i as getKryoConfig,a as getModulesDir};
2
+ //# sourceMappingURL=config.server.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.server.mjs","names":[],"sources":["../../src/core/config.server.ts"],"sourcesContent":["import fs from \"node:fs\";\nimport path from \"node:path\";\nimport { DEFAULT_CONFIG, type KryoConfig } from \"./config\";\n\nlet cachedConfig: KryoConfig | null = null;\n\n/**\n * Loads the Kryo configuration from kryo.config.ts or kryo.config in the current working directory.\n * SERVER ONLY.\n */\nexport async function getKryoConfig(): Promise<KryoConfig> {\n // Prevent this from ever running on the client even if imported\n if (typeof window !== \"undefined\") {\n throw new Error(\"getKryoConfig can only be called on the server.\");\n }\n\n // Use memory cache in production\n if (process.env.NODE_ENV === \"production\" && cachedConfig) {\n return cachedConfig;\n }\n\n const cwd = process.cwd();\n const configPathTS = path.join(cwd, \"kryo.config.ts\");\n const configPathJS = path.join(cwd, \"kryo.config\");\n const configPathMJS = path.join(cwd, \"kryo.config.mjs\");\n\n let loadedConfig: Partial<KryoConfig> = {};\n\n try {\n // Dynamic import jiti only on server to avoid bundling issues\n const { createJiti } = await import(\"jiti\");\n const jiti = createJiti(cwd, {\n fsCache: false,\n moduleCache: false,\n });\n\n if (fs.existsSync(configPathTS)) {\n const cacheBuster = `?t=${Date.now()}`;\n const imported: any = await jiti.import(\n `file://${configPathTS}${cacheBuster}`,\n { default: true },\n );\n loadedConfig = imported.default || imported;\n } else if (fs.existsSync(configPathMJS)) {\n const imported: any = await jiti.import(configPathMJS, { default: true });\n loadedConfig = imported.default || imported;\n } else if (fs.existsSync(configPathJS)) {\n const imported: any = await jiti.import(configPathJS, { default: true });\n loadedConfig = imported.default || imported;\n }\n } catch (error) {\n console.warn(\n \"[Kryo:Config] Could not load kryo.config.ts, using defaults.\",\n error,\n );\n }\n\n const finalConfig = { ...DEFAULT_CONFIG, ...loadedConfig };\n\n if (process.env.NODE_ENV === \"production\") {\n cachedConfig = finalConfig;\n }\n\n return finalConfig;\n}\n\n/**\n * Helper returning the absolute path to the modules directory.\n * SERVER ONLY.\n */\nexport async function getModulesDir(): Promise<string> {\n const config = await getKryoConfig();\n\n const dir = config.modulesDirectory || \"modules\";\n return path.isAbsolute(dir) ? dir : path.join(process.cwd(), dir);\n}\n"],"mappings":"8FAIA,IAAI,EAAkC,KAMtC,eAAsB,GAAqC,CAEzD,GAAI,OAAO,OAAW,IACpB,MAAU,MAAM,kDAAkD,CAIpE,GAAI,QAAQ,IAAI,WAAa,cAAgB,EAC3C,OAAO,EAGT,IAAM,EAAM,QAAQ,KAAK,CACnB,EAAe,EAAK,KAAK,EAAK,iBAAiB,CAC/C,EAAe,EAAK,KAAK,EAAK,cAAc,CAC5C,EAAgB,EAAK,KAAK,EAAK,kBAAkB,CAEnD,EAAoC,EAAE,CAE1C,GAAI,CAEF,GAAM,CAAE,cAAe,MAAM,OAAO,QAC9B,EAAO,EAAW,EAAK,CAC3B,QAAS,GACT,YAAa,GACd,CAAC,CAEF,GAAI,EAAG,WAAW,EAAa,CAAE,CAC/B,IAAM,EAAc,MAAM,KAAK,KAAK,GAC9B,EAAgB,MAAM,EAAK,OAC/B,UAAU,IAAe,IACzB,CAAE,QAAS,GAAM,CAClB,CACD,EAAe,EAAS,SAAW,UAC1B,EAAG,WAAW,EAAc,CAAE,CACvC,IAAM,EAAgB,MAAM,EAAK,OAAO,EAAe,CAAE,QAAS,GAAM,CAAC,CACzE,EAAe,EAAS,SAAW,UAC1B,EAAG,WAAW,EAAa,CAAE,CACtC,IAAM,EAAgB,MAAM,EAAK,OAAO,EAAc,CAAE,QAAS,GAAM,CAAC,CACxE,EAAe,EAAS,SAAW,SAE9B,EAAO,CACd,QAAQ,KACN,+DACA,EACD,CAGH,IAAM,EAAc,CAAE,GAAG,EAAgB,GAAG,EAAc,CAM1D,OAJI,QAAQ,IAAI,WAAa,eAC3B,EAAe,GAGV,EAOT,eAAsB,GAAiC,CAGrD,IAAM,GAFS,MAAM,GAAe,EAEjB,kBAAoB,UACvC,OAAO,EAAK,WAAW,EAAI,CAAG,EAAM,EAAK,KAAK,QAAQ,KAAK,CAAE,EAAI"}
@@ -0,0 +1 @@
1
+ var e=class{constructor(){this.handlers=new Map}subscribe(e,t,n){this.handlers.has(e)||this.handlers.set(e,new Map),this.handlers.get(e)?.set(t,n),console.log(`[Event Bus] Subscriber "${t}" added for "${e}"`)}unsubscribe(e,t){this.handlers.get(e)?.delete(t),console.log(`[Event Bus] Subscriber "${t}" removed from "${e}"`)}clearAll(){console.log(`[Event Bus] Resetting all listeners...`),this.handlers.clear()}async publish(e,t,n=`system`){let r=this.handlers.get(e);if(!r)return;let i=Array.from(r.values());console.log(`[Event Bus] Publishing "${e}" to ${i.length} subscribers`);let a={type:e,payload:t,timestamp:Date.now(),source:n};await Promise.all(i.map(async t=>{try{await t(a)}catch(t){console.error(`[Event Bus] Handler Error for ${e}:`,t)}}))}};const t=globalThis,n=t.__KRYO_EVENT_BUS__??new e;t.__KRYO_EVENT_BUS__=n,exports.eventBus=n;
@@ -0,0 +1,17 @@
1
+ import { EventHandler } from "./types.cjs";
2
+
3
+ //#region src/core/event-bus.d.ts
4
+ /**
5
+ * EventBus (Pub/Sub) - Global Singleton Pattern.
6
+ */
7
+ declare class EventBus {
8
+ private handlers;
9
+ subscribe<T>(eventType: string, subscriberId: string, handler: EventHandler<T>): void;
10
+ unsubscribe(eventType: string, subscriberId: string): void;
11
+ clearAll(): void;
12
+ publish<T>(eventType: string, payload: T, source?: string): Promise<void>;
13
+ }
14
+ declare const eventBus: EventBus;
15
+ //#endregion
16
+ export { eventBus };
17
+ //# sourceMappingURL=event-bus.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"event-bus.d.cts","names":[],"sources":["../../src/core/event-bus.ts"],"mappings":";;;;;AAAyD;cAKnD,QAAA;EAAA,QACI,QAAA;EAED,SAAA,GAAA,CACL,SAAA,UACA,YAAA,UACA,OAAA,EAAS,YAAA,CAAa,CAAA;EAYjB,WAAA,CAAY,SAAA,UAAmB,YAAA;EAO/B,QAAA,CAAA;EAKM,OAAA,GAAA,CACX,SAAA,UACA,OAAA,EAAS,CAAA,EACT,MAAA,YACC,OAAA;AAAA;AAAA,cAkCQ,QAAA,EAAQ,QAAA"}
@@ -0,0 +1,17 @@
1
+ import { EventHandler } from "./types.mjs";
2
+
3
+ //#region src/core/event-bus.d.ts
4
+ /**
5
+ * EventBus (Pub/Sub) - Global Singleton Pattern.
6
+ */
7
+ declare class EventBus {
8
+ private handlers;
9
+ subscribe<T>(eventType: string, subscriberId: string, handler: EventHandler<T>): void;
10
+ unsubscribe(eventType: string, subscriberId: string): void;
11
+ clearAll(): void;
12
+ publish<T>(eventType: string, payload: T, source?: string): Promise<void>;
13
+ }
14
+ declare const eventBus: EventBus;
15
+ //#endregion
16
+ export { eventBus };
17
+ //# sourceMappingURL=event-bus.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"event-bus.d.mts","names":[],"sources":["../../src/core/event-bus.ts"],"mappings":";;;;;AAAyD;cAKnD,QAAA;EAAA,QACI,QAAA;EAED,SAAA,GAAA,CACL,SAAA,UACA,YAAA,UACA,OAAA,EAAS,YAAA,CAAa,CAAA;EAYjB,WAAA,CAAY,SAAA,UAAmB,YAAA;EAO/B,QAAA,CAAA;EAKM,OAAA,GAAA,CACX,SAAA,UACA,OAAA,EAAS,CAAA,EACT,MAAA,YACC,OAAA;AAAA;AAAA,cAkCQ,QAAA,EAAQ,QAAA"}
@@ -0,0 +1,2 @@
1
+ var e=class{constructor(){this.handlers=new Map}subscribe(e,t,n){this.handlers.has(e)||this.handlers.set(e,new Map),this.handlers.get(e)?.set(t,n),console.log(`[Event Bus] Subscriber "${t}" added for "${e}"`)}unsubscribe(e,t){this.handlers.get(e)?.delete(t),console.log(`[Event Bus] Subscriber "${t}" removed from "${e}"`)}clearAll(){console.log(`[Event Bus] Resetting all listeners...`),this.handlers.clear()}async publish(e,t,n=`system`){let r=this.handlers.get(e);if(!r)return;let i=Array.from(r.values());console.log(`[Event Bus] Publishing "${e}" to ${i.length} subscribers`);let a={type:e,payload:t,timestamp:Date.now(),source:n};await Promise.all(i.map(async t=>{try{await t(a)}catch(t){console.error(`[Event Bus] Handler Error for ${e}:`,t)}}))}};const t=globalThis,n=t.__KRYO_EVENT_BUS__??new e;t.__KRYO_EVENT_BUS__=n;export{n as eventBus};
2
+ //# sourceMappingURL=event-bus.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"event-bus.mjs","names":[],"sources":["../../src/core/event-bus.ts"],"sourcesContent":["import type { EventHandler, SystemEvent } from \"./types\";\n\n/**\n * EventBus (Pub/Sub) - Global Singleton Pattern.\n */\nclass EventBus {\n private handlers: Map<string, Map<string, EventHandler>> = new Map();\n\n public subscribe<T>(\n eventType: string,\n subscriberId: string,\n handler: EventHandler<T>,\n ): void {\n if (!this.handlers.has(eventType)) {\n this.handlers.set(eventType, new Map());\n }\n const eventHandlers = this.handlers.get(eventType);\n eventHandlers?.set(subscriberId, handler);\n console.log(\n `[Event Bus] Subscriber \"${subscriberId}\" added for \"${eventType}\"`,\n );\n }\n\n public unsubscribe(eventType: string, subscriberId: string): void {\n this.handlers.get(eventType)?.delete(subscriberId);\n console.log(\n `[Event Bus] Subscriber \"${subscriberId}\" removed from \"${eventType}\"`,\n );\n }\n\n public clearAll(): void {\n console.log(\"[Event Bus] Resetting all listeners...\");\n this.handlers.clear();\n }\n\n public async publish<T>(\n eventType: string,\n payload: T,\n source: string = \"system\",\n ): Promise<void> {\n const eventHandlers = this.handlers.get(eventType);\n if (!eventHandlers) return;\n\n const handlers = Array.from(eventHandlers.values());\n\n console.log(\n `[Event Bus] Publishing \"${eventType}\" to ${handlers.length} subscribers`,\n );\n\n const event: SystemEvent<T> = {\n type: eventType,\n payload,\n timestamp: Date.now(),\n source,\n };\n\n await Promise.all(\n handlers.map(async (handler) => {\n try {\n await handler(event);\n } catch (error) {\n console.error(`[Event Bus] Handler Error for ${eventType}:`, error);\n }\n }),\n );\n }\n}\n\n// Ensure global singleton\nconst globalForEventBus = globalThis as unknown as {\n __KRYO_EVENT_BUS__: EventBus | undefined;\n};\n\nexport const eventBus = globalForEventBus.__KRYO_EVENT_BUS__ ?? new EventBus();\n\nglobalForEventBus.__KRYO_EVENT_BUS__ = eventBus;\n"],"mappings":"AAKA,IAAM,EAAN,KAAe,6BAC8C,IAAI,IAE/D,UACE,EACA,EACA,EACM,CACD,KAAK,SAAS,IAAI,EAAU,EAC/B,KAAK,SAAS,IAAI,EAAW,IAAI,IAAM,CAEnB,KAAK,SAAS,IAAI,EAAU,EACnC,IAAI,EAAc,EAAQ,CACzC,QAAQ,IACN,2BAA2B,EAAa,eAAe,EAAU,GAClE,CAGH,YAAmB,EAAmB,EAA4B,CAChE,KAAK,SAAS,IAAI,EAAU,EAAE,OAAO,EAAa,CAClD,QAAQ,IACN,2BAA2B,EAAa,kBAAkB,EAAU,GACrE,CAGH,UAAwB,CACtB,QAAQ,IAAI,yCAAyC,CACrD,KAAK,SAAS,OAAO,CAGvB,MAAa,QACX,EACA,EACA,EAAiB,SACF,CACf,IAAM,EAAgB,KAAK,SAAS,IAAI,EAAU,CAClD,GAAI,CAAC,EAAe,OAEpB,IAAM,EAAW,MAAM,KAAK,EAAc,QAAQ,CAAC,CAEnD,QAAQ,IACN,2BAA2B,EAAU,OAAO,EAAS,OAAO,cAC7D,CAED,IAAM,EAAwB,CAC5B,KAAM,EACN,UACA,UAAW,KAAK,KAAK,CACrB,SACD,CAED,MAAM,QAAQ,IACZ,EAAS,IAAI,KAAO,IAAY,CAC9B,GAAI,CACF,MAAM,EAAQ,EAAM,OACb,EAAO,CACd,QAAQ,MAAM,iCAAiC,EAAU,GAAI,EAAM,GAErE,CACH,GAKL,MAAM,EAAoB,WAIb,EAAW,EAAkB,oBAAsB,IAAI,EAEpE,EAAkB,mBAAqB"}
@@ -0,0 +1 @@
1
+ const e=require(`./providers/local.cjs`),t=require(`./service.cjs`);if(typeof window>`u`){let n=new e.LocalFileProvider;t.filesystemService.registerProvider(n),t.filesystemService.setDefaultProvider(n.id)}
@@ -0,0 +1,2 @@
1
+ import{LocalFileProvider as e}from"./providers/local.mjs";import{filesystemService as t}from"./service.mjs";if(typeof window>`u`){let n=new e;t.registerProvider(n),t.setDefaultProvider(n.id)}export{};
2
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../../../src/core/filesystem/index.ts"],"sourcesContent":["import { LocalFileProvider } from \"./providers/local\";\nimport { filesystemService } from \"./service\";\n\nexport * from \"./types\";\nexport { filesystemService };\n\n// Auto-register local provider\nif (typeof window === \"undefined\") {\n const local = new LocalFileProvider();\n\n filesystemService.registerProvider(local);\n filesystemService.setDefaultProvider(local.id);\n}\n"],"mappings":"4GAOA,GAAI,OAAO,OAAW,IAAa,CACjC,IAAM,EAAQ,IAAI,EAElB,EAAkB,iBAAiB,EAAM,CACzC,EAAkB,mBAAmB,EAAM,GAAG"}
@@ -0,0 +1 @@
1
+ const e=require(`../../../_virtual/_rolldown/runtime.cjs`);let t=require(`node:fs`);t=e.__toESM(t);let n=require(`node:path`);n=e.__toESM(n);var r=class{constructor(){this.id=`local`,this.name=`Local Filesystem`}generateUniqueImageName(e){let t=e.replace(/\s+/g,`-`).toLowerCase(),n=Math.floor(Math.random()*Date.now()).toString(36),r=t.lastIndexOf(`.`);return r<0?`${t}-${n}`:`${t.slice(0,r)}-${n}${t.slice(r)}`}async upload(e){try{let r=process.env.FILE_STORAGE_FOLDER??`public/storage`;t.default.existsSync(r)||t.default.mkdirSync(r,{recursive:!0});let i=this.generateUniqueImageName(e.name),a=n.default.join(r,i),o=await e.arrayBuffer();return t.default.writeFileSync(a,Buffer.from(o)),{name:i,url:`${r}/${i}`.replace(`public`,``),type:e.type,size:e.size,service:`local`,serviceId:a}}catch(e){return console.error(`Error uploading file`,e),{error:`Error uploading file`}}}};exports.LocalFileProvider=r;
@@ -0,0 +1,2 @@
1
+ import e from"node:fs";import t from"node:path";var n=class{constructor(){this.id=`local`,this.name=`Local Filesystem`}generateUniqueImageName(e){let t=e.replace(/\s+/g,`-`).toLowerCase(),n=Math.floor(Math.random()*Date.now()).toString(36),r=t.lastIndexOf(`.`);return r<0?`${t}-${n}`:`${t.slice(0,r)}-${n}${t.slice(r)}`}async upload(n){try{let r=process.env.FILE_STORAGE_FOLDER??`public/storage`;e.existsSync(r)||e.mkdirSync(r,{recursive:!0});let i=this.generateUniqueImageName(n.name),a=t.join(r,i),o=await n.arrayBuffer();return e.writeFileSync(a,Buffer.from(o)),{name:i,url:`${r}/${i}`.replace(`public`,``),type:n.type,size:n.size,service:`local`,serviceId:a}}catch(e){return console.error(`Error uploading file`,e),{error:`Error uploading file`}}}};export{n as LocalFileProvider};
2
+ //# sourceMappingURL=local.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"local.mjs","names":[],"sources":["../../../../src/core/filesystem/providers/local.ts"],"sourcesContent":["import fs from \"node:fs\";\nimport path from \"node:path\";\nimport type { IStorageProvider, StorageResult } from \"../types\";\n\nexport class LocalFileProvider implements IStorageProvider {\n public id = \"local\";\n public name = \"Local Filesystem\";\n\n private generateUniqueImageName(name: string) {\n const cleanName = name.replace(/\\s+/g, \"-\").toLowerCase();\n const suffix = Math.floor(Math.random() * Date.now()).toString(36);\n const index = cleanName.lastIndexOf(\".\");\n\n return index < 0\n ? `${cleanName}-${suffix}`\n : `${cleanName.slice(0, index)}-${suffix}${cleanName.slice(index)}`;\n }\n\n public async upload(file: File): Promise<StorageResult> {\n try {\n const storageFolder = process.env.FILE_STORAGE_FOLDER ?? \"public/storage\";\n\n if (!fs.existsSync(storageFolder)) {\n fs.mkdirSync(storageFolder, { recursive: true });\n }\n\n const name = this.generateUniqueImageName(file.name);\n const filePath = path.join(storageFolder, name);\n const buffer = await file.arrayBuffer();\n fs.writeFileSync(filePath, Buffer.from(buffer));\n\n const url = `${storageFolder}/${name}`.replace(\"public\", \"\");\n\n return {\n name: name,\n url,\n type: file.type,\n size: file.size,\n service: \"local\",\n serviceId: filePath,\n };\n } catch (error) {\n console.error(\"Error uploading file\", error);\n return { error: \"Error uploading file\" };\n }\n }\n}\n"],"mappings":"gDAIA,IAAa,EAAb,KAA2D,uBAC7C,kBACE,mBAEd,wBAAgC,EAAc,CAC5C,IAAM,EAAY,EAAK,QAAQ,OAAQ,IAAI,CAAC,aAAa,CACnD,EAAS,KAAK,MAAM,KAAK,QAAQ,CAAG,KAAK,KAAK,CAAC,CAAC,SAAS,GAAG,CAC5D,EAAQ,EAAU,YAAY,IAAI,CAExC,OAAO,EAAQ,EACX,GAAG,EAAU,GAAG,IAChB,GAAG,EAAU,MAAM,EAAG,EAAM,CAAC,GAAG,IAAS,EAAU,MAAM,EAAM,GAGrE,MAAa,OAAO,EAAoC,CACtD,GAAI,CACF,IAAM,EAAgB,QAAQ,IAAI,qBAAuB,iBAEpD,EAAG,WAAW,EAAc,EAC/B,EAAG,UAAU,EAAe,CAAE,UAAW,GAAM,CAAC,CAGlD,IAAM,EAAO,KAAK,wBAAwB,EAAK,KAAK,CAC9C,EAAW,EAAK,KAAK,EAAe,EAAK,CACzC,EAAS,MAAM,EAAK,aAAa,CAKvC,OAJA,EAAG,cAAc,EAAU,OAAO,KAAK,EAAO,CAAC,CAIxC,CACC,OACN,IAJU,GAAG,EAAc,GAAG,IAAO,QAAQ,SAAU,GAAG,CAK1D,KAAM,EAAK,KACX,KAAM,EAAK,KACX,QAAS,QACT,UAAW,EACZ,OACM,EAAO,CAEd,OADA,QAAQ,MAAM,uBAAwB,EAAM,CACrC,CAAE,MAAO,uBAAwB"}
@@ -0,0 +1 @@
1
+ var e=class{constructor(){this.providers=new Map,this.defaultProviderId=null}registerProvider(e){this.providers.set(e.id,e),(!this.defaultProviderId||this.defaultProviderId===`local`)&&(this.defaultProviderId=e.id),console.log(`[Filesystem] Provider registered: ${e.id}`)}unregisterProvider(e){this.providers.delete(e),this.defaultProviderId===e&&(this.defaultProviderId=this.providers.has(`local`)?`local`:Array.from(this.providers.keys())[0]||null),console.log(`[Filesystem] Provider unregistered: ${e}`)}setDefaultProvider(e){this.providers.has(e)&&(this.defaultProviderId=e,console.log(`[Filesystem] Default provider set to: ${e}`))}async upload(e,t){let n=t||this.defaultProviderId;(!n||!this.providers.has(n))&&(n=`local`);let r=this.providers.get(n);return r?await r.upload(e):{error:`No storage provider available (local fallback failed)`}}getProviders(){return Array.from(this.providers.values()).map(e=>({id:e.id,name:e.name}))}};const t=globalThis,n=t.__KRYO_FILESYSTEM_SERVICE__??new e;t.__KRYO_FILESYSTEM_SERVICE__=n,exports.filesystemService=n;
@@ -0,0 +1,19 @@
1
+ import { IStorageProvider, StorageResult } from "./types.cjs";
2
+
3
+ //#region src/core/filesystem/service.d.ts
4
+ declare class FilesystemService {
5
+ private providers;
6
+ private defaultProviderId;
7
+ registerProvider(provider: IStorageProvider): void;
8
+ unregisterProvider(id: string): void;
9
+ setDefaultProvider(id: string): void;
10
+ upload(file: File, providerId?: string): Promise<StorageResult>;
11
+ getProviders(): {
12
+ id: string;
13
+ name: string;
14
+ }[];
15
+ }
16
+ declare const filesystemService: FilesystemService;
17
+ //#endregion
18
+ export { filesystemService };
19
+ //# sourceMappingURL=service.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"service.d.cts","names":[],"sources":["../../../src/core/filesystem/service.ts"],"mappings":";;;cAEM,iBAAA;EAAA,QACI,SAAA;EAAA,QACA,iBAAA;EAED,gBAAA,CAAiB,QAAA,EAAU,gBAAA;EAQ3B,kBAAA,CAAmB,EAAA;EAUnB,kBAAA,CAAmB,EAAA;EAOb,MAAA,CAAO,IAAA,EAAM,IAAA,EAAM,UAAA,YAAsB,OAAA,CAAQ,aAAA;EAiBvD,YAAA,CAAA;;;;;cAaI,iBAAA,EAAiB,iBAAA"}
@@ -0,0 +1,19 @@
1
+ import { IStorageProvider, StorageResult } from "./types.mjs";
2
+
3
+ //#region src/core/filesystem/service.d.ts
4
+ declare class FilesystemService {
5
+ private providers;
6
+ private defaultProviderId;
7
+ registerProvider(provider: IStorageProvider): void;
8
+ unregisterProvider(id: string): void;
9
+ setDefaultProvider(id: string): void;
10
+ upload(file: File, providerId?: string): Promise<StorageResult>;
11
+ getProviders(): {
12
+ id: string;
13
+ name: string;
14
+ }[];
15
+ }
16
+ declare const filesystemService: FilesystemService;
17
+ //#endregion
18
+ export { filesystemService };
19
+ //# sourceMappingURL=service.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"service.d.mts","names":[],"sources":["../../../src/core/filesystem/service.ts"],"mappings":";;;cAEM,iBAAA;EAAA,QACI,SAAA;EAAA,QACA,iBAAA;EAED,gBAAA,CAAiB,QAAA,EAAU,gBAAA;EAQ3B,kBAAA,CAAmB,EAAA;EAUnB,kBAAA,CAAmB,EAAA;EAOb,MAAA,CAAO,IAAA,EAAM,IAAA,EAAM,UAAA,YAAsB,OAAA,CAAQ,aAAA;EAiBvD,YAAA,CAAA;;;;;cAaI,iBAAA,EAAiB,iBAAA"}
@@ -0,0 +1,2 @@
1
+ var e=class{constructor(){this.providers=new Map,this.defaultProviderId=null}registerProvider(e){this.providers.set(e.id,e),(!this.defaultProviderId||this.defaultProviderId===`local`)&&(this.defaultProviderId=e.id),console.log(`[Filesystem] Provider registered: ${e.id}`)}unregisterProvider(e){this.providers.delete(e),this.defaultProviderId===e&&(this.defaultProviderId=this.providers.has(`local`)?`local`:Array.from(this.providers.keys())[0]||null),console.log(`[Filesystem] Provider unregistered: ${e}`)}setDefaultProvider(e){this.providers.has(e)&&(this.defaultProviderId=e,console.log(`[Filesystem] Default provider set to: ${e}`))}async upload(e,t){let n=t||this.defaultProviderId;(!n||!this.providers.has(n))&&(n=`local`);let r=this.providers.get(n);return r?await r.upload(e):{error:`No storage provider available (local fallback failed)`}}getProviders(){return Array.from(this.providers.values()).map(e=>({id:e.id,name:e.name}))}};const t=globalThis,n=t.__KRYO_FILESYSTEM_SERVICE__??new e;t.__KRYO_FILESYSTEM_SERVICE__=n;export{n as filesystemService};
2
+ //# sourceMappingURL=service.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"service.mjs","names":[],"sources":["../../../src/core/filesystem/service.ts"],"sourcesContent":["import type { IStorageProvider, StorageResult } from \"./types\";\n\nclass FilesystemService {\n private providers: Map<string, IStorageProvider> = new Map();\n private defaultProviderId: string | null = null;\n\n public registerProvider(provider: IStorageProvider) {\n this.providers.set(provider.id, provider);\n if (!this.defaultProviderId || this.defaultProviderId === \"local\") {\n this.defaultProviderId = provider.id;\n }\n console.log(`[Filesystem] Provider registered: ${provider.id}`);\n }\n\n public unregisterProvider(id: string) {\n this.providers.delete(id);\n if (this.defaultProviderId === id) {\n this.defaultProviderId = this.providers.has(\"local\")\n ? \"local\"\n : Array.from(this.providers.keys())[0] || null;\n }\n console.log(`[Filesystem] Provider unregistered: ${id}`);\n }\n\n public setDefaultProvider(id: string) {\n if (this.providers.has(id)) {\n this.defaultProviderId = id;\n console.log(`[Filesystem] Default provider set to: ${id}`);\n }\n }\n\n public async upload(file: File, providerId?: string): Promise<StorageResult> {\n let id = providerId || this.defaultProviderId;\n\n // Fallback logic\n if (!id || !this.providers.has(id)) {\n id = \"local\";\n }\n\n const provider = this.providers.get(id);\n\n if (!provider) {\n return { error: \"No storage provider available (local fallback failed)\" };\n }\n\n return await provider.upload(file);\n }\n\n public getProviders() {\n return Array.from(this.providers.values()).map((p) => ({\n id: p.id,\n name: p.name,\n }));\n }\n}\n\n// Global Singleton Pattern\nconst globalForFilesystem = globalThis as unknown as {\n __KRYO_FILESYSTEM_SERVICE__: FilesystemService | undefined;\n};\n\nexport const filesystemService =\n globalForFilesystem.__KRYO_FILESYSTEM_SERVICE__ ?? new FilesystemService();\n\nglobalForFilesystem.__KRYO_FILESYSTEM_SERVICE__ = filesystemService;\n"],"mappings":"AAEA,IAAM,EAAN,KAAwB,8BAC6B,IAAI,2BACZ,KAE3C,iBAAwB,EAA4B,CAClD,KAAK,UAAU,IAAI,EAAS,GAAI,EAAS,EACrC,CAAC,KAAK,mBAAqB,KAAK,oBAAsB,WACxD,KAAK,kBAAoB,EAAS,IAEpC,QAAQ,IAAI,qCAAqC,EAAS,KAAK,CAGjE,mBAA0B,EAAY,CACpC,KAAK,UAAU,OAAO,EAAG,CACrB,KAAK,oBAAsB,IAC7B,KAAK,kBAAoB,KAAK,UAAU,IAAI,QAAQ,CAChD,QACA,MAAM,KAAK,KAAK,UAAU,MAAM,CAAC,CAAC,IAAM,MAE9C,QAAQ,IAAI,uCAAuC,IAAK,CAG1D,mBAA0B,EAAY,CAChC,KAAK,UAAU,IAAI,EAAG,GACxB,KAAK,kBAAoB,EACzB,QAAQ,IAAI,yCAAyC,IAAK,EAI9D,MAAa,OAAO,EAAY,EAA6C,CAC3E,IAAI,EAAK,GAAc,KAAK,mBAGxB,CAAC,GAAM,CAAC,KAAK,UAAU,IAAI,EAAG,IAChC,EAAK,SAGP,IAAM,EAAW,KAAK,UAAU,IAAI,EAAG,CAMvC,OAJK,EAIE,MAAM,EAAS,OAAO,EAAK,CAHzB,CAAE,MAAO,wDAAyD,CAM7E,cAAsB,CACpB,OAAO,MAAM,KAAK,KAAK,UAAU,QAAQ,CAAC,CAAC,IAAK,IAAO,CACrD,GAAI,EAAE,GACN,KAAM,EAAE,KACT,EAAE,GAKP,MAAM,EAAsB,WAIf,EACX,EAAoB,6BAA+B,IAAI,EAEzD,EAAoB,4BAA8B"}
@@ -0,0 +1,22 @@
1
+ //#region src/core/filesystem/types.d.ts
2
+ interface StorageData {
3
+ name: string;
4
+ url: string;
5
+ type: string;
6
+ size: number;
7
+ service: string;
8
+ serviceId: string;
9
+ }
10
+ interface StorageError {
11
+ error: string;
12
+ }
13
+ type StorageResult = StorageData | StorageError;
14
+ interface IStorageProvider {
15
+ id: string;
16
+ name: string;
17
+ upload(file: File, options?: any): Promise<StorageResult>;
18
+ delete?(serviceId: string): Promise<boolean>;
19
+ }
20
+ //#endregion
21
+ export { IStorageProvider, StorageData, StorageError, StorageResult };
22
+ //# sourceMappingURL=types.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.cts","names":[],"sources":["../../../src/core/filesystem/types.ts"],"mappings":";UAAiB,WAAA;EACf,IAAA;EACA,GAAA;EACA,IAAA;EACA,IAAA;EACA,OAAA;EACA,SAAA;AAAA;AAAA,UAGe,YAAA;EACf,KAAA;AAAA;AAAA,KAGU,aAAA,GAAgB,WAAA,GAAc,YAAA;AAAA,UAEzB,gBAAA;EACf,EAAA;EACA,IAAA;EACA,MAAA,CAAO,IAAA,EAAM,IAAA,EAAM,OAAA,SAAgB,OAAA,CAAQ,aAAA;EAC3C,MAAA,EAAQ,SAAA,WAAoB,OAAA;AAAA"}
@@ -0,0 +1,22 @@
1
+ //#region src/core/filesystem/types.d.ts
2
+ interface StorageData {
3
+ name: string;
4
+ url: string;
5
+ type: string;
6
+ size: number;
7
+ service: string;
8
+ serviceId: string;
9
+ }
10
+ interface StorageError {
11
+ error: string;
12
+ }
13
+ type StorageResult = StorageData | StorageError;
14
+ interface IStorageProvider {
15
+ id: string;
16
+ name: string;
17
+ upload(file: File, options?: any): Promise<StorageResult>;
18
+ delete?(serviceId: string): Promise<boolean>;
19
+ }
20
+ //#endregion
21
+ export { IStorageProvider, StorageData, StorageError, StorageResult };
22
+ //# sourceMappingURL=types.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.mts","names":[],"sources":["../../../src/core/filesystem/types.ts"],"mappings":";UAAiB,WAAA;EACf,IAAA;EACA,GAAA;EACA,IAAA;EACA,IAAA;EACA,OAAA;EACA,SAAA;AAAA;AAAA,UAGe,YAAA;EACf,KAAA;AAAA;AAAA,KAGU,aAAA,GAAgB,WAAA,GAAc,YAAA;AAAA,UAEzB,gBAAA;EACf,EAAA;EACA,IAAA;EACA,MAAA,CAAO,IAAA,EAAM,IAAA,EAAM,OAAA,SAAgB,OAAA,CAAQ,aAAA;EAC3C,MAAA,EAAQ,SAAA,WAAoB,OAAA;AAAA"}
@@ -0,0 +1 @@
1
+ "use server";require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../server/database/inject.cjs`),t=require(`../../server/database/schema.cjs`),n=require(`../auth/session.cjs`);let r=require(`drizzle-orm`);async function i(){let{user:i}=await n.getCurrentSession();return i?await e.db.select().from(t.notificationTable).where((0,r.eq)(t.notificationTable.userId,i.id)).orderBy((0,r.desc)(t.notificationTable.createdAt)):null}async function a(n){let[r]=await e.db.insert(t.notificationTable).values({...n,isRead:!1}).returning();return r}async function o(n){let[i]=await e.db.update(t.notificationTable).set({isRead:!0}).where((0,r.eq)(t.notificationTable.id,n)).returning();return i}async function s(){let{user:i}=await n.getCurrentSession();return i?await e.db.update(t.notificationTable).set({isRead:!0}).where((0,r.eq)(t.notificationTable.userId,i.id)).returning():null}exports.createNotification=a,exports.getUserNotifications=i,exports.markAllNotificationsAsRead=s,exports.markNotificationAsRead=o;
@@ -0,0 +1,58 @@
1
+ import { CreateNotificationPayload } from "./types.cjs";
2
+
3
+ //#region src/core/notifications/actions.d.ts
4
+ declare function getUserNotifications(): Promise<{
5
+ id: string;
6
+ title: string;
7
+ content: string | null;
8
+ target: string | null;
9
+ type: string | null;
10
+ isRead: boolean;
11
+ resourceId: string | null;
12
+ resourceType: string | null;
13
+ userId: string;
14
+ createdAt: Date;
15
+ updatedAt: Date | null;
16
+ }[] | null>;
17
+ declare function createNotification(data: CreateNotificationPayload): Promise<{
18
+ id: string;
19
+ createdAt: Date;
20
+ updatedAt: Date | null;
21
+ userId: string;
22
+ type: string | null;
23
+ title: string;
24
+ content: string | null;
25
+ target: string | null;
26
+ isRead: boolean;
27
+ resourceId: string | null;
28
+ resourceType: string | null;
29
+ }>;
30
+ declare function markNotificationAsRead(id: string): Promise<{
31
+ id: string;
32
+ title: string;
33
+ content: string | null;
34
+ target: string | null;
35
+ type: string | null;
36
+ isRead: boolean;
37
+ resourceId: string | null;
38
+ resourceType: string | null;
39
+ userId: string;
40
+ createdAt: Date;
41
+ updatedAt: Date | null;
42
+ }>;
43
+ declare function markAllNotificationsAsRead(): Promise<{
44
+ id: string;
45
+ title: string;
46
+ content: string | null;
47
+ target: string | null;
48
+ type: string | null;
49
+ isRead: boolean;
50
+ resourceId: string | null;
51
+ resourceType: string | null;
52
+ userId: string;
53
+ createdAt: Date;
54
+ updatedAt: Date | null;
55
+ }[] | null>;
56
+ //#endregion
57
+ export { createNotification, getUserNotifications, markAllNotificationsAsRead, markNotificationAsRead };
58
+ //# sourceMappingURL=actions.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"actions.d.cts","names":[],"sources":["../../../src/core/notifications/actions.ts"],"mappings":";;;iBAQsB,oBAAA,CAAA,GAAoB,OAAA;;;;;;;;;;;;;iBAWpB,kBAAA,CAAmB,IAAA,EAAM,yBAAA,GAAyB,OAAA;;;;;;;;;;;;;iBAYlD,sBAAA,CAAuB,EAAA,WAAU,OAAA;;;;;;;;;;;;;iBAUjC,0BAAA,CAAA,GAA0B,OAAA"}