alepha 0.22.0 → 0.24.0

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 (869) hide show
  1. package/assets/swagger-ui/swagger-ui-bundle.js +1 -1
  2. package/assets/swagger-ui/swagger-ui-standalone-preset.js +1 -1
  3. package/dist/api/audits/index.browser.js +49 -52
  4. package/dist/api/audits/index.browser.js.map +1 -1
  5. package/dist/api/audits/index.d.ts +629 -565
  6. package/dist/api/audits/index.d.ts.map +1 -1
  7. package/dist/api/audits/index.js +206 -98
  8. package/dist/api/audits/index.js.map +1 -1
  9. package/dist/api/files/index.browser.js +44 -44
  10. package/dist/api/files/index.browser.js.map +1 -1
  11. package/dist/api/files/index.d.ts +292 -293
  12. package/dist/api/files/index.d.ts.map +1 -1
  13. package/dist/api/files/index.js +61 -64
  14. package/dist/api/files/index.js.map +1 -1
  15. package/dist/api/jobs/index.browser.js +61 -59
  16. package/dist/api/jobs/index.browser.js.map +1 -1
  17. package/dist/api/jobs/index.d.ts +546 -347
  18. package/dist/api/jobs/index.d.ts.map +1 -1
  19. package/dist/api/jobs/index.js +165 -86
  20. package/dist/api/jobs/index.js.map +1 -1
  21. package/dist/api/keys/index.d.ts +242 -230
  22. package/dist/api/keys/index.d.ts.map +1 -1
  23. package/dist/api/keys/index.js +63 -66
  24. package/dist/api/keys/index.js.map +1 -1
  25. package/dist/api/notifications/index.browser.js +40 -38
  26. package/dist/api/notifications/index.browser.js.map +1 -1
  27. package/dist/api/notifications/index.d.ts +339 -209
  28. package/dist/api/notifications/index.d.ts.map +1 -1
  29. package/dist/api/notifications/index.js +108 -60
  30. package/dist/api/notifications/index.js.map +1 -1
  31. package/dist/api/oauth/index.d.ts +190 -78
  32. package/dist/api/oauth/index.d.ts.map +1 -1
  33. package/dist/api/oauth/index.js +290 -68
  34. package/dist/api/oauth/index.js.map +1 -1
  35. package/dist/api/organizations/index.browser.js +14 -14
  36. package/dist/api/organizations/index.browser.js.map +1 -1
  37. package/dist/api/organizations/index.d.ts +158 -134
  38. package/dist/api/organizations/index.d.ts.map +1 -1
  39. package/dist/api/organizations/index.js +18 -18
  40. package/dist/api/organizations/index.js.map +1 -1
  41. package/dist/api/parameters/index.browser.js +74 -53
  42. package/dist/api/parameters/index.browser.js.map +1 -1
  43. package/dist/api/parameters/index.d.ts +607 -513
  44. package/dist/api/parameters/index.d.ts.map +1 -1
  45. package/dist/api/parameters/index.js +205 -127
  46. package/dist/api/parameters/index.js.map +1 -1
  47. package/dist/api/payments/index.d.ts +652 -449
  48. package/dist/api/payments/index.d.ts.map +1 -1
  49. package/dist/api/payments/index.js +159 -93
  50. package/dist/api/payments/index.js.map +1 -1
  51. package/dist/api/subscriptions/index.d.ts +1032 -762
  52. package/dist/api/subscriptions/index.d.ts.map +1 -1
  53. package/dist/api/subscriptions/index.js +166 -185
  54. package/dist/api/subscriptions/index.js.map +1 -1
  55. package/dist/api/users/index.browser.js +48 -71
  56. package/dist/api/users/index.browser.js.map +1 -1
  57. package/dist/api/users/index.d.ts +1297 -1109
  58. package/dist/api/users/index.d.ts.map +1 -1
  59. package/dist/api/users/index.js +454 -369
  60. package/dist/api/users/index.js.map +1 -1
  61. package/dist/api/verifications/index.browser.js +17 -17
  62. package/dist/api/verifications/index.browser.js.map +1 -1
  63. package/dist/api/verifications/index.d.ts +169 -157
  64. package/dist/api/verifications/index.d.ts.map +1 -1
  65. package/dist/api/verifications/index.js +47 -95
  66. package/dist/api/verifications/index.js.map +1 -1
  67. package/dist/background/index.d.ts +0 -1
  68. package/dist/background/index.d.ts.map +1 -1
  69. package/dist/background/index.js.map +1 -1
  70. package/dist/background/index.workerd.js.map +1 -1
  71. package/dist/batch/index.d.ts +0 -1
  72. package/dist/batch/index.d.ts.map +1 -1
  73. package/dist/batch/index.js.map +1 -1
  74. package/dist/bin/index.js +1 -1
  75. package/dist/bin/index.js.map +1 -1
  76. package/dist/bucket/index.d.ts +27 -32
  77. package/dist/bucket/index.d.ts.map +1 -1
  78. package/dist/bucket/index.js +56 -26
  79. package/dist/bucket/index.js.map +1 -1
  80. package/dist/bucket/index.workerd.js +52 -24
  81. package/dist/bucket/index.workerd.js.map +1 -1
  82. package/dist/cache/core/index.d.ts +4 -6
  83. package/dist/cache/core/index.d.ts.map +1 -1
  84. package/dist/cache/core/index.js +4 -10
  85. package/dist/cache/core/index.js.map +1 -1
  86. package/dist/cache/core/index.workerd.js +4 -10
  87. package/dist/cache/core/index.workerd.js.map +1 -1
  88. package/dist/cache/database/index.d.ts +22 -23
  89. package/dist/cache/database/index.d.ts.map +1 -1
  90. package/dist/cache/database/index.js +11 -20
  91. package/dist/cache/database/index.js.map +1 -1
  92. package/dist/cache/redis/index.d.ts +3 -4
  93. package/dist/cache/redis/index.d.ts.map +1 -1
  94. package/dist/cache/redis/index.js +2 -2
  95. package/dist/cache/redis/index.js.map +1 -1
  96. package/dist/captcha/index.d.ts.map +1 -1
  97. package/dist/captcha/index.js +4 -4
  98. package/dist/captcha/index.js.map +1 -1
  99. package/dist/cli/config/index.d.ts +0 -1
  100. package/dist/cli/config/index.d.ts.map +1 -1
  101. package/dist/cli/core/index.d.ts +244 -475
  102. package/dist/cli/core/index.d.ts.map +1 -1
  103. package/dist/cli/core/index.js +308 -383
  104. package/dist/cli/core/index.js.map +1 -1
  105. package/dist/cli/devtools/index.d.ts +3 -9
  106. package/dist/cli/devtools/index.d.ts.map +1 -1
  107. package/dist/cli/devtools/index.js +3 -3
  108. package/dist/cli/devtools/index.js.map +1 -1
  109. package/dist/cli/i18n/index.d.ts +20 -39
  110. package/dist/cli/i18n/index.d.ts.map +1 -1
  111. package/dist/cli/i18n/index.js +51 -17
  112. package/dist/cli/i18n/index.js.map +1 -1
  113. package/dist/cli/platform/index.d.ts +89 -82
  114. package/dist/cli/platform/index.d.ts.map +1 -1
  115. package/dist/cli/platform/index.js +27 -33
  116. package/dist/cli/platform/index.js.map +1 -1
  117. package/dist/cli/platform-lib/index.d.ts +383 -410
  118. package/dist/cli/platform-lib/index.d.ts.map +1 -1
  119. package/dist/cli/platform-lib/index.js +300 -258
  120. package/dist/cli/platform-lib/index.js.map +1 -1
  121. package/dist/cli/vendor/index.d.ts +17 -41
  122. package/dist/cli/vendor/index.d.ts.map +1 -1
  123. package/dist/cli/vendor/index.js +10 -13
  124. package/dist/cli/vendor/index.js.map +1 -1
  125. package/dist/command/index.d.ts +82 -194
  126. package/dist/command/index.d.ts.map +1 -1
  127. package/dist/command/index.js +160 -563
  128. package/dist/command/index.js.map +1 -1
  129. package/dist/core/index.browser.js +845 -859
  130. package/dist/core/index.browser.js.map +1 -1
  131. package/dist/core/index.d.ts +787 -527
  132. package/dist/core/index.d.ts.map +1 -1
  133. package/dist/core/index.js +845 -859
  134. package/dist/core/index.js.map +1 -1
  135. package/dist/core/index.native.js +845 -859
  136. package/dist/core/index.native.js.map +1 -1
  137. package/dist/core/index.workerd.js +845 -859
  138. package/dist/core/index.workerd.js.map +1 -1
  139. package/dist/crypto/index.browser.js +1 -1
  140. package/dist/crypto/index.browser.js.map +1 -1
  141. package/dist/crypto/index.d.ts +3 -4
  142. package/dist/crypto/index.d.ts.map +1 -1
  143. package/dist/crypto/index.js +6 -3
  144. package/dist/crypto/index.js.map +1 -1
  145. package/dist/datetime/index.d.ts +12 -2
  146. package/dist/datetime/index.d.ts.map +1 -1
  147. package/dist/datetime/index.js +6 -1
  148. package/dist/datetime/index.js.map +1 -1
  149. package/dist/email/brevo/index.d.ts +0 -1
  150. package/dist/email/brevo/index.d.ts.map +1 -1
  151. package/dist/email/brevo/index.js +4 -4
  152. package/dist/email/brevo/index.js.map +1 -1
  153. package/dist/email/cloudflare/index.d.ts +0 -1
  154. package/dist/email/cloudflare/index.d.ts.map +1 -1
  155. package/dist/email/cloudflare/index.js +2 -2
  156. package/dist/email/cloudflare/index.js.map +1 -1
  157. package/dist/email/core/index.d.ts +15 -7
  158. package/dist/email/core/index.d.ts.map +1 -1
  159. package/dist/email/core/index.js +14 -5
  160. package/dist/email/core/index.js.map +1 -1
  161. package/dist/email/core/index.workerd.js +5 -1
  162. package/dist/email/core/index.workerd.js.map +1 -1
  163. package/dist/email/smtp/index.d.ts +8 -9
  164. package/dist/email/smtp/index.d.ts.map +1 -1
  165. package/dist/email/smtp/index.js +702 -479
  166. package/dist/email/smtp/index.js.map +1 -1
  167. package/dist/fake/index.d.ts +1580 -1238
  168. package/dist/fake/index.d.ts.map +1 -1
  169. package/dist/fake/index.js +11728 -32131
  170. package/dist/fake/index.js.map +1 -1
  171. package/dist/lock/core/index.d.ts +13 -9
  172. package/dist/lock/core/index.d.ts.map +1 -1
  173. package/dist/lock/core/index.js +5 -5
  174. package/dist/lock/core/index.js.map +1 -1
  175. package/dist/lock/redis/index.d.ts +0 -1
  176. package/dist/lock/redis/index.d.ts.map +1 -1
  177. package/dist/lock/redis/index.js.map +1 -1
  178. package/dist/logger/index.d.ts +81 -69
  179. package/dist/logger/index.d.ts.map +1 -1
  180. package/dist/logger/index.js +123 -56
  181. package/dist/logger/index.js.map +1 -1
  182. package/dist/mcp/index.d.ts +36 -90
  183. package/dist/mcp/index.d.ts.map +1 -1
  184. package/dist/mcp/index.js +65 -70
  185. package/dist/mcp/index.js.map +1 -1
  186. package/dist/orm/core/index.browser.js +54 -40
  187. package/dist/orm/core/index.browser.js.map +1 -1
  188. package/dist/orm/core/index.bun.js +140 -106
  189. package/dist/orm/core/index.bun.js.map +1 -1
  190. package/dist/orm/core/index.d.ts +145 -150
  191. package/dist/orm/core/index.d.ts.map +1 -1
  192. package/dist/orm/core/index.js +144 -109
  193. package/dist/orm/core/index.js.map +1 -1
  194. package/dist/orm/postgres/index.bun.js +64 -54
  195. package/dist/orm/postgres/index.bun.js.map +1 -1
  196. package/dist/orm/postgres/index.d.ts +36 -76
  197. package/dist/orm/postgres/index.d.ts.map +1 -1
  198. package/dist/orm/postgres/index.js +67 -57
  199. package/dist/orm/postgres/index.js.map +1 -1
  200. package/dist/queue/core/index.d.ts +62 -75
  201. package/dist/queue/core/index.d.ts.map +1 -1
  202. package/dist/queue/core/index.js +48 -71
  203. package/dist/queue/core/index.js.map +1 -1
  204. package/dist/queue/core/index.workerd.js +48 -71
  205. package/dist/queue/core/index.workerd.js.map +1 -1
  206. package/dist/queue/redis/index.d.ts +3 -4
  207. package/dist/queue/redis/index.d.ts.map +1 -1
  208. package/dist/queue/redis/index.js +2 -2
  209. package/dist/queue/redis/index.js.map +1 -1
  210. package/dist/react/auth/index.browser.js.map +1 -1
  211. package/dist/react/auth/index.d.ts +7 -4
  212. package/dist/react/auth/index.d.ts.map +1 -1
  213. package/dist/react/auth/index.js.map +1 -1
  214. package/dist/react/core/index.d.ts +87 -5
  215. package/dist/react/core/index.d.ts.map +1 -1
  216. package/dist/react/core/index.js +170 -23
  217. package/dist/react/core/index.js.map +1 -1
  218. package/dist/react/form/index.d.ts +4 -6
  219. package/dist/react/form/index.d.ts.map +1 -1
  220. package/dist/react/form/index.js +107 -71
  221. package/dist/react/form/index.js.map +1 -1
  222. package/dist/react/head/index.browser.js.map +1 -1
  223. package/dist/react/head/index.d.ts +0 -1
  224. package/dist/react/head/index.d.ts.map +1 -1
  225. package/dist/react/head/index.js.map +1 -1
  226. package/dist/react/i18n/index.d.ts +47 -5
  227. package/dist/react/i18n/index.d.ts.map +1 -1
  228. package/dist/react/i18n/index.js +116 -12
  229. package/dist/react/i18n/index.js.map +1 -1
  230. package/dist/react/intro/index.d.ts +1 -4
  231. package/dist/react/intro/index.d.ts.map +1 -1
  232. package/dist/react/intro/index.js.map +1 -1
  233. package/dist/react/router/index.browser.js +188 -29
  234. package/dist/react/router/index.browser.js.map +1 -1
  235. package/dist/react/router/index.d.ts +480 -372
  236. package/dist/react/router/index.d.ts.map +1 -1
  237. package/dist/react/router/index.js +261 -47
  238. package/dist/react/router/index.js.map +1 -1
  239. package/dist/react/sitemap/index.browser.js +35 -0
  240. package/dist/react/sitemap/index.browser.js.map +1 -0
  241. package/dist/react/sitemap/index.d.ts +91 -0
  242. package/dist/react/sitemap/index.d.ts.map +1 -0
  243. package/dist/react/sitemap/index.js +131 -0
  244. package/dist/react/sitemap/index.js.map +1 -0
  245. package/dist/react/testing/index.d.ts +4 -5
  246. package/dist/react/testing/index.d.ts.map +1 -1
  247. package/dist/react/testing/index.js +41 -15
  248. package/dist/react/testing/index.js.map +1 -1
  249. package/dist/react/testing/{chunk-BpyX8vjI.js → rolldown-runtime-Bl3dcgcQ.js} +1 -1
  250. package/dist/react/ui/index.d.ts +35 -34
  251. package/dist/react/ui/index.d.ts.map +1 -1
  252. package/dist/react/ui/index.js +12 -17
  253. package/dist/react/ui/index.js.map +1 -1
  254. package/dist/redis/index.bun.js +5 -5
  255. package/dist/redis/index.bun.js.map +1 -1
  256. package/dist/redis/index.d.ts +6 -7
  257. package/dist/redis/index.d.ts.map +1 -1
  258. package/dist/redis/index.js +6 -6
  259. package/dist/redis/index.js.map +1 -1
  260. package/dist/retry/index.d.ts +0 -1
  261. package/dist/retry/index.d.ts.map +1 -1
  262. package/dist/retry/index.js.map +1 -1
  263. package/dist/router/index.d.ts.map +1 -1
  264. package/dist/router/index.js.map +1 -1
  265. package/dist/scheduler/index.d.ts +4 -12
  266. package/dist/scheduler/index.d.ts.map +1 -1
  267. package/dist/scheduler/index.js +9 -4
  268. package/dist/scheduler/index.js.map +1 -1
  269. package/dist/scheduler/index.workerd.js +9 -4
  270. package/dist/scheduler/index.workerd.js.map +1 -1
  271. package/dist/security/index.browser.js +30 -28
  272. package/dist/security/index.browser.js.map +1 -1
  273. package/dist/security/index.d.ts +113 -44
  274. package/dist/security/index.d.ts.map +1 -1
  275. package/dist/security/index.js +452 -37
  276. package/dist/security/index.js.map +1 -1
  277. package/dist/server/auth/index.browser.js +19 -19
  278. package/dist/server/auth/index.browser.js.map +1 -1
  279. package/dist/server/auth/index.d.ts +215 -187
  280. package/dist/server/auth/index.d.ts.map +1 -1
  281. package/dist/server/auth/index.js +1145 -86
  282. package/dist/server/auth/index.js.map +1 -1
  283. package/dist/server/cookies/index.browser.js +103 -5
  284. package/dist/server/cookies/index.browser.js.map +1 -1
  285. package/dist/server/cookies/index.d.ts +86 -4
  286. package/dist/server/cookies/index.d.ts.map +1 -1
  287. package/dist/server/cookies/index.js +121 -8
  288. package/dist/server/cookies/index.js.map +1 -1
  289. package/dist/server/core/index.browser.js +22 -27
  290. package/dist/server/core/index.browser.js.map +1 -1
  291. package/dist/server/core/index.d.ts +134 -85
  292. package/dist/server/core/index.d.ts.map +1 -1
  293. package/dist/server/core/index.js +130 -118
  294. package/dist/server/core/index.js.map +1 -1
  295. package/dist/server/cors/index.d.ts +9 -10
  296. package/dist/server/cors/index.d.ts.map +1 -1
  297. package/dist/server/cors/index.js +14 -26
  298. package/dist/server/cors/index.js.map +1 -1
  299. package/dist/server/etag/index.d.ts +2 -3
  300. package/dist/server/etag/index.d.ts.map +1 -1
  301. package/dist/server/etag/index.js.map +1 -1
  302. package/dist/server/health/index.d.ts +18 -19
  303. package/dist/server/health/index.d.ts.map +1 -1
  304. package/dist/server/health/index.js +6 -6
  305. package/dist/server/health/index.js.map +1 -1
  306. package/dist/server/links/index.browser.js +15 -18
  307. package/dist/server/links/index.browser.js.map +1 -1
  308. package/dist/server/links/index.d.ts +66 -67
  309. package/dist/server/links/index.d.ts.map +1 -1
  310. package/dist/server/links/index.js +29 -32
  311. package/dist/server/links/index.js.map +1 -1
  312. package/dist/server/metrics/index.d.ts +0 -1
  313. package/dist/server/metrics/index.d.ts.map +1 -1
  314. package/dist/server/metrics/index.js +10 -3
  315. package/dist/server/metrics/index.js.map +1 -1
  316. package/dist/server/proxy/index.d.ts +0 -1
  317. package/dist/server/proxy/index.d.ts.map +1 -1
  318. package/dist/server/proxy/index.js.map +1 -1
  319. package/dist/server/rate-limit/index.d.ts +8 -9
  320. package/dist/server/rate-limit/index.d.ts.map +1 -1
  321. package/dist/server/rate-limit/index.js +6 -12
  322. package/dist/server/rate-limit/index.js.map +1 -1
  323. package/dist/server/static/index.d.ts +0 -1
  324. package/dist/server/static/index.d.ts.map +1 -1
  325. package/dist/server/static/index.js.map +1 -1
  326. package/dist/server/swagger/index.d.ts +4 -4
  327. package/dist/server/swagger/index.d.ts.map +1 -1
  328. package/dist/server/swagger/index.js +37 -25
  329. package/dist/server/swagger/index.js.map +1 -1
  330. package/dist/sms/index.d.ts +0 -1
  331. package/dist/sms/index.d.ts.map +1 -1
  332. package/dist/sms/index.js.map +1 -1
  333. package/dist/system/index.browser.js.map +1 -1
  334. package/dist/system/index.d.ts +0 -1
  335. package/dist/system/index.d.ts.map +1 -1
  336. package/dist/system/index.js +2 -1
  337. package/dist/system/index.js.map +1 -1
  338. package/dist/system/index.workerd.js.map +1 -1
  339. package/dist/topic/core/index.d.ts +19 -20
  340. package/dist/topic/core/index.d.ts.map +1 -1
  341. package/dist/topic/core/index.js +8 -8
  342. package/dist/topic/core/index.js.map +1 -1
  343. package/dist/topic/redis/index.d.ts +3 -4
  344. package/dist/topic/redis/index.d.ts.map +1 -1
  345. package/dist/topic/redis/index.js +2 -2
  346. package/dist/topic/redis/index.js.map +1 -1
  347. package/package.json +36 -36
  348. package/src/api/audits/__tests__/AuditJobs.spec.ts +83 -0
  349. package/src/api/audits/__tests__/AuditService.spec.ts +139 -1
  350. package/src/api/audits/controllers/AdminAuditController.ts +41 -41
  351. package/src/api/audits/entities/audits.ts +22 -22
  352. package/src/api/audits/index.ts +6 -1
  353. package/src/api/audits/jobs/AuditJobs.ts +29 -0
  354. package/src/api/audits/parameters/AuditParameters.ts +51 -0
  355. package/src/api/audits/primitives/$audit.ts +24 -0
  356. package/src/api/audits/schemas/auditQuerySchema.ts +13 -13
  357. package/src/api/audits/schemas/createAuditSchema.ts +18 -18
  358. package/src/api/audits/services/AuditService.ts +79 -7
  359. package/src/api/files/__tests__/FileController.spec.ts +5 -5
  360. package/src/api/files/__tests__/FileJobs.spec.ts +6 -0
  361. package/src/api/files/controllers/FileController.ts +25 -25
  362. package/src/api/files/entities/files.ts +15 -15
  363. package/src/api/files/schemas/fileCreatorSummarySchema.ts +7 -7
  364. package/src/api/files/schemas/fileQuerySchema.ts +9 -9
  365. package/src/api/files/schemas/fileResourceSchema.ts +7 -9
  366. package/src/api/files/schemas/storageStatsSchema.ts +13 -13
  367. package/src/api/jobs/__tests__/$job-hardening.spec.ts +289 -0
  368. package/src/api/jobs/__tests__/$job.spec.ts +18 -18
  369. package/src/api/jobs/controllers/AdminJobController.ts +8 -8
  370. package/src/api/jobs/entities/jobExecutionEntity.ts +29 -19
  371. package/src/api/jobs/providers/JobProvider.ts +128 -12
  372. package/src/api/jobs/providers/JobQueueProvider.ts +2 -2
  373. package/src/api/jobs/schemas/jobConfigAtom.ts +22 -22
  374. package/src/api/jobs/schemas/jobExecutionQuerySchema.ts +6 -6
  375. package/src/api/jobs/schemas/jobExecutionResourceSchema.ts +11 -15
  376. package/src/api/jobs/schemas/jobRegistrationSchema.ts +20 -19
  377. package/src/api/jobs/schemas/triggerJobSchema.ts +3 -3
  378. package/src/api/jobs/services/JobService.ts +6 -6
  379. package/src/api/keys/__tests__/ApiKeyService.spec.ts +2 -2
  380. package/src/api/keys/controllers/AdminApiKeyController.ts +10 -10
  381. package/src/api/keys/entities/apiKeyEntity.ts +15 -15
  382. package/src/api/keys/schemas/adminApiKeyQuerySchema.ts +4 -4
  383. package/src/api/keys/schemas/adminApiKeyResourceSchema.ts +15 -15
  384. package/src/api/keys/schemas/createApiKeyBodySchema.ts +5 -5
  385. package/src/api/keys/schemas/createApiKeyResponseSchema.ts +9 -9
  386. package/src/api/keys/schemas/listApiKeyResponseSchema.ts +13 -13
  387. package/src/api/keys/schemas/revokeApiKeyParamsSchema.ts +3 -3
  388. package/src/api/keys/schemas/revokeApiKeyResponseSchema.ts +3 -3
  389. package/src/api/notifications/__tests__/AlephaApiNotifications.spec.ts +2 -2
  390. package/src/api/notifications/controllers/AdminNotificationController.ts +38 -14
  391. package/src/api/notifications/jobs/NotificationJobs.ts +7 -6
  392. package/src/api/notifications/primitives/$notification.ts +43 -4
  393. package/src/api/notifications/schemas/notificationContactPreferencesSchema.ts +4 -4
  394. package/src/api/notifications/schemas/notificationContactSchema.ts +7 -7
  395. package/src/api/notifications/schemas/notificationDetailResourceSchema.ts +9 -11
  396. package/src/api/notifications/schemas/notificationPayloadSchema.ts +11 -9
  397. package/src/api/notifications/schemas/notificationQuerySchema.ts +6 -6
  398. package/src/api/notifications/schemas/notificationResourceSchema.ts +14 -14
  399. package/src/api/notifications/services/NotificationSenderService.ts +38 -2
  400. package/src/api/oauth/__tests__/OAuthClientService.spec.ts +42 -0
  401. package/src/api/oauth/__tests__/OAuthController.spec.ts +128 -0
  402. package/src/api/oauth/controllers/OAuthController.ts +132 -12
  403. package/src/api/oauth/entities/oauthClientEntity.ts +29 -12
  404. package/src/api/oauth/helpers/oauthMetadata.ts +1 -0
  405. package/src/api/oauth/helpers/oidcMetadata.ts +19 -0
  406. package/src/api/oauth/index.ts +1 -0
  407. package/src/api/oauth/schemas/authorizeDecisionBodySchema.ts +12 -11
  408. package/src/api/oauth/schemas/authorizeQuerySchema.ts +12 -10
  409. package/src/api/oauth/schemas/registerClientBodySchema.ts +10 -11
  410. package/src/api/oauth/schemas/tokenRequestBodySchema.ts +9 -8
  411. package/src/api/oauth/services/OAuthClientService.ts +228 -15
  412. package/src/api/organizations/controllers/AdminOrganizationController.ts +8 -8
  413. package/src/api/organizations/entities/organizations.ts +6 -6
  414. package/src/api/organizations/schemas/createOrganizationSchema.ts +5 -5
  415. package/src/api/organizations/schemas/organizationQuerySchema.ts +4 -4
  416. package/src/api/organizations/schemas/updateOrganizationSchema.ts +1 -2
  417. package/src/api/parameters/__tests__/$parameter.spec.ts +229 -50
  418. package/src/api/parameters/controllers/AdminParameterController.ts +9 -12
  419. package/src/api/parameters/entities/parameters.ts +29 -16
  420. package/src/api/parameters/primitives/$parameter.ts +3 -3
  421. package/src/api/parameters/schemas/activateParameterBodySchema.ts +4 -4
  422. package/src/api/parameters/schemas/createParameterVersionBodySchema.ts +15 -15
  423. package/src/api/parameters/schemas/parameterCreatorSummarySchema.ts +7 -7
  424. package/src/api/parameters/schemas/parameterCurrentResponseSchema.ts +7 -7
  425. package/src/api/parameters/schemas/parameterHistoryResponseSchema.ts +3 -3
  426. package/src/api/parameters/schemas/parameterNameParamSchema.ts +2 -3
  427. package/src/api/parameters/schemas/parameterNamesResponseSchema.ts +3 -3
  428. package/src/api/parameters/schemas/parameterResponseSchema.ts +3 -3
  429. package/src/api/parameters/schemas/parameterStatusSchema.ts +2 -2
  430. package/src/api/parameters/schemas/parameterTreeNodeSchema.ts +6 -6
  431. package/src/api/parameters/schemas/parameterVersionParamSchema.ts +5 -6
  432. package/src/api/parameters/schemas/parameterVersionResponseSchema.ts +3 -3
  433. package/src/api/parameters/schemas/rollbackParameterBodySchema.ts +6 -9
  434. package/src/api/parameters/services/ParameterProvider.ts +152 -65
  435. package/src/api/payments/controllers/AdminPaymentController.ts +7 -7
  436. package/src/api/payments/controllers/MockCheckoutController.ts +79 -28
  437. package/src/api/payments/controllers/PaymentController.ts +4 -4
  438. package/src/api/payments/entities/paymentIntents.ts +11 -11
  439. package/src/api/payments/entities/paymentMethods.ts +11 -11
  440. package/src/api/payments/entities/refunds.ts +9 -9
  441. package/src/api/payments/providers/PaymentProvider.ts +18 -0
  442. package/src/api/payments/schemas/intentSchemas.ts +25 -25
  443. package/src/api/payments/schemas/paymentMethodSchemas.ts +3 -3
  444. package/src/api/payments/services/PaymentService.ts +60 -3
  445. package/src/api/subscriptions/__tests__/SubscriptionService.spec.ts +14 -0
  446. package/src/api/subscriptions/controllers/AdminSubscriptionController.ts +11 -11
  447. package/src/api/subscriptions/controllers/SubscriptionController.ts +5 -4
  448. package/src/api/subscriptions/entities/subscriptionEvents.ts +15 -15
  449. package/src/api/subscriptions/entities/subscriptions.ts +22 -22
  450. package/src/api/subscriptions/notifications/SubscriptionNotifications.ts +22 -22
  451. package/src/api/subscriptions/schemas/cancelSubscriptionSchema.ts +4 -4
  452. package/src/api/subscriptions/schemas/changePlanSchema.ts +5 -5
  453. package/src/api/subscriptions/schemas/createSubscriptionSchema.ts +14 -7
  454. package/src/api/subscriptions/schemas/entitlementsSchema.ts +10 -10
  455. package/src/api/subscriptions/schemas/mrrSchema.ts +9 -9
  456. package/src/api/subscriptions/schemas/planDefinitionSchema.ts +21 -21
  457. package/src/api/subscriptions/schemas/planResourceSchema.ts +19 -19
  458. package/src/api/subscriptions/schemas/subscriptionQuerySchema.ts +8 -8
  459. package/src/api/subscriptions/schemas/subscriptionSettingsSchema.ts +7 -7
  460. package/src/api/subscriptions/schemas/subscriptionStatsSchema.ts +17 -17
  461. package/src/api/subscriptions/services/SubscriptionConfig.ts +2 -2
  462. package/src/api/users/__tests__/ApiKeys-integration.spec.ts +11 -11
  463. package/src/api/users/atoms/realmAuthSettingsAtom.ts +111 -119
  464. package/src/api/users/controllers/AdminIdentityController.ts +29 -19
  465. package/src/api/users/controllers/AdminSessionController.ts +37 -27
  466. package/src/api/users/controllers/AdminUserController.ts +75 -53
  467. package/src/api/users/controllers/MySessionController.ts +125 -0
  468. package/src/api/users/controllers/RealmController.ts +9 -9
  469. package/src/api/users/controllers/UserController.ts +55 -55
  470. package/src/api/users/entities/identities.ts +8 -8
  471. package/src/api/users/entities/sessions.ts +17 -17
  472. package/src/api/users/entities/users.ts +17 -17
  473. package/src/api/users/index.ts +3 -0
  474. package/src/api/users/notifications/UserNotifications.ts +76 -24
  475. package/src/api/users/primitives/$realm.ts +12 -0
  476. package/src/api/users/schemas/completePasswordResetRequestSchema.ts +8 -12
  477. package/src/api/users/schemas/completeRegistrationRequestSchema.ts +17 -20
  478. package/src/api/users/schemas/createUserSchema.ts +2 -2
  479. package/src/api/users/schemas/identityQuerySchema.ts +4 -4
  480. package/src/api/users/schemas/identityResourceSchema.ts +3 -2
  481. package/src/api/users/schemas/loginSchema.ts +4 -4
  482. package/src/api/users/schemas/passwordResetIntentResponseSchema.ts +6 -8
  483. package/src/api/users/schemas/realmConfigSchema.ts +10 -10
  484. package/src/api/users/schemas/registerQuerySchema.ts +6 -6
  485. package/src/api/users/schemas/registerRequestSchema.ts +21 -43
  486. package/src/api/users/schemas/registerResponseSchema.ts +2 -2
  487. package/src/api/users/schemas/registerSchema.ts +13 -31
  488. package/src/api/users/schemas/registrationIntentResponseSchema.ts +19 -23
  489. package/src/api/users/schemas/resetPasswordSchema.ts +10 -17
  490. package/src/api/users/schemas/sessionQuerySchema.ts +3 -3
  491. package/src/api/users/schemas/sessionResourceSchema.ts +25 -25
  492. package/src/api/users/schemas/updateUserSchema.ts +3 -4
  493. package/src/api/users/schemas/userQuerySchema.ts +7 -7
  494. package/src/api/users/services/RegistrationService.ts +25 -11
  495. package/src/api/users/services/UserService.ts +12 -6
  496. package/src/api/verifications/__tests__/CodeVerification.spec.ts +63 -101
  497. package/src/api/verifications/__tests__/LinkVerification.spec.ts +23 -92
  498. package/src/api/verifications/controllers/VerificationController.ts +13 -27
  499. package/src/api/verifications/entities/verifications.ts +13 -14
  500. package/src/api/verifications/schemas/requestVerificationCodeResponseSchema.ts +17 -14
  501. package/src/api/verifications/schemas/validateVerificationCodeResponseSchema.ts +9 -10
  502. package/src/api/verifications/schemas/verificationSettingsSchema.ts +65 -66
  503. package/src/api/verifications/schemas/verificationTypeEnumSchema.ts +2 -2
  504. package/src/api/verifications/services/VerificationService.ts +12 -0
  505. package/src/background/__tests__/BackgroundTaskProvider.spec.ts +36 -0
  506. package/src/batch/__tests__/$batch.spec.ts +22 -22
  507. package/src/batch/__tests__/startup-buffering.spec.ts +9 -9
  508. package/src/bin/index.ts +1 -1
  509. package/src/bucket/__tests__/TenantScopedBucket.spec.ts +60 -0
  510. package/src/bucket/providers/LocalFileStorageProvider.ts +14 -6
  511. package/src/bucket/providers/MemoryFileStorageProvider.ts +18 -7
  512. package/src/bucket/providers/R2FileStorageProvider.ts +14 -6
  513. package/src/bucket/providers/S3FileStorageProvider.ts +31 -15
  514. package/src/cache/core/primitives/$cache.ts +7 -10
  515. package/src/cache/database/entities/cacheEntries.ts +16 -27
  516. package/src/cache/database/providers/DatabaseCacheProvider.ts +15 -13
  517. package/src/cache/redis/providers/RedisCacheProvider.ts +6 -6
  518. package/src/captcha/providers/TurnstileCaptchaProvider.ts +4 -4
  519. package/src/cli/core/__tests__/BuildCloudflareTask.spec.ts +178 -0
  520. package/src/cli/core/__tests__/BuildDockerTask.spec.ts +0 -2
  521. package/src/cli/core/__tests__/DbCommand.spec.ts +108 -0
  522. package/src/cli/core/atoms/appEntryOptions.ts +5 -5
  523. package/src/cli/core/atoms/buildOptions.ts +76 -88
  524. package/src/cli/core/atoms/changelogOptions.ts +3 -3
  525. package/src/cli/core/atoms/devOptions.ts +3 -3
  526. package/src/cli/core/commands/build.ts +36 -49
  527. package/src/cli/core/commands/db.ts +171 -83
  528. package/src/cli/core/commands/dev.ts +8 -8
  529. package/src/cli/core/commands/gen/changelog.ts +12 -14
  530. package/src/cli/core/commands/gen/env.ts +6 -6
  531. package/src/cli/core/commands/gen/openapi.ts +6 -6
  532. package/src/cli/core/commands/init.ts +28 -33
  533. package/src/cli/core/commands/pack.ts +10 -10
  534. package/src/cli/core/commands/root.ts +7 -8
  535. package/src/cli/core/commands/test.ts +17 -20
  536. package/src/cli/core/index.ts +0 -3
  537. package/src/cli/core/tasks/BuildCloudflareTask.ts +138 -245
  538. package/src/cli/core/tasks/BuildPrerenderTask.ts +44 -7
  539. package/src/cli/core/templates/apiHelloResponseSchemaTs.ts +4 -4
  540. package/src/cli/devtools/atoms/devtoolsOptions.ts +6 -6
  541. package/src/cli/i18n/__tests__/I18nCheckService.spec.ts +48 -0
  542. package/src/cli/i18n/atoms/i18nOptions.ts +8 -8
  543. package/src/cli/i18n/services/I18nCheckService.ts +65 -11
  544. package/src/cli/platform/commands/SecretsCommand.ts +24 -25
  545. package/src/cli/platform/commands/platform.ts +40 -46
  546. package/src/cli/platform/index.ts +1 -1
  547. package/src/cli/platform-lib/__tests__/CloudflareAdapter.spec.ts +0 -4
  548. package/src/cli/platform-lib/__tests__/PlatformInspector.spec.ts +10 -3
  549. package/src/cli/platform-lib/__tests__/VercelAdapter.spec.ts +0 -2
  550. package/src/cli/platform-lib/adapters/CloudflareAdapter.ts +141 -50
  551. package/src/cli/platform-lib/adapters/VercelAdapter.ts +6 -11
  552. package/src/cli/platform-lib/atoms/platformOptions.ts +46 -25
  553. package/src/cli/platform-lib/schemas/cloudflare.ts +87 -87
  554. package/src/cli/platform-lib/schemas/platform.ts +51 -51
  555. package/src/cli/platform-lib/schemas/vercel.ts +28 -28
  556. package/src/cli/platform-lib/services/CloudflareApi.ts +5 -5
  557. package/src/cli/platform-lib/services/VercelApi.ts +4 -4
  558. package/src/cli/platform-lib/services/VercelCli.ts +6 -15
  559. package/src/cli/platform-lib/services/WranglerApi.ts +6 -15
  560. package/src/cli/vendor/atoms/vendorOptions.ts +9 -9
  561. package/src/cli/vendor/commands/VendorCommand.ts +11 -12
  562. package/src/command/__tests__/$command.spec.ts +82 -83
  563. package/src/command/__tests__/Asker.spec.ts +6 -13
  564. package/src/command/__tests__/CliProvider.spec.ts +136 -149
  565. package/src/command/__tests__/Runner.spec.ts +86 -110
  566. package/src/command/helpers/Asker.ts +23 -58
  567. package/src/command/helpers/Runner.ts +34 -110
  568. package/src/command/index.ts +4 -9
  569. package/src/command/primitives/$command.ts +10 -10
  570. package/src/command/providers/CliProvider.ts +183 -161
  571. package/src/core/Alepha.ts +62 -13
  572. package/src/core/__tests__/$atom.spec.ts +52 -3
  573. package/src/core/__tests__/$computed.spec.ts +129 -0
  574. package/src/core/__tests__/$env.spec.ts +13 -13
  575. package/src/core/__tests__/$inject.spec.ts +4 -4
  576. package/src/core/__tests__/$module.spec.ts +1 -1
  577. package/src/core/__tests__/Alepha-graph.spec.ts +1 -1
  578. package/src/core/__tests__/Alepha-parseEnv.spec.ts +32 -32
  579. package/src/core/__tests__/Alepha-start.spec.ts +3 -3
  580. package/src/core/__tests__/CodecManager.spec.ts +113 -94
  581. package/src/core/__tests__/KeylessJsonSchemaCodec.spec.ts +138 -138
  582. package/src/core/__tests__/SchemaValidator.spec.ts +43 -44
  583. package/src/core/__tests__/StateManager.persist.browser.spec.ts +87 -0
  584. package/src/core/__tests__/StateManager.spec.ts +423 -0
  585. package/src/core/__tests__/TypeBox-usecases.spec.ts +8 -8
  586. package/src/core/__tests__/TypeProvider.spec.ts +314 -309
  587. package/src/core/__tests__/dump.spec.ts +6 -6
  588. package/src/core/__tests__/pagination.spec.ts +4 -4
  589. package/src/core/__tests__/scoped-after-start.spec.ts +43 -0
  590. package/src/core/errors/TypeBoxError.ts +10 -4
  591. package/src/core/helpers/FileLike.ts +5 -5
  592. package/src/core/helpers/coerceStrings.ts +70 -0
  593. package/src/core/helpers/jsonSchemaToZod.ts +112 -0
  594. package/src/core/index.shared.ts +4 -1
  595. package/src/core/primitives/$atom.ts +95 -27
  596. package/src/core/primitives/$computed.ts +148 -0
  597. package/src/core/primitives/$env.ts +5 -5
  598. package/src/core/primitives/$state.ts +1 -1
  599. package/src/core/providers/AlsProvider.ts +26 -0
  600. package/src/core/providers/CodecManager.ts +1 -2
  601. package/src/core/providers/JsonSchemaCodec.ts +1 -2
  602. package/src/core/providers/KeylessJsonSchemaCodec.ts +82 -57
  603. package/src/core/providers/SchemaValidator.ts +48 -158
  604. package/src/core/providers/StateManager.ts +383 -9
  605. package/src/core/providers/TypeProvider.ts +80 -734
  606. package/src/core/providers/ZodProvider.ts +380 -0
  607. package/src/core/providers/zodAugment.ts +69 -0
  608. package/src/core/schemas/pageQuerySchema.ts +19 -21
  609. package/src/core/schemas/pageSchema.ts +47 -57
  610. package/src/crypto/__tests__/SecretProvider.spec.ts +31 -0
  611. package/src/crypto/providers/SecretProvider.ts +16 -10
  612. package/src/datetime/primitives/$throttle.ts +6 -1
  613. package/src/email/brevo/providers/BrevoEmailProvider.ts +4 -4
  614. package/src/email/cloudflare/providers/CloudflareEmailProvider.ts +6 -6
  615. package/src/email/core/index.ts +7 -2
  616. package/src/email/core/primitives/$email.ts +5 -1
  617. package/src/email/core/providers/LocalEmailProvider.ts +5 -5
  618. package/src/email/smtp/providers/NodemailerEmailProvider.ts +41 -52
  619. package/src/fake/__tests__/FakeProvider.spec.ts +110 -110
  620. package/src/fake/__tests__/keyName.example.ts +21 -21
  621. package/src/fake/__tests__/keyName.spec.ts +41 -41
  622. package/src/fake/__tests__/module.example.ts +8 -8
  623. package/src/fake/providers/FakeProvider.ts +122 -121
  624. package/src/lock/core/__tests__/lock-mutual-exclusion.spec.ts +44 -0
  625. package/src/lock/core/index.ts +1 -0
  626. package/src/lock/core/primitives/$lock.ts +13 -6
  627. package/src/logger/__tests__/CliFormatterProvider.spec.ts +76 -0
  628. package/src/logger/__tests__/Logger.spec.ts +49 -0
  629. package/src/logger/index.ts +25 -18
  630. package/src/logger/providers/CliFormatterProvider.ts +75 -0
  631. package/src/logger/schemas/logEntrySchema.ts +10 -10
  632. package/src/logger/services/Logger.ts +18 -0
  633. package/src/mcp/__tests__/$prompt.spec.ts +21 -23
  634. package/src/mcp/__tests__/$tool.spec.ts +22 -22
  635. package/src/mcp/__tests__/McpServerProvider.spec.ts +82 -11
  636. package/src/mcp/__tests__/StreamableHttpMcpTransport.spec.ts +2 -2
  637. package/src/mcp/__tests__/integration.spec.ts +33 -33
  638. package/src/mcp/primitives/$prompt.ts +11 -9
  639. package/src/mcp/primitives/$tool.ts +27 -86
  640. package/src/mcp/providers/McpServerProvider.ts +55 -0
  641. package/src/mcp/transports/StreamableHttpMcpTransport.ts +7 -7
  642. package/src/orm/__tests__/$repository-tests.ts +133 -27
  643. package/src/orm/__tests__/$repository.spec.ts +23 -0
  644. package/src/orm/__tests__/$transactional-tests.ts +4 -4
  645. package/src/orm/__tests__/ModelBuilder-tests.ts +28 -28
  646. package/src/orm/__tests__/ModelBuilder.spec.ts +124 -106
  647. package/src/orm/__tests__/QueryManager.spec.ts +5 -5
  648. package/src/orm/__tests__/delete-returning-tests.ts +11 -11
  649. package/src/orm/__tests__/deletedAt-tests.ts +3 -3
  650. package/src/orm/__tests__/enums.spec.ts +29 -25
  651. package/src/orm/__tests__/execute-tests.ts +8 -8
  652. package/src/orm/__tests__/fixtures/bigEntitySchema.ts +48 -48
  653. package/src/orm/__tests__/fixtures/userEntitySchema.ts +6 -6
  654. package/src/orm/__tests__/joins-tests.ts +30 -30
  655. package/src/orm/__tests__/organization-tests.ts +105 -3
  656. package/src/orm/__tests__/organization.spec.ts +46 -0
  657. package/src/orm/__tests__/orm-errors.spec.ts +10 -10
  658. package/src/orm/__tests__/orm-next-tests.ts +29 -29
  659. package/src/orm/__tests__/orm-showcase-tests.ts +9 -9
  660. package/src/orm/__tests__/primaryKey.spec.ts +4 -4
  661. package/src/orm/__tests__/query-date-encoding-tests.ts +17 -17
  662. package/src/orm/__tests__/ref-auto-onDelete.spec.ts +14 -14
  663. package/src/orm/__tests__/references.spec.ts +7 -7
  664. package/src/orm/__tests__/security.spec.ts +17 -17
  665. package/src/orm/__tests__/string-operators-tests.ts +5 -5
  666. package/src/orm/__tests__/timestamps-tests.ts +14 -14
  667. package/src/orm/__tests__/validation-tests.ts +5 -5
  668. package/src/orm/core/__tests__/BunSqliteProvider.bun.spec.ts +8 -8
  669. package/src/orm/core/constants/PG_SYMBOLS.ts +13 -1
  670. package/src/orm/core/entities/alephaSequences.ts +8 -8
  671. package/src/orm/core/helpers/pgAttr.ts +4 -4
  672. package/src/orm/core/primitives/$entity.ts +10 -6
  673. package/src/orm/core/providers/DatabaseTypeProvider.ts +46 -53
  674. package/src/orm/core/providers/drivers/BunSqliteProvider.ts +8 -8
  675. package/src/orm/core/providers/drivers/CloudflareD1Provider.ts +3 -5
  676. package/src/orm/core/providers/drivers/NodeSqliteProvider.ts +8 -8
  677. package/src/orm/core/schemas/databaseEnvSchema.ts +4 -4
  678. package/src/orm/core/schemas/insertSchema.ts +14 -18
  679. package/src/orm/core/schemas/legacyIdSchema.ts +2 -2
  680. package/src/orm/core/schemas/updateSchema.ts +10 -16
  681. package/src/orm/core/services/PgRelationManager.ts +2 -2
  682. package/src/orm/core/services/QueryManager.ts +13 -2
  683. package/src/orm/core/services/Repository.ts +88 -33
  684. package/src/orm/core/services/SqliteModelBuilder.ts +38 -45
  685. package/src/orm/postgres/__tests__/BunPostgresProvider.bun.spec.ts +4 -4
  686. package/src/orm/postgres/providers/CloudflareHyperdriveProvider.ts +4 -6
  687. package/src/orm/postgres/schemas/postgresEnvSchema.ts +6 -6
  688. package/src/orm/postgres/services/PostgresModelBuilder.ts +127 -114
  689. package/src/queue/core/__tests__/$consumer.spec.ts +4 -4
  690. package/src/queue/core/__tests__/WorkerProvider.spec.ts +4 -4
  691. package/src/queue/core/__tests__/shared.ts +6 -6
  692. package/src/queue/core/primitives/$consumer.ts +5 -5
  693. package/src/queue/core/primitives/$queue.ts +44 -61
  694. package/src/queue/core/providers/CloudflareQueueProvider.ts +6 -0
  695. package/src/queue/core/providers/WorkerProvider.ts +17 -14
  696. package/src/queue/redis/providers/RedisQueueProvider.ts +3 -3
  697. package/src/react/core/__tests__/ErrorBoundary.browser.spec.tsx +92 -0
  698. package/src/react/core/__tests__/Router.spec.tsx +4 -4
  699. package/src/react/core/__tests__/useComputed.browser.spec.tsx +192 -0
  700. package/src/react/core/__tests__/useQuery.browser.spec.tsx +48 -0
  701. package/src/react/core/__tests__/useSelector.browser.spec.tsx +105 -0
  702. package/src/react/core/__tests__/useStore.browser.spec.tsx +113 -0
  703. package/src/react/core/components/ErrorBoundary.tsx +42 -0
  704. package/src/react/core/hooks/useAction.ts +56 -19
  705. package/src/react/core/hooks/useComputed.ts +91 -0
  706. package/src/react/core/hooks/useSelector.ts +67 -0
  707. package/src/react/core/hooks/useStore.ts +36 -17
  708. package/src/react/core/index.ts +3 -0
  709. package/src/react/core/utils/shallowEqual.ts +36 -0
  710. package/src/react/form/__tests__/FormModel-submit-loading.spec.ts +71 -0
  711. package/src/react/form/__tests__/form-submitting-reactive.browser.spec.tsx +96 -0
  712. package/src/react/form/__tests__/useForm.browser.spec.tsx +54 -54
  713. package/src/react/form/errors/FormValidationError.ts +0 -2
  714. package/src/react/form/hooks/useForm.ts +19 -4
  715. package/src/react/form/hooks/useFormQuerySync.ts +0 -0
  716. package/src/react/form/services/FormModel.ts +124 -86
  717. package/src/react/form/services/parseField.ts +66 -27
  718. package/src/react/i18n/__tests__/I18nProvider.spec.ts +89 -0
  719. package/src/react/i18n/__tests__/Localize.spec.tsx +1 -1
  720. package/src/react/i18n/__tests__/locale-routing.spec.ts +107 -0
  721. package/src/react/i18n/providers/I18nProvider.ts +173 -14
  722. package/src/react/router/__tests__/$page.browser.spec.tsx +19 -19
  723. package/src/react/router/__tests__/$page.spec.tsx +21 -21
  724. package/src/react/router/__tests__/ReactBrowserProvider.browser.spec.ts +87 -1
  725. package/src/react/router/__tests__/RouterLocaleProvider.spec.ts +127 -0
  726. package/src/react/router/atoms/ssrManifestAtom.ts +16 -16
  727. package/src/react/router/components/NestedView.tsx +11 -3
  728. package/src/react/router/hooks/useQueryParams.ts +1 -1
  729. package/src/react/router/index.browser.ts +4 -0
  730. package/src/react/router/index.shared.ts +1 -0
  731. package/src/react/router/index.ts +9 -0
  732. package/src/react/router/primitives/$page.ts +2 -2
  733. package/src/react/router/providers/ReactBrowserProvider.ts +64 -13
  734. package/src/react/router/providers/ReactBrowserRouterProvider.ts +15 -1
  735. package/src/react/router/providers/ReactPageProvider.ts +38 -13
  736. package/src/react/router/providers/ReactServerProvider.ts +105 -16
  737. package/src/react/router/providers/RootComponentsProvider.ts +13 -0
  738. package/src/react/router/providers/RouterLocaleProvider.ts +125 -0
  739. package/src/react/router/providers/__tests__/RootComponentsProvider.spec.ts +15 -0
  740. package/src/react/router/providers/__tests__/rootComponents.ssr.browser.spec.tsx +67 -0
  741. package/src/react/sitemap/__tests__/$sitemap.spec.ts +131 -0
  742. package/src/react/sitemap/index.browser.ts +21 -0
  743. package/src/react/sitemap/index.ts +25 -0
  744. package/src/react/sitemap/primitives/$sitemap.browser.ts +26 -0
  745. package/src/react/sitemap/primitives/$sitemap.ts +196 -0
  746. package/src/react/ui/atoms/uiAtom.ts +6 -6
  747. package/src/react/ui/atoms/uiThemeListAtom.ts +7 -7
  748. package/src/react/ui/hooks/useColorMode.ts +11 -4
  749. package/src/react/ui/services/SchemaControl.ts +4 -4
  750. package/src/redis/providers/BunRedisProvider.ts +19 -11
  751. package/src/redis/providers/NodeRedisProvider.ts +3 -3
  752. package/src/scheduler/primitives/$scheduler.ts +21 -8
  753. package/src/security/__tests__/assertRealmScope.spec.ts +29 -0
  754. package/src/security/atoms/currentTenantAtom.ts +6 -6
  755. package/src/security/atoms/currentUserAtom.ts +2 -2
  756. package/src/security/primitives/$issuer.ts +24 -2
  757. package/src/security/providers/JwtProvider.ts +100 -0
  758. package/src/security/providers/SecurityProvider.ts +43 -2
  759. package/src/security/schemas/permissionSchema.ts +19 -19
  760. package/src/security/schemas/roleSchema.ts +22 -28
  761. package/src/security/schemas/userAccountInfoSchema.ts +47 -37
  762. package/src/server/auth/__tests__/appleClientSecret.spec.ts +34 -0
  763. package/src/server/auth/__tests__/federationRedirectReplay.spec.ts +44 -0
  764. package/src/server/auth/helpers/appleClientSecret.ts +24 -0
  765. package/src/server/auth/helpers/jtiReplayGuard.ts +41 -0
  766. package/src/server/auth/helpers/safeRedirectPath.ts +19 -0
  767. package/src/server/auth/index.ts +1 -0
  768. package/src/server/auth/primitives/$auth.ts +6 -6
  769. package/src/server/auth/primitives/$authApple.ts +10 -10
  770. package/src/server/auth/primitives/$authFacebook.ts +10 -10
  771. package/src/server/auth/primitives/$authFranceConnect.ts +10 -10
  772. package/src/server/auth/primitives/$authGithub.ts +10 -10
  773. package/src/server/auth/primitives/$authGoogle.ts +10 -10
  774. package/src/server/auth/primitives/$authMicrosoft.ts +14 -14
  775. package/src/server/auth/providers/ServerAuthProvider.ts +67 -52
  776. package/src/server/auth/schemas/authenticationProviderSchema.ts +9 -12
  777. package/src/server/auth/schemas/tokenResponseSchema.ts +2 -2
  778. package/src/server/auth/schemas/tokensSchema.ts +16 -16
  779. package/src/server/auth/schemas/userinfoResponseSchema.ts +3 -3
  780. package/src/server/cookies/__tests__/AtomCookieBinding.spec.ts +80 -0
  781. package/src/server/cookies/__tests__/AtomCookiePersistence.browser.spec.ts +169 -0
  782. package/src/server/cookies/__tests__/AtomCookiePersistence.spec.ts +294 -0
  783. package/src/server/cookies/__tests__/ServerCookiesProvider.spec.ts +82 -12
  784. package/src/server/cookies/index.browser.ts +4 -1
  785. package/src/server/cookies/index.ts +8 -1
  786. package/src/server/cookies/primitives/$cookie.browser.ts +1 -1
  787. package/src/server/cookies/primitives/$cookie.ts +16 -0
  788. package/src/server/cookies/providers/AtomCookiePersistence.browser.ts +133 -0
  789. package/src/server/cookies/providers/AtomCookiePersistence.ts +148 -0
  790. package/src/server/cookies/providers/ServerCookiesProvider.ts +32 -4
  791. package/src/server/cookies/services/CookieParser.ts +6 -1
  792. package/src/server/core/__tests__/$action.spec.ts +13 -13
  793. package/src/server/core/__tests__/$middleware.spec.ts +10 -10
  794. package/src/server/core/__tests__/$route.spec.ts +9 -9
  795. package/src/server/core/__tests__/$sse.spec.ts +26 -26
  796. package/src/server/core/__tests__/BunHttpServerProvider.bun.spec.ts +6 -6
  797. package/src/server/core/__tests__/HttpClient.spec.ts +2 -2
  798. package/src/server/core/__tests__/NodeHttpServerProvider.spec.ts +15 -3
  799. package/src/server/core/__tests__/ServerBodyParserProvider.spec.ts +14 -14
  800. package/src/server/core/__tests__/ServerMultipartProvider.spec.ts +33 -33
  801. package/src/server/core/__tests__/ServerRouterProvider-errorHandler.spec.ts +5 -1
  802. package/src/server/core/__tests__/ServerRouterProvider-getRoutes.spec.ts +25 -25
  803. package/src/server/core/__tests__/ServerRouterProvider-serializationError.spec.ts +9 -5
  804. package/src/server/core/__tests__/ServerRouterProvider-validationError.spec.ts +56 -24
  805. package/src/server/core/errors/ValidationError.ts +6 -3
  806. package/src/server/core/helpers/isMultipart.ts +2 -1
  807. package/src/server/core/index.ts +5 -2
  808. package/src/server/core/interfaces/ServerRequest.ts +14 -14
  809. package/src/server/core/primitives/$action.ts +26 -36
  810. package/src/server/core/primitives/$route.ts +27 -0
  811. package/src/server/core/primitives/$sse.ts +3 -3
  812. package/src/server/core/providers/BunHttpServerProvider.ts +8 -9
  813. package/src/server/core/providers/NodeHttpServerProvider.ts +8 -9
  814. package/src/server/core/providers/ServerBodyParserProvider.ts +20 -12
  815. package/src/server/core/providers/ServerCompressProvider.ts +9 -10
  816. package/src/server/core/providers/ServerHelmetProvider.ts +26 -27
  817. package/src/server/core/providers/ServerMultipartProvider.ts +19 -19
  818. package/src/server/core/providers/ServerRouterProvider.ts +44 -15
  819. package/src/server/core/schemas/errorSchema.ts +20 -25
  820. package/src/server/core/schemas/okSchema.ts +9 -14
  821. package/src/server/core/services/HttpClient.ts +13 -1
  822. package/src/server/core/services/ServerRequestParser.ts +6 -6
  823. package/src/server/cors/providers/ServerCorsProvider.ts +26 -28
  824. package/src/server/health/schemas/healthSchema.ts +6 -6
  825. package/src/server/links/__tests__/$remote.spec.ts +3 -3
  826. package/src/server/links/__tests__/BatchEndpoint.spec.ts +9 -9
  827. package/src/server/links/__tests__/LinkProvider.spec.ts +9 -9
  828. package/src/server/links/__tests__/ServerLinksProvider.spec.ts +23 -23
  829. package/src/server/links/__tests__/fixtures/CrudApp.ts +21 -21
  830. package/src/server/links/atoms/apiLinksAtom.ts +2 -2
  831. package/src/server/links/atoms/linkOptionsAtom.ts +6 -6
  832. package/src/server/links/primitives/$remote.ts +3 -3
  833. package/src/server/links/providers/LinkProvider.ts +3 -3
  834. package/src/server/links/providers/ServerLinksProvider.ts +20 -20
  835. package/src/server/links/schemas/apiLinksResponseSchema.ts +23 -23
  836. package/src/server/proxy/__tests__/$proxy.spec.ts +9 -9
  837. package/src/server/proxy/providers/ServerProxyProvider.ts +5 -0
  838. package/src/server/rate-limit/providers/ServerRateLimitProvider.ts +18 -20
  839. package/src/server/swagger/__tests__/$swagger.spec.ts +91 -94
  840. package/src/server/swagger/__tests__/ui.spec.ts +3 -3
  841. package/src/server/swagger/providers/ServerSwaggerProvider.ts +66 -43
  842. package/src/system/__tests__/NodeShellProvider.spec.ts +46 -0
  843. package/src/system/providers/NodeShellProvider.ts +4 -1
  844. package/src/topic/core/__tests__/$subscriber.spec.ts +4 -4
  845. package/src/topic/core/__tests__/shared.ts +8 -8
  846. package/src/topic/core/primitives/$subscriber.ts +5 -5
  847. package/src/topic/core/primitives/$topic.ts +14 -14
  848. package/src/topic/redis/providers/RedisTopicProvider.ts +3 -3
  849. package/dist/container/core/index.d.ts +0 -236
  850. package/dist/container/core/index.d.ts.map +0 -1
  851. package/dist/container/core/index.js +0 -231
  852. package/dist/container/core/index.js.map +0 -1
  853. package/dist/container/core/index.workerd.js +0 -192
  854. package/dist/container/core/index.workerd.js.map +0 -1
  855. package/src/cli/core/tasks/BuildSitemapTask.ts +0 -130
  856. package/src/command/helpers/PrettyAsker.ts +0 -256
  857. package/src/command/helpers/PrettyPrint.ts +0 -332
  858. package/src/container/core/__tests__/$container.spec.ts +0 -83
  859. package/src/container/core/index.ts +0 -50
  860. package/src/container/core/index.workerd.ts +0 -53
  861. package/src/container/core/interfaces/ContainerOptions.ts +0 -69
  862. package/src/container/core/primitives/$container.ts +0 -100
  863. package/src/container/core/providers/CloudflareContainerProvider.ts +0 -70
  864. package/src/container/core/providers/ContainerProvider.ts +0 -92
  865. package/src/container/core/providers/MockContainerProvider.ts +0 -62
  866. package/src/container/core/providers/NodeContainerProvider.ts +0 -53
  867. package/src/core/__tests__/jsonSchemaToTypeBox.spec.ts +0 -771
  868. package/src/core/helpers/jsonSchemaToTypeBox.ts +0 -359
  869. /package/dist/orm/core/{chunk-B4FMCO8f.js → rolldown-runtime-B4FMCO8f.js} +0 -0
@@ -1,12 +1,8 @@
1
1
  import { AsyncLocalStorage } from "node:async_hooks";
2
- import { Static as Static$1, StaticDecode, StaticDecode as Static, StaticEncode, StaticEncode as StaticEncode$1, TAny, TAny as TAny$1, TArray, TArray as TArray$1, TArrayOptions, TBigInt, TBoolean, TBoolean as TBoolean$1, TInteger, TInteger as TInteger$1, TInterface, TKeysToIndexer, TKeysToIndexer as TKeysToIndexer$1, TNull, TNull as TNull$1, TNumber, TNumber as TNumber$1, TNumberOptions, TNumberOptions as TNumberOptions$1, TObject, TObject as TObject$1, TObjectOptions, TObjectOptions as TObjectOptions$1, TOmit, TOptional, TOptionalAdd, TOptionalAdd as TOptionalAdd$1, TPartial, TPick, TPick as TPick$1, TProperties, TProperties as TProperties$1, TRecord, TRecord as TRecord$1, TSchema, TSchema as TSchema$1, TSchemaOptions, TString, TString as TString$1, TStringOptions, TStringOptions as TStringOptions$1, TTuple, TUnion, TUnion as TUnion$1, TUnsafe, TUnsafe as TUnsafe$1, TVoid, Type } from "typebox";
3
- import Format from "typebox/format";
4
- import { Validator } from "typebox/compile";
2
+ import { z as z$1 } from "zod";
5
3
  import { Middleware as Middleware$1 } from "alepha";
6
- import { TLocalizedValidationError } from "typebox/error";
7
4
  import { Readable } from "node:stream";
8
5
  import { ReadableStream as ReadableStream$1 } from "node:stream/web";
9
-
10
6
  //#region ../../src/core/constants/KIND.d.ts
11
7
  /**
12
8
  * Used for identifying primitives.
@@ -153,28 +149,6 @@ interface LoggerInterface {
153
149
  error(message: string, data?: unknown): void;
154
150
  }
155
151
  //#endregion
156
- //#region ../../src/core/errors/AlephaError.d.ts
157
- /**
158
- * Default error class for Alepha.
159
- */
160
- declare class AlephaError extends Error {
161
- name: string;
162
- }
163
- //#endregion
164
- //#region ../../src/core/errors/TypeBoxError.d.ts
165
- declare class TypeBoxError extends AlephaError {
166
- name: string;
167
- readonly cause: TLocalizedValidationError;
168
- readonly value: {
169
- path: string;
170
- message: string;
171
- };
172
- constructor(error: TLocalizedValidationError);
173
- }
174
- interface TypeBoxErrorParams {
175
- requiredProperties?: string[];
176
- }
177
- //#endregion
178
152
  //#region ../../src/core/helpers/FileLike.d.ts
179
153
  interface FileLike {
180
154
  /**
@@ -232,327 +206,296 @@ interface FileLike {
232
206
  /**
233
207
  * TypeBox view of FileLike.
234
208
  */
235
- type TFile = TUnsafe$1<FileLike>;
236
- declare const isTypeFile: (value: TSchema$1) => value is TFile;
209
+ type TFile = TUnsafe<FileLike>;
210
+ declare const isTypeFile: (value: TSchema) => value is TFile;
237
211
  declare const isFileLike: (value: any) => value is FileLike;
238
212
  type StreamLike = ReadableStream | ReadableStream$1 | Readable | NodeJS.ReadableStream;
239
- type TStream = TUnsafe$1<StreamLike>;
213
+ type TStream = TUnsafe<StreamLike>;
240
214
  //#endregion
241
- //#region ../../src/core/providers/TypeProvider.d.ts
242
- declare class TypeGuard {
243
- isBigInt: (value: TSchema$1) => value is TString$1;
244
- isUUID: (value: TSchema$1) => value is TString$1;
245
- isObject: typeof Type.IsObject;
246
- isNumber: typeof Type.IsNumber;
247
- isString: typeof Type.IsString;
248
- isBoolean: typeof Type.IsBoolean;
249
- isAny: typeof Type.IsAny;
250
- isArray: typeof Type.IsArray;
251
- isOptional: typeof Type.IsOptional;
252
- isUnion: typeof Type.IsUnion;
253
- isInteger: typeof Type.IsInteger;
254
- isNull: typeof Type.IsNull;
255
- isUndefined: typeof Type.IsUndefined;
256
- isUnsafe: typeof Type.IsUnsafe;
257
- isRecord: typeof Type.IsRecord;
258
- isTuple: typeof Type.IsTuple;
259
- isVoid: typeof Type.IsVoid;
260
- isLiteral: typeof Type.IsLiteral;
261
- isSchema: typeof Type.IsSchema;
262
- isScalar: (schema: TSchema$1) => boolean;
263
- isFile: (value: TSchema$1) => value is TFile;
264
- isDateTime: (schema: unknown) => boolean;
265
- isDate: (schema: unknown) => boolean;
266
- isTime: (schema: unknown) => boolean;
267
- isDuration: (schema: unknown) => boolean;
268
- }
269
- declare module "typebox" {
270
- interface TString {
271
- format?: string;
272
- minLength?: number;
273
- maxLength?: number;
215
+ //#region ../../src/core/providers/zodAugment.d.ts
216
+ /**
217
+ * Legacy-compatibility shims so typebox-era structural accessors keep working
218
+ * on zod schemas (the "short path" for the migration — avoids rewriting
219
+ * hundreds of schema-walking call-sites):
220
+ *
221
+ * typebox zod alias added here
222
+ * ---------------- ------------ ----------------
223
+ * obj.properties obj.shape .properties -> .shape
224
+ * array.items array.element .items -> .element
225
+ * union.anyOf union.options .anyOf -> .options
226
+ *
227
+ * Both the runtime (prototype getters) and the type-level (`declare module`
228
+ * interface merge) are provided, so `schema.properties` resolves and typechecks.
229
+ *
230
+ * Imported for side-effects by ZodProvider so it loads with the `z` core.
231
+ */
232
+ declare module "zod" {
233
+ interface ZodObject {
234
+ /** typebox-compat alias for {@link ZodObject.shape}. */
235
+ readonly properties: this["shape"];
274
236
  }
275
- interface TNumber {
276
- format?: "int64";
237
+ interface ZodArray {
238
+ /** typebox-compat alias for {@link ZodArray.element}. */
239
+ readonly items: this["element"];
277
240
  }
241
+ interface ZodUnion {
242
+ /** typebox-compat alias for {@link ZodUnion.options}. */
243
+ readonly anyOf: this["options"];
244
+ }
245
+ interface ZodTuple {
246
+ /** typebox-compat alias for the tuple's element schemas. */
247
+ readonly items: readonly import("zod").ZodType[];
248
+ }
249
+ }
250
+ //#endregion
251
+ //#region ../../src/core/providers/ZodProvider.d.ts
252
+ /**
253
+ * Alepha's `z` — a thin, enhanceable wrapper over zod 4 that mirrors the
254
+ * ergonomics of the legacy typebox `t` provider (same call-shapes, so existing
255
+ * `t.*` call-sites become a near-mechanical rename), while delegating all
256
+ * validation + static-type inference to zod.
257
+ *
258
+ * Design notes:
259
+ * - No encode/decode. string -> string, number -> number. Validation is a plain
260
+ * `schema.parse(value)` — zod does NOT use `Function`/`eval`, so this is safe
261
+ * inside Cloudflare Workers (unlike typebox's `Compile`).
262
+ * - Metadata (`title`, `description`, `format`, custom `~options`) rides on zod's
263
+ * native `.meta()` registry, so `z.toJSONSchema()` round-trips it for OpenAPI
264
+ * + form generation. Defaults use `.default()`.
265
+ */
266
+ type ZType = z$1.ZodType;
267
+ type ZObject<T extends z$1.ZodRawShape = any> = z$1.ZodObject<T>;
268
+ /** Replaces typebox `Static<T>`. */
269
+ type Infer<T extends z$1.ZodType> = z$1.infer<T>;
270
+ /**
271
+ * Shallow output-extraction for `T extends SomeSchema ? Static<T> : Fallback`
272
+ * conditional positions.
273
+ *
274
+ * Reads zod's `_zod.output` directly (a single shallow conditional) instead of
275
+ * first testing `T extends TRequestBody` / `TResponseBody` — those tests compare
276
+ * `T` against 5-6 member unions of deeply-recursive zod class types, and that
277
+ * structural assignability check is what trips TypeScript's instantiation-depth
278
+ * limit (TS2589) inside `$action`'s generics. The extracted type is identical to
279
+ * `Static<T>` for any real schema; non-schema `T` (e.g. `undefined`) yields
280
+ * `Fallback`.
281
+ */
282
+ type SchemaOutput<T, Fallback = any> = [T] extends [{
283
+ _zod: {
284
+ output: infer O;
285
+ };
286
+ }] ? O : Fallback;
287
+ interface SchemaOptions {
288
+ title?: string;
289
+ description?: string;
290
+ default?: unknown;
291
+ format?: string;
292
+ /** Alepha string transforms, kept for JSON-Schema round-trip parity. */
293
+ "~options"?: {
294
+ trim?: boolean;
295
+ lowercase?: boolean;
296
+ };
297
+ [key: string]: unknown;
278
298
  }
299
+ interface StringOptions extends SchemaOptions {
300
+ minLength?: number;
301
+ maxLength?: number;
302
+ pattern?: string | RegExp;
303
+ }
304
+ interface NumberOptions extends SchemaOptions {
305
+ minimum?: number;
306
+ maximum?: number;
307
+ }
308
+ interface TextOptions extends StringOptions {
309
+ size?: "short" | "regular" | "long" | "rich";
310
+ trim?: boolean;
311
+ lowercase?: boolean;
312
+ }
313
+ /** Defaults mirroring TypeProvider's static length caps. */
314
+ declare const Z_LIMITS: {
315
+ short: number;
316
+ regular: number;
317
+ long: number;
318
+ rich: number;
319
+ arrayMaxItems: number;
320
+ };
321
+ declare const z: {
322
+ /**
323
+ * Native zod coercion namespace (`z.coerce.number()`, `z.coerce.boolean()`…).
324
+ * Used at the HTTP/string boundary (query, headers, env) where everything
325
+ * arrives as a string; request bodies and the ORM stay strict (no coercion).
326
+ */
327
+ coerce: typeof z$1.coerce;
328
+ object: typeof z$1.object;
329
+ array: typeof z$1.array;
330
+ record: typeof z$1.record;
331
+ tuple: typeof z$1.tuple;
332
+ union: typeof z$1.union;
333
+ string: typeof z$1.string;
334
+ number: typeof z$1.number;
335
+ boolean: typeof z$1.boolean;
336
+ null: typeof z$1.null;
337
+ any: typeof z$1.any;
338
+ void: typeof z$1.void;
339
+ undefined: typeof z$1.undefined;
340
+ literal: typeof z$1.literal;
341
+ /** Alias for `zod.literal` (legacy `t.const`). */
342
+ const: typeof z$1.literal;
343
+ enum: typeof z$1.enum;
344
+ /** Integer — native `z.int()` (format `safeint`, drives PG INT column). */
345
+ integer: typeof z$1.int;
346
+ /** Free-form JSON object (`Record<string, any>`). */
347
+ json: () => z$1.ZodRecord<z$1.ZodString, z$1.ZodAny>;
348
+ text: (options?: TextOptions) => z$1.ZodString;
349
+ shortText: (options?: TextOptions) => z$1.ZodString;
350
+ longText: (options?: TextOptions) => z$1.ZodString;
351
+ richText: (options?: TextOptions) => z$1.ZodString;
352
+ email: () => z$1.ZodString;
353
+ uuid: () => z$1.ZodString;
354
+ url: () => z$1.ZodString;
355
+ datetime: () => z$1.ZodString;
356
+ date: () => z$1.ZodString;
357
+ time: () => z$1.ZodString;
358
+ /** bigint as a validated string (no codec). */
359
+ bigint: () => z$1.ZodString;
360
+ binary: () => z$1.ZodString;
361
+ duration: () => z$1.ZodString;
362
+ e164: () => z$1.ZodString;
363
+ bcp47: () => z$1.ZodString;
364
+ constantCase: () => z$1.ZodString;
365
+ int32: () => z$1.ZodInt;
366
+ int64: () => z$1.ZodInt;
367
+ file: (options?: {
368
+ maxSize?: number;
369
+ }) => z$1.ZodAny;
370
+ stream: () => z$1.ZodAny;
371
+ valueLabel: () => z$1.ZodObject<{
372
+ value: z$1.ZodString;
373
+ label: z$1.ZodString;
374
+ description: z$1.ZodOptional<z$1.ZodString>;
375
+ }, z$1.core.$strip>;
376
+ /** Pagination wrapper, mirrors `pageSchema(item)`. */
377
+ page: <T extends z$1.ZodType>(item: T) => z$1.ZodObject<{
378
+ content: z$1.ZodArray<T>;
379
+ page: z$1.ZodObject<{
380
+ number: z$1.ZodInt;
381
+ size: z$1.ZodInt;
382
+ offset: z$1.ZodInt;
383
+ numberOfElements: z$1.ZodInt;
384
+ totalElements: z$1.ZodOptional<z$1.ZodInt>;
385
+ totalPages: z$1.ZodOptional<z$1.ZodInt>;
386
+ isEmpty: z$1.ZodBoolean;
387
+ isFirst: z$1.ZodBoolean;
388
+ isLast: z$1.ZodBoolean;
389
+ }, z$1.core.$strip>;
390
+ }, z$1.core.$strip>;
391
+ /** Export a schema to JSON Schema (OpenAPI / form generation). */
392
+ toJSONSchema: typeof z$1.toJSONSchema;
393
+ /** Runtime type guards (`z.schema.*`) — schema introspection for ORM + forms. */
394
+ schema: {
395
+ isOptional: (s: any) => s is z$1.ZodOptional<z$1.core.$ZodType<unknown, unknown, z$1.core.$ZodTypeInternals<unknown, unknown>>>;
396
+ isDefault: (s: any) => s is z$1.ZodDefault<z$1.core.$ZodType<unknown, unknown, z$1.core.$ZodTypeInternals<unknown, unknown>>>;
397
+ isObject: (s: any) => s is z$1.ZodObject<z$1.core.$ZodLooseShape, z$1.core.$strip>;
398
+ isString: (s: any) => boolean;
399
+ isNumber: (s: any) => boolean;
400
+ isBoolean: (s: any) => s is z$1.ZodBoolean;
401
+ isArray: (s: any) => s is z$1.ZodArray<z$1.core.$ZodType<unknown, unknown, z$1.core.$ZodTypeInternals<unknown, unknown>>>;
402
+ isUnion: (s: any) => s is z$1.ZodUnion<readonly z$1.core.$ZodType<unknown, unknown, z$1.core.$ZodTypeInternals<unknown, unknown>>[]>;
403
+ isNull: (s: any) => s is z$1.ZodNull;
404
+ isRecord: (s: any) => s is z$1.ZodRecord<z$1.core.$ZodRecordKey, z$1.core.$ZodType<unknown, unknown, z$1.core.$ZodTypeInternals<unknown, unknown>>>;
405
+ isEnum: (s: any) => boolean;
406
+ isLiteral: (s: any) => boolean;
407
+ isAny: (s: any) => s is z$1.ZodAny;
408
+ isNullable: (s: any) => s is z$1.ZodNullable<z$1.core.$ZodType<unknown, unknown, z$1.core.$ZodTypeInternals<unknown, unknown>>>;
409
+ isInteger: (s: any) => boolean;
410
+ isText: (s: any) => boolean;
411
+ isDateTime: (s: any) => boolean;
412
+ isDate: (s: any) => boolean;
413
+ isTime: (s: any) => boolean;
414
+ isBigInt: (s: any) => boolean;
415
+ isUuid: (s: any) => boolean;
416
+ isEmail: (s: any) => boolean;
417
+ isUrl: (s: any) => boolean;
418
+ isBinary: (s: any) => boolean;
419
+ isUUID: (s: any) => boolean;
420
+ isScalar: (s: any) => boolean;
421
+ isSchema: (s: any) => s is z$1.ZodType<unknown, unknown, z$1.core.$ZodTypeInternals<unknown, unknown>>;
422
+ isTuple: (s: any) => s is z$1.ZodTuple<readonly z$1.core.$ZodType<unknown, unknown, z$1.core.$ZodTypeInternals<unknown, unknown>>[], z$1.core.$ZodType<unknown, unknown, z$1.core.$ZodTypeInternals<unknown, unknown>> | null>;
423
+ isUndefined: (s: any) => s is z$1.ZodUndefined;
424
+ isUnsafe: (s: any) => s is z$1.ZodAny | z$1.ZodUnknown;
425
+ isVoid: (s: any) => s is z$1.ZodVoid;
426
+ format: (s: any) => string | undefined;
427
+ /** The string values of a `ZodEnum` (typebox-compat for `value.enum`). */
428
+ enumValues: (s: any) => string[];
429
+ /** Peel optional / nullable / default wrappers to the inner schema. */
430
+ unwrap: (s: any) => any;
431
+ /**
432
+ * Read a schema's default value (peeling optional/nullable wrappers), or
433
+ * `undefined` if there is none. In zod, defaults are a `ZodDefault` wrapper
434
+ * (not a `default` data property as in typebox), so `"default" in schema`
435
+ * is NOT a valid test — every schema has a `.default()` method.
436
+ */
437
+ getDefault: (s: any) => unknown;
438
+ /** typebox-compat: the object's required (non-optional) field names. */
439
+ requiredKeys: (s: any) => string[];
440
+ };
441
+ };
442
+ type Z = typeof z;
443
+ //#endregion
444
+ //#region ../../src/core/providers/TypeProvider.d.ts
445
+ /** Raw zod namespace (legacy `Type` escape hatch). */
446
+ declare const Type: typeof z$1;
447
+ type Static<T extends ZType> = Infer<T>;
448
+ type StaticDecode<T extends ZType> = Infer<T>;
449
+ type StaticEncode<T extends ZType> = Infer<T>;
450
+ type TSchema = ZType;
451
+ type TObject<T extends z$1.ZodRawShape = any> = ZObject<T>;
452
+ type TProperties = z$1.ZodRawShape;
453
+ type TString = z$1.ZodString;
454
+ type TNumber = z$1.ZodNumber;
455
+ type TInteger = z$1.ZodNumber;
456
+ type TBoolean = z$1.ZodBoolean;
457
+ type TArray<T extends ZType = ZType> = z$1.ZodArray<T>;
458
+ type TUnion<_T extends ZType[] = ZType[]> = z$1.ZodUnion;
459
+ type TRecord = z$1.ZodRecord<any, any>;
460
+ type TTuple = ZType;
461
+ type TNull = z$1.ZodNull;
462
+ type TAny = z$1.ZodAny;
463
+ type TVoid = z$1.ZodVoid;
464
+ type TBigInt = z$1.ZodString;
465
+ type TUnsafe<_T = unknown> = ZType;
466
+ type TOptional<T extends ZType = ZType> = z$1.ZodOptional<T>;
467
+ type TOptionalAdd<T extends ZType = ZType> = z$1.ZodOptional<T>;
468
+ type TPick<T extends ZObject = ZObject, _K = unknown> = T;
469
+ type TOmit<T extends ZObject = ZObject, _K = unknown> = T;
470
+ type TPartial<_T extends ZObject = ZObject> = ZObject;
471
+ type TInterface<_T = unknown, _U = unknown> = ZObject;
472
+ type TKeysToIndexer<_T = unknown> = any;
473
+ type TSchemaOptions = SchemaOptions;
474
+ type TStringOptions = StringOptions;
475
+ type TNumberOptions = NumberOptions;
476
+ type TObjectOptions = SchemaOptions;
477
+ type TArrayOptions = SchemaOptions;
478
+ type TextLength = "short" | "regular" | "long" | "rich";
479
+ type TTextOptions = TextOptions;
480
+ interface TEnumOptions extends TextOptions {
481
+ /** `"text"` = TEXT column; omitted = a real PostgreSQL ENUM type. */
482
+ mode?: "text";
483
+ /** Custom PG ENUM type name (shared across tables). */
484
+ name?: string;
485
+ }
486
+ /** Legacy `TypeProvider` — kept for its static config knobs. */
279
487
  declare class TypeProvider {
280
- static format: typeof Format;
281
- static translateError(error: TypeBoxError, _locale?: string): string;
282
- static setLocale(_locale: string): void;
283
- static isValidBigInt(value: string | number): boolean;
284
- /**
285
- * Default maximum length for strings.
286
- *
287
- * It can be set to a larger value:
288
- * ```ts
289
- * TypeProvider.DEFAULT_STRING_MAX_LENGTH = 1000000;
290
- * TypeProvider.DEFAULT_STRING_MAX_LENGTH = undefined; // no limit (not recommended)
291
- * ```
292
- */
293
488
  static DEFAULT_STRING_MAX_LENGTH: number | undefined;
294
- /**
295
- * Maximum length for short strings, such as names or titles.
296
- */
297
489
  static DEFAULT_SHORT_STRING_MAX_LENGTH: number | undefined;
298
- /**
299
- * Maximum length for long strings, such as descriptions or comments.
300
- * It can be overridden in the string options.
301
- *
302
- * It can be set to a larger value:
303
- * ```ts
304
- * TypeProvider.DEFAULT_LONG_STRING_MAX_LENGTH = 2048;
305
- * ```
306
- */
307
490
  static DEFAULT_LONG_STRING_MAX_LENGTH: number | undefined;
308
- /**
309
- * Maximum length for rich strings, such as HTML or Markdown.
310
- * This is a large value to accommodate rich text content.
311
- * > It's also the maximum length of PG's TEXT type.
312
- *
313
- * It can be overridden in the string options.
314
- *
315
- * It can be set to a larger value:
316
- * ```ts
317
- * TypeProvider.DEFAULT_RICH_STRING_MAX_LENGTH = 1000000;
318
- * ```
319
- */
320
491
  static DEFAULT_RICH_STRING_MAX_LENGTH: number | undefined;
321
- /**
322
- * Maximum number of items in an array.
323
- * This is a default value to prevent excessive memory usage.
324
- * It can be overridden in the array options.
325
- */
326
492
  static DEFAULT_ARRAY_MAX_ITEMS: number;
327
- raw: typeof Type;
328
- any: typeof Type.Any;
329
- void: typeof Type.Void;
330
- undefined: typeof Type.Undefined;
331
- record: typeof Type.Record;
332
- union: typeof Type.Union;
333
- tuple: typeof Type.Tuple;
334
- null: typeof Type.Null;
335
- const: typeof Type.Literal;
336
- options: typeof Type.Options;
337
- /**
338
- * Type guards to check the type of schema.
339
- * This is not a runtime type check, but a compile-time type guard.
340
- *
341
- * @example
342
- * ```ts
343
- * if (t.schema.isString(schema)) {
344
- * // schema is TString
345
- * }
346
- * ```
347
- */
348
- readonly schema: TypeGuard;
349
- extend<T extends TSchema$1[], U extends TProperties$1>(schema: [...T], properties: U, options?: TSchemaOptions): TInterface<T, U>;
350
- extend<T extends TObject$1, U extends TProperties$1>(schema: T, properties: U, options?: TSchemaOptions): TInterface<[T], U>;
351
- pick<T extends TObject$1, Indexer extends PropertyKey[]>(schema: T, keys: [...Indexer], options?: TObjectOptions$1): TPick$1<T, TKeysToIndexer$1<Indexer>>;
352
- omit<T extends TObject$1, Indexer extends PropertyKey[]>(schema: T, keys: [...Indexer], options?: TObjectOptions$1): TOmit<T, TKeysToIndexer$1<Indexer>>;
353
- partial<T extends TSchema$1>(schema: T, options?: TSchemaOptions): TPartial<T>;
354
- /**
355
- * Create a schema for an object.
356
- * By default, additional properties are not allowed.
357
- *
358
- * @example
359
- * ```ts
360
- * const userSchema = t.object({
361
- * id: t.integer(),
362
- * name: t.string(),
363
- * });
364
- * ```
365
- */
366
- object<T extends TProperties$1>(properties: T, options?: TObjectOptions$1): TObject$1<T>;
367
- /**
368
- * Create a schema for an array.
369
- * By default, the maximum number of items is limited to prevent excessive memory usage.
370
- *
371
- * @see TypeProvider.DEFAULT_ARRAY_MAX_ITEMS
372
- */
373
- array<T extends TSchema$1>(schema: T, options?: TArrayOptions): TArray$1<T>;
374
- /**
375
- * Create a schema for a string.
376
- * For db or input fields, consider using `t.text()` instead, which has length limits.
377
- *
378
- * If you need a string with specific format (e.g. email, uuid), consider using the corresponding method (e.g. `t.email()`, `t.uuid()`).
379
- */
380
- string(options?: TStringOptions$1): TString$1;
381
- /**
382
- * Create a schema for a string with length limits.
383
- * For internal strings without length limits, consider using `t.string()` instead.
384
- *
385
- * Default size is "regular", which has a max length of 255 characters.
386
- */
387
- text(options?: TTextOptions): TString$1;
388
- /**
389
- * Create a schema for a JSON object.
390
- * This is a record with string keys and any values.
391
- */
392
- json<T = any>(options?: TSchemaOptions): TRecord$1<string, TAny$1>;
393
- /**
394
- * Create a schema for a boolean.
395
- */
396
- boolean(options?: TSchemaOptions): TBoolean$1;
397
- /**
398
- * Create a schema for a number.
399
- */
400
- number(options?: TNumberOptions$1): TNumber$1;
401
- /**
402
- * Create a schema for an integer.
403
- */
404
- integer(options?: TNumberOptions$1): TInteger$1;
405
- int32(options?: TNumberOptions$1): TInteger$1;
406
- /**
407
- * Mimic a signed 64-bit integer.
408
- *
409
- * This is NOT a true int64, as JavaScript cannot represent all int64 values.
410
- * It is a number that is an integer and between -9007199254740991 and 9007199254740991.
411
- * Use `t.bigint()` for true int64 values represented as strings.
412
- */
413
- int64(options?: TNumberOptions$1): TNumber$1;
414
- /**
415
- * Make a schema optional.
416
- */
417
- optional<T extends TSchema$1>(schema: T): TOptionalAdd$1<T>;
418
- /**
419
- * Make a schema nullable.
420
- */
421
- nullable<T extends TSchema$1>(schema: T, options?: TObjectOptions$1): TUnion$1<[TNull$1, T]>;
422
- /**
423
- * Create a schema that maps all properties of an object schema to nullable.
424
- */
425
- nullify: (schema: TSchema$1, options?: TObjectOptions$1) => TSchema$1;
426
- /**
427
- * Create a schema for a string enum.
428
- *
429
- * By default, this creates a real PostgreSQL ENUM type in the database.
430
- * Use `{ mode: "text" }` to store as a TEXT column instead.
431
- *
432
- * @example
433
- * ```ts
434
- * // PostgreSQL ENUM type (default)
435
- * status: t.enum(["pending", "active", "archived"])
436
- *
437
- * // TEXT column
438
- * status: t.enum(["pending", "active", "archived"], { mode: "text" })
439
- *
440
- * // Shared enum name across tables
441
- * status: t.enum(["enabled", "disabled"], { name: "shared_status_enum" })
442
- * ```
443
- */
444
- enum<T extends string[]>(values: [...T], options?: TEnumOptions): TUnsafe$1<T[number]>;
445
- /**
446
- * Create a schema for a bigint represented as a string.
447
- * This is a string that validates bigint format (e.g. "123456789").
448
- */
449
- bigint(options?: TStringOptions$1): TString$1;
450
- /**
451
- * Create a schema for a URL represented as a string.
452
- */
453
- url(options?: TStringOptions$1): TString$1;
454
- /**
455
- * Create a schema for binary data represented as a base64 string.
456
- */
457
- binary(options?: TStringOptions$1): TString$1;
458
- /**
459
- * Create a schema for uuid.
460
- */
461
- uuid(options?: TStringOptions$1): TString$1;
462
- /**
463
- * Create a schema for a file-like object.
464
- *
465
- * File like mimics the File API in browsers, but is adapted to work in Node.js as well.
466
- *
467
- * Implementation of file-like objects is handled by "alepha/file" package.
468
- */
469
- file(options?: {
470
- maxSize?: number;
471
- }): TFile;
472
- /**
473
- * @experimental
474
- */
475
- stream(): TStream;
476
- email(options?: TStringOptions$1): TString$1;
477
- e164(options?: TStringOptions$1): TString$1;
478
- bcp47(options?: TStringOptions$1): TString$1;
479
- /**
480
- * Create a schema for short text, such as names or titles.
481
- * Default max length is 64 characters.
482
- */
483
- shortText(options?: TStringOptions$1): TString$1;
484
- /**
485
- * Create a schema for long text, such as descriptions or comments.
486
- * Default max length is 1024 characters.
487
- */
488
- longText(options?: TStringOptions$1): TString$1;
489
- /**
490
- * Create a schema for rich text, such as HTML or Markdown.
491
- * Default max length is 65535 characters.
492
- */
493
- richText(options?: TStringOptions$1): TString$1;
494
- /**
495
- * Create a schema for a constant case string e.g. LIKE_THIS.
496
- */
497
- constantCase: (options?: TStringOptions$1) => TString$1;
498
- /**
499
- * Create a schema for an object with a value and label.
500
- */
501
- valueLabel: (options?: TObjectOptions$1) => TObject$1<{
502
- value: TString$1;
503
- label: TString$1;
504
- description: Type.TOptional<TString$1>;
505
- }>;
506
- datetime: (options?: TStringOptions$1) => TString$1;
507
- date: (options?: TStringOptions$1) => TString$1;
508
- time: (options?: TStringOptions$1) => TString$1;
509
- duration: (options?: TStringOptions$1) => TString$1;
510
- }
511
- type TextLength = "short" | "regular" | "long" | "rich";
512
- interface TEnumOptions extends TTextOptions {
513
- /**
514
- * Storage mode for the enum.
515
- *
516
- * - `"text"` — stores as a TEXT column in the database.
517
- * - When omitted, creates a real PostgreSQL ENUM type.
518
- */
519
- mode?: "text";
520
- /**
521
- * Custom name for the PostgreSQL ENUM type.
522
- *
523
- * Use this to share the same enum type across multiple tables.
524
- * If not specified, the name is auto-generated from the table and column names.
525
- */
526
- name?: string;
527
- }
528
- interface TTextOptions extends TStringOptions$1 {
529
- /**
530
- * Predefined size of the text.
531
- *
532
- * - `short` - short text, such as names or titles. Default max length is 64 characters.
533
- * - `regular` - regular text, such as single-line input. Default max length is 255 characters.
534
- * - `long` - long text, such as descriptions or comments. Default max length is 1024 characters.
535
- * - `rich` - rich text, such as HTML or Markdown. Default max length is 65535 characters.
536
- *
537
- * You can override the default max length by specifying `maxLength` in the options.
538
- *
539
- * @default "regular"
540
- */
541
- size?: TextLength;
542
- /**
543
- * Trim whitespace from both ends of the string.
544
- *
545
- * @default true
546
- */
547
- trim?: boolean;
548
- /**
549
- * Convert the string to lowercase.
550
- *
551
- * @default false
552
- */
553
- lowercase?: boolean;
493
+ static translateError: (error: {
494
+ message?: string;
495
+ }, _locale?: string) => string;
496
+ static setLocale: (_locale: string) => void;
497
+ static isValidBigInt: (value: string | number) => boolean;
554
498
  }
555
- declare const t: TypeProvider;
556
499
  //#endregion
557
500
  //#region ../../src/core/primitives/$atom.d.ts
558
501
  /**
@@ -566,16 +509,16 @@ declare const t: TypeProvider;
566
509
  * You control how state is structured and validated.
567
510
  *
568
511
  * Features:
569
- * - Set a schema for validation
570
- * - Set a default value for initial state
571
- * - Rules, like read-only, custom validation, etc.
572
- * - Automatic getter access in services with {@link $use}
512
+ * - Schema validation on every write (invalid writes throw)
513
+ * - Default value for initial state
514
+ * - Automatic getter access in services with {@link $state}
573
515
  * - SSR support (server state automatically serialized and hydrated on client)
574
- * - React integration (useAtom hook for automatic component re-renders)
575
- * - Middleware
576
- * - Persistence adapters (localStorage, Redis, database, file system, cookie, etc.)
577
- * - State migrations (version upgrades when schema changes)
578
- * - Documentation generation & devtools integration
516
+ * - React integration (useStore / useSelector hooks for automatic re-renders)
517
+ * - Derived values with {@link $computed} (useComputed hook)
518
+ * - Persistence adapters: cookie (SSR-safe), localStorage, sessionStorage
519
+ * - `serverOnly` flag to keep an atom out of the hydration payload
520
+ * - reset / watch helpers on the state manager
521
+ * - Documentation generation & devtools integration (mutation log)
579
522
  *
580
523
  * Common use cases:
581
524
  * - user preferences
@@ -588,27 +531,166 @@ declare const t: TypeProvider;
588
531
  * If you need to store complex data, consider using identifiers or references instead.
589
532
  */
590
533
  declare const $atom: {
591
- <T extends TObject<TProperties$2> | TArray$1, N extends string>(options: AtomOptions<T, N>): Atom<T, N>;
534
+ <T extends ZType, N extends string>(options: AtomOptions<T, N>): Atom<T, N>;
592
535
  [KIND]: string;
593
536
  };
594
- type AtomOptions<T extends TAtomObject, N extends string> = {
537
+ /**
538
+ * Persistence adapter for an atom.
539
+ */
540
+ type AtomPersist = "cookie" | "localStorage" | "sessionStorage";
541
+ type AtomOptions<T extends ZType, N extends string> = {
595
542
  name: N;
596
543
  schema: T;
597
544
  description?: string;
598
- } & (T extends TOptionalAdd<T> ? {
545
+ /**
546
+ * Persist this atom outside the in-memory store.
547
+ *
548
+ * - `"cookie"` — synced to an HTTP cookie by the `alepha/server/cookies`
549
+ * module. Works on the server AND in the browser, so it is the only
550
+ * correct adapter for SSR apps: the server reads it while rendering and
551
+ * the first paint matches the persisted state.
552
+ * - `"localStorage"` / `"sessionStorage"` — browser Web Storage. Fine for
553
+ * pure SPA apps. The server cannot see these values; registering such
554
+ * an atom during SSR logs a warning.
555
+ *
556
+ * Values are validated against the schema when read back; invalid or
557
+ * corrupted entries are discarded and the default is used.
558
+ *
559
+ * **Security: cookie-persisted atoms are attacker-controlled.** The
560
+ * cookie written by `persist: "cookie"` is unsigned, unencrypted, and
561
+ * freely writable by any client-side script (`AtomCookiePersistence`'s
562
+ * `cookieOptions()` sets no `sign`, `encrypt`, or `httpOnly`) — a request
563
+ * can present any value it wants for it. Never persist trust-bearing
564
+ * state — user ids, roles, entitlements, permissions — in a
565
+ * `persist: "cookie"` atom. If you need a signed, encrypted, and/or
566
+ * `httpOnly` cookie, declare an explicit
567
+ * `$cookie({ key: atom.key, sign: true, encrypt: true, httpOnly: true, ... })`
568
+ * binding instead — that is the escape hatch for trust-bearing values.
569
+ */
570
+ persist?: AtomPersist;
571
+ /**
572
+ * Exclude this atom from the SSR hydration export
573
+ * (`StateManager.exportAtoms()`).
574
+ *
575
+ * This is the ONLY guarantee `serverOnly` makes: the value is never
576
+ * written into the `<script id="__ssr">` JSON block serialized into the
577
+ * HTML payload. It says nothing about any other channel a value can
578
+ * reach the browser through.
579
+ *
580
+ * **Cannot be combined with `persist`.** Every persistence adapter
581
+ * (`"cookie"`, `"localStorage"`, `"sessionStorage"`) targets the browser
582
+ * by definition — cookie persistence ships the value in a `Set-Cookie`
583
+ * response header, and web-storage persistence IS the browser. Declaring
584
+ * `serverOnly: true` together with any `persist` value throws
585
+ * `AlephaError` at `$atom()` call time, because the persistence channel
586
+ * would leak the exact value `serverOnly` is meant to keep server-side.
587
+ *
588
+ * Use `serverOnly` for atoms that may hold secrets or internal
589
+ * request-scoped state that must never leave the server, and never pair
590
+ * it with `persist`.
591
+ *
592
+ * **Never make a `serverOnly` atom a dependency of a `$computed` that the
593
+ * browser reads through `useComputed`.** A computed is re-derived, never
594
+ * serialized: the server derives it from the atom's real value, and the
595
+ * browser — which never received that value — re-derives it from the
596
+ * atom's default. The two disagree, producing a React hydration mismatch
597
+ * and a silently wrong value from then on. Keep such a computed
598
+ * server-side (`alepha.store.get`), or derive it from atoms that ship.
599
+ */
600
+ serverOnly?: boolean;
601
+ } & (T extends z$1.ZodOptional<any> ? {
599
602
  default?: Static<T>;
600
603
  } : {
601
604
  default: Static<T>;
602
605
  });
603
- declare class Atom<T extends TAtomObject = TObject, N extends string = string> {
606
+ declare class Atom<T extends ZType = TObject, N extends string = string> {
604
607
  readonly options: AtomOptions<T, N>;
605
608
  get schema(): T;
606
609
  get key(): N;
607
610
  constructor(options: AtomOptions<T, N>);
608
611
  }
609
- type TProperties$2 = any;
610
- type TAtomObject = TObject<any> | TArray$1;
611
- type AtomStatic<T extends TAtomObject> = T extends TOptionalAdd<T> ? Static<T> | undefined : Static<T>;
612
+ type TAtomObject = ZType;
613
+ type AtomStatic<T extends ZType> = T extends z$1.ZodOptional<any> ? Static<T> | undefined : Static<T>;
614
+ //#endregion
615
+ //#region ../../src/core/primitives/$computed.d.ts
616
+ /**
617
+ * Define a derived, read-only value computed from one or more atoms
618
+ * (or other computed values).
619
+ *
620
+ * Dependencies are declared statically, which keeps the data flow explicit
621
+ * and lets subscribers know exactly which mutations invalidate the value.
622
+ *
623
+ * Computed values are never stored, serialized, hydrated, or persisted —
624
+ * they are recomputed from their dependencies on every read, so they are
625
+ * always correct inside request-scoped (fork) state on the server.
626
+ *
627
+ * ```ts
628
+ * const cartTotal = $computed({
629
+ * name: "cartTotal",
630
+ * deps: [cartAtom],
631
+ * get: (cart) => cart.items.reduce((sum, it) => sum + it.price, 0),
632
+ * });
633
+ *
634
+ * alepha.store.get(cartTotal); // number
635
+ * ```
636
+ *
637
+ * ### Footgun: a `serverOnly` dependency breaks hydration
638
+ *
639
+ * A computed whose deps include a `serverOnly` atom will NOT agree across the
640
+ * SSR boundary. `serverOnly` keeps the atom out of the hydration payload, so
641
+ * the server derives the value from the atom's real value while the browser
642
+ * re-derives it from the atom's *default* — React then hydrates a DOM that
643
+ * does not match the markup it received (a hydration mismatch, and a
644
+ * silently wrong value afterwards).
645
+ *
646
+ * Either keep the computed server-side only (read it via `alepha.store.get`,
647
+ * never through `useComputed`), or derive it from atoms that ship to the
648
+ * browser. Note this cuts the other way too: if the value is safe to send to
649
+ * the browser, the dependency should not have been `serverOnly` to begin
650
+ * with.
651
+ */
652
+ declare const $computed: {
653
+ <const D extends ReadonlyArray<AnyDep>, R, N extends string = string>(options: ComputedOptions<D, R, N>): Computed<R, N>;
654
+ [KIND]: string;
655
+ };
656
+ type AnyDep = Atom<any, any> | Computed<any, any>;
657
+ type DepValues<D extends ReadonlyArray<AnyDep>> = { [K in keyof D]: D[K] extends Atom<infer T, any> ? AtomStatic<T> : D[K] extends Computed<infer R2, any> ? R2 : never; };
658
+ interface ComputedOptions<D extends ReadonlyArray<AnyDep>, R, N extends string = string> {
659
+ name: N;
660
+ deps: D;
661
+ get: (...values: DepValues<D>) => R;
662
+ description?: string;
663
+ }
664
+ declare class Computed<R = unknown, N extends string = string> {
665
+ readonly options: ComputedOptions<any, R, N>;
666
+ constructor(options: ComputedOptions<any, R, N>);
667
+ get key(): N;
668
+ /**
669
+ * Reentrancy guard for {@link keys}. Deps are declared as a `readonly`
670
+ * array at construction time, so a cycle can't be built through the
671
+ * public API — but the array itself isn't frozen, so nothing stops a
672
+ * caller from reaching in and creating one anyway. Without this guard,
673
+ * a cycle would recurse until the JS engine throws a native
674
+ * `RangeError`, which violates the repo's "never throw a bare `Error`"
675
+ * convention.
676
+ */
677
+ protected resolvingKeys: boolean;
678
+ /**
679
+ * Reentrancy guard for {@link compute}, same rationale as
680
+ * {@link resolvingKeys}.
681
+ */
682
+ protected computing: boolean;
683
+ /**
684
+ * Transitive atom keys this computed value depends on. Subscribers
685
+ * (useComputed, StateManager.watch) use this to know which `state:mutate`
686
+ * events invalidate the value.
687
+ */
688
+ keys(): string[];
689
+ /**
690
+ * Resolve the value using the given dependency resolver.
691
+ */
692
+ compute(resolve: (dep: AnyDep) => unknown): R;
693
+ }
612
694
  //#endregion
613
695
  //#region ../../src/core/primitives/$inject.d.ts
614
696
  /**
@@ -803,6 +885,17 @@ declare class AlsProvider {
803
885
  run<R>(callback: () => R, data?: Record<string, any>): R;
804
886
  exists(): boolean;
805
887
  get<T>(key: string, scope?: StateScope): T | undefined;
888
+ /**
889
+ * Return the raw ALS layer object that owns `key`, walking from the
890
+ * current layer up through parent forks — the same resolution order as
891
+ * the default-scope branch of {@link get}. Returns `undefined` when no
892
+ * active ALS layer (current or any ancestor) has the key.
893
+ *
894
+ * Used by `StateManager.register()` to decode a value in place, in
895
+ * whichever fork layer it physically lives, instead of flattening
896
+ * fork-scoped state into the app-level store.
897
+ */
898
+ getLayer(key: string): AsyncLocalStorageData | undefined;
806
899
  has(key: string): boolean;
807
900
  set<T>(key: string, value: T): void;
808
901
  }
@@ -842,9 +935,9 @@ declare class JsonSchemaCodec extends SchemaCodec {
842
935
  protected readonly json: Json;
843
936
  protected readonly encoder: TextEncoder;
844
937
  protected readonly decoder: TextDecoder;
845
- encodeToString<T extends TSchema$1>(schema: T, value: Static<T>): string;
846
- encodeToBinary<T extends TSchema$1>(schema: T, value: Static<T>): Uint8Array;
847
- decode<T>(schema: TSchema$1, value: unknown): T;
938
+ encodeToString<T extends TSchema>(schema: T, value: Static<T>): string;
939
+ encodeToBinary<T extends TSchema>(schema: T, value: Static<T>): Uint8Array;
940
+ decode<T>(schema: TSchema, value: unknown): T;
848
941
  }
849
942
  //#endregion
850
943
  //#region ../../src/core/providers/KeylessJsonSchemaCodec.d.ts
@@ -868,7 +961,7 @@ interface KeylessCodecOptions {
868
961
  * to be a simple JSON array instead of an object with keys.
869
962
  */
870
963
  declare class KeylessJsonSchemaCodec extends SchemaCodec {
871
- protected readonly cache: Map<TSchema$1, KeylessCodec<any>>;
964
+ protected readonly cache: Map<import("alepha").ZType, KeylessCodec<any>>;
872
965
  protected readonly textEncoder: TextEncoder;
873
966
  protected readonly textDecoder: TextDecoder;
874
967
  protected varCounter: number;
@@ -885,15 +978,15 @@ declare class KeylessJsonSchemaCodec extends SchemaCodec {
885
978
  /**
886
979
  * Encode value to a keyless JSON string.
887
980
  */
888
- encodeToString<T extends TSchema$1>(schema: T, value: Static<T>): string;
981
+ encodeToString<T extends TSchema>(schema: T, value: Static<T>): string;
889
982
  /**
890
983
  * Encode value to binary (UTF-8 encoded keyless JSON).
891
984
  */
892
- encodeToBinary<T extends TSchema$1>(schema: T, value: Static<T>): Uint8Array;
985
+ encodeToBinary<T extends TSchema>(schema: T, value: Static<T>): Uint8Array;
893
986
  /**
894
987
  * Decode keyless JSON string or binary to value.
895
988
  */
896
- decode<T>(schema: TSchema$1, value: unknown): T;
989
+ decode<T>(schema: TSchema, value: unknown): T;
897
990
  /**
898
991
  * Test if `new Function()` is available (not blocked by CSP).
899
992
  */
@@ -902,80 +995,70 @@ declare class KeylessJsonSchemaCodec extends SchemaCodec {
902
995
  * Get a compiled codec for the given schema.
903
996
  * Codecs are cached for reuse.
904
997
  */
905
- protected getCodec<T>(schema: TSchema$1): KeylessCodec<T>;
998
+ protected getCodec<T>(schema: TSchema): KeylessCodec<T>;
906
999
  protected nextVar(): string;
907
1000
  /**
908
1001
  * Compile codec using `new Function()` for maximum performance.
909
1002
  * Only used when CSP allows and useFunctionCompilation is true.
910
1003
  */
911
- protected compileWithFunction(schema: TSchema$1): KeylessCodec;
1004
+ protected compileWithFunction(schema: TSchema): KeylessCodec;
912
1005
  /**
913
1006
  * Compile codec using interpreter-based approach.
914
1007
  * Safer (no eval/Function) but slower. Used in browser by default.
915
1008
  */
916
- protected compileInterpreted(schema: TSchema$1): KeylessCodec;
917
- protected interpretEncode(schema: TSchema$1, value: any): any;
918
- protected interpretDecode(schema: TSchema$1, ctx: {
1009
+ protected compileInterpreted(schema: TSchema): KeylessCodec;
1010
+ protected interpretEncode(schema: TSchema, value: any): any;
1011
+ protected interpretDecode(schema: TSchema, ctx: {
919
1012
  arr: any[];
920
1013
  i: number;
921
1014
  }): any;
922
- protected interpretDecodeFromValue(schema: TSchema$1, value: any): any;
923
- protected genEnc(schema: TSchema$1, ve: string): string;
924
- protected genDec(schema: TSchema$1): {
1015
+ protected interpretDecodeFromValue(schema: TSchema, value: any): any;
1016
+ protected genEnc(schema: TSchema, ve: string): string;
1017
+ protected genDec(schema: TSchema): {
925
1018
  code: string;
926
1019
  result: string;
927
1020
  };
928
- protected genDecFromValue(schema: TSchema$1, expr: string): string;
929
- protected isLeaf(schema: TSchema$1): boolean;
930
- protected getObjectFields(schema: TObject$1): Array<{
1021
+ protected genDecFromValue(schema: TSchema, expr: string): string;
1022
+ protected isLeaf(schema: TSchema): boolean;
1023
+ protected getObjectFields(schema: TObject): Array<{
931
1024
  key: string;
932
1025
  isOpt: boolean;
933
1026
  isNullable: boolean;
934
- inner: TSchema$1;
1027
+ inner: TSchema;
935
1028
  }>;
936
- protected isEnum(schema: TSchema$1): boolean;
937
- protected isNullable(schema: TSchema$1): boolean;
938
- protected unwrap(schema: TSchema$1): TSchema$1;
1029
+ protected isEnum(schema: TSchema): boolean;
1030
+ protected isNullable(schema: TSchema): boolean;
1031
+ protected unwrap(schema: TSchema): TSchema;
939
1032
  /**
940
1033
  * Reconstruct an object from a parsed array (for when input is already parsed).
941
1034
  */
942
- protected reconstructObject(schema: TSchema$1, arr: any[]): any;
1035
+ protected reconstructObject(schema: TSchema, arr: any[]): any;
943
1036
  }
944
1037
  //#endregion
945
1038
  //#region ../../src/core/providers/SchemaValidator.d.ts
946
- declare class SchemaValidator {
947
- protected cache: Map<TSchema$1, Validator<import("typebox").TProperties, TSchema$1, unknown, unknown>>;
948
- protected useEval: boolean;
949
- /**
950
- * Validate the value against the provided schema.
951
- *
952
- * Validation create a new value by applying some preprocessing. (e.g., trimming text)
953
- */
954
- validate<T extends TSchema$1>(schema: T, value: unknown, options?: ValidateOptions): Static<T>;
955
- /**
956
- * Deep clone a schema. Useful when a schema is going to be mutated.
957
- */
958
- clone<T extends TSchema$1>(schema: T): T;
959
- protected getValidator<T extends TSchema$1>(schema: T): Validator<{}, T>;
960
- /**
961
- * Preprocess the value based on the schema before validation.
962
- *
963
- * - If the value is `null` and the schema does not allow `null`, it converts it to `undefined`.
964
- * - If the value is a string and the schema has a `~options.trim` flag, it trims whitespace from the string.
965
- */
966
- beforeParse(schema: any, value: any, options: ValidateOptions): any;
967
- /**
968
- * Used by `beforeParse` to determine if a schema allows null values.
969
- */
970
- protected isSchemaNullable: (schema: any) => boolean;
971
- protected onConfigure: import("alepha").HookPrimitive<"configure">;
972
- protected canEval(): boolean;
973
- }
974
1039
  interface ValidateOptions {
975
1040
  trim?: boolean;
976
1041
  nullToUndefined?: boolean;
977
1042
  deleteUndefined?: boolean;
978
1043
  }
1044
+ /**
1045
+ * Validates + coerces a value against a zod schema.
1046
+ *
1047
+ * Trimming / lowercasing / defaults / unknown-key stripping all live in the
1048
+ * schema itself now (zod), so this is a thin wrapper over `schema.parse`.
1049
+ * No typebox `Compile`, no `eval` — safe inside Cloudflare Workers.
1050
+ */
1051
+ declare class SchemaValidator {
1052
+ validate<T extends TSchema>(schema: T, value: unknown, _options?: ValidateOptions): Static<T>;
1053
+ safeValidate<T extends TSchema>(schema: T, value: unknown): import("zod").ZodSafeParseResult<import("zod").output<T>>;
1054
+ /** Zod schemas are immutable — clone is a pass-through. */
1055
+ clone<T extends TSchema>(schema: T): T;
1056
+ /**
1057
+ * Legacy pre-processing entry point. Coercion now happens inside `parse`,
1058
+ * so this is a no-op kept for call-site compatibility.
1059
+ */
1060
+ beforeParse(_schema: unknown, value: unknown, _options?: ValidateOptions): unknown;
1061
+ }
979
1062
  //#endregion
980
1063
  //#region ../../src/core/providers/CodecManager.d.ts
981
1064
  type Encoding = "object" | "string" | "binary";
@@ -999,7 +1082,7 @@ interface EncodeOptions<T extends Encoding = Encoding> {
999
1082
  */
1000
1083
  validation?: ValidateOptions | false;
1001
1084
  }
1002
- type EncodeResult<T extends TSchema$1, E extends Encoding> = E extends "string" ? string : E extends "binary" ? Uint8Array : StaticEncode$1<T>;
1085
+ type EncodeResult<T extends TSchema, E extends Encoding> = E extends "string" ? string : E extends "binary" ? Uint8Array : StaticEncode<T>;
1003
1086
  interface DecodeOptions {
1004
1087
  /**
1005
1088
  * The encoder to use (e.g., 'json', 'protobuf', 'msgpack')
@@ -1038,17 +1121,17 @@ declare class CodecManager {
1038
1121
  /**
1039
1122
  * Encode data using the specified codec and output format.
1040
1123
  */
1041
- encode<T extends TSchema$1, E extends Encoding = "object">(schema: T, value: unknown, options?: EncodeOptions<E>): EncodeResult<T, E>;
1124
+ encode<T extends TSchema, E extends Encoding = "object">(schema: T, value: unknown, options?: EncodeOptions<E>): EncodeResult<T, E>;
1042
1125
  /**
1043
1126
  * Decode data using the specified codec.
1044
1127
  */
1045
- decode<T extends TSchema$1>(schema: T, data: any, options?: DecodeOptions): Static<T>;
1128
+ decode<T extends TSchema>(schema: T, data: any, options?: DecodeOptions): Static<T>;
1046
1129
  /**
1047
1130
  * Validate decoded data against the schema.
1048
1131
  *
1049
1132
  * This is automatically called before encoding or after decoding.
1050
1133
  */
1051
- validate<T extends TSchema$1>(schema: T, value: unknown, options?: ValidateOptions): Static<T>;
1134
+ validate<T extends TSchema>(schema: T, value: unknown, options?: ValidateOptions): Static<T>;
1052
1135
  }
1053
1136
  interface CodecRegisterOptions {
1054
1137
  name: string;
@@ -1147,7 +1230,8 @@ declare class StateManager<State$1 extends object = State> {
1147
1230
  protected readonly als: AlsProvider;
1148
1231
  protected readonly events: EventManager;
1149
1232
  protected readonly codec: JsonSchemaCodec;
1150
- protected readonly atoms: Map<keyof State$1, Atom<TObject$1<import("typebox").TProperties>, string>>;
1233
+ protected readonly validator: SchemaValidator;
1234
+ protected readonly atoms: Map<keyof State$1, Atom<TObject, string>>;
1151
1235
  protected store: Partial<State$1>;
1152
1236
  constructor(store?: Partial<State$1>);
1153
1237
  /**
@@ -1162,7 +1246,98 @@ declare class StateManager<State$1 extends object = State> {
1162
1246
  */
1163
1247
  exportAtoms(scope?: "current" | "app"): Record<string, unknown>;
1164
1248
  getAtoms(context?: boolean): Array<AtomWithValue>;
1249
+ /**
1250
+ * Return the registered atom for a state key, if any.
1251
+ */
1252
+ getAtom(key: string): Atom | undefined;
1253
+ /**
1254
+ * Every atom registered so far, whatever store layer (if any) currently
1255
+ * holds its value.
1256
+ *
1257
+ * This is the order-independent way to discover atoms. The
1258
+ * `"state:register"` event fires exactly once per key and `EventManager`
1259
+ * has no replay buffer, so a service instantiated after an atom registered
1260
+ * never hears about it — a real hazard, since `$module.register()`
1261
+ * registers `atoms[]` BEFORE it wires `imports[]` and injects `services[]`.
1262
+ * Services that act on atoms (e.g. the cookie persistence adapter) must
1263
+ * read this registry on demand rather than build their own map from the
1264
+ * event.
1265
+ */
1266
+ listAtoms(): Array<Atom>;
1165
1267
  register(atom: Atom<any>): this;
1268
+ /**
1269
+ * Install the atom's declared default into the app-level store.
1270
+ *
1271
+ * Deliberately bypasses {@link set}, for two reasons:
1272
+ *
1273
+ * 1. `set()` short-circuits when the new value equals the currently
1274
+ * *resolved* value (`prevValue === value` for non-objects) — inside a
1275
+ * fork that already holds the same primitive value, the app-store write
1276
+ * would simply never happen.
1277
+ * 2. A registration seed is initialisation, NOT a mutation, so it must not
1278
+ * emit `state:mutate`. Persistence adapters listen on that event: an
1279
+ * atom registering lazily mid-request would otherwise emit a mutation
1280
+ * carrying its *default*, and the cookie adapter would dutifully write
1281
+ * it back as a `Set-Cookie` — overwriting the very cookie the request
1282
+ * arrived with.
1283
+ *
1284
+ * A `undefined` default (only reachable for an optional schema) is not
1285
+ * written at all, so the key stays absent from the store — matching the
1286
+ * previous behaviour of `set(key, undefined)`.
1287
+ */
1288
+ protected seedDefault(atom: Atom<any>, key: keyof State$1): void;
1289
+ /**
1290
+ * A fresh, schema-validated copy of the atom's declared default.
1291
+ *
1292
+ * `atom.options.default` is a module-level object shared by every
1293
+ * container and every request in the process. Handing that exact reference
1294
+ * to the store would let an ordinary `store.mut(atom, s => ...)` mutate the
1295
+ * declaration itself, permanently and process-wide. Every other write path
1296
+ * round-trips through the validator (zod always returns a new object), so
1297
+ * these must too.
1298
+ */
1299
+ protected cloneDefault(atom: Atom<any>): unknown;
1300
+ /**
1301
+ * Decode a value that already exists under an atom's key at registration
1302
+ * time, in place, in whichever layer it physically lives (an ALS fork
1303
+ * layer or the app store) — never flattening a fork-scoped value into the
1304
+ * app-level store.
1305
+ *
1306
+ * On schema mismatch, falls back to the atom's default (written into that
1307
+ * same layer) and emits a warning: a bad seed silently reverting a whole
1308
+ * atom to its defaults should be visible, not indistinguishable from
1309
+ * "nothing was ever set".
1310
+ */
1311
+ protected decodeExisting(atom: Atom<any>, key: keyof State$1, layer: Record<string, any>): void;
1312
+ /**
1313
+ * Web-storage persistence (localStorage / sessionStorage) for atoms
1314
+ * declared with `persist`. Best-effort: quota errors and privacy modes
1315
+ * are swallowed. Cookie persistence is NOT handled here — it needs the
1316
+ * HTTP request cycle and lives in `alepha/server/cookies`
1317
+ * (AtomCookiePersistence), which discovers its atoms through
1318
+ * {@link listAtoms}. Both adapters are therefore registration-order
1319
+ * independent: one `persist` option, one reliability contract.
1320
+ */
1321
+ protected bindWebStorage(atom: Atom<any>): void;
1322
+ /**
1323
+ * Best-effort `Storage#removeItem`. Some privacy modes throw on every
1324
+ * Storage method, including `removeItem` — this must never escape a
1325
+ * recovery `catch`, or persistence stops being best-effort.
1326
+ */
1327
+ protected safeRemoveItem(storage: Storage, key: string): void;
1328
+ /**
1329
+ * Resolve a Web Storage area, or undefined when unavailable (server,
1330
+ * privacy mode that throws on access).
1331
+ */
1332
+ protected getWebStorage(kind: "localStorage" | "sessionStorage"): Storage | undefined;
1333
+ /**
1334
+ * Best-effort logger lookup. `StateManager` lives in `core`, which cannot
1335
+ * depend on the logger module, so this reads the `"alepha.logger"` state
1336
+ * key directly (set by `Alepha.create()`, see `Alepha.ts`) instead of
1337
+ * injecting a logger service. May be `undefined` during early boot, before
1338
+ * the logger is wired up — callers must stay null-safe.
1339
+ */
1340
+ protected get logger(): LoggerInterface | undefined;
1166
1341
  /**
1167
1342
  * Get a value from the state with proper typing.
1168
1343
  *
@@ -1172,6 +1347,7 @@ declare class StateManager<State$1 extends object = State> {
1172
1347
  * - `"parent"`: Read only from the immediate parent fork layer.
1173
1348
  * - `"app"`: Read only from the root (app-level) store.
1174
1349
  */
1350
+ get<R>(target: Computed<R>, scope?: StateScope): R;
1175
1351
  get<T extends TAtomObject>(target: Atom<T>, scope?: StateScope): Static<T>;
1176
1352
  get<Key extends keyof State$1>(target: Key, scope?: StateScope): State$1[Key] | undefined;
1177
1353
  /**
@@ -1179,10 +1355,38 @@ declare class StateManager<State$1 extends object = State> {
1179
1355
  */
1180
1356
  set<T extends TAtomObject>(target: Atom<T>, value: AtomStatic<T>, options?: SetStateOptions): this;
1181
1357
  set<Key extends keyof State$1>(target: Key, value: State$1[Key] | undefined, options?: SetStateOptions): this;
1358
+ /**
1359
+ * Reset an atom back to its declared default value.
1360
+ */
1361
+ reset<T extends TAtomObject>(atom: Atom<T>): this;
1362
+ /**
1363
+ * Observe mutations of an atom, a computed value, or a raw state key
1364
+ * outside React. Returns an unsubscribe function.
1365
+ *
1366
+ * **`Computed` overload, server-side caveat.** A computed has no stored
1367
+ * value, so the watcher keeps the last computed result in a single `prev`
1368
+ * closure variable, created once at subscription time and shared by every
1369
+ * invocation. Request-scoped (fork) state is not: two concurrent requests
1370
+ * resolve different values for the same dependency atoms. So the
1371
+ * `prevValue` handed to the callback is "the value this watcher computed
1372
+ * last time it fired", which may well have been computed inside a
1373
+ * *different* request's fork. `value` is always correct (it is computed
1374
+ * fresh, inside the mutating context); only `prevValue` can cross request
1375
+ * boundaries.
1376
+ *
1377
+ * That is fine for `watch`'s intended use — app-level, non-React
1378
+ * observation of app-level state (React subscribes through `useComputed`,
1379
+ * which is per-component and browser-side, where there is only ever one
1380
+ * "request"). Do not build per-request logic on a computed's `prevValue`
1381
+ * on the server.
1382
+ */
1383
+ watch<T extends TAtomObject>(target: Atom<T>, callback: (value: Static<T>, prevValue: Static<T> | undefined) => void): () => void;
1384
+ watch<R>(target: Computed<R>, callback: (value: R, prevValue: R | undefined) => void): () => void;
1385
+ watch<Key extends keyof State$1>(target: Key, callback: (value: State$1[Key] | undefined, prevValue: State$1[Key] | undefined) => void): () => void;
1182
1386
  /**
1183
1387
  * Mutate a value in the state.
1184
1388
  */
1185
- mut<T extends TObject$1>(target: Atom<T>, mutator: (current: Static<T>) => Static<T>): this;
1389
+ mut<T extends TObject>(target: Atom<T>, mutator: (current: Static<T>) => Static<T>): this;
1186
1390
  mut<Key extends keyof State$1>(target: Key, mutator: (current: State$1[Key] | undefined) => State$1[Key] | undefined): this;
1187
1391
  /**
1188
1392
  * Check if a key exists in the state.
@@ -1206,10 +1410,15 @@ declare class StateManager<State$1 extends object = State> {
1206
1410
  */
1207
1411
  keys(): (keyof State$1)[];
1208
1412
  }
1209
- type OnlyArray<T extends object> = { [K in keyof T]: NonNullable<T[K]> extends Array<any> ? K : never };
1413
+ type OnlyArray<T extends object> = { [K in keyof T]: NonNullable<T[K]> extends Array<any> ? K : never; };
1210
1414
  interface SetStateOptions {
1211
1415
  skipContext?: boolean;
1212
1416
  skipEvents?: boolean;
1417
+ /**
1418
+ * Skip schema validation for this write. Internal escape hatch for
1419
+ * callers that have already validated the value (e.g. hydration).
1420
+ */
1421
+ skipValidation?: boolean;
1213
1422
  }
1214
1423
  //#endregion
1215
1424
  //#region ../../src/core/Alepha.d.ts
@@ -1273,8 +1482,8 @@ interface SetStateOptions {
1273
1482
  * // But you should use $env() primitive to get typed values from the environment.
1274
1483
  * class App {
1275
1484
  * env = $env(
1276
- * t.object({
1277
- * MY_VAR: t.text(),
1485
+ * z.object({
1486
+ * MY_VAR: z.text(),
1278
1487
  * })
1279
1488
  * );
1280
1489
  * }
@@ -1443,10 +1652,15 @@ declare class Alepha {
1443
1652
  get env(): Readonly<Env>;
1444
1653
  constructor(state?: Partial<State>);
1445
1654
  fork<R>(callback: () => R, data?: Record<string, any>): R;
1446
- get<T extends TAtomObject>(target: Atom<T>, scope?: StateScope): Static$1<T>;
1655
+ get<R>(target: Computed<R>, scope?: StateScope): R;
1656
+ get<T extends TAtomObject>(target: Atom<T>, scope?: StateScope): Static<T>;
1447
1657
  get<Key extends keyof State>(target: Key, scope?: StateScope): State[Key] | undefined;
1448
1658
  set<T extends TAtomObject>(target: Atom<T>, value: AtomStatic<T>): this;
1449
1659
  set<Key extends keyof State>(target: Key, value: State[Key] | undefined): this;
1660
+ /**
1661
+ * Reset an atom back to its declared default value.
1662
+ */
1663
+ reset<T extends TAtomObject>(target: Atom<T>): this;
1450
1664
  /**
1451
1665
  * True when start() is called.
1452
1666
  *
@@ -1660,7 +1874,7 @@ declare class Alepha {
1660
1874
  * @param schema - The schema object to apply environment variables to.
1661
1875
  * @return The schema object with environment variables applied.
1662
1876
  */
1663
- parseEnv<T extends TObject$1>(schema: T): Static$1<T>;
1877
+ parseEnv<T extends TObject>(schema: T): Static<T>;
1664
1878
  /**
1665
1879
  * Get all environment variable schemas and their parsed values.
1666
1880
  *
@@ -1776,8 +1990,8 @@ interface State {
1776
1990
  * db = $inject(DatabaseProvider);
1777
1991
  * alepha = $inject(Alepha);
1778
1992
  * env = $env(
1779
- * t.object({
1780
- * MIGRATE: t.optional(t.boolean()),
1993
+ * z.object({
1994
+ * MIGRATE: z.boolean().optional(),
1781
1995
  * }),
1782
1996
  * );
1783
1997
  *
@@ -1873,6 +2087,15 @@ interface Hooks {
1873
2087
  */
1874
2088
  prevValue: any;
1875
2089
  };
2090
+ /**
2091
+ * Triggered the first time an atom is registered in the state manager.
2092
+ */
2093
+ "state:register": {
2094
+ /**
2095
+ * The atom that was registered.
2096
+ */
2097
+ atom: Atom<any, any>;
2098
+ };
1876
2099
  }
1877
2100
  //#endregion
1878
2101
  //#region ../../src/core/interfaces/Run.d.ts
@@ -1906,6 +2129,14 @@ interface RunOptions {
1906
2129
  */
1907
2130
  declare const OPTIONS: unique symbol;
1908
2131
  //#endregion
2132
+ //#region ../../src/core/errors/AlephaError.d.ts
2133
+ /**
2134
+ * Default error class for Alepha.
2135
+ */
2136
+ declare class AlephaError extends Error {
2137
+ name: string;
2138
+ }
2139
+ //#endregion
1909
2140
  //#region ../../src/core/errors/AppNotStartedError.d.ts
1910
2141
  declare class AppNotStartedError extends AlephaError {
1911
2142
  readonly name = "AppNotStartedError";
@@ -1930,25 +2161,66 @@ declare class TooLateSubstitutionError extends AlephaError {
1930
2161
  constructor(original: string, substitution: string);
1931
2162
  }
1932
2163
  //#endregion
2164
+ //#region ../../src/core/errors/TypeBoxError.d.ts
2165
+ /** Minimal validation-error shape (decoupled from any schema lib). */
2166
+ interface ValidationErrorLike {
2167
+ message: string;
2168
+ instancePath?: string;
2169
+ params?: unknown;
2170
+ }
2171
+ declare class TypeBoxError extends AlephaError {
2172
+ name: string;
2173
+ readonly cause: ValidationErrorLike;
2174
+ readonly value: {
2175
+ path: string;
2176
+ message: string;
2177
+ };
2178
+ constructor(error: ValidationErrorLike);
2179
+ }
2180
+ interface TypeBoxErrorParams {
2181
+ requiredProperties?: string[];
2182
+ }
2183
+ //#endregion
2184
+ //#region ../../src/core/helpers/coerceStrings.d.ts
2185
+ /**
2186
+ * Coerce a single string value coming from a string-only boundary (HTTP query,
2187
+ * HTTP headers, environment variables) to the JS type its schema declares.
2188
+ *
2189
+ * This is the zod-standard `z.coerce` behavior applied only at the edges where
2190
+ * inputs are inherently strings — request bodies and the ORM stay strict. A
2191
+ * value that cannot be coerced is returned unchanged so the subsequent
2192
+ * validation produces a proper rejection. Arrays coerce element-wise.
2193
+ */
2194
+ declare const coerceScalar: (schema: unknown, value: unknown) => unknown;
2195
+ /**
2196
+ * Coerce each declared field of an object against its object schema. Used to
2197
+ * normalize string-only boundary maps (env vars, query objects) before strict
2198
+ * validation. Undeclared keys are passed through untouched.
2199
+ */
2200
+ declare const coerceObject: (schema: unknown, value: Record<string, unknown>) => Record<string, unknown>;
2201
+ //#endregion
1933
2202
  //#region ../../src/core/schemas/pageSchema.d.ts
1934
- declare const pageMetadataSchema: TObject<{
1935
- number: import("typebox").TInteger;
1936
- size: import("typebox").TInteger;
1937
- offset: import("typebox").TInteger;
1938
- numberOfElements: import("typebox").TInteger;
1939
- totalElements: import("typebox").TOptional<import("typebox").TInteger>;
1940
- totalPages: import("typebox").TOptional<import("typebox").TInteger>;
1941
- isEmpty: import("typebox").TBoolean;
1942
- isFirst: import("typebox").TBoolean;
1943
- isLast: import("typebox").TBoolean;
1944
- sort: import("typebox").TOptional<TObject<{
1945
- sorted: import("typebox").TBoolean;
1946
- fields: TArray<TObject<{
1947
- field: import("typebox").TString;
1948
- direction: import("typebox").TUnsafe<"asc" | "desc">;
1949
- }>>;
1950
- }>>;
1951
- }>;
2203
+ declare const pageMetadataSchema: import("zod").ZodObject<{
2204
+ number: import("zod").ZodInt;
2205
+ size: import("zod").ZodInt;
2206
+ offset: import("zod").ZodInt;
2207
+ numberOfElements: import("zod").ZodInt;
2208
+ totalElements: import("zod").ZodOptional<import("zod").ZodInt>;
2209
+ totalPages: import("zod").ZodOptional<import("zod").ZodInt>;
2210
+ isEmpty: import("zod").ZodBoolean;
2211
+ isFirst: import("zod").ZodBoolean;
2212
+ isLast: import("zod").ZodBoolean;
2213
+ sort: import("zod").ZodOptional<import("zod").ZodObject<{
2214
+ sorted: import("zod").ZodBoolean;
2215
+ fields: import("zod").ZodArray<import("zod").ZodObject<{
2216
+ field: import("zod").ZodString;
2217
+ direction: import("zod").ZodEnum<{
2218
+ asc: "asc";
2219
+ desc: "desc";
2220
+ }>;
2221
+ }, import("zod/v4/core").$strip>>;
2222
+ }, import("zod/v4/core").$strip>>;
2223
+ }, import("zod/v4/core").$strip>;
1952
2224
  /**
1953
2225
  * Create a pagination schema for the given object schema.
1954
2226
  *
@@ -1957,7 +2229,7 @@ declare const pageMetadataSchema: TObject<{
1957
2229
  *
1958
2230
  * @example
1959
2231
  * ```ts
1960
- * const userSchema = t.object({ id: t.integer(), name: t.text() });
2232
+ * const userSchema = z.object({ id: z.integer(), name: z.text() });
1961
2233
  * const userPageSchema = pageSchema(userSchema);
1962
2234
  * ```
1963
2235
  *
@@ -1971,7 +2243,7 @@ declare const pageMetadataSchema: TObject<{
1971
2243
  * })
1972
2244
  * ```
1973
2245
  */
1974
- declare const pageSchema: <T extends TObject | TRecord>(objectSchema: T, options?: TObjectOptions) => TPage<T>;
2246
+ declare const pageSchema: <T extends TObject | TRecord>(objectSchema: T) => TPage<T>;
1975
2247
  type TPage<T extends TObject | TRecord> = TObject<{
1976
2248
  content: TArray<T>;
1977
2249
  page: typeof pageMetadataSchema;
@@ -2021,7 +2293,7 @@ declare module "alepha" {
2021
2293
  */
2022
2294
  page<T extends TObject | TRecord>(itemSchema: T): TPage<T>;
2023
2295
  }
2024
- } //# sourceMappingURL=pageSchema.d.ts.map
2296
+ }
2025
2297
  //#endregion
2026
2298
  //#region ../../src/core/helpers/createPagination.d.ts
2027
2299
  /**
@@ -2073,88 +2345,19 @@ declare function createPagination<T>(entities: T[], limit?: number, offset?: num
2073
2345
  direction: "asc" | "desc";
2074
2346
  }>): Page<T>;
2075
2347
  //#endregion
2076
- //#region ../../src/core/helpers/jsonSchemaToTypeBox.d.ts
2077
- /**
2078
- * JSON Schema representation for conversion to TypeBox.
2079
- */
2080
- interface JsonSchemaObject {
2081
- type?: string | string[];
2082
- properties?: Record<string, JsonSchemaObject>;
2083
- required?: string[];
2084
- items?: JsonSchemaObject;
2085
- enum?: (string | number | boolean)[];
2086
- const?: unknown;
2087
- format?: string;
2088
- title?: string;
2089
- description?: string;
2090
- default?: unknown;
2091
- minLength?: number;
2092
- maxLength?: number;
2093
- minimum?: number;
2094
- maximum?: number;
2095
- exclusiveMinimum?: number;
2096
- exclusiveMaximum?: number;
2097
- multipleOf?: number;
2098
- pattern?: string;
2099
- minItems?: number;
2100
- maxItems?: number;
2101
- uniqueItems?: boolean;
2102
- "~options"?: {
2103
- trim?: boolean;
2104
- lowercase?: boolean;
2105
- };
2106
- oneOf?: JsonSchemaObject[];
2107
- anyOf?: JsonSchemaObject[];
2108
- allOf?: JsonSchemaObject[];
2109
- not?: JsonSchemaObject;
2110
- $ref?: string;
2111
- }
2348
+ //#region ../../src/core/helpers/jsonSchemaToZod.d.ts
2112
2349
  /**
2113
- * Converts a JSON Schema object to a TypeBox schema using Alepha's type system.
2114
- *
2115
- * This is useful when receiving JSON Schema from an API (e.g., configuration schemas)
2116
- * and needing to use them with TypeBox-based form rendering or validation.
2117
- *
2118
- * **Supports:**
2119
- * - Basic types: string, number, integer, boolean, null, object, array
2120
- * - String formats: email, uuid, date-time, date, time, url/uri, binary, bigint, duration, color
2121
- * - Enums (string enums)
2122
- * - Nested objects with required/optional properties
2123
- * - Arrays with item schemas
2124
- * - Common validation options: minLength, maxLength, minimum, maximum, pattern
2125
- * - anyOf/oneOf/allOf with nullable patterns (e.g., `anyOf: [type, null]` → `t.nullable(type)`)
2126
- * - Alepha ~options (trim, lowercase) pass-through
2127
- *
2128
- * **Not supported:**
2129
- * - $ref (references)
2130
- * - additionalProperties, patternProperties
2131
- * - Complex composition schemas (multiple non-null types in anyOf/oneOf/allOf)
2132
- *
2133
- * @param schema - JSON Schema object to convert
2134
- * @returns TypeBox TSchema
2135
- *
2136
- * @example
2137
- * ```ts
2138
- * const jsonSchema = {
2139
- * type: "object",
2140
- * properties: {
2141
- * email: { type: "string", format: "email" },
2142
- * age: { type: "integer", minimum: 0 },
2143
- * active: { type: "boolean" },
2144
- * },
2145
- * required: ["email"]
2146
- * };
2147
- *
2148
- * const typeBoxSchema = jsonSchemaToTypeBox(jsonSchema);
2149
- * // Equivalent to:
2150
- * // t.object({
2151
- * // email: t.email(),
2152
- * // age: t.optional(t.integer({ minimum: 0 })),
2153
- * // active: t.optional(t.boolean()),
2154
- * // })
2155
- * ```
2350
+ * Convert a JSON Schema object into a zod schema (the inverse of
2351
+ * `z.toJSONSchema`). zod 4 has no native `fromJSONSchema`, so this provides the
2352
+ * round-trip needed by dynamic, schema-driven UIs (e.g. devtools forms built
2353
+ * from an entity's or action's published JSON Schema).
2354
+ *
2355
+ * Covers the JSON Schema subset Alepha emits: object/array/string (+formats),
2356
+ * number/integer, boolean, null, enum, and `anyOf`/`oneOf` (including the
2357
+ * nullable `anyOf: [..., { type: "null" }]` shape). Anything unrecognized falls
2358
+ * back to `z.any()`.
2156
2359
  */
2157
- declare function jsonSchemaToTypeBox(schema: JsonSchemaObject): any;
2360
+ declare const jsonSchemaToZod: (schema: any) => ZType;
2158
2361
  //#endregion
2159
2362
  //#region ../../src/core/helpers/ref.d.ts
2160
2363
  /**
@@ -2169,6 +2372,64 @@ declare const __alephaRef: {
2169
2372
  };
2170
2373
  parent?: Service;
2171
2374
  };
2375
+ /**
2376
+ * Note:
2377
+ *
2378
+ * This file is used to share context between $primitives and the Alepha core during the injection phase.
2379
+ *
2380
+ * There is no side effect as long as Alepha is not used concurrently in multiple contexts (which is not the case).
2381
+ *
2382
+ * // __alephaRef === undefined
2383
+ * // begin alepha.with()
2384
+ * // __alephaRef.context = alepha
2385
+ * // ... injection phase ...
2386
+ * // __alephaRef.context = undefined
2387
+ * // end alepha.with()
2388
+ * // __alephaRef === undefined
2389
+ *
2390
+ * As .with() is synchronous, there is no risk of context leakage.
2391
+ *
2392
+ * ---------------------------------------------------------------------------------------------------------------------
2393
+ *
2394
+ * Why this helper?
2395
+ *
2396
+ * It allows to avoid passing Alepha instance to every $hook, $inject, etc. calls. It's a beautiful syntactic sugar.
2397
+ *
2398
+ * With sugar:
2399
+ *
2400
+ * class A {
2401
+ * on = $hook( ... ) // <- __alephaRef is set here
2402
+ * }
2403
+ *
2404
+ * Without sugar:
2405
+ *
2406
+ * class A {
2407
+ * constructor(alepha: Alepha) {
2408
+ * this.on = $hook(alepha, ... ) // <- no need of __alephaRef
2409
+ * }
2410
+ * }
2411
+ *
2412
+ * One main goal of Alepha is working with classes but without the class verbosity.
2413
+ * Forcing to pass Alepha instance in constructors would be a step back in that direction!
2414
+ *
2415
+ * ---------------------------------------------------------------------------------------------------------------------
2416
+ *
2417
+ * TODO: harden the cursor against mid-instantiation throws.
2418
+ *
2419
+ * Today, the cleanup of `__alephaRef.alepha`, `__alephaRef.service`, `__alephaRef.parent`
2420
+ * is performed by the caller after the synchronous instantiation returns. If the
2421
+ * instantiation throws (e.g., a primitive factory blows up, or a user constructor
2422
+ * raises), the cursor can be left holding stale references until the next
2423
+ * instantiation overwrites them. In practice this is harmless because Alepha is
2424
+ * single-threaded synchronous during boot and the next inject() rewrites the
2425
+ * cursor — but it is a sharp edge for debuggers (frame inspection shows ghost
2426
+ * state) and any future tooling that introspects __alephaRef out-of-band.
2427
+ *
2428
+ * Plan: wrap each cursor mutation in Alepha.ts in a try/finally that snapshots
2429
+ * the previous value and restores it on exit (even on throw). Equivalent to a
2430
+ * lexically-scoped "with" — pushes/pops cleanly. Should be a 5-line refactor in
2431
+ * Alepha.ts:1131-1132 once we touch it.
2432
+ */
2172
2433
  //#endregion
2173
2434
  //#region ../../src/core/interfaces/Pagination.d.ts
2174
2435
  /**
@@ -2287,8 +2548,8 @@ interface ContextPrimitive {
2287
2548
  * log = $logger();
2288
2549
  *
2289
2550
  * // program expect a var env "HELLO" as string to works
2290
- * env = $env(t.object({
2291
- * HELLO: t.text()
2551
+ * env = $env(z.object({
2552
+ * HELLO: z.text()
2292
2553
  * }));
2293
2554
  *
2294
2555
  * sayHello = () => this.log.info("Hello ${this.env.HELLO}")
@@ -2297,7 +2558,7 @@ interface ContextPrimitive {
2297
2558
  * run(alepha.with(App));
2298
2559
  * ```
2299
2560
  */
2300
- declare const $env: <T extends TObject$1>(type: T) => Static$1<T>;
2561
+ declare const $env: <T extends TObject>(type: T) => Static<T>;
2301
2562
  //#endregion
2302
2563
  //#region ../../src/core/primitives/$hook.d.ts
2303
2564
  /**
@@ -2486,7 +2747,6 @@ declare const $mode: (args: ModeOptions) => boolean;
2486
2747
  * ```
2487
2748
  */
2488
2749
  declare function $pipeline<T extends (...args: any[]) => any>(options: PipelineOptions<T>): PipelinePrimitiveFn<T>;
2489
- declare namespace $pipeline {}
2490
2750
  declare class PipelinePrimitive<TOptions extends PipelinePrimitiveOptions = PipelinePrimitiveOptions> extends Primitive<TOptions> {
2491
2751
  readonly handler: PipelineHandler;
2492
2752
  get middlewares(): MiddlewareMetadata[];
@@ -2595,7 +2855,7 @@ declare const $scope: () => Middleware;
2595
2855
  *
2596
2856
  * @example
2597
2857
  * ```ts
2598
- * const userState = $atom({ schema: t.object({ name: t.text(), role: t.text() }) });
2858
+ * const userState = $atom({ schema: z.object({ name: z.text(), role: z.text() }) });
2599
2859
  *
2600
2860
  * class UserComponent {
2601
2861
  * user = $state(userState); // Reactive reference to atom state
@@ -2609,11 +2869,11 @@ declare const $scope: () => Middleware;
2609
2869
  declare const $state: <T extends TAtomObject, N extends string>(atom: Atom<T, N>) => Readonly<Static<T>>;
2610
2870
  //#endregion
2611
2871
  //#region ../../src/core/schemas/pageQuerySchema.d.ts
2612
- declare const pageQuerySchema: import("typebox").TObject<{
2613
- page: import("typebox").TOptional<import("typebox").TInteger>;
2614
- size: import("typebox").TOptional<import("typebox").TInteger>;
2615
- sort: import("typebox").TOptional<import("typebox").TString>;
2616
- }>;
2872
+ declare const pageQuerySchema: import("zod").ZodObject<{
2873
+ page: import("zod").ZodOptional<import("zod").ZodDefault<import("zod").ZodInt>>;
2874
+ size: import("zod").ZodOptional<import("zod").ZodDefault<import("zod").ZodInt>>;
2875
+ sort: import("zod").ZodOptional<import("zod").ZodString>;
2876
+ }, import("zod/v4/core").$strip>;
2617
2877
  type PageQuery = Static<typeof pageQuerySchema>;
2618
2878
  //#endregion
2619
2879
  //#region ../../src/core/index.d.ts
@@ -2649,5 +2909,5 @@ declare const AlephaCore: Service<import("alepha").Module>;
2649
2909
  */
2650
2910
  declare const run: (entry: Alepha | Service | Array<Service>, opts?: RunOptions) => Alepha;
2651
2911
  //#endregion
2652
- export { $atom, $context, $env, $hook, $inject, $memoize, $mode, $module, $pipeline, $scope, $state, ALS_PARENT, AbstractClass, Alepha, AlephaCore, AlephaDump, AlephaDumpEnvVariable, AlephaError, AlsProvider, AppNotStartedError, Async, AsyncFn, AsyncLocalStorageData, Atom, AtomOptions, AtomStatic, AtomWithValue, CircularDependencyError, CodecManager, CodecRegisterOptions, CompileOptions, CompiledEventExecutor, ContainerLockedError, ContextPrimitive, CreateMiddlewareOptions, DecodeOptions, EncodeOptions, EncodeResult, Encoding, Env, EventManager, FileLike, Format, Hook, HookOptions, HookPrimitive, Hooks, InjectOptions, InjectPrimitive, InstantiableClass, Json, JsonSchemaCodec, JsonSchemaObject, KIND, KeylessCodec, KeylessCodecOptions, KeylessJsonSchemaCodec, LogLevel, LoggerInterface, MaybePromise, MemoizeOptions, Middleware, MiddlewareMetadata, ModeOptions, Module, ModulePrimitiveOptions, OPTIONS, Page, PageMetadata, PageQuery, PageRequest, PipelineHandler, PipelineOptions, PipelinePrimitive, PipelinePrimitiveFn, PipelinePrimitiveOptions, Primitive, PrimitiveArgs, PrimitiveConfig, PrimitiveFactoryLike, RunFunction, SchemaCodec, SchemaValidator, Service, ServiceEntry, ServiceSubstitution, SetStateOptions, SortDirection, SortField, State, StateManager, StateScope, type Static, type StaticDecode, type StaticEncode, StreamLike, type TAny, type TArray, TAtomObject, type TBigInt, type TBoolean, TEnumOptions, TFile, type TInteger, type TKeysToIndexer, type TNull, type TNumber, type TNumberOptions, type TObject, type TObjectOptions, type TOptional, type TOptionalAdd, TPage, type TPick, type TProperties, type TRecord, type TSchema, TStream, type TString, type TStringOptions, TTextOptions, type TTuple, type TUnion, type TUnsafe, type TVoid, TextLength, TooLateSubstitutionError, Type, TypeBoxError, TypeBoxErrorParams, TypeGuard, TypeProvider, ValidateOptions, WithModule, __alephaRef, createMiddleware, createPagination, createPrimitive, isClass, isFileLike, isTypeFile, jsonSchemaToTypeBox, pageMetadataSchema, pageQuerySchema, pageSchema, run, t };
2912
+ export { $atom, $computed, $context, $env, $hook, $inject, $memoize, $mode, $module, $pipeline, $scope, $state, ALS_PARENT, AbstractClass, Alepha, AlephaCore, AlephaDump, AlephaDumpEnvVariable, AlephaError, AlsProvider, AnyDep, AppNotStartedError, Async, AsyncFn, AsyncLocalStorageData, Atom, AtomOptions, AtomPersist, AtomStatic, AtomWithValue, CircularDependencyError, CodecManager, CodecRegisterOptions, CompileOptions, CompiledEventExecutor, Computed, ComputedOptions, ContainerLockedError, ContextPrimitive, CreateMiddlewareOptions, DecodeOptions, DepValues, EncodeOptions, EncodeResult, Encoding, Env, EventManager, FileLike, Hook, HookOptions, HookPrimitive, Hooks, Infer, InjectOptions, InjectPrimitive, InstantiableClass, Json, JsonSchemaCodec, KIND, KeylessCodec, KeylessCodecOptions, KeylessJsonSchemaCodec, LogLevel, LoggerInterface, MaybePromise, MemoizeOptions, Middleware, MiddlewareMetadata, ModeOptions, Module, ModulePrimitiveOptions, NumberOptions, OPTIONS, Page, PageMetadata, PageQuery, PageRequest, PipelineHandler, PipelineOptions, PipelinePrimitive, PipelinePrimitiveFn, PipelinePrimitiveOptions, Primitive, PrimitiveArgs, PrimitiveConfig, PrimitiveFactoryLike, RunFunction, SchemaCodec, SchemaOptions, SchemaOutput, SchemaValidator, Service, ServiceEntry, ServiceSubstitution, SetStateOptions, SortDirection, SortField, State, StateManager, StateScope, Static, StaticDecode, StaticEncode, StreamLike, StringOptions, TAny, TArray, TArrayOptions, TAtomObject, TBigInt, TBoolean, TEnumOptions, TFile, TInteger, TInterface, TKeysToIndexer, TNull, TNumber, TNumberOptions, TObject, TObjectOptions, TOmit, TOptional, TOptionalAdd, TPage, TPartial, TPick, TProperties, TRecord, TSchema, TSchemaOptions, TStream, TString, TStringOptions, TTextOptions, TTuple, TUnion, TUnsafe, TVoid, TextLength, TextOptions, TooLateSubstitutionError, Type, TypeBoxError, TypeBoxErrorParams, TypeProvider, ValidateOptions, ValidationErrorLike, WithModule, Z, ZObject, ZType, Z_LIMITS, __alephaRef, coerceObject, coerceScalar, createMiddleware, createPagination, createPrimitive, isClass, isFileLike, isTypeFile, jsonSchemaToZod, pageMetadataSchema, pageQuerySchema, pageSchema, run, z };
2653
2913
  //# sourceMappingURL=index.d.ts.map