mimarjs 0.0.0-stage → 0.0.1-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1364) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +50 -2
  3. package/bin/mimar.js +32 -0
  4. package/dist/auth/auth.d.ts +86 -0
  5. package/dist/auth/auth.d.ts.map +1 -0
  6. package/dist/auth/auth.js +212 -0
  7. package/dist/auth/auth.js.map +1 -0
  8. package/dist/auth/errors.d.ts +44 -0
  9. package/dist/auth/errors.d.ts.map +1 -0
  10. package/dist/auth/errors.js +66 -0
  11. package/dist/auth/errors.js.map +1 -0
  12. package/dist/auth/index.d.ts +9 -0
  13. package/dist/auth/index.d.ts.map +1 -0
  14. package/dist/auth/index.js +9 -0
  15. package/dist/auth/index.js.map +1 -0
  16. package/dist/auth/manager.d.ts +109 -0
  17. package/dist/auth/manager.d.ts.map +1 -0
  18. package/dist/auth/manager.js +113 -0
  19. package/dist/auth/manager.js.map +1 -0
  20. package/dist/auth/middleware.d.ts +26 -0
  21. package/dist/auth/middleware.d.ts.map +1 -0
  22. package/dist/auth/middleware.js +152 -0
  23. package/dist/auth/middleware.js.map +1 -0
  24. package/dist/auth/passwords.d.ts +45 -0
  25. package/dist/auth/passwords.d.ts.map +1 -0
  26. package/dist/auth/passwords.js +104 -0
  27. package/dist/auth/passwords.js.map +1 -0
  28. package/dist/auth/policy.d.ts +57 -0
  29. package/dist/auth/policy.d.ts.map +1 -0
  30. package/dist/auth/policy.js +115 -0
  31. package/dist/auth/policy.js.map +1 -0
  32. package/dist/auth/setup.d.ts +55 -0
  33. package/dist/auth/setup.d.ts.map +1 -0
  34. package/dist/auth/setup.js +50 -0
  35. package/dist/auth/setup.js.map +1 -0
  36. package/dist/auth/state.d.ts +19 -0
  37. package/dist/auth/state.d.ts.map +1 -0
  38. package/dist/auth/state.js +19 -0
  39. package/dist/auth/state.js.map +1 -0
  40. package/dist/auth/tokens.d.ts +22 -0
  41. package/dist/auth/tokens.d.ts.map +1 -0
  42. package/dist/auth/tokens.js +51 -0
  43. package/dist/auth/tokens.js.map +1 -0
  44. package/dist/auth/verification.d.ts +31 -0
  45. package/dist/auth/verification.d.ts.map +1 -0
  46. package/dist/auth/verification.js +77 -0
  47. package/dist/auth/verification.js.map +1 -0
  48. package/dist/aws/index.d.ts +2 -0
  49. package/dist/aws/index.d.ts.map +1 -0
  50. package/dist/aws/index.js +2 -0
  51. package/dist/aws/index.js.map +1 -0
  52. package/dist/aws/signer.d.ts +47 -0
  53. package/dist/aws/signer.d.ts.map +1 -0
  54. package/dist/aws/signer.js +130 -0
  55. package/dist/aws/signer.js.map +1 -0
  56. package/dist/broadcast/index.d.ts +2 -0
  57. package/dist/broadcast/index.d.ts.map +1 -0
  58. package/dist/broadcast/index.js +2 -0
  59. package/dist/broadcast/index.js.map +1 -0
  60. package/dist/cache/cache.d.ts +129 -0
  61. package/dist/cache/cache.d.ts.map +1 -0
  62. package/dist/cache/cache.js +407 -0
  63. package/dist/cache/cache.js.map +1 -0
  64. package/dist/cache/database.d.ts +38 -0
  65. package/dist/cache/database.d.ts.map +1 -0
  66. package/dist/cache/database.js +210 -0
  67. package/dist/cache/database.js.map +1 -0
  68. package/dist/cache/file.d.ts +18 -0
  69. package/dist/cache/file.d.ts.map +1 -0
  70. package/dist/cache/file.js +237 -0
  71. package/dist/cache/file.js.map +1 -0
  72. package/dist/cache/index.d.ts +9 -0
  73. package/dist/cache/index.d.ts.map +1 -0
  74. package/dist/cache/index.js +9 -0
  75. package/dist/cache/index.js.map +1 -0
  76. package/dist/cache/manager.d.ts +42 -0
  77. package/dist/cache/manager.d.ts.map +1 -0
  78. package/dist/cache/manager.js +107 -0
  79. package/dist/cache/manager.js.map +1 -0
  80. package/dist/cache/module.d.ts +41 -0
  81. package/dist/cache/module.d.ts.map +1 -0
  82. package/dist/cache/module.js +49 -0
  83. package/dist/cache/module.js.map +1 -0
  84. package/dist/cache/rate-limiter.d.ts +76 -0
  85. package/dist/cache/rate-limiter.d.ts.map +1 -0
  86. package/dist/cache/rate-limiter.js +119 -0
  87. package/dist/cache/rate-limiter.js.map +1 -0
  88. package/dist/cache/redis.d.ts +19 -0
  89. package/dist/cache/redis.d.ts.map +1 -0
  90. package/dist/cache/redis.js +99 -0
  91. package/dist/cache/redis.js.map +1 -0
  92. package/dist/cache/store.d.ts +78 -0
  93. package/dist/cache/store.d.ts.map +1 -0
  94. package/dist/cache/store.js +162 -0
  95. package/dist/cache/store.js.map +1 -0
  96. package/dist/client/index.d.ts +4 -0
  97. package/dist/client/index.d.ts.map +1 -0
  98. package/dist/client/index.js +2 -0
  99. package/dist/client/index.js.map +1 -0
  100. package/dist/client/pages.d.ts +51 -0
  101. package/dist/client/pages.d.ts.map +1 -0
  102. package/dist/client/pages.js +2 -0
  103. package/dist/client/pages.js.map +1 -0
  104. package/dist/client/routes.d.ts +22 -0
  105. package/dist/client/routes.d.ts.map +1 -0
  106. package/dist/client/routes.js +66 -0
  107. package/dist/client/routes.js.map +1 -0
  108. package/dist/client/wire.d.ts +44 -0
  109. package/dist/client/wire.d.ts.map +1 -0
  110. package/dist/client/wire.js +2 -0
  111. package/dist/client/wire.js.map +1 -0
  112. package/dist/config/config.d.ts +39 -0
  113. package/dist/config/config.d.ts.map +1 -0
  114. package/dist/config/config.js +44 -0
  115. package/dist/config/config.js.map +1 -0
  116. package/dist/config/index.d.ts +3 -0
  117. package/dist/config/index.d.ts.map +1 -0
  118. package/dist/config/index.js +3 -0
  119. package/dist/config/index.js.map +1 -0
  120. package/dist/config/sections.d.ts +243 -0
  121. package/dist/config/sections.d.ts.map +1 -0
  122. package/dist/config/sections.js +250 -0
  123. package/dist/config/sections.js.map +1 -0
  124. package/dist/console/command.d.ts +82 -0
  125. package/dist/console/command.d.ts.map +1 -0
  126. package/dist/console/command.js +82 -0
  127. package/dist/console/command.js.map +1 -0
  128. package/dist/console/index.d.ts +4 -0
  129. package/dist/console/index.d.ts.map +1 -0
  130. package/dist/console/index.js +4 -0
  131. package/dist/console/index.js.map +1 -0
  132. package/dist/console/io.d.ts +79 -0
  133. package/dist/console/io.d.ts.map +1 -0
  134. package/dist/console/io.js +214 -0
  135. package/dist/console/io.js.map +1 -0
  136. package/dist/console/kernel.d.ts +38 -0
  137. package/dist/console/kernel.d.ts.map +1 -0
  138. package/dist/console/kernel.js +279 -0
  139. package/dist/console/kernel.js.map +1 -0
  140. package/dist/container/container.d.ts +47 -0
  141. package/dist/container/container.d.ts.map +1 -0
  142. package/dist/container/container.js +130 -0
  143. package/dist/container/container.js.map +1 -0
  144. package/dist/container/index.d.ts +2 -0
  145. package/dist/container/index.d.ts.map +1 -0
  146. package/dist/container/index.js +2 -0
  147. package/dist/container/index.js.map +1 -0
  148. package/dist/cookie/index.d.ts +2 -0
  149. package/dist/cookie/index.d.ts.map +1 -0
  150. package/dist/cookie/index.js +2 -0
  151. package/dist/cookie/index.js.map +1 -0
  152. package/dist/crypt/crypt.d.ts +48 -0
  153. package/dist/crypt/crypt.d.ts.map +1 -0
  154. package/dist/crypt/crypt.js +151 -0
  155. package/dist/crypt/crypt.js.map +1 -0
  156. package/dist/crypt/index.d.ts +2 -0
  157. package/dist/crypt/index.d.ts.map +1 -0
  158. package/dist/crypt/index.js +2 -0
  159. package/dist/crypt/index.js.map +1 -0
  160. package/dist/db/codec.d.ts +36 -0
  161. package/dist/db/codec.d.ts.map +1 -0
  162. package/dist/db/codec.js +129 -0
  163. package/dist/db/codec.js.map +1 -0
  164. package/dist/db/contract.d.ts +103 -0
  165. package/dist/db/contract.d.ts.map +1 -0
  166. package/dist/db/contract.js +2 -0
  167. package/dist/db/contract.js.map +1 -0
  168. package/dist/db/db.d.ts +41 -0
  169. package/dist/db/db.d.ts.map +1 -0
  170. package/dist/db/db.js +48 -0
  171. package/dist/db/db.js.map +1 -0
  172. package/dist/db/drivers/better-sqlite3.d.ts +4 -0
  173. package/dist/db/drivers/better-sqlite3.d.ts.map +1 -0
  174. package/dist/db/drivers/better-sqlite3.js +49 -0
  175. package/dist/db/drivers/better-sqlite3.js.map +1 -0
  176. package/dist/db/drivers/mysql.d.ts +5 -0
  177. package/dist/db/drivers/mysql.d.ts.map +1 -0
  178. package/dist/db/drivers/mysql.js +318 -0
  179. package/dist/db/drivers/mysql.js.map +1 -0
  180. package/dist/db/drivers/pgsql.d.ts +5 -0
  181. package/dist/db/drivers/pgsql.d.ts.map +1 -0
  182. package/dist/db/drivers/pgsql.js +261 -0
  183. package/dist/db/drivers/pgsql.js.map +1 -0
  184. package/dist/db/drivers/sqlite.d.ts +51 -0
  185. package/dist/db/drivers/sqlite.d.ts.map +1 -0
  186. package/dist/db/drivers/sqlite.js +251 -0
  187. package/dist/db/drivers/sqlite.js.map +1 -0
  188. package/dist/db/errors.d.ts +65 -0
  189. package/dist/db/errors.d.ts.map +1 -0
  190. package/dist/db/errors.js +101 -0
  191. package/dist/db/errors.js.map +1 -0
  192. package/dist/db/grammars/grammar.d.ts +77 -0
  193. package/dist/db/grammars/grammar.d.ts.map +1 -0
  194. package/dist/db/grammars/grammar.js +345 -0
  195. package/dist/db/grammars/grammar.js.map +1 -0
  196. package/dist/db/grammars/mysql.d.ts +45 -0
  197. package/dist/db/grammars/mysql.d.ts.map +1 -0
  198. package/dist/db/grammars/mysql.js +147 -0
  199. package/dist/db/grammars/mysql.js.map +1 -0
  200. package/dist/db/grammars/pgsql.d.ts +20 -0
  201. package/dist/db/grammars/pgsql.d.ts.map +1 -0
  202. package/dist/db/grammars/pgsql.js +66 -0
  203. package/dist/db/grammars/pgsql.js.map +1 -0
  204. package/dist/db/grammars/sqlite.d.ts +27 -0
  205. package/dist/db/grammars/sqlite.d.ts.map +1 -0
  206. package/dist/db/grammars/sqlite.js +95 -0
  207. package/dist/db/grammars/sqlite.js.map +1 -0
  208. package/dist/db/index.d.ts +18 -0
  209. package/dist/db/index.d.ts.map +1 -0
  210. package/dist/db/index.js +17 -0
  211. package/dist/db/index.js.map +1 -0
  212. package/dist/db/kysely/index.d.ts +2 -0
  213. package/dist/db/kysely/index.d.ts.map +1 -0
  214. package/dist/db/kysely/index.js +2 -0
  215. package/dist/db/kysely/index.js.map +1 -0
  216. package/dist/db/kysely/kysely.d.ts +15 -0
  217. package/dist/db/kysely/kysely.d.ts.map +1 -0
  218. package/dist/db/kysely/kysely.js +127 -0
  219. package/dist/db/kysely/kysely.js.map +1 -0
  220. package/dist/db/manager.d.ts +138 -0
  221. package/dist/db/manager.d.ts.map +1 -0
  222. package/dist/db/manager.js +776 -0
  223. package/dist/db/manager.js.map +1 -0
  224. package/dist/db/pool.d.ts +28 -0
  225. package/dist/db/pool.d.ts.map +1 -0
  226. package/dist/db/pool.js +114 -0
  227. package/dist/db/pool.js.map +1 -0
  228. package/dist/db/query/builder.d.ts +290 -0
  229. package/dist/db/query/builder.d.ts.map +1 -0
  230. package/dist/db/query/builder.js +957 -0
  231. package/dist/db/query/builder.js.map +1 -0
  232. package/dist/db/query/state.d.ts +183 -0
  233. package/dist/db/query/state.d.ts.map +1 -0
  234. package/dist/db/query/state.js +48 -0
  235. package/dist/db/query/state.js.map +1 -0
  236. package/dist/db/sql.d.ts +82 -0
  237. package/dist/db/sql.d.ts.map +1 -0
  238. package/dist/db/sql.js +143 -0
  239. package/dist/db/sql.js.map +1 -0
  240. package/dist/env/env.d.ts +61 -0
  241. package/dist/env/env.d.ts.map +1 -0
  242. package/dist/env/env.js +184 -0
  243. package/dist/env/env.js.map +1 -0
  244. package/dist/env/index.d.ts +2 -0
  245. package/dist/env/index.d.ts.map +1 -0
  246. package/dist/env/index.js +2 -0
  247. package/dist/env/index.js.map +1 -0
  248. package/dist/errors/errors.d.ts +42 -0
  249. package/dist/errors/errors.d.ts.map +1 -0
  250. package/dist/errors/errors.js +60 -0
  251. package/dist/errors/errors.js.map +1 -0
  252. package/dist/errors/index.d.ts +2 -0
  253. package/dist/errors/index.d.ts.map +1 -0
  254. package/dist/errors/index.js +2 -0
  255. package/dist/errors/index.js.map +1 -0
  256. package/dist/events/event.d.ts +52 -0
  257. package/dist/events/event.d.ts.map +1 -0
  258. package/dist/events/event.js +77 -0
  259. package/dist/events/event.js.map +1 -0
  260. package/dist/events/fake.d.ts +22 -0
  261. package/dist/events/fake.d.ts.map +1 -0
  262. package/dist/events/fake.js +53 -0
  263. package/dist/events/fake.js.map +1 -0
  264. package/dist/events/index.d.ts +6 -0
  265. package/dist/events/index.d.ts.map +1 -0
  266. package/dist/events/index.js +6 -0
  267. package/dist/events/index.js.map +1 -0
  268. package/dist/events/listener.d.ts +49 -0
  269. package/dist/events/listener.d.ts.map +1 -0
  270. package/dist/events/listener.js +31 -0
  271. package/dist/events/listener.js.map +1 -0
  272. package/dist/events/manager.d.ts +54 -0
  273. package/dist/events/manager.d.ts.map +1 -0
  274. package/dist/events/manager.js +166 -0
  275. package/dist/events/manager.js.map +1 -0
  276. package/dist/events/module.d.ts +10 -0
  277. package/dist/events/module.d.ts.map +1 -0
  278. package/dist/events/module.js +12 -0
  279. package/dist/events/module.js.map +1 -0
  280. package/dist/factory/factory.d.ts +93 -0
  281. package/dist/factory/factory.d.ts.map +1 -0
  282. package/dist/factory/factory.js +261 -0
  283. package/dist/factory/factory.js.map +1 -0
  284. package/dist/factory/fake.d.ts +92 -0
  285. package/dist/factory/fake.d.ts.map +1 -0
  286. package/dist/factory/fake.js +328 -0
  287. package/dist/factory/fake.js.map +1 -0
  288. package/dist/factory/index.d.ts +4 -0
  289. package/dist/factory/index.d.ts.map +1 -0
  290. package/dist/factory/index.js +4 -0
  291. package/dist/factory/index.js.map +1 -0
  292. package/dist/factory/seed.d.ts +21 -0
  293. package/dist/factory/seed.d.ts.map +1 -0
  294. package/dist/factory/seed.js +55 -0
  295. package/dist/factory/seed.js.map +1 -0
  296. package/dist/feature/index.d.ts +2 -0
  297. package/dist/feature/index.d.ts.map +1 -0
  298. package/dist/feature/index.js +2 -0
  299. package/dist/feature/index.js.map +1 -0
  300. package/dist/foundation/application.d.ts +156 -0
  301. package/dist/foundation/application.d.ts.map +1 -0
  302. package/dist/foundation/application.js +1258 -0
  303. package/dist/foundation/application.js.map +1 -0
  304. package/dist/foundation/cache-commands.d.ts +7 -0
  305. package/dist/foundation/cache-commands.d.ts.map +1 -0
  306. package/dist/foundation/cache-commands.js +48 -0
  307. package/dist/foundation/cache-commands.js.map +1 -0
  308. package/dist/foundation/command-result.d.ts +14 -0
  309. package/dist/foundation/command-result.d.ts.map +1 -0
  310. package/dist/foundation/command-result.js +43 -0
  311. package/dist/foundation/command-result.js.map +1 -0
  312. package/dist/foundation/commands.d.ts +159 -0
  313. package/dist/foundation/commands.d.ts.map +1 -0
  314. package/dist/foundation/commands.js +404 -0
  315. package/dist/foundation/commands.js.map +1 -0
  316. package/dist/foundation/database-commands.d.ts +24 -0
  317. package/dist/foundation/database-commands.d.ts.map +1 -0
  318. package/dist/foundation/database-commands.js +304 -0
  319. package/dist/foundation/database-commands.js.map +1 -0
  320. package/dist/foundation/debug-page.d.ts +11 -0
  321. package/dist/foundation/debug-page.d.ts.map +1 -0
  322. package/dist/foundation/debug-page.js +112 -0
  323. package/dist/foundation/debug-page.js.map +1 -0
  324. package/dist/foundation/dev-vite.d.ts +2 -0
  325. package/dist/foundation/dev-vite.d.ts.map +1 -0
  326. package/dist/foundation/dev-vite.js +39 -0
  327. package/dist/foundation/dev-vite.js.map +1 -0
  328. package/dist/foundation/dev.d.ts +31 -0
  329. package/dist/foundation/dev.d.ts.map +1 -0
  330. package/dist/foundation/dev.js +430 -0
  331. package/dist/foundation/dev.js.map +1 -0
  332. package/dist/foundation/discovery.d.ts +41 -0
  333. package/dist/foundation/discovery.d.ts.map +1 -0
  334. package/dist/foundation/discovery.js +69 -0
  335. package/dist/foundation/discovery.js.map +1 -0
  336. package/dist/foundation/error-pages.d.ts +10 -0
  337. package/dist/foundation/error-pages.d.ts.map +1 -0
  338. package/dist/foundation/error-pages.js +38 -0
  339. package/dist/foundation/error-pages.js.map +1 -0
  340. package/dist/foundation/exceptions.d.ts +20 -0
  341. package/dist/foundation/exceptions.d.ts.map +1 -0
  342. package/dist/foundation/exceptions.js +36 -0
  343. package/dist/foundation/exceptions.js.map +1 -0
  344. package/dist/foundation/generators.d.ts +71 -0
  345. package/dist/foundation/generators.d.ts.map +1 -0
  346. package/dist/foundation/generators.js +577 -0
  347. package/dist/foundation/generators.js.map +1 -0
  348. package/dist/foundation/helpers.d.ts +7 -0
  349. package/dist/foundation/helpers.d.ts.map +1 -0
  350. package/dist/foundation/helpers.js +12 -0
  351. package/dist/foundation/helpers.js.map +1 -0
  352. package/dist/foundation/index.d.ts +8 -0
  353. package/dist/foundation/index.d.ts.map +1 -0
  354. package/dist/foundation/index.js +8 -0
  355. package/dist/foundation/index.js.map +1 -0
  356. package/dist/foundation/install-api.d.ts +4 -0
  357. package/dist/foundation/install-api.d.ts.map +1 -0
  358. package/dist/foundation/install-api.js +91 -0
  359. package/dist/foundation/install-api.js.map +1 -0
  360. package/dist/foundation/provider.d.ts +83 -0
  361. package/dist/foundation/provider.d.ts.map +1 -0
  362. package/dist/foundation/provider.js +13 -0
  363. package/dist/foundation/provider.js.map +1 -0
  364. package/dist/foundation/queue-commands.d.ts +38 -0
  365. package/dist/foundation/queue-commands.d.ts.map +1 -0
  366. package/dist/foundation/queue-commands.js +279 -0
  367. package/dist/foundation/queue-commands.js.map +1 -0
  368. package/dist/foundation/route-types.d.ts +22 -0
  369. package/dist/foundation/route-types.d.ts.map +1 -0
  370. package/dist/foundation/route-types.js +158 -0
  371. package/dist/foundation/route-types.js.map +1 -0
  372. package/dist/foundation/schedule-commands.d.ts +4 -0
  373. package/dist/foundation/schedule-commands.d.ts.map +1 -0
  374. package/dist/foundation/schedule-commands.js +128 -0
  375. package/dist/foundation/schedule-commands.js.map +1 -0
  376. package/dist/foundation/stubs/api.d.ts +9 -0
  377. package/dist/foundation/stubs/api.d.ts.map +1 -0
  378. package/dist/foundation/stubs/api.js +225 -0
  379. package/dist/foundation/stubs/api.js.map +1 -0
  380. package/dist/foundation/stubs/handler.d.ts +15 -0
  381. package/dist/foundation/stubs/handler.d.ts.map +1 -0
  382. package/dist/foundation/stubs/handler.js +54 -0
  383. package/dist/foundation/stubs/handler.js.map +1 -0
  384. package/dist/foundation/stubs/others.d.ts +53 -0
  385. package/dist/foundation/stubs/others.d.ts.map +1 -0
  386. package/dist/foundation/stubs/others.js +159 -0
  387. package/dist/foundation/stubs/others.js.map +1 -0
  388. package/dist/foundation/test-command.d.ts +9 -0
  389. package/dist/foundation/test-command.d.ts.map +1 -0
  390. package/dist/foundation/test-command.js +43 -0
  391. package/dist/foundation/test-command.js.map +1 -0
  392. package/dist/hash/hash.d.ts +44 -0
  393. package/dist/hash/hash.d.ts.map +1 -0
  394. package/dist/hash/hash.js +94 -0
  395. package/dist/hash/hash.js.map +1 -0
  396. package/dist/hash/index.d.ts +2 -0
  397. package/dist/hash/index.d.ts.map +1 -0
  398. package/dist/hash/index.js +2 -0
  399. package/dist/hash/index.js.map +1 -0
  400. package/dist/http/cookies.d.ts +37 -0
  401. package/dist/http/cookies.d.ts.map +1 -0
  402. package/dist/http/cookies.js +86 -0
  403. package/dist/http/cookies.js.map +1 -0
  404. package/dist/http/csrf.d.ts +24 -0
  405. package/dist/http/csrf.d.ts.map +1 -0
  406. package/dist/http/csrf.js +93 -0
  407. package/dist/http/csrf.js.map +1 -0
  408. package/dist/http/form.d.ts +11 -0
  409. package/dist/http/form.d.ts.map +1 -0
  410. package/dist/http/form.js +57 -0
  411. package/dist/http/form.js.map +1 -0
  412. package/dist/http/index.d.ts +18 -0
  413. package/dist/http/index.d.ts.map +1 -0
  414. package/dist/http/index.js +18 -0
  415. package/dist/http/index.js.map +1 -0
  416. package/dist/http/kernel.d.ts +82 -0
  417. package/dist/http/kernel.d.ts.map +1 -0
  418. package/dist/http/kernel.js +454 -0
  419. package/dist/http/kernel.js.map +1 -0
  420. package/dist/http/maintenance.d.ts +25 -0
  421. package/dist/http/maintenance.d.ts.map +1 -0
  422. package/dist/http/maintenance.js +70 -0
  423. package/dist/http/maintenance.js.map +1 -0
  424. package/dist/http/middleware.d.ts +75 -0
  425. package/dist/http/middleware.d.ts.map +1 -0
  426. package/dist/http/middleware.js +169 -0
  427. package/dist/http/middleware.js.map +1 -0
  428. package/dist/http/multipart.d.ts +4 -0
  429. package/dist/http/multipart.d.ts.map +1 -0
  430. package/dist/http/multipart.js +95 -0
  431. package/dist/http/multipart.js.map +1 -0
  432. package/dist/http/render.d.ts +19 -0
  433. package/dist/http/render.d.ts.map +1 -0
  434. package/dist/http/render.js +65 -0
  435. package/dist/http/render.js.map +1 -0
  436. package/dist/http/request.d.ts +106 -0
  437. package/dist/http/request.d.ts.map +1 -0
  438. package/dist/http/request.js +313 -0
  439. package/dist/http/request.js.map +1 -0
  440. package/dist/http/response.d.ts +128 -0
  441. package/dist/http/response.d.ts.map +1 -0
  442. package/dist/http/response.js +217 -0
  443. package/dist/http/response.js.map +1 -0
  444. package/dist/http/server.d.ts +27 -0
  445. package/dist/http/server.d.ts.map +1 -0
  446. package/dist/http/server.js +76 -0
  447. package/dist/http/server.js.map +1 -0
  448. package/dist/http/signature.d.ts +10 -0
  449. package/dist/http/signature.d.ts.map +1 -0
  450. package/dist/http/signature.js +42 -0
  451. package/dist/http/signature.js.map +1 -0
  452. package/dist/http/throttle.d.ts +26 -0
  453. package/dist/http/throttle.d.ts.map +1 -0
  454. package/dist/http/throttle.js +52 -0
  455. package/dist/http/throttle.js.map +1 -0
  456. package/dist/http/types.d.ts +66 -0
  457. package/dist/http/types.d.ts.map +1 -0
  458. package/dist/http/types.js +5 -0
  459. package/dist/http/types.js.map +1 -0
  460. package/dist/http/uploads.d.ts +46 -0
  461. package/dist/http/uploads.d.ts.map +1 -0
  462. package/dist/http/uploads.js +130 -0
  463. package/dist/http/uploads.js.map +1 -0
  464. package/dist/http/wire.d.ts +15 -0
  465. package/dist/http/wire.d.ts.map +1 -0
  466. package/dist/http/wire.js +114 -0
  467. package/dist/http/wire.js.map +1 -0
  468. package/dist/http/write.d.ts +13 -0
  469. package/dist/http/write.d.ts.map +1 -0
  470. package/dist/http/write.js +161 -0
  471. package/dist/http/write.js.map +1 -0
  472. package/dist/http-client/index.d.ts +2 -0
  473. package/dist/http-client/index.d.ts.map +1 -0
  474. package/dist/http-client/index.js +2 -0
  475. package/dist/http-client/index.js.map +1 -0
  476. package/dist/index.d.ts +8 -0
  477. package/dist/index.d.ts.map +1 -0
  478. package/dist/index.js +6 -0
  479. package/dist/index.js.map +1 -0
  480. package/dist/inertia/index.d.ts +5 -0
  481. package/dist/inertia/index.d.ts.map +1 -0
  482. package/dist/inertia/index.js +4 -0
  483. package/dist/inertia/index.js.map +1 -0
  484. package/dist/inertia/inertia.d.ts +159 -0
  485. package/dist/inertia/inertia.d.ts.map +1 -0
  486. package/dist/inertia/inertia.js +406 -0
  487. package/dist/inertia/inertia.js.map +1 -0
  488. package/dist/inertia/props.d.ts +138 -0
  489. package/dist/inertia/props.d.ts.map +1 -0
  490. package/dist/inertia/props.js +138 -0
  491. package/dist/inertia/props.js.map +1 -0
  492. package/dist/inertia/resolve.d.ts +51 -0
  493. package/dist/inertia/resolve.d.ts.map +1 -0
  494. package/dist/inertia/resolve.js +289 -0
  495. package/dist/inertia/resolve.js.map +1 -0
  496. package/dist/inertia/response.d.ts +24 -0
  497. package/dist/inertia/response.d.ts.map +1 -0
  498. package/dist/inertia/response.js +49 -0
  499. package/dist/inertia/response.js.map +1 -0
  500. package/dist/inertia/ssr-worker.d.ts +25 -0
  501. package/dist/inertia/ssr-worker.d.ts.map +1 -0
  502. package/dist/inertia/ssr-worker.js +55 -0
  503. package/dist/inertia/ssr-worker.js.map +1 -0
  504. package/dist/inertia/ssr.d.ts +49 -0
  505. package/dist/inertia/ssr.d.ts.map +1 -0
  506. package/dist/inertia/ssr.js +273 -0
  507. package/dist/inertia/ssr.js.map +1 -0
  508. package/dist/log/channels.d.ts +27 -0
  509. package/dist/log/channels.d.ts.map +1 -0
  510. package/dist/log/channels.js +95 -0
  511. package/dist/log/channels.js.map +1 -0
  512. package/dist/log/index.d.ts +4 -0
  513. package/dist/log/index.d.ts.map +1 -0
  514. package/dist/log/index.js +4 -0
  515. package/dist/log/index.js.map +1 -0
  516. package/dist/log/log.d.ts +69 -0
  517. package/dist/log/log.d.ts.map +1 -0
  518. package/dist/log/log.js +173 -0
  519. package/dist/log/log.js.map +1 -0
  520. package/dist/log/record.d.ts +26 -0
  521. package/dist/log/record.d.ts.map +1 -0
  522. package/dist/log/record.js +89 -0
  523. package/dist/log/record.js.map +1 -0
  524. package/dist/mail/address.d.ts +27 -0
  525. package/dist/mail/address.d.ts.map +1 -0
  526. package/dist/mail/address.js +44 -0
  527. package/dist/mail/address.js.map +1 -0
  528. package/dist/mail/auth.d.ts +6 -0
  529. package/dist/mail/auth.d.ts.map +1 -0
  530. package/dist/mail/auth.js +39 -0
  531. package/dist/mail/auth.js.map +1 -0
  532. package/dist/mail/components.d.ts +29 -0
  533. package/dist/mail/components.d.ts.map +1 -0
  534. package/dist/mail/components.js +87 -0
  535. package/dist/mail/components.js.map +1 -0
  536. package/dist/mail/fake.d.ts +42 -0
  537. package/dist/mail/fake.d.ts.map +1 -0
  538. package/dist/mail/fake.js +111 -0
  539. package/dist/mail/fake.js.map +1 -0
  540. package/dist/mail/index.d.ts +9 -0
  541. package/dist/mail/index.d.ts.map +1 -0
  542. package/dist/mail/index.js +9 -0
  543. package/dist/mail/index.js.map +1 -0
  544. package/dist/mail/mail.d.ts +56 -0
  545. package/dist/mail/mail.d.ts.map +1 -0
  546. package/dist/mail/mail.js +68 -0
  547. package/dist/mail/mail.js.map +1 -0
  548. package/dist/mail/manager.d.ts +77 -0
  549. package/dist/mail/manager.d.ts.map +1 -0
  550. package/dist/mail/manager.js +160 -0
  551. package/dist/mail/manager.js.map +1 -0
  552. package/dist/mail/text.d.ts +3 -0
  553. package/dist/mail/text.d.ts.map +1 -0
  554. package/dist/mail/text.js +161 -0
  555. package/dist/mail/text.js.map +1 -0
  556. package/dist/mail/transport.d.ts +57 -0
  557. package/dist/mail/transport.d.ts.map +1 -0
  558. package/dist/mail/transport.js +41 -0
  559. package/dist/mail/transport.js.map +1 -0
  560. package/dist/migrations/create-database.d.ts +6 -0
  561. package/dist/migrations/create-database.d.ts.map +1 -0
  562. package/dist/migrations/create-database.js +23 -0
  563. package/dist/migrations/create-database.js.map +1 -0
  564. package/dist/migrations/dump.d.ts +27 -0
  565. package/dist/migrations/dump.d.ts.map +1 -0
  566. package/dist/migrations/dump.js +258 -0
  567. package/dist/migrations/dump.js.map +1 -0
  568. package/dist/migrations/files.d.ts +40 -0
  569. package/dist/migrations/files.d.ts.map +1 -0
  570. package/dist/migrations/files.js +101 -0
  571. package/dist/migrations/files.js.map +1 -0
  572. package/dist/migrations/index.d.ts +5 -0
  573. package/dist/migrations/index.d.ts.map +1 -0
  574. package/dist/migrations/index.js +5 -0
  575. package/dist/migrations/index.js.map +1 -0
  576. package/dist/migrations/migrator.d.ts +97 -0
  577. package/dist/migrations/migrator.d.ts.map +1 -0
  578. package/dist/migrations/migrator.js +383 -0
  579. package/dist/migrations/migrator.js.map +1 -0
  580. package/dist/model/checks.d.ts +10 -0
  581. package/dist/model/checks.d.ts.map +1 -0
  582. package/dist/model/checks.js +171 -0
  583. package/dist/model/checks.js.map +1 -0
  584. package/dist/model/columns.d.ts +153 -0
  585. package/dist/model/columns.d.ts.map +1 -0
  586. package/dist/model/columns.js +96 -0
  587. package/dist/model/columns.js.map +1 -0
  588. package/dist/model/describe.d.ts +36 -0
  589. package/dist/model/describe.d.ts.map +1 -0
  590. package/dist/model/describe.js +57 -0
  591. package/dist/model/describe.js.map +1 -0
  592. package/dist/model/drift.d.ts +15 -0
  593. package/dist/model/drift.d.ts.map +1 -0
  594. package/dist/model/drift.js +123 -0
  595. package/dist/model/drift.js.map +1 -0
  596. package/dist/model/errors.d.ts +33 -0
  597. package/dist/model/errors.d.ts.map +1 -0
  598. package/dist/model/errors.js +55 -0
  599. package/dist/model/errors.js.map +1 -0
  600. package/dist/model/index.d.ts +14 -0
  601. package/dist/model/index.d.ts.map +1 -0
  602. package/dist/model/index.js +13 -0
  603. package/dist/model/index.js.map +1 -0
  604. package/dist/model/keys.d.ts +37 -0
  605. package/dist/model/keys.d.ts.map +1 -0
  606. package/dist/model/keys.js +39 -0
  607. package/dist/model/keys.js.map +1 -0
  608. package/dist/model/loading.d.ts +8 -0
  609. package/dist/model/loading.d.ts.map +1 -0
  610. package/dist/model/loading.js +201 -0
  611. package/dist/model/loading.js.map +1 -0
  612. package/dist/model/meta.d.ts +27 -0
  613. package/dist/model/meta.d.ts.map +1 -0
  614. package/dist/model/meta.js +110 -0
  615. package/dist/model/meta.js.map +1 -0
  616. package/dist/model/model.d.ts +107 -0
  617. package/dist/model/model.d.ts.map +1 -0
  618. package/dist/model/model.js +667 -0
  619. package/dist/model/model.js.map +1 -0
  620. package/dist/model/query.d.ts +214 -0
  621. package/dist/model/query.d.ts.map +1 -0
  622. package/dist/model/query.js +869 -0
  623. package/dist/model/query.js.map +1 -0
  624. package/dist/model/related.d.ts +40 -0
  625. package/dist/model/related.d.ts.map +1 -0
  626. package/dist/model/related.js +274 -0
  627. package/dist/model/related.js.map +1 -0
  628. package/dist/model/relations.d.ts +160 -0
  629. package/dist/model/relations.d.ts.map +1 -0
  630. package/dist/model/relations.js +44 -0
  631. package/dist/model/relations.js.map +1 -0
  632. package/dist/model/types.d.ts +461 -0
  633. package/dist/model/types.d.ts.map +1 -0
  634. package/dist/model/types.js +2 -0
  635. package/dist/model/types.js.map +1 -0
  636. package/dist/notification/index.d.ts +2 -0
  637. package/dist/notification/index.d.ts.map +1 -0
  638. package/dist/notification/index.js +2 -0
  639. package/dist/notification/index.js.map +1 -0
  640. package/dist/pagination/index.d.ts +2 -0
  641. package/dist/pagination/index.d.ts.map +1 -0
  642. package/dist/pagination/index.js +2 -0
  643. package/dist/pagination/index.js.map +1 -0
  644. package/dist/pagination/paginator.d.ts +174 -0
  645. package/dist/pagination/paginator.d.ts.map +1 -0
  646. package/dist/pagination/paginator.js +413 -0
  647. package/dist/pagination/paginator.js.map +1 -0
  648. package/dist/queue/batches.d.ts +152 -0
  649. package/dist/queue/batches.d.ts.map +1 -0
  650. package/dist/queue/batches.js +344 -0
  651. package/dist/queue/batches.js.map +1 -0
  652. package/dist/queue/database.d.ts +35 -0
  653. package/dist/queue/database.d.ts.map +1 -0
  654. package/dist/queue/database.js +137 -0
  655. package/dist/queue/database.js.map +1 -0
  656. package/dist/queue/driver.d.ts +72 -0
  657. package/dist/queue/driver.d.ts.map +1 -0
  658. package/dist/queue/driver.js +17 -0
  659. package/dist/queue/driver.js.map +1 -0
  660. package/dist/queue/envelope.d.ts +66 -0
  661. package/dist/queue/envelope.d.ts.map +1 -0
  662. package/dist/queue/envelope.js +81 -0
  663. package/dist/queue/envelope.js.map +1 -0
  664. package/dist/queue/failed.d.ts +43 -0
  665. package/dist/queue/failed.d.ts.map +1 -0
  666. package/dist/queue/failed.js +76 -0
  667. package/dist/queue/failed.js.map +1 -0
  668. package/dist/queue/fake.d.ts +68 -0
  669. package/dist/queue/fake.d.ts.map +1 -0
  670. package/dist/queue/fake.js +93 -0
  671. package/dist/queue/fake.js.map +1 -0
  672. package/dist/queue/index.d.ts +15 -0
  673. package/dist/queue/index.d.ts.map +1 -0
  674. package/dist/queue/index.js +15 -0
  675. package/dist/queue/index.js.map +1 -0
  676. package/dist/queue/job.d.ts +137 -0
  677. package/dist/queue/job.d.ts.map +1 -0
  678. package/dist/queue/job.js +154 -0
  679. package/dist/queue/job.js.map +1 -0
  680. package/dist/queue/manager.d.ts +116 -0
  681. package/dist/queue/manager.d.ts.map +1 -0
  682. package/dist/queue/manager.js +545 -0
  683. package/dist/queue/manager.js.map +1 -0
  684. package/dist/queue/middleware.d.ts +33 -0
  685. package/dist/queue/middleware.d.ts.map +1 -0
  686. package/dist/queue/middleware.js +88 -0
  687. package/dist/queue/middleware.js.map +1 -0
  688. package/dist/queue/module.d.ts +42 -0
  689. package/dist/queue/module.d.ts.map +1 -0
  690. package/dist/queue/module.js +68 -0
  691. package/dist/queue/module.js.map +1 -0
  692. package/dist/queue/redis.d.ts +27 -0
  693. package/dist/queue/redis.d.ts.map +1 -0
  694. package/dist/queue/redis.js +189 -0
  695. package/dist/queue/redis.js.map +1 -0
  696. package/dist/queue/runner.d.ts +79 -0
  697. package/dist/queue/runner.d.ts.map +1 -0
  698. package/dist/queue/runner.js +129 -0
  699. package/dist/queue/runner.js.map +1 -0
  700. package/dist/queue/sqs.d.ts +59 -0
  701. package/dist/queue/sqs.d.ts.map +1 -0
  702. package/dist/queue/sqs.js +323 -0
  703. package/dist/queue/sqs.js.map +1 -0
  704. package/dist/queue/worker.d.ts +59 -0
  705. package/dist/queue/worker.d.ts.map +1 -0
  706. package/dist/queue/worker.js +466 -0
  707. package/dist/queue/worker.js.map +1 -0
  708. package/dist/redis/index.d.ts +2 -0
  709. package/dist/redis/index.d.ts.map +1 -0
  710. package/dist/redis/index.js +2 -0
  711. package/dist/redis/index.js.map +1 -0
  712. package/dist/redis/redis.d.ts +41 -0
  713. package/dist/redis/redis.d.ts.map +1 -0
  714. package/dist/redis/redis.js +140 -0
  715. package/dist/redis/redis.js.map +1 -0
  716. package/dist/reverb/index.d.ts +2 -0
  717. package/dist/reverb/index.d.ts.map +1 -0
  718. package/dist/reverb/index.js +2 -0
  719. package/dist/reverb/index.js.map +1 -0
  720. package/dist/routing/index.d.ts +6 -0
  721. package/dist/routing/index.d.ts.map +1 -0
  722. package/dist/routing/index.js +6 -0
  723. package/dist/routing/index.js.map +1 -0
  724. package/dist/routing/paths.d.ts +27 -0
  725. package/dist/routing/paths.d.ts.map +1 -0
  726. package/dist/routing/paths.js +45 -0
  727. package/dist/routing/paths.js.map +1 -0
  728. package/dist/routing/router.d.ts +137 -0
  729. package/dist/routing/router.d.ts.map +1 -0
  730. package/dist/routing/router.js +236 -0
  731. package/dist/routing/router.js.map +1 -0
  732. package/dist/routing/routing.d.ts +34 -0
  733. package/dist/routing/routing.d.ts.map +1 -0
  734. package/dist/routing/routing.js +57 -0
  735. package/dist/routing/routing.js.map +1 -0
  736. package/dist/routing/table.d.ts +35 -0
  737. package/dist/routing/table.d.ts.map +1 -0
  738. package/dist/routing/table.js +247 -0
  739. package/dist/routing/table.js.map +1 -0
  740. package/dist/routing/urls.d.ts +34 -0
  741. package/dist/routing/urls.d.ts.map +1 -0
  742. package/dist/routing/urls.js +116 -0
  743. package/dist/routing/urls.js.map +1 -0
  744. package/dist/schedule/cron.d.ts +35 -0
  745. package/dist/schedule/cron.d.ts.map +1 -0
  746. package/dist/schedule/cron.js +212 -0
  747. package/dist/schedule/cron.js.map +1 -0
  748. package/dist/schedule/index.d.ts +5 -0
  749. package/dist/schedule/index.d.ts.map +1 -0
  750. package/dist/schedule/index.js +5 -0
  751. package/dist/schedule/index.js.map +1 -0
  752. package/dist/schedule/schedule.d.ts +38 -0
  753. package/dist/schedule/schedule.d.ts.map +1 -0
  754. package/dist/schedule/schedule.js +70 -0
  755. package/dist/schedule/schedule.js.map +1 -0
  756. package/dist/schedule/scheduler.d.ts +89 -0
  757. package/dist/schedule/scheduler.d.ts.map +1 -0
  758. package/dist/schedule/scheduler.js +404 -0
  759. package/dist/schedule/scheduler.js.map +1 -0
  760. package/dist/schedule/task.d.ts +150 -0
  761. package/dist/schedule/task.d.ts.map +1 -0
  762. package/dist/schedule/task.js +323 -0
  763. package/dist/schedule/task.js.map +1 -0
  764. package/dist/schema/blueprint.d.ts +256 -0
  765. package/dist/schema/blueprint.d.ts.map +1 -0
  766. package/dist/schema/blueprint.js +458 -0
  767. package/dist/schema/blueprint.js.map +1 -0
  768. package/dist/schema/builder.d.ts +40 -0
  769. package/dist/schema/builder.d.ts.map +1 -0
  770. package/dist/schema/builder.js +153 -0
  771. package/dist/schema/builder.js.map +1 -0
  772. package/dist/schema/grammars/grammar.d.ts +112 -0
  773. package/dist/schema/grammars/grammar.d.ts.map +1 -0
  774. package/dist/schema/grammars/grammar.js +231 -0
  775. package/dist/schema/grammars/grammar.js.map +1 -0
  776. package/dist/schema/grammars/mysql.d.ts +43 -0
  777. package/dist/schema/grammars/mysql.d.ts.map +1 -0
  778. package/dist/schema/grammars/mysql.js +220 -0
  779. package/dist/schema/grammars/mysql.js.map +1 -0
  780. package/dist/schema/grammars/pgsql.d.ts +33 -0
  781. package/dist/schema/grammars/pgsql.d.ts.map +1 -0
  782. package/dist/schema/grammars/pgsql.js +218 -0
  783. package/dist/schema/grammars/pgsql.js.map +1 -0
  784. package/dist/schema/grammars/sqlite-text.d.ts +24 -0
  785. package/dist/schema/grammars/sqlite-text.d.ts.map +1 -0
  786. package/dist/schema/grammars/sqlite-text.js +174 -0
  787. package/dist/schema/grammars/sqlite-text.js.map +1 -0
  788. package/dist/schema/grammars/sqlite.d.ts +39 -0
  789. package/dist/schema/grammars/sqlite.d.ts.map +1 -0
  790. package/dist/schema/grammars/sqlite.js +484 -0
  791. package/dist/schema/grammars/sqlite.js.map +1 -0
  792. package/dist/schema/index.d.ts +9 -0
  793. package/dist/schema/index.d.ts.map +1 -0
  794. package/dist/schema/index.js +9 -0
  795. package/dist/schema/index.js.map +1 -0
  796. package/dist/schema/schema.d.ts +48 -0
  797. package/dist/schema/schema.d.ts.map +1 -0
  798. package/dist/schema/schema.js +47 -0
  799. package/dist/schema/schema.js.map +1 -0
  800. package/dist/scope/context.d.ts +39 -0
  801. package/dist/scope/context.d.ts.map +1 -0
  802. package/dist/scope/context.js +113 -0
  803. package/dist/scope/context.js.map +1 -0
  804. package/dist/scope/index.d.ts +3 -0
  805. package/dist/scope/index.d.ts.map +1 -0
  806. package/dist/scope/index.js +3 -0
  807. package/dist/scope/index.js.map +1 -0
  808. package/dist/scope/scope.d.ts +116 -0
  809. package/dist/scope/scope.d.ts.map +1 -0
  810. package/dist/scope/scope.js +148 -0
  811. package/dist/scope/scope.js.map +1 -0
  812. package/dist/session/cache-store.d.ts +17 -0
  813. package/dist/session/cache-store.d.ts.map +1 -0
  814. package/dist/session/cache-store.js +45 -0
  815. package/dist/session/cache-store.js.map +1 -0
  816. package/dist/session/database.d.ts +32 -0
  817. package/dist/session/database.d.ts.map +1 -0
  818. package/dist/session/database.js +98 -0
  819. package/dist/session/database.js.map +1 -0
  820. package/dist/session/index.d.ts +7 -0
  821. package/dist/session/index.d.ts.map +1 -0
  822. package/dist/session/index.js +7 -0
  823. package/dist/session/index.js.map +1 -0
  824. package/dist/session/manager.d.ts +61 -0
  825. package/dist/session/manager.d.ts.map +1 -0
  826. package/dist/session/manager.js +217 -0
  827. package/dist/session/manager.js.map +1 -0
  828. package/dist/session/middleware.d.ts +6 -0
  829. package/dist/session/middleware.d.ts.map +1 -0
  830. package/dist/session/middleware.js +76 -0
  831. package/dist/session/middleware.js.map +1 -0
  832. package/dist/session/session.d.ts +118 -0
  833. package/dist/session/session.d.ts.map +1 -0
  834. package/dist/session/session.js +223 -0
  835. package/dist/session/session.js.map +1 -0
  836. package/dist/session/stores.d.ts +36 -0
  837. package/dist/session/stores.d.ts.map +1 -0
  838. package/dist/session/stores.js +151 -0
  839. package/dist/session/stores.js.map +1 -0
  840. package/dist/storage/index.d.ts +2 -0
  841. package/dist/storage/index.d.ts.map +1 -0
  842. package/dist/storage/index.js +2 -0
  843. package/dist/storage/index.js.map +1 -0
  844. package/dist/str/index.d.ts +2 -0
  845. package/dist/str/index.d.ts.map +1 -0
  846. package/dist/str/index.js +2 -0
  847. package/dist/str/index.js.map +1 -0
  848. package/dist/str/str.d.ts +27 -0
  849. package/dist/str/str.d.ts.map +1 -0
  850. package/dist/str/str.js +102 -0
  851. package/dist/str/str.js.map +1 -0
  852. package/dist/support/clock.d.ts +6 -0
  853. package/dist/support/clock.d.ts.map +1 -0
  854. package/dist/support/clock.js +7 -0
  855. package/dist/support/clock.js.map +1 -0
  856. package/dist/support/data.d.ts +29 -0
  857. package/dist/support/data.d.ts.map +1 -0
  858. package/dist/support/data.js +160 -0
  859. package/dist/support/data.js.map +1 -0
  860. package/dist/support/index.d.ts +8 -0
  861. package/dist/support/index.d.ts.map +1 -0
  862. package/dist/support/index.js +7 -0
  863. package/dist/support/index.js.map +1 -0
  864. package/dist/support/register.d.ts +14 -0
  865. package/dist/support/register.d.ts.map +1 -0
  866. package/dist/support/register.js +2 -0
  867. package/dist/support/register.js.map +1 -0
  868. package/dist/support/text.d.ts +8 -0
  869. package/dist/support/text.d.ts.map +1 -0
  870. package/dist/support/text.js +19 -0
  871. package/dist/support/text.js.map +1 -0
  872. package/dist/support/type-assertions.d.ts +7 -0
  873. package/dist/support/type-assertions.d.ts.map +1 -0
  874. package/dist/support/type-assertions.js +10 -0
  875. package/dist/support/type-assertions.js.map +1 -0
  876. package/dist/support/types.d.ts +34 -0
  877. package/dist/support/types.d.ts.map +1 -0
  878. package/dist/support/types.js +31 -0
  879. package/dist/support/types.js.map +1 -0
  880. package/dist/support/units.d.ts +17 -0
  881. package/dist/support/units.d.ts.map +1 -0
  882. package/dist/support/units.js +54 -0
  883. package/dist/support/units.js.map +1 -0
  884. package/dist/task/index.d.ts +2 -0
  885. package/dist/task/index.d.ts.map +1 -0
  886. package/dist/task/index.js +2 -0
  887. package/dist/task/index.js.map +1 -0
  888. package/dist/task/task.d.ts +68 -0
  889. package/dist/task/task.d.ts.map +1 -0
  890. package/dist/task/task.js +162 -0
  891. package/dist/task/task.js.map +1 -0
  892. package/dist/testing/assert-database.d.ts +10 -0
  893. package/dist/testing/assert-database.d.ts.map +1 -0
  894. package/dist/testing/assert-database.js +125 -0
  895. package/dist/testing/assert-database.js.map +1 -0
  896. package/dist/testing/conformance/cache.d.ts +24 -0
  897. package/dist/testing/conformance/cache.d.ts.map +1 -0
  898. package/dist/testing/conformance/cache.js +397 -0
  899. package/dist/testing/conformance/cache.js.map +1 -0
  900. package/dist/testing/conformance/column-types.d.ts +44 -0
  901. package/dist/testing/conformance/column-types.d.ts.map +1 -0
  902. package/dist/testing/conformance/column-types.js +47 -0
  903. package/dist/testing/conformance/column-types.js.map +1 -0
  904. package/dist/testing/conformance/database.d.ts +11 -0
  905. package/dist/testing/conformance/database.d.ts.map +1 -0
  906. package/dist/testing/conformance/database.js +410 -0
  907. package/dist/testing/conformance/database.js.map +1 -0
  908. package/dist/testing/conformance/factories.d.ts +4 -0
  909. package/dist/testing/conformance/factories.d.ts.map +1 -0
  910. package/dist/testing/conformance/factories.js +313 -0
  911. package/dist/testing/conformance/factories.js.map +1 -0
  912. package/dist/testing/conformance/harness.d.ts +30 -0
  913. package/dist/testing/conformance/harness.d.ts.map +1 -0
  914. package/dist/testing/conformance/harness.js +85 -0
  915. package/dist/testing/conformance/harness.js.map +1 -0
  916. package/dist/testing/conformance/index.d.ts +13 -0
  917. package/dist/testing/conformance/index.d.ts.map +1 -0
  918. package/dist/testing/conformance/index.js +12 -0
  919. package/dist/testing/conformance/index.js.map +1 -0
  920. package/dist/testing/conformance/migrations.d.ts +4 -0
  921. package/dist/testing/conformance/migrations.d.ts.map +1 -0
  922. package/dist/testing/conformance/migrations.js +313 -0
  923. package/dist/testing/conformance/migrations.js.map +1 -0
  924. package/dist/testing/conformance/models.d.ts +4 -0
  925. package/dist/testing/conformance/models.d.ts.map +1 -0
  926. package/dist/testing/conformance/models.js +715 -0
  927. package/dist/testing/conformance/models.js.map +1 -0
  928. package/dist/testing/conformance/pagination.d.ts +4 -0
  929. package/dist/testing/conformance/pagination.d.ts.map +1 -0
  930. package/dist/testing/conformance/pagination.js +283 -0
  931. package/dist/testing/conformance/pagination.js.map +1 -0
  932. package/dist/testing/conformance/query-builder.d.ts +4 -0
  933. package/dist/testing/conformance/query-builder.d.ts.map +1 -0
  934. package/dist/testing/conformance/query-builder.js +725 -0
  935. package/dist/testing/conformance/query-builder.js.map +1 -0
  936. package/dist/testing/conformance/queue.d.ts +29 -0
  937. package/dist/testing/conformance/queue.d.ts.map +1 -0
  938. package/dist/testing/conformance/queue.js +203 -0
  939. package/dist/testing/conformance/queue.js.map +1 -0
  940. package/dist/testing/conformance/relationships.d.ts +4 -0
  941. package/dist/testing/conformance/relationships.d.ts.map +1 -0
  942. package/dist/testing/conformance/relationships.js +737 -0
  943. package/dist/testing/conformance/relationships.js.map +1 -0
  944. package/dist/testing/conformance/schema.d.ts +4 -0
  945. package/dist/testing/conformance/schema.d.ts.map +1 -0
  946. package/dist/testing/conformance/schema.js +320 -0
  947. package/dist/testing/conformance/schema.js.map +1 -0
  948. package/dist/testing/conformance/session.d.ts +22 -0
  949. package/dist/testing/conformance/session.d.ts.map +1 -0
  950. package/dist/testing/conformance/session.js +162 -0
  951. package/dist/testing/conformance/session.js.map +1 -0
  952. package/dist/testing/database.d.ts +28 -0
  953. package/dist/testing/database.d.ts.map +1 -0
  954. package/dist/testing/database.js +213 -0
  955. package/dist/testing/database.js.map +1 -0
  956. package/dist/testing/files.d.ts +11 -0
  957. package/dist/testing/files.d.ts.map +1 -0
  958. package/dist/testing/files.js +44 -0
  959. package/dist/testing/files.js.map +1 -0
  960. package/dist/testing/index.d.ts +7 -0
  961. package/dist/testing/index.d.ts.map +1 -0
  962. package/dist/testing/index.js +7 -0
  963. package/dist/testing/index.js.map +1 -0
  964. package/dist/testing/inertia.d.ts +35 -0
  965. package/dist/testing/inertia.d.ts.map +1 -0
  966. package/dist/testing/inertia.js +127 -0
  967. package/dist/testing/inertia.js.map +1 -0
  968. package/dist/testing/query-log.d.ts +10 -0
  969. package/dist/testing/query-log.d.ts.map +1 -0
  970. package/dist/testing/query-log.js +31 -0
  971. package/dist/testing/query-log.js.map +1 -0
  972. package/dist/testing/response.d.ts +100 -0
  973. package/dist/testing/response.d.ts.map +1 -0
  974. package/dist/testing/response.js +329 -0
  975. package/dist/testing/response.js.map +1 -0
  976. package/dist/testing/testing.d.ts +191 -0
  977. package/dist/testing/testing.d.ts.map +1 -0
  978. package/dist/testing/testing.js +449 -0
  979. package/dist/testing/testing.js.map +1 -0
  980. package/dist/time/index.d.ts +3 -0
  981. package/dist/time/index.d.ts.map +1 -0
  982. package/dist/time/index.js +2 -0
  983. package/dist/time/index.js.map +1 -0
  984. package/dist/time/time.d.ts +39 -0
  985. package/dist/time/time.d.ts.map +1 -0
  986. package/dist/time/time.js +130 -0
  987. package/dist/time/time.js.map +1 -0
  988. package/dist/tracing/index.d.ts +2 -0
  989. package/dist/tracing/index.d.ts.map +1 -0
  990. package/dist/tracing/index.js +2 -0
  991. package/dist/tracing/index.js.map +1 -0
  992. package/dist/validation/index.d.ts +6 -0
  993. package/dist/validation/index.d.ts.map +1 -0
  994. package/dist/validation/index.js +6 -0
  995. package/dist/validation/index.js.map +1 -0
  996. package/dist/validation/input.d.ts +89 -0
  997. package/dist/validation/input.d.ts.map +1 -0
  998. package/dist/validation/input.js +241 -0
  999. package/dist/validation/input.js.map +1 -0
  1000. package/dist/validation/messages.d.ts +7 -0
  1001. package/dist/validation/messages.d.ts.map +1 -0
  1002. package/dist/validation/messages.js +93 -0
  1003. package/dist/validation/messages.js.map +1 -0
  1004. package/dist/validation/presence.d.ts +32 -0
  1005. package/dist/validation/presence.d.ts.map +1 -0
  1006. package/dist/validation/presence.js +17 -0
  1007. package/dist/validation/presence.js.map +1 -0
  1008. package/dist/validation/rules.d.ts +321 -0
  1009. package/dist/validation/rules.d.ts.map +1 -0
  1010. package/dist/validation/rules.js +603 -0
  1011. package/dist/validation/rules.js.map +1 -0
  1012. package/dist/validation/standard.d.ts +33 -0
  1013. package/dist/validation/standard.d.ts.map +1 -0
  1014. package/dist/validation/standard.js +10 -0
  1015. package/dist/validation/standard.js.map +1 -0
  1016. package/dist/view/channel.d.ts +13 -0
  1017. package/dist/view/channel.d.ts.map +1 -0
  1018. package/dist/view/channel.js +6 -0
  1019. package/dist/view/channel.js.map +1 -0
  1020. package/dist/view/head.d.ts +60 -0
  1021. package/dist/view/head.d.ts.map +1 -0
  1022. package/dist/view/head.js +122 -0
  1023. package/dist/view/head.js.map +1 -0
  1024. package/dist/view/helpers.d.ts +17 -0
  1025. package/dist/view/helpers.d.ts.map +1 -0
  1026. package/dist/view/helpers.js +19 -0
  1027. package/dist/view/helpers.js.map +1 -0
  1028. package/dist/view/html.d.ts +25 -0
  1029. package/dist/view/html.d.ts.map +1 -0
  1030. package/dist/view/html.js +291 -0
  1031. package/dist/view/html.js.map +1 -0
  1032. package/dist/view/index.d.ts +7 -0
  1033. package/dist/view/index.d.ts.map +1 -0
  1034. package/dist/view/index.js +7 -0
  1035. package/dist/view/index.js.map +1 -0
  1036. package/dist/view/translate.d.ts +14 -0
  1037. package/dist/view/translate.d.ts.map +1 -0
  1038. package/dist/view/translate.js +42 -0
  1039. package/dist/view/translate.js.map +1 -0
  1040. package/dist/vite/index.d.ts +3 -0
  1041. package/dist/vite/index.d.ts.map +1 -0
  1042. package/dist/vite/index.js +3 -0
  1043. package/dist/vite/index.js.map +1 -0
  1044. package/dist/vite/plugin.d.ts +51 -0
  1045. package/dist/vite/plugin.d.ts.map +1 -0
  1046. package/dist/vite/plugin.js +273 -0
  1047. package/dist/vite/plugin.js.map +1 -0
  1048. package/dist/vite/vite.d.ts +68 -0
  1049. package/dist/vite/vite.d.ts.map +1 -0
  1050. package/dist/vite/vite.js +228 -0
  1051. package/dist/vite/vite.js.map +1 -0
  1052. package/dist/workflow/index.d.ts +2 -0
  1053. package/dist/workflow/index.d.ts.map +1 -0
  1054. package/dist/workflow/index.js +2 -0
  1055. package/dist/workflow/index.js.map +1 -0
  1056. package/docs/authentication.md +428 -0
  1057. package/docs/authorization.md +203 -0
  1058. package/docs/cache.md +215 -0
  1059. package/docs/configuration.md +86 -0
  1060. package/docs/console.md +99 -0
  1061. package/docs/container.md +58 -0
  1062. package/docs/csrf.md +54 -0
  1063. package/docs/database-testing.md +121 -0
  1064. package/docs/database.md +314 -0
  1065. package/docs/documentation.md +49 -0
  1066. package/docs/encryption.md +104 -0
  1067. package/docs/errors.md +85 -0
  1068. package/docs/events.md +136 -0
  1069. package/docs/factories.md +144 -0
  1070. package/docs/hashing.md +78 -0
  1071. package/docs/inertia.md +469 -0
  1072. package/docs/installation.md +87 -0
  1073. package/docs/lifecycle.md +84 -0
  1074. package/docs/logging.md +49 -0
  1075. package/docs/middleware.md +64 -0
  1076. package/docs/migrations.md +192 -0
  1077. package/docs/models.md +301 -0
  1078. package/docs/pagination.md +129 -0
  1079. package/docs/passwords.md +151 -0
  1080. package/docs/providers.md +51 -0
  1081. package/docs/queries.md +239 -0
  1082. package/docs/queues.md +407 -0
  1083. package/docs/rate-limiting.md +64 -0
  1084. package/docs/redis.md +76 -0
  1085. package/docs/relationships.md +251 -0
  1086. package/docs/requests.md +53 -0
  1087. package/docs/responses.md +71 -0
  1088. package/docs/routing.md +84 -0
  1089. package/docs/scheduling.md +177 -0
  1090. package/docs/seeding.md +96 -0
  1091. package/docs/session.md +138 -0
  1092. package/docs/structure.md +45 -0
  1093. package/docs/testing.md +134 -0
  1094. package/docs/upgrade.md +42 -0
  1095. package/docs/uploads.md +74 -0
  1096. package/docs/validation.md +105 -0
  1097. package/docs/verification.md +125 -0
  1098. package/docs/views.md +94 -0
  1099. package/docs/vite.md +193 -0
  1100. package/package.json +270 -3
  1101. package/src/auth/auth.ts +260 -0
  1102. package/src/auth/errors.ts +69 -0
  1103. package/src/auth/index.ts +34 -0
  1104. package/src/auth/manager.ts +205 -0
  1105. package/src/auth/middleware.ts +169 -0
  1106. package/src/auth/passwords.ts +117 -0
  1107. package/src/auth/policy.ts +184 -0
  1108. package/src/auth/setup.ts +96 -0
  1109. package/src/auth/state.ts +24 -0
  1110. package/src/auth/tokens.ts +66 -0
  1111. package/src/auth/verification.ts +85 -0
  1112. package/src/aws/index.ts +10 -0
  1113. package/src/aws/signer.ts +170 -0
  1114. package/src/broadcast/index.ts +1 -0
  1115. package/src/cache/cache.ts +495 -0
  1116. package/src/cache/database.ts +243 -0
  1117. package/src/cache/file.ts +262 -0
  1118. package/src/cache/index.ts +26 -0
  1119. package/src/cache/manager.ts +138 -0
  1120. package/src/cache/module.ts +59 -0
  1121. package/src/cache/rate-limiter.ts +183 -0
  1122. package/src/cache/redis.ts +122 -0
  1123. package/src/cache/store.ts +239 -0
  1124. package/src/client/index.ts +3 -0
  1125. package/src/client/pages.ts +90 -0
  1126. package/src/client/routes.ts +90 -0
  1127. package/src/client/wire.ts +93 -0
  1128. package/src/config/config.ts +83 -0
  1129. package/src/config/index.ts +27 -0
  1130. package/src/config/sections.ts +501 -0
  1131. package/src/console/command.ts +171 -0
  1132. package/src/console/index.ts +13 -0
  1133. package/src/console/io.ts +285 -0
  1134. package/src/console/kernel.ts +309 -0
  1135. package/src/container/container.ts +174 -0
  1136. package/src/container/index.ts +1 -0
  1137. package/src/cookie/index.ts +1 -0
  1138. package/src/crypt/crypt.ts +185 -0
  1139. package/src/crypt/index.ts +1 -0
  1140. package/src/db/codec.ts +143 -0
  1141. package/src/db/contract.ts +128 -0
  1142. package/src/db/db.ts +72 -0
  1143. package/src/db/drivers/better-sqlite3.ts +62 -0
  1144. package/src/db/drivers/mysql.ts +379 -0
  1145. package/src/db/drivers/pgsql.ts +293 -0
  1146. package/src/db/drivers/sqlite.ts +321 -0
  1147. package/src/db/errors.ts +149 -0
  1148. package/src/db/grammars/grammar.ts +429 -0
  1149. package/src/db/grammars/mysql.ts +181 -0
  1150. package/src/db/grammars/pgsql.ts +83 -0
  1151. package/src/db/grammars/sqlite.ts +109 -0
  1152. package/src/db/index.ts +107 -0
  1153. package/src/db/kysely/index.ts +1 -0
  1154. package/src/db/kysely/kysely.ts +182 -0
  1155. package/src/db/manager.ts +891 -0
  1156. package/src/db/pool.ts +127 -0
  1157. package/src/db/query/builder.ts +1245 -0
  1158. package/src/db/query/state.ts +210 -0
  1159. package/src/db/sql.ts +196 -0
  1160. package/src/env/env.ts +224 -0
  1161. package/src/env/index.ts +11 -0
  1162. package/src/errors/errors.ts +83 -0
  1163. package/src/errors/index.ts +1 -0
  1164. package/src/events/event.ts +113 -0
  1165. package/src/events/fake.ts +73 -0
  1166. package/src/events/index.ts +16 -0
  1167. package/src/events/listener.ts +86 -0
  1168. package/src/events/manager.ts +192 -0
  1169. package/src/events/module.ts +14 -0
  1170. package/src/factory/factory.ts +394 -0
  1171. package/src/factory/fake.ts +431 -0
  1172. package/src/factory/index.ts +14 -0
  1173. package/src/factory/seed.ts +72 -0
  1174. package/src/feature/index.ts +1 -0
  1175. package/src/foundation/application.ts +1419 -0
  1176. package/src/foundation/cache-commands.ts +49 -0
  1177. package/src/foundation/command-result.ts +46 -0
  1178. package/src/foundation/commands.ts +432 -0
  1179. package/src/foundation/database-commands.ts +321 -0
  1180. package/src/foundation/debug-page.ts +142 -0
  1181. package/src/foundation/dev-vite.ts +32 -0
  1182. package/src/foundation/dev.ts +464 -0
  1183. package/src/foundation/discovery.ts +96 -0
  1184. package/src/foundation/error-pages.ts +32 -0
  1185. package/src/foundation/exceptions.ts +56 -0
  1186. package/src/foundation/generators.ts +642 -0
  1187. package/src/foundation/helpers.ts +15 -0
  1188. package/src/foundation/index.ts +16 -0
  1189. package/src/foundation/install-api.ts +109 -0
  1190. package/src/foundation/provider.ts +98 -0
  1191. package/src/foundation/queue-commands.ts +301 -0
  1192. package/src/foundation/route-types.ts +199 -0
  1193. package/src/foundation/schedule-commands.ts +139 -0
  1194. package/src/foundation/stubs/api.ts +232 -0
  1195. package/src/foundation/stubs/handler.ts +76 -0
  1196. package/src/foundation/stubs/others.ts +188 -0
  1197. package/src/foundation/test-command.ts +40 -0
  1198. package/src/hash/hash.ts +138 -0
  1199. package/src/hash/index.ts +1 -0
  1200. package/src/http/busboy.d.ts +31 -0
  1201. package/src/http/cookies.ts +104 -0
  1202. package/src/http/csrf.ts +102 -0
  1203. package/src/http/form.ts +60 -0
  1204. package/src/http/index.ts +87 -0
  1205. package/src/http/kernel.ts +509 -0
  1206. package/src/http/maintenance.ts +85 -0
  1207. package/src/http/middleware.ts +229 -0
  1208. package/src/http/multipart.ts +105 -0
  1209. package/src/http/render.ts +77 -0
  1210. package/src/http/request.ts +368 -0
  1211. package/src/http/response.ts +301 -0
  1212. package/src/http/server.ts +95 -0
  1213. package/src/http/signature.ts +42 -0
  1214. package/src/http/throttle.ts +67 -0
  1215. package/src/http/types.ts +71 -0
  1216. package/src/http/uploads.ts +139 -0
  1217. package/src/http/wire.ts +104 -0
  1218. package/src/http/write.ts +158 -0
  1219. package/src/http-client/index.ts +1 -0
  1220. package/src/index.ts +20 -0
  1221. package/src/inertia/index.ts +26 -0
  1222. package/src/inertia/inertia.ts +590 -0
  1223. package/src/inertia/props.ts +237 -0
  1224. package/src/inertia/resolve.ts +326 -0
  1225. package/src/inertia/response.ts +66 -0
  1226. package/src/inertia/ssr-worker.ts +66 -0
  1227. package/src/inertia/ssr.ts +369 -0
  1228. package/src/log/channels.ts +101 -0
  1229. package/src/log/index.ts +3 -0
  1230. package/src/log/log.ts +216 -0
  1231. package/src/log/record.ts +107 -0
  1232. package/src/mail/address.ts +60 -0
  1233. package/src/mail/auth.ts +54 -0
  1234. package/src/mail/components.ts +98 -0
  1235. package/src/mail/fake.ts +131 -0
  1236. package/src/mail/index.ts +38 -0
  1237. package/src/mail/mail.ts +124 -0
  1238. package/src/mail/manager.ts +212 -0
  1239. package/src/mail/text.ts +150 -0
  1240. package/src/mail/transport.ts +88 -0
  1241. package/src/migrations/create-database.ts +27 -0
  1242. package/src/migrations/dump.ts +317 -0
  1243. package/src/migrations/files.ts +118 -0
  1244. package/src/migrations/index.ts +21 -0
  1245. package/src/migrations/migrator.ts +499 -0
  1246. package/src/model/checks.ts +189 -0
  1247. package/src/model/columns.ts +221 -0
  1248. package/src/model/describe.ts +95 -0
  1249. package/src/model/drift.ts +150 -0
  1250. package/src/model/errors.ts +69 -0
  1251. package/src/model/index.ts +96 -0
  1252. package/src/model/keys.ts +73 -0
  1253. package/src/model/loading.ts +226 -0
  1254. package/src/model/meta.ts +120 -0
  1255. package/src/model/model.ts +788 -0
  1256. package/src/model/query.ts +1100 -0
  1257. package/src/model/related.ts +336 -0
  1258. package/src/model/relations.ts +211 -0
  1259. package/src/model/types.ts +557 -0
  1260. package/src/notification/index.ts +1 -0
  1261. package/src/pagination/index.ts +21 -0
  1262. package/src/pagination/paginator.ts +545 -0
  1263. package/src/queue/batches.ts +481 -0
  1264. package/src/queue/database.ts +177 -0
  1265. package/src/queue/driver.ts +85 -0
  1266. package/src/queue/envelope.ts +133 -0
  1267. package/src/queue/failed.ts +119 -0
  1268. package/src/queue/fake.ts +145 -0
  1269. package/src/queue/index.ts +88 -0
  1270. package/src/queue/job.ts +295 -0
  1271. package/src/queue/manager.ts +636 -0
  1272. package/src/queue/middleware.ts +111 -0
  1273. package/src/queue/module.ts +74 -0
  1274. package/src/queue/redis.ts +223 -0
  1275. package/src/queue/runner.ts +185 -0
  1276. package/src/queue/sqs.ts +381 -0
  1277. package/src/queue/worker.ts +519 -0
  1278. package/src/redis/index.ts +1 -0
  1279. package/src/redis/redis.ts +158 -0
  1280. package/src/reverb/index.ts +1 -0
  1281. package/src/routing/index.ts +15 -0
  1282. package/src/routing/paths.ts +67 -0
  1283. package/src/routing/router.ts +346 -0
  1284. package/src/routing/routing.ts +80 -0
  1285. package/src/routing/table.ts +281 -0
  1286. package/src/routing/urls.ts +139 -0
  1287. package/src/schedule/cron.ts +221 -0
  1288. package/src/schedule/index.ts +11 -0
  1289. package/src/schedule/schedule.ts +99 -0
  1290. package/src/schedule/scheduler.ts +455 -0
  1291. package/src/schedule/task.ts +381 -0
  1292. package/src/schema/blueprint.ts +684 -0
  1293. package/src/schema/builder.ts +178 -0
  1294. package/src/schema/grammars/grammar.ts +348 -0
  1295. package/src/schema/grammars/mysql.ts +241 -0
  1296. package/src/schema/grammars/pgsql.ts +248 -0
  1297. package/src/schema/grammars/sqlite-text.ts +177 -0
  1298. package/src/schema/grammars/sqlite.ts +540 -0
  1299. package/src/schema/index.ts +25 -0
  1300. package/src/schema/schema.ts +87 -0
  1301. package/src/scope/context.ts +124 -0
  1302. package/src/scope/index.ts +26 -0
  1303. package/src/scope/scope.ts +250 -0
  1304. package/src/session/cache-store.ts +57 -0
  1305. package/src/session/database.ts +121 -0
  1306. package/src/session/index.ts +24 -0
  1307. package/src/session/manager.ts +251 -0
  1308. package/src/session/middleware.ts +79 -0
  1309. package/src/session/session.ts +282 -0
  1310. package/src/session/stores.ts +173 -0
  1311. package/src/storage/index.ts +1 -0
  1312. package/src/str/index.ts +1 -0
  1313. package/src/str/str.ts +115 -0
  1314. package/src/support/clock.ts +11 -0
  1315. package/src/support/data.ts +156 -0
  1316. package/src/support/index.ts +26 -0
  1317. package/src/support/register.ts +13 -0
  1318. package/src/support/text.ts +17 -0
  1319. package/src/support/type-assertions.ts +14 -0
  1320. package/src/support/types.ts +80 -0
  1321. package/src/support/units.ts +67 -0
  1322. package/src/task/index.ts +14 -0
  1323. package/src/task/task.ts +199 -0
  1324. package/src/testing/assert-database.ts +145 -0
  1325. package/src/testing/conformance/cache.ts +453 -0
  1326. package/src/testing/conformance/column-types.ts +47 -0
  1327. package/src/testing/conformance/database.ts +512 -0
  1328. package/src/testing/conformance/factories.ts +350 -0
  1329. package/src/testing/conformance/harness.ts +107 -0
  1330. package/src/testing/conformance/index.ts +12 -0
  1331. package/src/testing/conformance/migrations.ts +400 -0
  1332. package/src/testing/conformance/models.ts +810 -0
  1333. package/src/testing/conformance/pagination.ts +324 -0
  1334. package/src/testing/conformance/query-builder.ts +900 -0
  1335. package/src/testing/conformance/queue.ts +239 -0
  1336. package/src/testing/conformance/relationships.ts +948 -0
  1337. package/src/testing/conformance/schema.ts +373 -0
  1338. package/src/testing/conformance/session.ts +190 -0
  1339. package/src/testing/database.ts +245 -0
  1340. package/src/testing/files.ts +46 -0
  1341. package/src/testing/index.ts +15 -0
  1342. package/src/testing/inertia.ts +151 -0
  1343. package/src/testing/query-log.ts +34 -0
  1344. package/src/testing/response.ts +391 -0
  1345. package/src/testing/testing.ts +593 -0
  1346. package/src/time/index.ts +2 -0
  1347. package/src/time/time.ts +143 -0
  1348. package/src/tracing/index.ts +1 -0
  1349. package/src/validation/index.ts +38 -0
  1350. package/src/validation/input.ts +334 -0
  1351. package/src/validation/messages.ts +96 -0
  1352. package/src/validation/presence.ts +52 -0
  1353. package/src/validation/rules.ts +839 -0
  1354. package/src/validation/standard.ts +45 -0
  1355. package/src/view/channel.ts +16 -0
  1356. package/src/view/head.ts +165 -0
  1357. package/src/view/helpers.ts +29 -0
  1358. package/src/view/html.ts +303 -0
  1359. package/src/view/index.ts +6 -0
  1360. package/src/view/translate.ts +48 -0
  1361. package/src/vite/index.ts +2 -0
  1362. package/src/vite/plugin.ts +311 -0
  1363. package/src/vite/vite.ts +302 -0
  1364. package/src/workflow/index.ts +1 -0
@@ -0,0 +1,124 @@
1
+ // Context values, per-unit-of-work memoization, and deferred work: the scope as application code sees it.
2
+ import { randomUUID } from 'node:crypto'
3
+ import { MimarError } from '../errors/index.ts'
4
+ import { isJsonValue } from '../support/index.ts'
5
+ import { type ContextKey, contextKeyNamed, type Deferred, type ScopeKind, scope, withChildScope } from './scope.ts'
6
+
7
+ /**
8
+ * A typed key for a context value. The name appears in logs and in job payloads, so keep it short and stable. Keys are
9
+ * one per name: `contextKey('team')` returns the same key wherever it is called, which is how a queued job finds the
10
+ * values its dispatcher set.
11
+ */
12
+ export function contextKey<T>(name: string): ContextKey<T> {
13
+ return contextKeyNamed<T>(name)
14
+ }
15
+
16
+ function serializable(key: ContextKey<unknown>, value: unknown): void {
17
+ if (!isJsonValue(value)) {
18
+ throw new MimarError(
19
+ 'E_CONTEXT_NOT_SERIALIZABLE',
20
+ `The context value for \`${key.name}\` is not JSON data. Context values travel with queued jobs, so they must be plain objects, arrays, strings, numbers, booleans or null. Store an id instead of an object.`,
21
+ )
22
+ }
23
+ }
24
+
25
+ /** Values attached to the current unit of work: logged with every line, and copied into jobs dispatched from it. */
26
+ export const context = Object.freeze({
27
+ get<T>(key: ContextKey<T>): T | undefined {
28
+ const current = scope('context.get()')
29
+ return (current.values.has(key) ? current.values.get(key) : current.hidden.get(key)) as T | undefined
30
+ },
31
+ getOrFail<T>(key: ContextKey<T>): T {
32
+ const current = scope('context.getOrFail()')
33
+ if (current.values.has(key)) return current.values.get(key) as T
34
+ if (current.hidden.has(key)) return current.hidden.get(key) as T
35
+ throw new MimarError(
36
+ 'E_CONTEXT_MISSING',
37
+ `The context value \`${key.name}\` is not set in this ${current.kind}. Set it first with context.set().`,
38
+ )
39
+ },
40
+ set<T>(key: ContextKey<T>, value: T): void {
41
+ serializable(key, value)
42
+ const current = scope('context.set()')
43
+ current.hidden.delete(key)
44
+ current.values.set(key, value)
45
+ },
46
+ /** Like `set`, but the value is never logged. It still travels with jobs. */
47
+ setHidden<T>(key: ContextKey<T>, value: T): void {
48
+ serializable(key, value)
49
+ const current = scope('context.setHidden()')
50
+ current.values.delete(key)
51
+ current.hidden.set(key, value)
52
+ },
53
+ has(key: ContextKey<unknown>): boolean {
54
+ const current = scope('context.has()')
55
+ return current.values.has(key) || current.hidden.has(key)
56
+ },
57
+ forget(key: ContextKey<unknown>): void {
58
+ const current = scope('context.forget()')
59
+ current.values.delete(key)
60
+ current.hidden.delete(key)
61
+ },
62
+ /** Runs `work` with `key` set to `value`; outside `work` the previous value is back. */
63
+ with<T, R>(key: ContextKey<T>, value: T, work: () => R): R {
64
+ serializable(key, value)
65
+ const current = scope('context.with()')
66
+ const values = new Map(current.values)
67
+ values.set(key, value)
68
+ return withChildScope({ values }, work)
69
+ },
70
+ /** The logged values, by name. */
71
+ all(): Record<string, unknown> {
72
+ return Object.fromEntries([...scope('context.all()').values].map(([key, value]) => [key.name, value]))
73
+ },
74
+ /** Aborted when the unit of work ends, times out or the client goes away. */
75
+ get signal(): AbortSignal {
76
+ return scope('context.signal').signal
77
+ },
78
+ get kind(): ScopeKind {
79
+ return scope('context.kind').kind
80
+ },
81
+ })
82
+
83
+ /** Thrown when a `once()` computation waits for its own result. */
84
+ export class OnceCycleError extends MimarError {
85
+ constructor(name: string) {
86
+ super(
87
+ 'E_ONCE_CYCLE',
88
+ `${name} called itself with the same arguments while computing its result, which would wait forever. Break the cycle.`,
89
+ )
90
+ }
91
+ }
92
+
93
+ type OnceArgument = string | number | boolean | null
94
+
95
+ /**
96
+ * Returns a function whose result is remembered for the current unit of work, per argument list. Concurrent callers
97
+ * share one computation; a failed computation is forgotten, so the next call tries again.
98
+ */
99
+ export function once<A extends readonly OnceArgument[], T>(compute: (...args: A) => T | Promise<T>): (...args: A) => Promise<T> {
100
+ // Each once() function has its own id, so two functions never share results, whatever their names.
101
+ const identity = randomUUID()
102
+ const name = compute.name ? `once(${compute.name})` : 'A once() function'
103
+ const remembered = (...args: A): Promise<T> => {
104
+ const current = scope(name)
105
+ const key = `${identity}:${JSON.stringify(args)}`
106
+ if (current.computing.has(key)) return Promise.reject(new OnceCycleError(name))
107
+ const existing = current.memo.get(key)
108
+ if (existing !== undefined) return existing as Promise<T>
109
+ const computing = new Set(current.computing)
110
+ computing.add(key)
111
+ const promise = withChildScope({ computing }, () => Promise.resolve().then(() => compute(...args)))
112
+ current.memo.set(key, promise)
113
+ promise.catch(() => {
114
+ if (current.memo.get(key) === promise) current.memo.delete(key)
115
+ })
116
+ return promise
117
+ }
118
+ return remembered
119
+ }
120
+
121
+ /** Runs `work` after the response is sent, or after the command or job finishes. Failures are reported, never retried. */
122
+ export function defer(work: Deferred): void {
123
+ scope('defer()').deferred.push(work)
124
+ }
@@ -0,0 +1,26 @@
1
+ export { context, contextKey, defer, OnceCycleError, once } from './context.ts'
2
+ export {
3
+ type ContextKey,
4
+ contextKeyNamed,
5
+ currentApplication,
6
+ currentScope,
7
+ currentUser,
8
+ type Deferred,
9
+ type OpenScopeOptions,
10
+ OutsideScopeError,
11
+ openScope,
12
+ report,
13
+ requestUrlSlot,
14
+ runInScope,
15
+ type Scope,
16
+ type ScopeApplication,
17
+ scope,
18
+ scopeBind,
19
+ type ScopeHandle,
20
+ type ScopeKind,
21
+ type ScopeSlot,
22
+ scopeSlot,
23
+ type UserRef,
24
+ userSlot,
25
+ withChildScope,
26
+ } from './scope.ts'
@@ -0,0 +1,250 @@
1
+ // The scope: one per unit of work (a request, a command, a job, a test). It holds the current application and what
2
+ // belongs to this unit of work, and it is how helpers such as `config()`, `resolve()` and `auth.user()` find them.
3
+ //
4
+ // This file holds the framework's only module-level state: the AsyncLocalStorage instance and the context keys by name.
5
+ import { AsyncLocalStorage } from 'node:async_hooks'
6
+ import { MimarError } from '../errors/index.ts'
7
+ import type { Clock, Key } from '../support/index.ts'
8
+
9
+ export type ScopeKind = 'request' | 'command' | 'job' | 'listener' | 'schedule' | 'workflow' | 'test' | 'boot'
10
+
11
+ /**
12
+ * What the lower layers need from the application. The foundation's `Application` implements it; modules below the
13
+ * foundation see only this.
14
+ */
15
+ export interface ScopeApplication {
16
+ /** APP_ENV: `local`, `testing`, `production`, … Development aids (checks that cost time) run in `local` and `testing`. */
17
+ readonly environment: string
18
+ readonly clock: Clock
19
+ /** The default zone for `today()` and display helpers (APP_TIMEZONE). Storage is always UTC. */
20
+ readonly timeZone: string
21
+ resolve<T>(key: Key<T>): T
22
+ /** Records an error without failing the unit of work: logs it with the scope's context and runs report hooks. */
23
+ report(error: unknown, context?: Record<string, unknown>): void
24
+ }
25
+
26
+ declare const valueType: unique symbol
27
+
28
+ /** A typed key for a context value: `const currentTeam = contextKey<Team>('team')`. */
29
+ export interface ContextKey<T> {
30
+ readonly name: string
31
+ /** Carries `T` for the type checker only; never set. */
32
+ readonly [valueType]?: T
33
+ }
34
+
35
+ export type Deferred = () => void | Promise<void>
36
+
37
+ export interface Scope {
38
+ readonly app: ScopeApplication
39
+ readonly kind: ScopeKind
40
+ readonly signal: AbortSignal
41
+ /** Context values: logged, and copied into jobs dispatched from this scope. */
42
+ readonly values: Map<ContextKey<unknown>, unknown>
43
+ /** Context values that travel with jobs but are never logged. */
44
+ readonly hidden: Map<ContextKey<unknown>, unknown>
45
+ /** `once()` results for this unit of work. */
46
+ readonly memo: Map<string, Promise<unknown>>
47
+ /** Work to run after the unit of work finishes (`defer()`). */
48
+ readonly deferred: Deferred[]
49
+ /** Per-scope fields owned by other modules (the request, the user, the transaction), keyed by `scopeSlot`. */
50
+ readonly slots: ReadonlyMap<symbol, unknown>
51
+ /** The `once()` computations running in this chain of calls, to detect a computation that waits for itself. */
52
+ readonly computing: ReadonlySet<string>
53
+ }
54
+
55
+ const storage = new AsyncLocalStorage<Scope>()
56
+
57
+ /** Context keys by name: one key per name, so a queued job's values, restored by name, are found by the same key. */
58
+ const contextKeys = new Map<string, ContextKey<unknown>>()
59
+
60
+ /** The context key named `name`: the same key for every call with that name. */
61
+ export function contextKeyNamed<T>(name: string): ContextKey<T> {
62
+ let key = contextKeys.get(name)
63
+ if (key === undefined) {
64
+ key = Object.freeze({ name })
65
+ contextKeys.set(name, key)
66
+ }
67
+ return key as ContextKey<T>
68
+ }
69
+
70
+ /**
71
+ * The abort reason of a finished scope. One frozen value, not an Error per unit of work: building an Error captures a
72
+ * stack trace, which costs more than the rest of finishing a request.
73
+ */
74
+ const scopeFinished = Object.freeze({ name: 'ScopeFinished', code: 'E_SCOPE_FINISHED', message: 'The unit of work has finished.' })
75
+
76
+ /** Thrown when a helper that needs an application runs outside any scope. */
77
+ export class OutsideScopeError extends MimarError {
78
+ constructor(helper: string) {
79
+ super(
80
+ 'E_OUTSIDE_SCOPE',
81
+ `${helper} was called outside an application scope. Call it inside a request, command, job or test, or wrap the call in app.scope(() => ...).`,
82
+ )
83
+ }
84
+ }
85
+
86
+ /** The current scope, or an error naming `helper` when there is none. */
87
+ export function scope(helper = 'This helper'): Scope {
88
+ const current = storage.getStore()
89
+ if (current === undefined) throw new OutsideScopeError(helper)
90
+ return current
91
+ }
92
+
93
+ /** The current scope, or `undefined`. */
94
+ export function currentScope(): Scope | undefined {
95
+ return storage.getStore()
96
+ }
97
+
98
+ export interface OpenScopeOptions {
99
+ /** Aborts the scope's signal from outside: a client disconnect, a route timeout, shutdown. */
100
+ signal?: AbortSignal
101
+ /** Context values carried in from elsewhere (a queued job restores the values of the scope that dispatched it). */
102
+ values?: Iterable<[ContextKey<unknown>, unknown]>
103
+ hidden?: Iterable<[ContextKey<unknown>, unknown]>
104
+ slots?: Iterable<[symbol, unknown]>
105
+ }
106
+
107
+ /** A unit of work's scope and the means to run inside it and to finish it. */
108
+ export interface ScopeHandle {
109
+ readonly scope: Scope
110
+ /** Runs `work` inside the scope. */
111
+ run<T>(work: () => T): T
112
+ /**
113
+ * Ends the unit of work: runs the deferred work in order (each failure is reported, none stops the others), then
114
+ * aborts the signal. Returns once the deferred work has settled.
115
+ */
116
+ finish(): Promise<void>
117
+ }
118
+
119
+ /** Opens a new root scope for one unit of work of `app`. The kernels, the worker and the test harness call this. */
120
+ export function openScope(app: ScopeApplication, kind: ScopeKind, options: OpenScopeOptions = {}): ScopeHandle {
121
+ const controller = new AbortController()
122
+ const outside = options.signal
123
+ const onAbort = () => controller.abort(outside?.reason)
124
+ if (outside?.aborted) controller.abort(outside.reason)
125
+ else outside?.addEventListener('abort', onAbort, { once: true })
126
+
127
+ const created: Scope = {
128
+ app,
129
+ kind,
130
+ signal: controller.signal,
131
+ values: new Map(options.values),
132
+ hidden: new Map(options.hidden),
133
+ memo: new Map(),
134
+ deferred: [],
135
+ slots: new Map(options.slots),
136
+ computing: new Set(),
137
+ }
138
+ let finished = false
139
+ return {
140
+ scope: created,
141
+ run: (work) => storage.run(created, work),
142
+ async finish() {
143
+ if (finished) return
144
+ finished = true
145
+ outside?.removeEventListener('abort', onAbort)
146
+ while (created.deferred.length > 0) {
147
+ const work = created.deferred.shift()!
148
+ try {
149
+ await storage.run(created, work)
150
+ } catch (error) {
151
+ app.report(error, { during: 'deferred work' })
152
+ }
153
+ }
154
+ controller.abort(scopeFinished)
155
+ },
156
+ }
157
+ }
158
+
159
+ /** Runs `work` in a child of the current scope with some fields replaced. Unchanged fields are shared with the parent. */
160
+ export function withChildScope<T>(
161
+ changes: Partial<Pick<Scope, 'values' | 'hidden' | 'deferred' | 'slots' | 'computing'>>,
162
+ work: () => T,
163
+ ): T {
164
+ const parent = scope()
165
+ return storage.run({ ...parent, ...changes }, work)
166
+ }
167
+
168
+ /** Runs `work` inside `target` (a scope captured earlier). Used to restore a scope in a callback registered elsewhere. */
169
+ export function runInScope<T>(target: Scope, work: () => T): T {
170
+ return storage.run(target, work)
171
+ }
172
+
173
+ /**
174
+ * Captures the current scope and returns a function that runs `fn` inside it: for a callback registered on a long-lived
175
+ * emitter created outside the scope.
176
+ */
177
+ export function scopeBind<A extends unknown[], R>(fn: (...args: A) => R): (...args: A) => R {
178
+ const captured = scope('scopeBind()')
179
+ return (...args: A) => storage.run(captured, () => fn(...args))
180
+ }
181
+
182
+ /** A typed per-scope field for another module: `const requestSlot = scopeSlot<HttpRequest>('request')`. */
183
+ export interface ScopeSlot<T> {
184
+ readonly name: string
185
+ get(): T | undefined
186
+ /** The value, or an error naming `helper` when the scope does not have one. */
187
+ require(helper: string, missing: string): T
188
+ /** Runs `work` in a child scope where this slot holds `value`. */
189
+ with<R>(value: T, work: () => R): R
190
+ /** The slot's entry, for `openScope({ slots })`. */
191
+ entry(value: T): [symbol, unknown]
192
+ }
193
+
194
+ export function scopeSlot<T>(name: string): ScopeSlot<T> {
195
+ const id = Symbol(name)
196
+ return Object.freeze({
197
+ name,
198
+ get: () => storage.getStore()?.slots.get(id) as T | undefined,
199
+ require(helper: string, missing: string) {
200
+ const value = scope(helper).slots.get(id)
201
+ if (value === undefined) throw new MimarError('E_SCOPE_SLOT_MISSING', missing)
202
+ return value as T
203
+ },
204
+ with<R>(value: T, work: () => R): R {
205
+ const parent = scope()
206
+ const slots = new Map(parent.slots)
207
+ slots.set(id, value)
208
+ return storage.run({ ...parent, slots }, work)
209
+ },
210
+ entry: (value: T): [symbol, unknown] => [id, value],
211
+ })
212
+ }
213
+
214
+ /** The application of the current scope. */
215
+ export function currentApplication(helper = 'application()'): ScopeApplication {
216
+ return scope(helper).app
217
+ }
218
+
219
+ /**
220
+ * Records an error without failing the unit of work. Inside a scope it goes to the application's reporter; outside
221
+ * one it is written to standard error, so nothing is ever swallowed.
222
+ */
223
+ export function report(error: unknown, context?: Record<string, unknown>): void {
224
+ const current = storage.getStore()
225
+ if (current !== undefined) {
226
+ current.app.report(error, context)
227
+ return
228
+ }
229
+ const text = error instanceof Error ? (error.stack ?? `${error.name}: ${error.message}`) : String(error)
230
+ process.stderr.write(`${text}\n`)
231
+ }
232
+
233
+ /** The signed-in user, in a box the auth layer changes when someone signs in or out during the unit of work. */
234
+ export interface UserRef {
235
+ current: unknown
236
+ }
237
+
238
+ /** The signed-in user of the current unit of work, set by the auth layer. `authenticated` and `auth.user()` read it. */
239
+ export const userSlot = scopeSlot<UserRef>('user')
240
+
241
+ /** The signed-in user of the current unit of work, or null: for modules below auth (throttling, input authorizers). */
242
+ export function currentUser(): unknown {
243
+ return userSlot.get()?.current ?? null
244
+ }
245
+
246
+ /**
247
+ * The URL of the current request, set by the HTTP kernel. Code below the HTTP layer reads the query string and the
248
+ * path from it: paginators take `?page=` and point their links at the path.
249
+ */
250
+ export const requestUrlSlot = scopeSlot<URL>('request URL')
@@ -0,0 +1,57 @@
1
+ // Sessions in a cache store, as the `redis` driver keeps them: one entry per session, which the store expires at the
2
+ // time the manager gives, and the cache's lock to serialize saves from several processes. The entry holds its expiry
3
+ // too, checked against the application's clock, since a store such as Redis expires entries by its own clock.
4
+ import { type Cache, LockTimeoutError } from '../cache/index.ts'
5
+ import { MimarError } from '../errors/index.ts'
6
+ import type { Clock } from '../support/index.ts'
7
+ import type { SessionData } from './session.ts'
8
+ import type { SessionStore } from './stores.ts'
9
+
10
+ /** How long a save waits for another process's save of the same session. */
11
+ const lockWait = '10s'
12
+
13
+ interface Entry {
14
+ /** Epoch milliseconds, from the application's clock. */
15
+ readonly expiresAt: number
16
+ readonly data: SessionData
17
+ }
18
+
19
+ export class CacheSessionStore implements SessionStore {
20
+ readonly #cache: () => Cache
21
+ readonly #clock: Clock
22
+
23
+ /** `cache` is called on each use, so its store is chosen on first use. */
24
+ constructor(options: { cache: () => Cache; clock: Clock }) {
25
+ this.#cache = options.cache
26
+ this.#clock = options.clock
27
+ }
28
+
29
+ async read(id: string): Promise<SessionData | null> {
30
+ const entry = await this.#cache().get<Entry>(id)
31
+ if (entry === null || typeof entry !== 'object' || typeof entry.expiresAt !== 'number') return null
32
+ if (entry.data === null || typeof entry.data !== 'object' || Array.isArray(entry.data)) return null
33
+ return entry.expiresAt > this.#clock.now().epochMilliseconds ? entry.data : null
34
+ }
35
+
36
+ async write(id: string, data: SessionData, expiresAt: Temporal.Instant): Promise<void> {
37
+ const ttl = expiresAt.epochMilliseconds - this.#clock.now().epochMilliseconds
38
+ if (ttl <= 0) await this.#cache().forget(id)
39
+ else await this.#cache().put(id, { expiresAt: expiresAt.epochMilliseconds, data } satisfies Entry, `${ttl}ms`)
40
+ }
41
+
42
+ async destroy(id: string): Promise<void> {
43
+ await this.#cache().forget(id)
44
+ }
45
+
46
+ async lock<R>(id: string, work: () => Promise<R>): Promise<R> {
47
+ try {
48
+ return await this.#cache().lock(id, '30s').block(lockWait, work)
49
+ } catch (error) {
50
+ if (!(error instanceof LockTimeoutError)) throw error
51
+ throw new MimarError(
52
+ 'E_SESSION_LOCKED',
53
+ 'The session could not be saved: another request held its lock for more than 10 seconds.',
54
+ )
55
+ }
56
+ }
57
+ }
@@ -0,0 +1,121 @@
1
+ // The `database` session driver: one row per session in the table `session.createTable()` makes, with the signed-in
2
+ // user's id and the client's address and browser. A session expires SESSION_LIFETIME after its last request, counted
3
+ // from the row's `last_activity`, so shortening the lifetime applies to sessions already stored. Saves from several
4
+ // processes are serialized with a lock on the session's row.
5
+ import { ConfigRepository } from '../config/index.ts'
6
+ import type { DatabaseConnection } from '../db/index.ts'
7
+ import { requestSlot } from '../http/index.ts'
8
+ import type { Blueprint } from '../schema/index.ts'
9
+ import { schema } from '../schema/index.ts'
10
+ import { currentApplication } from '../scope/index.ts'
11
+ import type { Clock } from '../support/index.ts'
12
+ import { milliseconds } from '../time/index.ts'
13
+ import { type SessionData, userSessionKey } from './session.ts'
14
+ import type { SessionStore } from './stores.ts'
15
+
16
+ export interface DatabaseSessionStoreOptions {
17
+ /** The connection to use, looked up on every call (tests point a connection at another database between them). */
18
+ readonly connection: () => DatabaseConnection
19
+ readonly table: string
20
+ /** How long a session lives after its last request. */
21
+ readonly lifetime: Temporal.Duration
22
+ readonly clock: Clock
23
+ }
24
+
25
+ /** The `user_agent` column keeps at most this many characters of the header. */
26
+ const userAgentLimit = 1000
27
+
28
+ /** The signed-in user's id, for the user_id column: a whole number, as the column holds; null for a guest or another kind of key. */
29
+ function userIdOf(data: SessionData): number | null {
30
+ const login = data[userSessionKey]
31
+ const id = login !== null && typeof login === 'object' ? (login as { id?: unknown }).id : undefined
32
+ return typeof id === 'number' && Number.isSafeInteger(id) ? id : null
33
+ }
34
+
35
+ /** Sessions in a database table, shared by every process that uses the database. */
36
+ export class DatabaseSessionStore implements SessionStore {
37
+ readonly #connection: () => DatabaseConnection
38
+ readonly #table: string
39
+ readonly #lifetime: number
40
+ readonly #clock: Clock
41
+
42
+ constructor(options: DatabaseSessionStoreOptions) {
43
+ this.#connection = options.connection
44
+ this.#table = options.table
45
+ this.#lifetime = Math.floor(milliseconds(options.lifetime) / 1000)
46
+ this.#clock = options.clock
47
+ }
48
+
49
+ #rows() {
50
+ return this.#connection().table<{ id: string; payload: string }>(this.#table)
51
+ }
52
+
53
+ #now(): number {
54
+ return Math.floor(this.#clock.now().epochMilliseconds / 1000)
55
+ }
56
+
57
+ async read(id: string): Promise<SessionData | null> {
58
+ const row = await this.#rows()
59
+ .select('payload')
60
+ .where('id', id)
61
+ .where('last_activity', '>', this.#now() - this.#lifetime)
62
+ .first()
63
+ if (row === null || row === undefined) return null
64
+ try {
65
+ const data: unknown = JSON.parse(String(row.payload))
66
+ return data !== null && typeof data === 'object' && !Array.isArray(data) ? (data as SessionData) : null
67
+ } catch {
68
+ return null
69
+ }
70
+ }
71
+
72
+ async write(id: string, data: SessionData): Promise<void> {
73
+ const request = requestSlot.get()
74
+ const values = {
75
+ id,
76
+ user_id: userIdOf(data),
77
+ payload: JSON.stringify(data),
78
+ last_activity: this.#now(),
79
+ ip_address: request?.ip ?? null,
80
+ user_agent: request?.header('user-agent')?.slice(0, userAgentLimit) ?? null,
81
+ }
82
+ await this.#rows().upsert(values, 'id', ['user_id', 'payload', 'last_activity', 'ip_address', 'user_agent'])
83
+ }
84
+
85
+ async destroy(id: string): Promise<void> {
86
+ await this.#rows().where('id', id).delete()
87
+ }
88
+
89
+ /** Runs `work` in a transaction that holds the session's row, so a save from another process waits for this one. */
90
+ lock<R>(id: string, work: () => Promise<R>): Promise<R> {
91
+ return this.#connection().transaction(async () => {
92
+ await this.#rows().select('id').where('id', id).lockForUpdate().first()
93
+ return work()
94
+ })
95
+ }
96
+
97
+ async prune(): Promise<number> {
98
+ return this.#rows()
99
+ .where('last_activity', '<=', this.#now() - this.#lifetime)
100
+ .delete()
101
+ }
102
+ }
103
+
104
+ /** The columns of the sessions table. */
105
+ export function sessionColumns(table: Blueprint): void {
106
+ table.string('id').primary()
107
+ table.foreignId('user_id').nullable().index()
108
+ table.string('ip_address', 45).nullable()
109
+ table.text('user_agent').nullable()
110
+ table.longText('payload')
111
+ table.bigInteger('last_activity').index()
112
+ }
113
+
114
+ /**
115
+ * Makes the table the `database` session driver uses (SESSION_TABLE, `sessions` by default) on SESSION_CONNECTION, or
116
+ * on the migration's connection when that is unset. Call it in a migration: `await session.createTable()`.
117
+ */
118
+ export async function createSessionTable(): Promise<void> {
119
+ const { connection, table } = currentApplication('session.createTable()').resolve(ConfigRepository).framework.session
120
+ await (connection === null ? schema : schema.connection(connection)).create(table, sessionColumns)
121
+ }
@@ -0,0 +1,24 @@
1
+ export { CacheSessionStore } from './cache-store.ts'
2
+ export { createSessionTable, DatabaseSessionStore, type DatabaseSessionStoreOptions, sessionColumns } from './database.ts'
3
+ export {
4
+ cookieLimit,
5
+ SessionManager,
6
+ type SessionStoreContext,
7
+ type SessionStoreFactory,
8
+ SessionTooLargeError,
9
+ } from './manager.ts'
10
+ export { startSession } from './middleware.ts'
11
+ export {
12
+ errors,
13
+ flash,
14
+ newSessionId,
15
+ old,
16
+ Session,
17
+ type SessionChanges,
18
+ type SessionData,
19
+ session,
20
+ sessionIdPattern,
21
+ sessionSlot,
22
+ userSessionKey,
23
+ } from './session.ts'
24
+ export { FileSessionStore, MemorySessionStore, type SessionStore } from './stores.ts'