mimarjs 0.0.1-alpha.0 → 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 +49 -3
  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 +272 -11
  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,519 @@
1
+ // The worker behind `queue:work`: one process, up to `concurrency` jobs in flight as async tasks. It reserves jobs from
2
+ // its queues in the order given, runs each attempt (runner.ts), and owns what follows: acknowledging, retrying with
3
+ // backoff, failing for good and recording the failure. Between reservations it checks the restart signal, paused
4
+ // queues and its limits.
5
+ //
6
+ // A stop signal (SIGTERM, Ctrl+C) stops reserving; jobs in flight get SERVER_SHUTDOWN_TIMEOUT to finish, then their
7
+ // signals abort and they go back on the queue without counting as an attempt. An attempt still running past its
8
+ // timeout plus QUEUE_TIMEOUT_GRACE is hung: the other jobs get the grace to finish and the worker exits with code 1,
9
+ // for its supervisor to restart. When the event loop itself is blocked, no timer can run, so a watchdog on a
10
+ // worker_threads thread kills the process instead.
11
+ import { randomUUID } from 'node:crypto'
12
+ import { Worker as Thread } from 'node:worker_threads'
13
+ import { MimarError } from '../errors/index.ts'
14
+ import { openScope, type ScopeApplication } from '../scope/index.ts'
15
+ import { humanize } from '../time/index.ts'
16
+ import type { ReservedJob } from './driver.ts'
17
+ import { type Envelope, encodeEnvelope } from './envelope.ts'
18
+ import { type AnyJob, backoffAfter } from './job.ts'
19
+ import type { QueueManager, RestoredJob } from './manager.ts'
20
+ import { type AttemptOutcome, runAttempt, runFailedHook } from './runner.ts'
21
+
22
+ /** Thrown into the failed record of a job no worker could run: its name is not registered on this application. */
23
+ export class UnknownJobError extends MimarError {
24
+ constructor(name: string, version: string) {
25
+ super(
26
+ 'E_UNKNOWN_JOB',
27
+ `The job "${name}" is not registered on the application running this worker (version ${version}). It may have been renamed or removed, or dispatched by a newer release: deploy the code that defines it, then run queue:retry.`,
28
+ )
29
+ }
30
+ }
31
+
32
+ /** Recorded when a job comes back with no attempts left: an earlier attempt ended without a result. */
33
+ export class MaxAttemptsExceededError extends MimarError {
34
+ constructor(name: string, tries: number) {
35
+ super(
36
+ 'E_MAX_ATTEMPTS',
37
+ `The job "${name}" was reserved more than its ${tries === 1 ? 'one attempt' : `${tries} attempts`} allow. An earlier attempt ended without a result: its worker died or was killed, or the job ran longer than QUEUE_RETRY_AFTER.`,
38
+ )
39
+ }
40
+ }
41
+
42
+ /** Recorded when a job's `retryUntil` has passed. */
43
+ export class RetryUntilPassedError extends MimarError {
44
+ constructor(name: string) {
45
+ super('E_RETRY_UNTIL', `The job "${name}" ran out of time: its retryUntil has passed since it was dispatched.`)
46
+ }
47
+ }
48
+
49
+ export interface WorkerOptions {
50
+ /** The connection to work (QUEUE_CONNECTION when omitted). */
51
+ readonly connection?: string
52
+ /** The queues to take jobs from, earlier names first. Default: the connection's queue. */
53
+ readonly queues?: readonly string[]
54
+ /** Jobs in flight at once. Default 1. */
55
+ readonly concurrency?: number
56
+ /** Milliseconds to wait when the queues are empty. Default 3000. */
57
+ readonly sleep?: number
58
+ /** Stop after taking this many jobs. */
59
+ readonly maxJobs?: number
60
+ /** Stop after this many milliseconds. */
61
+ readonly maxTime?: number
62
+ /** Stop when the queues are empty. */
63
+ readonly stopWhenEmpty?: boolean
64
+ /** Milliseconds jobs in flight get to finish once `signal` aborts. Default: SERVER_SHUTDOWN_TIMEOUT. */
65
+ readonly shutdownTimeout?: number
66
+ /** Stops the worker gracefully. */
67
+ readonly signal?: AbortSignal
68
+ /** Receives a line for each job that starts and ends. */
69
+ readonly log?: (line: string) => void
70
+ /** Ends the process after a hung job. Default: `process.exit`. */
71
+ readonly exit?: (code: number) => void
72
+ /** Watches for a blocked event loop from a thread. Default true. */
73
+ readonly watchdog?: boolean
74
+ }
75
+
76
+ /** Why a worker stopped. */
77
+ export type WorkerStop = 'signal' | 'restart' | 'max-jobs' | 'max-time' | 'empty' | 'hung'
78
+
79
+ export interface WorkerResult {
80
+ readonly stop: WorkerStop
81
+ /** Jobs taken from the queues. */
82
+ readonly processed: number
83
+ }
84
+
85
+ function pause(ms: number, signal?: AbortSignal): Promise<void> {
86
+ return new Promise((resolve) => {
87
+ if (signal?.aborted) return resolve()
88
+ const timer = setTimeout(done, ms)
89
+ function done() {
90
+ clearTimeout(timer)
91
+ signal?.removeEventListener('abort', done)
92
+ resolve()
93
+ }
94
+ signal?.addEventListener('abort', done, { once: true })
95
+ })
96
+ }
97
+
98
+ function errorText(error: unknown): string {
99
+ return error instanceof Error ? error.message : String(error)
100
+ }
101
+
102
+ // The watchdog thread. It reads the main thread's heartbeat and the earliest deadline of the jobs in flight from shared
103
+ // memory; when the deadline has passed and the heartbeat has stopped, the event loop is blocked and only the operating
104
+ // system can stop the process. `process.exit` in a thread ends only the thread, so it sends SIGKILL.
105
+ const watchdogSource = `
106
+ const { workerData, parentPort } = require('node:worker_threads')
107
+ const { writeSync } = require('node:fs')
108
+ const shared = new BigInt64Array(workerData.buffer)
109
+ const job = { name: '' }
110
+ parentPort.on('message', (message) => { job.name = message })
111
+ setInterval(() => {
112
+ const now = BigInt(Temporal.Now.instant().epochMilliseconds)
113
+ const heartbeat = Atomics.load(shared, 0)
114
+ const deadline = Atomics.load(shared, 1)
115
+ if (deadline > 0n && now > deadline + 1000n && now - heartbeat > 2000n) {
116
+ writeSync(2, 'The job "' + job.name + '" has blocked the event loop for ' + Math.round(Number(now - heartbeat) / 1000) + ' seconds, past its timeout and QUEUE_TIMEOUT_GRACE, so its worker is killed for its supervisor to restart. A job that blocks the event loop belongs in a worker_threads task, or on a queue of its own with --concurrency=1.\\n')
117
+ process.kill(process.pid, 'SIGKILL')
118
+ }
119
+ }, 250)
120
+ `
121
+
122
+ class Watchdog {
123
+ readonly #shared = new BigInt64Array(new SharedArrayBuffer(16))
124
+ readonly #thread: Thread
125
+ readonly #beat: ReturnType<typeof setInterval>
126
+ readonly #deadlines = new Map<symbol, { at: number; name: string }>()
127
+ #name = ''
128
+
129
+ constructor() {
130
+ this.#thread = new Thread(watchdogSource, { eval: true, workerData: { buffer: this.#shared.buffer } })
131
+ this.#thread.unref()
132
+ this.#beatNow()
133
+ this.#beat = setInterval(() => this.#beatNow(), 500)
134
+ this.#beat.unref()
135
+ }
136
+
137
+ #beatNow(): void {
138
+ Atomics.store(this.#shared, 0, BigInt(Temporal.Now.instant().epochMilliseconds))
139
+ }
140
+
141
+ /** Sets or clears the deadline of one attempt. */
142
+ deadline(attempt: symbol, name: string, at: number | null): void {
143
+ if (at === null) this.#deadlines.delete(attempt)
144
+ else this.#deadlines.set(attempt, { at, name })
145
+ let earliest: { at: number; name: string } | null = null
146
+ for (const entry of this.#deadlines.values()) if (earliest === null || entry.at < earliest.at) earliest = entry
147
+ if (earliest !== null && earliest.name !== this.#name) {
148
+ this.#name = earliest.name
149
+ this.#thread.postMessage(earliest.name)
150
+ }
151
+ this.#beatNow()
152
+ Atomics.store(this.#shared, 1, BigInt(earliest?.at ?? 0))
153
+ }
154
+
155
+ async stop(): Promise<void> {
156
+ clearInterval(this.#beat)
157
+ await this.#thread.terminate()
158
+ }
159
+ }
160
+
161
+ /** Works one connection's queues until it is told to stop. */
162
+ export class QueueWorker {
163
+ readonly #manager: QueueManager
164
+ readonly #app: ScopeApplication
165
+ readonly #connection: string
166
+ readonly #queues: readonly string[]
167
+ readonly #concurrency: number
168
+ readonly #options: WorkerOptions
169
+ readonly #shutdownTimeout: number
170
+ readonly #inFlight = new Map<ReservedJob, Promise<void>>()
171
+ /** Aborts the signals of the attempts in flight when the worker stops before they end. */
172
+ readonly #interrupt = new AbortController()
173
+ /** Wakes the loop from a wait when a job hangs. */
174
+ readonly #wake = new AbortController()
175
+ /** Aborts on the stop signal or a hung job: what every wait of the loop listens to. */
176
+ readonly #halt: AbortSignal
177
+ #halted: Promise<void> | null = null
178
+ #watchdog: Watchdog | null = null
179
+ #interrupting = false
180
+ #abandoned = false
181
+ /** The hung job's processing, which ends once its attempt is recorded. */
182
+ #hung: Promise<void> | null = null
183
+
184
+ constructor(manager: QueueManager, options: WorkerOptions & { shutdownTimeout: number }) {
185
+ this.#manager = manager
186
+ this.#app = manager.app
187
+ this.#connection = options.connection ?? manager.config.default
188
+ this.#queues = options.queues !== undefined && options.queues.length > 0 ? options.queues : [manager.defaultQueue(this.#connection)]
189
+ const concurrency = options.concurrency ?? 1
190
+ if (!Number.isInteger(concurrency) || concurrency < 1) {
191
+ throw new MimarError('E_INVALID_WORKER', `A worker's concurrency is a whole number of at least 1, not ${concurrency}.`)
192
+ }
193
+ this.#concurrency = concurrency
194
+ this.#options = options
195
+ this.#shutdownTimeout = options.shutdownTimeout
196
+ this.#halt = options.signal === undefined ? this.#wake.signal : AbortSignal.any([options.signal, this.#wake.signal])
197
+ }
198
+
199
+ get connection(): string {
200
+ return this.#connection
201
+ }
202
+
203
+ get queues(): readonly string[] {
204
+ return this.#queues
205
+ }
206
+
207
+ #log(line: string): void {
208
+ if (this.#options.log === undefined) return
209
+ const time = Temporal.Instant.fromEpochMilliseconds(this.#manager.clock.now().epochMilliseconds)
210
+ .toZonedDateTimeISO(Temporal.Now.timeZoneId())
211
+ .toPlainDateTime()
212
+ .toString({ smallestUnit: 'second' })
213
+ .replace('T', ' ')
214
+ this.#options.log(`${time} ${line}`)
215
+ }
216
+
217
+ /**
218
+ * Runs the worker's own reads and writes (reserving, acknowledging, recording) in a unit of work of their own: not
219
+ * the command's, whose signal aborts on Ctrl+C while those writes must still happen.
220
+ */
221
+ async #unit<T>(work: () => Promise<T>): Promise<T> {
222
+ const handle = openScope(this.#app, 'job')
223
+ try {
224
+ return await handle.run(work)
225
+ } finally {
226
+ await handle.finish()
227
+ }
228
+ }
229
+
230
+ /** Works until a stop: the signal, `queue:restart`, a limit, empty queues (`stopWhenEmpty`) or a hung job. */
231
+ async run(): Promise<WorkerResult> {
232
+ const manager = this.#manager
233
+ const driver = manager.driver(this.#connection)
234
+ const signal = this.#options.signal
235
+ const startedAt = performance.now()
236
+ const restartAtStart = await this.#unit(() => manager.restartedAt())
237
+ const halt = this.#halt
238
+ this.#halted = new Promise<void>((resolve) => {
239
+ if (halt.aborted) resolve()
240
+ else halt.addEventListener('abort', () => resolve(), { once: true })
241
+ })
242
+ const sleep = this.#options.sleep ?? 3000
243
+ const maxJobs = this.#options.maxJobs ?? null
244
+ const maxTime = this.#options.maxTime ?? null
245
+ if (this.#options.watchdog !== false) this.#watchdog = new Watchdog()
246
+ let processed = 0
247
+ let stop: WorkerStop | null = null
248
+ try {
249
+ while (stop === null) {
250
+ if (signal?.aborted) stop = 'signal'
251
+ else if (this.#hung !== null) stop = 'hung'
252
+ else if (maxTime !== null && performance.now() - startedAt >= maxTime) stop = 'max-time'
253
+ else if (maxJobs !== null && processed >= maxJobs) stop = 'max-jobs'
254
+ if (stop !== null) break
255
+
256
+ if (this.#inFlight.size >= this.#concurrency) {
257
+ await this.#settleOne()
258
+ continue
259
+ }
260
+ let reserved: ReservedJob[] = []
261
+ try {
262
+ const wanted = Math.min(
263
+ this.#concurrency - this.#inFlight.size,
264
+ maxJobs === null ? Number.POSITIVE_INFINITY : maxJobs - processed,
265
+ )
266
+ const next = await this.#unit(async () => {
267
+ // Between jobs: a restart asked for since this worker started stops it.
268
+ if ((await manager.restartedAt()) !== restartAtStart) return 'restart' as const
269
+ const queues = await manager.active(this.#connection, this.#queues)
270
+ if (queues.length === 0) return []
271
+ // A driver may wait for a job only while nothing runs, so a finished job frees its slot at once.
272
+ const wait = this.#inFlight.size === 0 && this.#options.stopWhenEmpty !== true
273
+ return driver.pop(queues, wanted, { wait, signal: halt })
274
+ })
275
+ if (next === 'restart') {
276
+ stop = 'restart'
277
+ break
278
+ }
279
+ reserved = next
280
+ } catch (error) {
281
+ this.#app.report(error, { during: `reserving jobs on the queue connection "${this.#connection}"` })
282
+ await pause(sleep, halt)
283
+ continue
284
+ }
285
+ if (reserved.length === 0) {
286
+ if (this.#inFlight.size > 0) {
287
+ if (this.#options.stopWhenEmpty) await this.#settleOne()
288
+ else await Promise.race([this.#settleOne(), pause(sleep, halt)])
289
+ } else if (this.#options.stopWhenEmpty) stop = 'empty'
290
+ else await pause(sleep, halt)
291
+ continue
292
+ }
293
+ for (const job of reserved) {
294
+ processed++
295
+ const running: Promise<void> = this.#unit(() => this.#process(job))
296
+ .catch((error: unknown) => this.#app.report(error, { during: 'processing a queued job' }))
297
+ .finally(() => this.#inFlight.delete(job))
298
+ this.#inFlight.set(job, running)
299
+ }
300
+ }
301
+ if (stop === 'hung') {
302
+ // The other jobs have had the grace; the hung one stays running until the process ends.
303
+ await this.#hung
304
+ this.#abandoned = true
305
+ } else await this.#drain(stop === 'signal')
306
+ } finally {
307
+ await this.#watchdog?.stop()
308
+ this.#watchdog = null
309
+ }
310
+ if (stop === 'hung') {
311
+ this.#log('A job is hung: the worker exits with code 1.')
312
+ ;(this.#options.exit ?? ((code: number) => process.exit(code)))(1)
313
+ }
314
+ return { stop, processed }
315
+ }
316
+
317
+ /** Waits for one job in flight to end, for the stop signal or for a job to hang. */
318
+ async #settleOne(): Promise<void> {
319
+ await Promise.race([...this.#inFlight.values(), this.#halted])
320
+ }
321
+
322
+ /**
323
+ * Waits for the jobs in flight. On a stop signal they get the shutdown timeout, then their signals abort and they
324
+ * get the grace; any still running are left reserved, to be retried after QUEUE_RETRY_AFTER.
325
+ */
326
+ async #drain(signalled: boolean): Promise<void> {
327
+ if (this.#inFlight.size === 0) return
328
+ const all = () => Promise.allSettled([...this.#inFlight.values()]).then(() => true as const)
329
+ if (!signalled) {
330
+ const stopped = this.#halted!.then(() => false as const)
331
+ if ((await Promise.race([all(), stopped])) === true) return
332
+ if (this.#hung !== null) {
333
+ await this.#hung
334
+ this.#abandoned = true
335
+ return
336
+ }
337
+ }
338
+ this.#log(
339
+ `Stopping: waiting up to ${humanize(`${this.#shutdownTimeout}ms`, { exact: true })} for ${this.#inFlight.size === 1 ? 'one job' : `${this.#inFlight.size} jobs`} to finish.`,
340
+ )
341
+ if ((await Promise.race([all(), pause(this.#shutdownTimeout).then(() => false as const)])) === true) return
342
+ this.#interrupting = true
343
+ this.#interrupt.abort(new MimarError('E_WORKER_STOPPING', 'The worker is stopping.'))
344
+ if ((await Promise.race([all(), pause(this.#manager.grace).then(() => false as const)])) === true) return
345
+ this.#abandoned = true
346
+ this.#log(
347
+ `${this.#inFlight.size === 1 ? 'One job is' : `${this.#inFlight.size} jobs are`} still running and stay reserved: they will be retried after QUEUE_RETRY_AFTER.`,
348
+ )
349
+ }
350
+
351
+ async #process(reserved: ReservedJob): Promise<void> {
352
+ const manager = this.#manager
353
+ let restored: RestoredJob
354
+ try {
355
+ restored = manager.restore(reserved.envelope)
356
+ } catch (error) {
357
+ await this.#failUnreadable(reserved, error)
358
+ return
359
+ }
360
+ const { envelope } = restored
361
+ const job = manager.job(envelope.name)
362
+ if (job === undefined) {
363
+ await this.#failForGood(reserved, restored, null, new UnknownJobError(envelope.name, manager.version), true)
364
+ return
365
+ }
366
+ if (envelope.batch !== undefined && (await manager.batchCancelled(envelope.batch))) {
367
+ // The batch's other jobs still count this one, so its finally callback comes.
368
+ await this.#follow(envelope, () => manager.completed(envelope))
369
+ await this.#ack(reserved)
370
+ await manager.releaseUnique(envelope)
371
+ this.#log(`${job.name} ${envelope.id} skipped: its batch was cancelled`)
372
+ return
373
+ }
374
+ const attempt = reserved.attempts - envelope.interrupted
375
+ if (attempt > job.tries) {
376
+ await this.#failForGood(reserved, restored, job, new MaxAttemptsExceededError(job.name, job.tries), true)
377
+ return
378
+ }
379
+ if (this.#outOfTime(job, envelope)) {
380
+ await this.#failForGood(reserved, restored, job, new RetryUntilPassedError(job.name), true)
381
+ return
382
+ }
383
+
384
+ const label = `${job.name} ${envelope.id}`
385
+ this.#log(`${label} running (attempt ${attempt})`)
386
+ const started = performance.now()
387
+ const key = Symbol(job.name)
388
+ const outcome = await runAttempt({
389
+ app: this.#app,
390
+ job,
391
+ id: envelope.id,
392
+ payload: envelope.payload,
393
+ attempt,
394
+ queue: reserved.queue,
395
+ connection: this.#connection,
396
+ batchId: envelope.batch ?? envelope.batchCallback ?? null,
397
+ values: restored.values,
398
+ hidden: restored.hidden,
399
+ grace: manager.grace,
400
+ stop: this.#interrupt.signal,
401
+ deadline: (at) => this.#watchdog?.deadline(key, job.name, at),
402
+ })
403
+ if (this.#abandoned) return
404
+ const took = `${Math.round(performance.now() - started)} ms`
405
+ if (this.#interrupting && outcome.kind !== 'done') {
406
+ await this.#release(reserved, { ...envelope, interrupted: envelope.interrupted + 1 }, 0)
407
+ this.#log(`${label} interrupted, back on the queue`)
408
+ return
409
+ }
410
+ await this.#settle(reserved, restored, job, attempt, outcome, label, took)
411
+ }
412
+
413
+ async #settle(
414
+ reserved: ReservedJob,
415
+ restored: RestoredJob,
416
+ job: AnyJob,
417
+ attempt: number,
418
+ outcome: AttemptOutcome,
419
+ label: string,
420
+ took: string,
421
+ ): Promise<void> {
422
+ const { envelope } = restored
423
+ switch (outcome.kind) {
424
+ case 'done':
425
+ // Before the job leaves its queue: a worker that dies here runs the job again, rather than lose what follows.
426
+ await this.#follow(envelope, () => this.#manager.completed(envelope))
427
+ await this.#ack(reserved)
428
+ await this.#manager.releaseUnique(envelope)
429
+ this.#log(`${label} done in ${took}`)
430
+ return
431
+ case 'released':
432
+ await this.#release(reserved, envelope, outcome.delay)
433
+ this.#log(`${label} released${outcome.delay > 0 ? ` for ${humanize(`${outcome.delay}ms`, { exact: true })}` : ''}`)
434
+ return
435
+ case 'fail':
436
+ this.#app.report(outcome.error, { job: job.name, id: envelope.id, attempt })
437
+ await this.#failForGood(reserved, restored, job, outcome.error, false)
438
+ return
439
+ default: {
440
+ if (outcome.kind === 'hung' && this.#hung === null) {
441
+ // The handler cannot be stopped: the worker stops reserving, gives the other jobs the grace, records
442
+ // this attempt and exits. Recording it last keeps another worker from taking the job while it runs.
443
+ this.#hung = this.#inFlight.get(reserved) ?? Promise.resolve()
444
+ this.#wake.abort()
445
+ const others = [...this.#inFlight].filter(([other]) => other !== reserved).map(([, running]) => running)
446
+ await Promise.race([Promise.allSettled(others), pause(this.#manager.grace)])
447
+ }
448
+ this.#app.report(outcome.error, { job: job.name, id: envelope.id, attempt })
449
+ const counted: Envelope = { ...envelope, exceptions: envelope.exceptions + 1 }
450
+ const settled = { ...restored, envelope: counted }
451
+ if (attempt >= job.tries || counted.exceptions >= job.maxExceptions || this.#outOfTime(job, envelope)) {
452
+ await this.#failForGood(reserved, settled, job, outcome.error, false)
453
+ return
454
+ }
455
+ const delay = backoffAfter(job, attempt)
456
+ await this.#release(reserved, counted, delay)
457
+ this.#log(
458
+ `${label} failed (${errorText(outcome.error)}), retrying${delay > 0 ? ` in ${humanize(`${delay}ms`, { exact: true })}` : ''}`,
459
+ )
460
+ }
461
+ }
462
+ }
463
+
464
+ #outOfTime(job: AnyJob, envelope: Envelope): boolean {
465
+ return job.retryUntil !== null && this.#manager.clock.now().epochMilliseconds >= envelope.dispatchedAt + job.retryUntil
466
+ }
467
+
468
+ async #ack(reserved: ReservedJob): Promise<void> {
469
+ try {
470
+ await this.#manager.driver(this.#connection).ack(reserved)
471
+ } catch (error) {
472
+ this.#app.report(error, { during: `removing a finished job from the queue connection "${this.#connection}"` })
473
+ }
474
+ }
475
+
476
+ async #release(reserved: ReservedJob, envelope: Envelope, delay: number): Promise<void> {
477
+ try {
478
+ await this.#manager.driver(this.#connection).release(reserved, delay, encodeEnvelope(envelope))
479
+ } catch (error) {
480
+ this.#app.report(error, { during: `putting a job back on the queue connection "${this.#connection}"` })
481
+ }
482
+ }
483
+
484
+ /** Runs the job's `failed` hook, records the failure, and removes the job from its queue. */
485
+ async #failForGood(reserved: ReservedJob, restored: RestoredJob, job: AnyJob | null, error: unknown, report: boolean): Promise<void> {
486
+ const { envelope } = restored
487
+ if (report) this.#app.report(error, { job: envelope.name, id: envelope.id })
488
+ if (job !== null) await runFailedHook(this.#app, job, envelope.payload, error, restored)
489
+ await this.#record({ id: envelope.id, queue: reserved.queue, envelope: encodeEnvelope(envelope) }, error)
490
+ await this.#follow(envelope, () => this.#manager.failedForGood(envelope))
491
+ await this.#ack(reserved)
492
+ await this.#manager.releaseUnique(envelope)
493
+ this.#log(`${envelope.name} ${envelope.id} failed: ${errorText(error)}`)
494
+ }
495
+
496
+ /** Runs what follows a job (its chain, its batch); an error there is reported, and the job still leaves its queue. */
497
+ async #follow(envelope: Envelope, work: () => Promise<void>): Promise<void> {
498
+ try {
499
+ await work()
500
+ } catch (error) {
501
+ this.#app.report(error, { during: `dispatching what follows the job "${envelope.name}"`, id: envelope.id })
502
+ }
503
+ }
504
+
505
+ async #failUnreadable(reserved: ReservedJob, error: unknown): Promise<void> {
506
+ this.#app.report(error, { during: `reading a job on the queue connection "${this.#connection}"` })
507
+ await this.#record({ id: randomUUID(), queue: reserved.queue, envelope: reserved.envelope }, error)
508
+ await this.#ack(reserved)
509
+ this.#log(`An unreadable job failed: ${errorText(error)}`)
510
+ }
511
+
512
+ async #record(job: { id: string; queue: string; envelope: string }, error: unknown): Promise<void> {
513
+ try {
514
+ await this.#manager.failed().record({ ...job, connection: this.#connection }, error)
515
+ } catch (recordError) {
516
+ this.#app.report(recordError, { during: 'recording a failed job' })
517
+ }
518
+ }
519
+ }
@@ -0,0 +1 @@
1
+ export { MissingRedisPackageError, type RedisClient, RedisManager, redis, UnknownRedisConnectionError } from './redis.ts'
@@ -0,0 +1,158 @@
1
+ // Redis connections. The framework does not wrap Redis commands: `redis.connection()` is the node-redis client itself,
2
+ // made from the REDIS_ variables on first use and closed when the application stops. node-redis traces its own
3
+ // commands on the `node-redis:command` diagnostics channel.
4
+ import { createRequire } from 'node:module'
5
+ import { join } from 'node:path'
6
+ import type { RedisClientType } from 'redis'
7
+ import type { RedisConfig, RedisConnectionConfig } from '../config/index.ts'
8
+ import { MimarError } from '../errors/index.ts'
9
+ import { currentApplication } from '../scope/index.ts'
10
+ import type { Frozen } from '../support/index.ts'
11
+ import { milliseconds } from '../time/index.ts'
12
+
13
+ /** A node-redis client: `await client.set('key', 'value')`. */
14
+ export type RedisClient = RedisClientType
15
+
16
+ /** The `redis` package is an optional peer: installed by the applications that use Redis. */
17
+ export class MissingRedisPackageError extends MimarError {
18
+ constructor(what: string) {
19
+ super('E_MISSING_DRIVER_PACKAGE', `${what} needs the "redis" package, which is not installed. Install it: npm install redis`)
20
+ }
21
+ }
22
+
23
+ /** A connection name that is not configured. */
24
+ export class UnknownRedisConnectionError extends MimarError {
25
+ constructor(name: string, known: readonly string[]) {
26
+ super(
27
+ 'E_UNKNOWN_REDIS_CONNECTION',
28
+ `There is no Redis connection named "${name}". The connections are: ${known.join(', ')}. Add one in config/redis.ts.`,
29
+ )
30
+ }
31
+ }
32
+
33
+ interface RedisModule {
34
+ createClient(options: object): RedisClient
35
+ }
36
+
37
+ /** The node-redis options of one connection. A URL gives the address and credentials; the database is always set. */
38
+ function clientOptions(name: string, config: Frozen<RedisConnectionConfig>): object {
39
+ const socket = { connectTimeout: 10_000, reconnectStrategy: (retries: number) => Math.min(100 * 2 ** retries, 3_000) }
40
+ const credentials = {
41
+ ...(config.username === null ? {} : { username: config.username }),
42
+ ...(config.password === null ? {} : { password: config.password }),
43
+ }
44
+ // A command waits to be sent while the connection is down, but not for ever: after the timeout it fails.
45
+ const common = {
46
+ name: `mimar-${name}`,
47
+ database: config.database,
48
+ commandOptions: { timeout: milliseconds(config.timeout) },
49
+ ...credentials,
50
+ }
51
+ if (config.url !== null) return { url: config.url, socket, ...common }
52
+ return { socket: { ...socket, host: config.host, port: config.port }, ...common }
53
+ }
54
+
55
+ /** Where `connection` is, for messages: never its password. */
56
+ function address(config: Frozen<RedisConnectionConfig>): string {
57
+ if (config.url === null) return `${config.host}:${config.port}/${config.database}`
58
+ try {
59
+ const url = new URL(config.url)
60
+ return url.protocol === 'unix:' ? url.pathname : `${url.hostname}:${url.port || 6379}/${config.database}`
61
+ } catch {
62
+ return 'REDIS_URL'
63
+ }
64
+ }
65
+
66
+ export class RedisManager {
67
+ readonly #config: Frozen<RedisConfig>
68
+ readonly #basePath: string
69
+ readonly #log: (message: string, values: Record<string, unknown>) => void
70
+ readonly #clients = new Map<string, RedisClient>()
71
+ #module: RedisModule | undefined
72
+
73
+ constructor(options: {
74
+ config: Frozen<RedisConfig>
75
+ /** The application root: the `redis` package is looked up from there, as the application installs it. */
76
+ basePath: string
77
+ /** Where connection failures are written: one line when a connection fails, none while it keeps retrying. */
78
+ log?: (message: string, values: Record<string, unknown>) => void
79
+ }) {
80
+ this.#config = options.config
81
+ this.#basePath = options.basePath
82
+ this.#log = options.log ?? (() => {})
83
+ }
84
+
85
+ /** The configured connection names. */
86
+ names(): string[] {
87
+ return Object.keys(this.#config.connections)
88
+ }
89
+
90
+ /** Whether the `redis` package can be loaded. */
91
+ installed(): boolean {
92
+ try {
93
+ this.#load('Redis')
94
+ return true
95
+ } catch {
96
+ return false
97
+ }
98
+ }
99
+
100
+ /** The client of `name`, made and connected on first use. Commands sent while it connects wait for it. */
101
+ connection(name = 'default', what = 'Redis'): RedisClient {
102
+ const existing = this.#clients.get(name)
103
+ if (existing !== undefined) return existing
104
+ const config = this.#config.connections[name]
105
+ if (config === undefined) throw new UnknownRedisConnectionError(name, this.names())
106
+ const client = this.#load(what).createClient(clientOptions(name, config))
107
+ let failing = false
108
+ client.on('error', (error: Error) => {
109
+ if (failing) return
110
+ failing = true
111
+ this.#log(`The Redis connection ${name} (${address(config)}) failed: ${error.message}. It is retrying.`, { connection: name })
112
+ })
113
+ client.on('ready', () => {
114
+ failing = false
115
+ })
116
+ this.#clients.set(name, client)
117
+ client.connect().catch(() => {})
118
+ return client
119
+ }
120
+
121
+ /** Closes every client: pending commands finish first. */
122
+ async close(): Promise<void> {
123
+ const clients = [...this.#clients.values()]
124
+ this.#clients.clear()
125
+ await Promise.all(
126
+ clients.map(async (client) => {
127
+ if (client.isOpen) await client.close().catch(() => client.destroy())
128
+ else client.destroy()
129
+ }),
130
+ )
131
+ }
132
+
133
+ #load(what: string): RedisModule {
134
+ if (this.#module !== undefined) return this.#module
135
+ const require = createRequire(join(this.#basePath, 'package.json'))
136
+ try {
137
+ this.#module = require('redis') as RedisModule
138
+ } catch (error) {
139
+ if ((error as { code?: string }).code === 'MODULE_NOT_FOUND') {
140
+ try {
141
+ this.#module = createRequire(import.meta.url)('redis') as RedisModule
142
+ } catch {
143
+ throw new MissingRedisPackageError(what)
144
+ }
145
+ } else throw error
146
+ }
147
+ return this.#module
148
+ }
149
+ }
150
+
151
+ /** The application's Redis connections. */
152
+ export const redis = Object.freeze({
153
+ /**
154
+ * The node-redis client of a connection: `default` (REDIS_DB) unless named. It connects on first use and closes
155
+ * when the application stops: `await redis.connection().set('key', 'value', { expiration: { type: 'EX', value: 60 } })`.
156
+ */
157
+ connection: (name = 'default'): RedisClient => currentApplication('redis.connection()').resolve(RedisManager).connection(name),
158
+ })
@@ -0,0 +1 @@
1
+ export {}