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 @@
1
+ {"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../src/model/model.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,667 @@
1
+ // biome-ignore-all lint/complexity/noThisInStatic: a static acts on the model it is called on (Post.create), not on ModelBase
2
+ // `class Post extends Model('posts', { … }) {}`. `Model()` makes a class that carries the table and the columns; every
3
+ // model shares one base, whose statics read and create rows and whose methods write a row in place. Rows are made with
4
+ // `Object.create(Post.prototype)`, never by the constructor, so a model must not declare one, nor fields, nor private
5
+ // members: they would be missing on every row.
6
+ import { crypt } from '../crypt/index.js';
7
+ import { DatabaseManager, isSql } from '../db/index.js';
8
+ import { EventDispatcher, makeEvent } from '../events/index.js';
9
+ import { hash, Password } from '../hash/index.js';
10
+ import { scope } from '../scope/index.js';
11
+ import { plainDataKey } from '../support/index.js';
12
+ import { ulid, uuid } from '../str/index.js';
13
+ import { now } from '../time/index.js';
14
+ import { isColumn } from './columns.js';
15
+ import { InvalidModelValueError, ModelDefinitionError, ModelNotFoundError, UnknownModelColumnError, UnknownRelationError, } from './errors.js';
16
+ import { relationKeys } from './keys.js';
17
+ import { loadRelations, loadsKey } from './loading.js';
18
+ import { assignColumns, describeColumns, readModelValue, setColumn } from './meta.js';
19
+ import { baseQuery, connectionKey, guardRow, lookupValue, ModelQuery, parseLoads, } from './query.js';
20
+ import { relationQuery } from './related.js';
21
+ import { isRelation } from './relations.js';
22
+ const metaKey = Symbol('mimar.model.meta');
23
+ const infoKey = Symbol('mimar.model.info');
24
+ const relationsKey = Symbol('mimar.model.relations');
25
+ const deletedKey = Symbol('mimar.model.deleted');
26
+ /** Set on a model class while the boot check constructs it to look for field initializers. */
27
+ export const probeKey = Symbol('mimar.model.probe');
28
+ /** The methods every row has; a column cannot share a name with one. */
29
+ export const rowMethods = Object.freeze([
30
+ 'relations',
31
+ 'update',
32
+ 'delete',
33
+ 'increment',
34
+ 'decrement',
35
+ 'refresh',
36
+ 'toJSON',
37
+ 'load',
38
+ 'related',
39
+ 'constructor',
40
+ ]);
41
+ const numericKinds = ['id', 'foreignId', 'integer', 'bigint', 'float', 'decimal'];
42
+ function metaOf(model) {
43
+ const meta = model[metaKey];
44
+ if (meta === undefined) {
45
+ throw new ModelDefinitionError(`${model.name || 'This class'} is not a model. Declare one as: class Post extends Model('posts', { … }) {}`);
46
+ }
47
+ return meta;
48
+ }
49
+ /** `Post`, or `Model('posts')` for a class made by Model() and not extended. */
50
+ export function displayName(model) {
51
+ return model.name && !model.name.startsWith('Model(') ? model.name : `Model('${model.table}')`;
52
+ }
53
+ /** What a model's queries need, made once per model class and kept on it. */
54
+ export function infoOf(model) {
55
+ const own = model;
56
+ if (Object.hasOwn(model, infoKey))
57
+ return own[infoKey];
58
+ const meta = metaOf(model);
59
+ const resolved = new Map();
60
+ let names;
61
+ const info = Object.freeze({
62
+ table: meta.table,
63
+ get primaryKey() {
64
+ return model.primaryKey;
65
+ },
66
+ get routeKey() {
67
+ return typeof model.routeKey === 'string' ? model.routeKey : model.primaryKey;
68
+ },
69
+ prototype: model.prototype,
70
+ displayName: displayName(model),
71
+ meta,
72
+ prepareUpdate: async (values, helper) => {
73
+ const prepared = await prepare(model, values, `${helper}`, true);
74
+ stamp(info, prepared, false);
75
+ return prepared.stored;
76
+ },
77
+ get relationNames() {
78
+ names ??= Object.freeze(Object.keys(relationsOf(model)));
79
+ return names;
80
+ },
81
+ relation: (name) => resolveRelation(model, info, resolved, name),
82
+ load: (rows, nodes, connection) => loadRelations(info, rows, nodes, connection),
83
+ create: (values, connection) => createRow(model, values, connection),
84
+ });
85
+ Object.defineProperty(model, infoKey, { value: info });
86
+ return info;
87
+ }
88
+ /** A relationship of the model with its related model and keys, resolved on first use and kept. */
89
+ function resolveRelation(model, info, resolved, name) {
90
+ const known = resolved.get(name);
91
+ if (known !== undefined)
92
+ return known;
93
+ const relations = relationsOf(model);
94
+ const relation = Object.hasOwn(relations, name) ? relations[name] : undefined;
95
+ if (relation === undefined)
96
+ throw new UnknownRelationError(info.displayName, name, Object.keys(relations));
97
+ const related = relation.related();
98
+ if (!isModel(related)) {
99
+ throw new ModelDefinitionError(`${info.displayName}.relations() declares ${name}, and its function does not return a model class.`);
100
+ }
101
+ const entry = Object.freeze({
102
+ name,
103
+ relation,
104
+ related: infoOf(related),
105
+ keys: relationKeys(model, name, relation, related),
106
+ });
107
+ resolved.set(name, entry);
108
+ return entry;
109
+ }
110
+ /** Whether a value is a model class: one made by Model(), or a class extending it. */
111
+ export function isModel(value) {
112
+ return typeof value === 'function' && value.prototype instanceof ModelBase && metaKey in value;
113
+ }
114
+ /** The model's relationships, read once from `relations()` without a row. */
115
+ export function relationsOf(model) {
116
+ const own = model;
117
+ if (Object.hasOwn(model, relationsKey))
118
+ return own[relationsKey];
119
+ const declared = model.prototype.relations.call(undefined);
120
+ if (typeof declared !== 'object' || declared === null || Array.isArray(declared)) {
121
+ throw new ModelDefinitionError(`${displayName(model)}.relations() returned ${declared === null ? 'null' : typeof declared}. It returns an object of relationships: relations() { return { user: belongsTo(() => User) } }.`);
122
+ }
123
+ for (const [name, relation] of Object.entries(declared)) {
124
+ if (!isRelation(relation)) {
125
+ throw new ModelDefinitionError(`${displayName(model)}.relations() declares ${name}, which is not a relationship. Declare it with belongsTo, hasOne, hasMany or belongsToMany: ${name}: hasMany(() => Comment).`);
126
+ }
127
+ }
128
+ const relations = Object.freeze({ ...declared });
129
+ Object.defineProperty(model, relationsKey, { value: relations });
130
+ return relations;
131
+ }
132
+ function valuesObject(info, helper, values) {
133
+ if (typeof values !== 'object' || values === null || Array.isArray(values) || isSql(values)) {
134
+ throw new InvalidModelValueError(`${info.displayName}.${helper} takes an object of column values: { title: 'Hello' }.`);
135
+ }
136
+ return values;
137
+ }
138
+ /** A value as the database stores it, and as the row holds it. */
139
+ async function convert(info, column, value, expressions) {
140
+ const where = `${info.displayName}.${column.property}`;
141
+ if (value === null) {
142
+ if (!column.options.nullable) {
143
+ throw new InvalidModelValueError(`${where} cannot be null: the column is not nullable. If it may be empty, declare it with .nullable().`);
144
+ }
145
+ return [null, null];
146
+ }
147
+ if (isSql(value) || (typeof value === 'object' && typeof value.toSubquery === 'function')) {
148
+ if (expressions)
149
+ return [value, undefined];
150
+ throw new InvalidModelValueError(`${where} was given a SQL expression. A row's own write needs the values it stores; for an expression, write through the query (${info.displayName}.query().where(…).update({ … })) and read the row again with refresh().`);
151
+ }
152
+ switch (column.options.kind) {
153
+ case 'password': {
154
+ if (value instanceof Password) {
155
+ const hashed = await hash.make(value);
156
+ return [hashed, hashed];
157
+ }
158
+ if (typeof value === 'string' && /^\$[a-z0-9-]+\$/i.test(value))
159
+ return [value, value];
160
+ throw new InvalidModelValueError(`${where} takes a Password, which is hashed before it is stored, or a password hash. Wrap the text: new Password(text). A plain string is refused so that no password is stored as it was typed.`);
161
+ }
162
+ case 'encrypted':
163
+ return [crypt.encrypt(value), value];
164
+ case 'enum': {
165
+ const values = column.options.values ?? [];
166
+ if (!values.includes(value)) {
167
+ throw new InvalidModelValueError(`${where} is one of ${values.map((each) => `"${each}"`).join(', ')}, not ${JSON.stringify(value) ?? String(value)}.`);
168
+ }
169
+ return [value, value];
170
+ }
171
+ case 'json':
172
+ return [JSON.stringify(value), value];
173
+ case 'vector': {
174
+ const numbers = value instanceof Float32Array ? Array.from(value) : Array.isArray(value) ? value : null;
175
+ if (numbers === null || numbers.some((number) => typeof number !== 'number' || !Number.isFinite(number))) {
176
+ throw new InvalidModelValueError(`${where} takes a Float32Array or an array of numbers.`);
177
+ }
178
+ if (column.options.dimensions !== undefined && numbers.length !== column.options.dimensions) {
179
+ throw new InvalidModelValueError(`${where} holds ${column.options.dimensions} numbers, not ${numbers.length}.`);
180
+ }
181
+ return [`[${numbers.join(',')}]`, Float32Array.from(numbers)];
182
+ }
183
+ case 'timestamp':
184
+ return value instanceof Temporal.ZonedDateTime ? [value.toInstant(), value.toInstant()] : [value, value];
185
+ default:
186
+ return [value, value];
187
+ }
188
+ }
189
+ /** Checks and converts the values of a write. Undefined values are left out, as if they were not given. */
190
+ async function prepare(model, values, helper, expressions) {
191
+ const info = infoOf(model);
192
+ const stored = {};
193
+ const read = {};
194
+ for (const [property, value] of Object.entries(valuesObject(info, helper, values))) {
195
+ if (value === undefined)
196
+ continue;
197
+ const column = info.meta.byProperty.get(property);
198
+ if (column === undefined) {
199
+ throw new UnknownModelColumnError(info.displayName, property, info.meta.columns.map((each) => each.property));
200
+ }
201
+ const [storedValue, readValue] = await convert(info, column, value, expressions);
202
+ stored[property] = storedValue;
203
+ if (readValue !== undefined)
204
+ read[property] = readValue;
205
+ }
206
+ return { stored, read };
207
+ }
208
+ /** Fills what the framework owns: `updatedAt` on every write, `createdAt` and generated keys on create. */
209
+ function stamp(info, prepared, creating) {
210
+ let at;
211
+ for (const column of info.meta.columns) {
212
+ const generated = column.options.generated;
213
+ if (generated === undefined || column.property in prepared.stored)
214
+ continue;
215
+ if (generated === 'updatedAt' || (creating && generated === 'createdAt')) {
216
+ at ??= now();
217
+ prepared.stored[column.property] = at;
218
+ prepared.read[column.property] = at;
219
+ }
220
+ else if (creating && (generated === 'uuid' || generated === 'ulid')) {
221
+ at ??= now();
222
+ const milliseconds = Number(at.epochMilliseconds);
223
+ const key = generated === 'uuid' ? uuid(milliseconds) : ulid(milliseconds);
224
+ prepared.stored[column.property] = key;
225
+ prepared.read[column.property] = key;
226
+ }
227
+ }
228
+ }
229
+ function connectionOf(info, connection) {
230
+ return scope(info.displayName).app.resolve(DatabaseManager).connection(connection);
231
+ }
232
+ /** Where a model keeps its events, made the first time they are asked for. */
233
+ const eventsKey = Symbol.for('mimar.model.events');
234
+ /** The model's own event of this kind: `Post.created` is the same value every time, and only Post's. */
235
+ function modelEventOf(model, kind) {
236
+ if (!Object.hasOwn(model, eventsKey))
237
+ Object.defineProperty(model, eventsKey, { value: {} });
238
+ const events = model[eventsKey];
239
+ events[kind] ??= makeEvent(`${displayName(model)}.${kind}`, model);
240
+ return events[kind];
241
+ }
242
+ /** Dispatches a model's event after its write, when anything listens to it; inside a transaction, after it commits. */
243
+ async function announce(model, kind, payload) {
244
+ const event = modelEventOf(model, kind);
245
+ const dispatcher = scope(`${displayName(model)}.${kind}`).app.resolve(EventDispatcher);
246
+ if (dispatcher.listening(event))
247
+ await dispatcher.dispatch(event, payload, `${displayName(model)}.${kind}`);
248
+ }
249
+ /** Runs a write in a transaction when the model has the hook, so that the hook and the statement commit together. */
250
+ function withHook(model, hook, connection, work) {
251
+ if (typeof model.hooks?.[hook] !== 'function')
252
+ return work();
253
+ return connectionOf(infoOf(model), connection).transaction(work);
254
+ }
255
+ /** A row object from values the framework already holds, in the order of the columns. */
256
+ function rowFrom(model, info, values, connection) {
257
+ const row = Object.create(model.prototype);
258
+ for (const column of info.meta.columns) {
259
+ if (column.property in values)
260
+ setColumn(row, column, values[column.property]);
261
+ }
262
+ if (connection !== undefined)
263
+ Object.defineProperty(row, connectionKey, { value: connection });
264
+ return guardRow(info, row);
265
+ }
266
+ /** Inserts prepared values and returns the row, with its key and the columns the database filled. */
267
+ async function insertRow(model, prepared, connection) {
268
+ const info = infoOf(model);
269
+ const key = model.primaryKey;
270
+ const keyColumn = info.meta.byProperty.get(key);
271
+ if (keyColumn === undefined)
272
+ throw missingKey(info);
273
+ const { stored, read } = prepared;
274
+ if (stored[key] === undefined) {
275
+ const id = await baseQuery(info, connection).insertGetId(stored);
276
+ read[key] = readModelValue(info.displayName, keyColumn, id);
277
+ }
278
+ else {
279
+ await baseQuery(info, connection).insert(stored);
280
+ }
281
+ const filled = info.meta.columns.filter((column) => column.options.hasDefault && !(column.property in read));
282
+ if (filled.length > 0) {
283
+ const row = await baseQuery(info, connection)
284
+ .select(...filled.map((column) => column.property))
285
+ .where(key, read[key])
286
+ .first();
287
+ if (row !== null)
288
+ Object.assign(read, row);
289
+ }
290
+ for (const column of info.meta.columns) {
291
+ if (column.options.nullable && !(column.property in read))
292
+ read[column.property] = null;
293
+ }
294
+ return rowFrom(model, info, read, connection);
295
+ }
296
+ function missingKey(info) {
297
+ return new ModelDefinitionError(`${info.displayName} has no column for its primary key "${info.primaryKey}". Declare it (id: column.id()), or name another key: static override primaryKey = 'uuid'.`);
298
+ }
299
+ /** The model of a row, its key, and the connection it came from. Throws for a row its own delete() removed. */
300
+ function target(row, helper) {
301
+ const model = row.constructor;
302
+ const info = infoOf(model);
303
+ const id = row[model.primaryKey];
304
+ if (id === undefined || id === null) {
305
+ throw new ModelDefinitionError(`${info.displayName}.${helper} needs the row's key "${model.primaryKey}", and this object has none. Rows written through the model come from a query or from create().`);
306
+ }
307
+ if (row[deletedKey] === true) {
308
+ throw new ModelNotFoundError(info.displayName, [id], `${info.displayName} ${String(id)} was deleted by delete(), so ${helper} cannot write it.`);
309
+ }
310
+ return { model, info, id, connection: row[connectionKey] };
311
+ }
312
+ async function step(row, helper, column, by, sign) {
313
+ const { info, id, connection, model } = target(row, helper);
314
+ const meta = typeof column === 'string' ? info.meta.byProperty.get(column) : undefined;
315
+ if (meta === undefined || !numericKinds.includes(meta.options.kind)) {
316
+ const numeric = info.meta.columns.filter((each) => numericKinds.includes(each.options.kind)).map((each) => each.property);
317
+ throw new InvalidModelValueError(`${info.displayName}.${helper} takes a numeric column, and ${String(column)} is not one. The numeric columns are: ${numeric.join(', ')}`);
318
+ }
319
+ const prepared = { stored: {}, read: {} };
320
+ stamp(info, prepared, false);
321
+ const query = baseQuery(info, connection).where(model.primaryKey, id);
322
+ const affected = sign === 1
323
+ ? await query.increment(meta.property, by, prepared.stored)
324
+ : await query.decrement(meta.property, by, prepared.stored);
325
+ if (affected === 0)
326
+ throw new ModelNotFoundError(info.displayName, [id]);
327
+ const value = await baseQuery(info, connection).where(model.primaryKey, id).value(meta.property);
328
+ setColumn(row, meta, readModelValue(info.displayName, meta, value));
329
+ assignColumns(info.meta, row, prepared.read);
330
+ return row;
331
+ }
332
+ /** The key `toWire()` (in `mimarjs/http`) looks for: a row's wire form is its JSON. */
333
+ const toWireKey = Symbol.for('mimar.toWire');
334
+ /** The key validation's database rules (`unique`, `exists`) ask a model under, so validation never imports the database. */
335
+ const presenceKey = Symbol.for('mimar.presence');
336
+ /** The base of every model. Its statics act on the model's table; its methods on one row. */
337
+ export class ModelBase {
338
+ /** The primary key's property. */
339
+ static primaryKey = 'id';
340
+ /** The column `route()` and `fromRoute()` use for the model: the primary key unless a model names another. */
341
+ static routeKey = undefined;
342
+ /** Functions run around the model's own writes. */
343
+ static hooks = Object.freeze({});
344
+ /** Dispatched after a row is created (after the transaction commits, inside one): `listen(Post.created, ({ model }) => …)`. */
345
+ static get created() {
346
+ return modelEventOf(this, 'created');
347
+ }
348
+ /** Dispatched after a row is updated, with the properties written: `listen(Post.updated, ({ model, changed }) => …)`. */
349
+ static get updated() {
350
+ return modelEventOf(this, 'updated');
351
+ }
352
+ /** Dispatched after a row is deleted: `listen(Post.deleted, ({ model }) => …)`. */
353
+ static get deleted() {
354
+ return modelEventOf(this, 'deleted');
355
+ }
356
+ constructor() {
357
+ if (!Object.hasOwn(new.target, probeKey)) {
358
+ const name = displayName(new.target);
359
+ throw new ModelDefinitionError(`${name} rows come from the database: ${name}.create({ … }) inserts one and ${name}.find(id) reads one. new ${name}() is not supported.`);
360
+ }
361
+ }
362
+ // ── statics: reading ─────────────────────────────────────────────────────────────────────────────────────────────
363
+ static query() {
364
+ return ModelQuery.for(infoOf(this), undefined);
365
+ }
366
+ static on(connection) {
367
+ if (typeof connection !== 'string' || connection === '') {
368
+ throw new ModelDefinitionError(`${displayName(this)}.on() takes the name of a connection in config/database.ts.`);
369
+ }
370
+ return ModelQuery.for(infoOf(this), connection);
371
+ }
372
+ static find(id) {
373
+ return ModelQuery.for(infoOf(this), undefined).find(id);
374
+ }
375
+ static findOrFail(id) {
376
+ return ModelQuery.for(infoOf(this), undefined).findOrFail(id);
377
+ }
378
+ static findMany(ids) {
379
+ return ModelQuery.for(infoOf(this), undefined).findMany(ids);
380
+ }
381
+ /**
382
+ * The row a route parameter names: `Post.fromRoute(request, 'post')`, by the model's route key, or by `column`.
383
+ * ModelNotFoundError (404) when there is none, or when the value cannot be one of the column's.
384
+ */
385
+ static fromRoute(request, name, column) {
386
+ return ModelQuery.for(infoOf(this), undefined).fromRoute(request, name, column);
387
+ }
388
+ /**
389
+ * For validation's `unique()` and `exists()`: whether a row holds a value in `column` (default: the primary key).
390
+ * The column is checked when the rule is declared; the query joins the ambient transaction.
391
+ */
392
+ static [presenceKey](column, helper) {
393
+ const info = infoOf(this);
394
+ const property = column ?? this.primaryKey;
395
+ const meta = info.meta.byProperty.get(property);
396
+ if (meta === undefined) {
397
+ throw new UnknownModelColumnError(info.displayName, property, info.meta.columns.map((each) => each.property));
398
+ }
399
+ // A hidden column is only kept out of JSON; a hashed or encrypted one stores what no value compares equal to.
400
+ if (meta.options.kind === 'password' || meta.options.kind === 'encrypted') {
401
+ throw new InvalidModelValueError(`${helper} compares stored values, and ${info.displayName}.${property} is ${meta.options.kind === 'password' ? 'hashed' : 'encrypted'}.`);
402
+ }
403
+ const model = this;
404
+ return Object.freeze({
405
+ column: meta.property,
406
+ async exists(value, options) {
407
+ const lookup = lookupValue(meta, value);
408
+ if (lookup === undefined || lookup === null)
409
+ return false;
410
+ let query = ModelQuery.for(info, undefined).where(meta.property, lookup);
411
+ const ignored = options.ignore;
412
+ if (ignored !== undefined && ignored !== null) {
413
+ const key = typeof ignored === 'object' ? ignored[model.primaryKey] : ignored;
414
+ if (key !== undefined && key !== null)
415
+ query = query.where(model.primaryKey, '!=', key);
416
+ }
417
+ if (options.constrain !== undefined) {
418
+ const narrowed = options.constrain(query);
419
+ if (!(narrowed instanceof ModelQuery)) {
420
+ throw new InvalidModelValueError(`The function given to ${helper} must return the query it was given, with its clauses added.`);
421
+ }
422
+ query = narrowed;
423
+ }
424
+ return query.exists();
425
+ },
426
+ });
427
+ }
428
+ static all() {
429
+ return ModelQuery.for(infoOf(this), undefined).get();
430
+ }
431
+ /** Loads relationships onto rows already read, one query per relationship: `Post.loadMany(posts, 'user')`. */
432
+ static async loadMany(rows, ...args) {
433
+ const info = infoOf(this);
434
+ if (!Array.isArray(rows) || rows.some((row) => !(row instanceof this))) {
435
+ throw new InvalidModelValueError(`${info.displayName}.loadMany() takes an array of ${info.displayName} rows, then the relationships.`);
436
+ }
437
+ const nodes = parseLoads(info, 'loadMany()', args);
438
+ // Rows read from different connections load from their own.
439
+ const byConnection = new Map();
440
+ for (const row of rows) {
441
+ const connection = row[connectionKey];
442
+ const group = byConnection.get(connection);
443
+ if (group === undefined)
444
+ byConnection.set(connection, [row]);
445
+ else
446
+ group.push(row);
447
+ }
448
+ for (const [connection, group] of byConnection)
449
+ await info.load(group, nodes, connection);
450
+ return rows;
451
+ }
452
+ // ── statics: writing ─────────────────────────────────────────────────────────────────────────────────────────────
453
+ static create(values) {
454
+ return createRow(this, values, undefined);
455
+ }
456
+ static async destroy(ids) {
457
+ const rows = (await ModelQuery.for(infoOf(this), undefined).findMany(ids));
458
+ for (const row of rows)
459
+ await row.delete();
460
+ return rows.length;
461
+ }
462
+ static async firstOrCreate(attributes, values = {}) {
463
+ const found = await matching(this, attributes, 'firstOrCreate()').first();
464
+ if (found !== null)
465
+ return [found, false];
466
+ return [
467
+ await ModelBase.create.call(this, { ...attributes, ...valuesObject(infoOf(this), 'firstOrCreate()', values) }),
468
+ true,
469
+ ];
470
+ }
471
+ static async updateOrCreate(attributes, values = {}) {
472
+ const found = (await matching(this, attributes, 'updateOrCreate()').first());
473
+ const rest = valuesObject(infoOf(this), 'updateOrCreate()', values);
474
+ if (found !== null)
475
+ return found.update(rest);
476
+ return ModelBase.create.call(this, { ...attributes, ...rest });
477
+ }
478
+ static async insertMany(rows) {
479
+ const stored = await storedRows(this, rows, 'insertMany()');
480
+ return stored.length === 0 ? 0 : baseQuery(infoOf(this), undefined).insert(stored);
481
+ }
482
+ static async upsert(rows, uniqueBy, update) {
483
+ const info = infoOf(this);
484
+ const stored = await storedRows(this, rows, 'upsert()');
485
+ const [first] = stored;
486
+ if (first === undefined)
487
+ return 0;
488
+ const unique = typeof uniqueBy === 'string' ? [uniqueBy] : Array.isArray(uniqueBy) ? uniqueBy : [];
489
+ for (const property of unique) {
490
+ if (!info.meta.byProperty.has(property)) {
491
+ throw new UnknownModelColumnError(info.displayName, property, info.meta.columns.map((each) => each.property));
492
+ }
493
+ }
494
+ const created = info.meta.columns.find((column) => column.options.generated === 'createdAt')?.property;
495
+ const updated = info.meta.columns.find((column) => column.options.generated === 'updatedAt')?.property;
496
+ const columns = update === undefined
497
+ ? Object.keys(first).filter((property) => !unique.includes(property) && property !== created)
498
+ : [...update, ...(updated !== undefined && !update.includes(updated) ? [updated] : [])];
499
+ return baseQuery(info, undefined).upsert(stored, unique, columns);
500
+ }
501
+ // ── a row ────────────────────────────────────────────────────────────────────────────────────────────────────────
502
+ relations() {
503
+ return {};
504
+ }
505
+ async update(values) {
506
+ const { model, info, id, connection } = target(this, 'update()');
507
+ const written = await withHook(model, 'updating', connection, async () => {
508
+ let given = { ...valuesObject(info, 'update()', values) };
509
+ if (typeof model.hooks.updating === 'function') {
510
+ const changed = await model.hooks.updating(this, { ...given });
511
+ if (changed !== undefined)
512
+ given = { ...valuesObject(info, 'hooks.updating()', changed) };
513
+ }
514
+ const prepared = await prepare(model, given, 'update()', false);
515
+ if (Object.keys(prepared.stored).length === 0)
516
+ return null;
517
+ stamp(info, prepared, false);
518
+ const affected = await baseQuery(info, connection).where(model.primaryKey, id).update(prepared.stored);
519
+ if (affected === 0)
520
+ throw new ModelNotFoundError(info.displayName, [id]);
521
+ assignColumns(info.meta, this, prepared.read);
522
+ return Object.keys(prepared.read);
523
+ });
524
+ if (written !== null)
525
+ await announce(model, 'updated', { model: this, changed: written });
526
+ return this;
527
+ }
528
+ async delete() {
529
+ const { model, info, id, connection } = target(this, 'delete()');
530
+ await withHook(model, 'deleting', connection, async () => {
531
+ if (typeof model.hooks.deleting === 'function')
532
+ await model.hooks.deleting(this);
533
+ await baseQuery(info, connection).where(model.primaryKey, id).delete();
534
+ });
535
+ Object.defineProperty(this, deletedKey, { value: true });
536
+ await announce(model, 'deleted', { model: this });
537
+ }
538
+ increment(column, by = 1) {
539
+ return step(this, 'increment()', column, by, 1);
540
+ }
541
+ decrement(column, by = 1) {
542
+ return step(this, 'decrement()', column, by, -1);
543
+ }
544
+ async refresh() {
545
+ const { model, info, id, connection } = target(this, 'refresh()');
546
+ const fresh = (await baseQuery(info, connection).where(model.primaryKey, id).first());
547
+ if (fresh === null)
548
+ throw new ModelNotFoundError(info.displayName, [id]);
549
+ for (const column of info.meta.columns) {
550
+ if (column.property in fresh)
551
+ setColumn(this, column, fresh[column.property]);
552
+ }
553
+ const loads = this[loadsKey];
554
+ if (loads !== undefined)
555
+ await info.load([this], loads, connection);
556
+ return this;
557
+ }
558
+ /** Loads relationships onto this row and returns it: `post.load('tags', 'comments.user')`. */
559
+ async load(...args) {
560
+ const model = this.constructor;
561
+ const info = infoOf(model);
562
+ await info.load([this], parseLoads(info, 'load()', args), this[connectionKey]);
563
+ return this;
564
+ }
565
+ /** A relationship of this row as a query of its related rows: `post.related('comments').where(…).get()`. */
566
+ related(name) {
567
+ const info = infoOf(this.constructor);
568
+ if (typeof name !== 'string' || name === '') {
569
+ throw new InvalidModelValueError(`${info.displayName}.related() takes the name of a relationship: post.related('comments').`);
570
+ }
571
+ return relationQuery(info, this, name, this[connectionKey]);
572
+ }
573
+ /** The row as `toWire()` sends it: the same as its JSON. */
574
+ [toWireKey]() {
575
+ return this.toJSON();
576
+ }
577
+ /** What a row is called when it is passed where plain data belongs: a cached value, a job's payload. */
578
+ [plainDataKey]() {
579
+ return { kind: 'model', name: displayName(this.constructor) };
580
+ }
581
+ /** The columns, minus hidden ones, and the relationships loaded, recursively. */
582
+ toJSON() {
583
+ const hidden = infoOf(this.constructor).meta.hidden;
584
+ const json = {};
585
+ for (const [key, value] of Object.entries(this)) {
586
+ if (hidden.has(key))
587
+ continue;
588
+ json[key] = typeof value === 'bigint' ? value.toString() : value instanceof Float32Array ? Array.from(value) : value;
589
+ }
590
+ return json;
591
+ }
592
+ }
593
+ /** Inserts a row, with the `creating` hook, on the connection given. */
594
+ async function createRow(model, values, connection) {
595
+ const info = infoOf(model);
596
+ const row = await withHook(model, 'creating', connection, async () => {
597
+ let given = { ...valuesObject(info, 'create()', values) };
598
+ if (typeof model.hooks.creating === 'function') {
599
+ const changed = await model.hooks.creating({ ...given });
600
+ if (changed !== undefined)
601
+ given = { ...valuesObject(info, 'hooks.creating()', changed) };
602
+ }
603
+ const prepared = await prepare(model, given, 'create()', false);
604
+ stamp(info, prepared, true);
605
+ return insertRow(model, prepared, connection);
606
+ });
607
+ await announce(model, 'created', { model: row });
608
+ return row;
609
+ }
610
+ /** A query for the rows whose columns equal `attributes`. */
611
+ function matching(model, attributes, helper) {
612
+ const info = infoOf(model);
613
+ let query = ModelQuery.for(info, undefined);
614
+ for (const [property, value] of Object.entries(valuesObject(info, helper, attributes))) {
615
+ if (value === undefined)
616
+ continue;
617
+ if (!info.meta.byProperty.has(property)) {
618
+ throw new UnknownModelColumnError(info.displayName, property, info.meta.columns.map((each) => each.property));
619
+ }
620
+ query = query.where(property, value);
621
+ }
622
+ return query;
623
+ }
624
+ async function storedRows(model, rows, helper) {
625
+ const info = infoOf(model);
626
+ if (!Array.isArray(rows))
627
+ throw new InvalidModelValueError(`${info.displayName}.${helper} takes an array of rows.`);
628
+ const stored = [];
629
+ for (const row of rows) {
630
+ const prepared = await prepare(model, row, helper, false);
631
+ stamp(info, prepared, true);
632
+ stored.push(prepared.stored);
633
+ }
634
+ return stored;
635
+ }
636
+ /**
637
+ * A model's base class: `class Post extends Model('posts', { id: column.id(), title: column.string() }) {}`. The table
638
+ * name is explicit; property names are camelCase and their columns the snake_case form.
639
+ */
640
+ export function Model(table, columns) {
641
+ if (typeof table !== 'string' || table.trim() === '') {
642
+ throw new ModelDefinitionError("Model() takes the table's name first: class Post extends Model('posts', { … }) {}");
643
+ }
644
+ if (typeof columns !== 'object' || columns === null || Array.isArray(columns)) {
645
+ throw new ModelDefinitionError(`Model('${table}') takes the columns second: Model('${table}', { id: column.id(), … }).`);
646
+ }
647
+ for (const [property, declaration] of Object.entries(columns)) {
648
+ if (!isColumn(declaration)) {
649
+ throw new ModelDefinitionError(`Model('${table}') was given ${property}, which is not a column. Declare it with column: ${property}: column.string().`);
650
+ }
651
+ if (rowMethods.includes(property)) {
652
+ throw new ModelDefinitionError(`Model('${table}') declares the column ${property}, which is also a method of every row. Name the property differently and keep the column with .named('${property}').`);
653
+ }
654
+ }
655
+ const meta = describeColumns(`Model('${table}')`, table, columns);
656
+ const frozen = Object.freeze({ ...columns });
657
+ const Base = class extends ModelBase {
658
+ static table = table;
659
+ static columns = frozen;
660
+ };
661
+ Object.defineProperty(Base, metaKey, { value: meta });
662
+ Object.defineProperty(Base, 'name', { value: `Model(${table})` });
663
+ // The runtime class has every static and row method; the column properties exist on the rows it makes, and the
664
+ // statics' `this` types are declared in ModelStatics.
665
+ return Base;
666
+ }
667
+ //# sourceMappingURL=model.js.map