velocious 1.0.449 → 1.0.450

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 (630) hide show
  1. package/build/application.js +4 -4
  2. package/build/authorization/ability.js +8 -8
  3. package/build/authorization/base-resource.js +4 -4
  4. package/build/background-jobs/cron-expression.js +1 -1
  5. package/build/background-jobs/forked-runner-child.js +1 -1
  6. package/build/background-jobs/job-registry.js +1 -1
  7. package/build/background-jobs/job-runner.js +1 -1
  8. package/build/background-jobs/job.js +1 -1
  9. package/build/background-jobs/json-socket.js +4 -4
  10. package/build/background-jobs/main.js +21 -21
  11. package/build/background-jobs/scheduler.js +7 -7
  12. package/build/background-jobs/store.js +7 -7
  13. package/build/background-jobs/web/controller.js +2 -2
  14. package/build/background-jobs/worker.js +12 -12
  15. package/build/beacon/client.js +11 -8
  16. package/build/beacon/in-process-broker.js +2 -2
  17. package/build/beacon/in-process-client.js +2 -2
  18. package/build/beacon/server.js +3 -3
  19. package/build/cli/browser-cli.js +1 -1
  20. package/build/cli/commands/db/base-command.js +2 -2
  21. package/build/cli/index.js +2 -2
  22. package/build/cli/tenant-database-command-helper.js +3 -3
  23. package/build/cli/use-browser-cli.js +1 -1
  24. package/build/configuration.js +38 -38
  25. package/build/controller.js +8 -8
  26. package/build/current-configuration.js +1 -1
  27. package/build/database/annotations-async-hooks.js +2 -2
  28. package/build/database/annotations.js +3 -3
  29. package/build/database/drivers/base-column.js +1 -1
  30. package/build/database/drivers/base-foreign-key.js +1 -1
  31. package/build/database/drivers/base-table.js +1 -1
  32. package/build/database/drivers/base.js +10 -10
  33. package/build/database/drivers/mssql/index.js +1 -1
  34. package/build/database/drivers/mssql/table.js +1 -1
  35. package/build/database/drivers/mysql/index.js +3 -3
  36. package/build/database/drivers/mysql/query.js +1 -1
  37. package/build/database/drivers/mysql/table.js +1 -1
  38. package/build/database/drivers/pgsql/index.js +2 -2
  39. package/build/database/drivers/sqlite/base.js +16 -16
  40. package/build/database/drivers/sqlite/index.js +11 -11
  41. package/build/database/drivers/sqlite/index.native.js +1 -1
  42. package/build/database/drivers/sqlite/index.web.js +3 -3
  43. package/build/database/drivers/sqlite/query.js +1 -1
  44. package/build/database/drivers/sqlite/query.web.js +1 -1
  45. package/build/database/drivers/sqlite/sql/alter-table.js +2 -2
  46. package/build/database/drivers/sqlite/table.js +1 -1
  47. package/build/database/migrator/files-finder.js +1 -1
  48. package/build/database/migrator.js +6 -6
  49. package/build/database/pool/async-tracked-multi-connection.js +27 -27
  50. package/build/database/pool/base-methods-forward.js +4 -4
  51. package/build/database/pool/base.js +8 -8
  52. package/build/database/query/from-base.js +1 -1
  53. package/build/database/query/index.js +10 -10
  54. package/build/database/query/join-object.js +3 -3
  55. package/build/database/query/model-class-query.js +39 -39
  56. package/build/database/query/preloader/belongs-to.js +22 -22
  57. package/build/database/query/preloader/has-many.js +20 -20
  58. package/build/database/query/preloader/has-one.js +8 -8
  59. package/build/database/query/preloader/selection.js +3 -3
  60. package/build/database/query/preloader.js +8 -8
  61. package/build/database/query/query-data.js +9 -9
  62. package/build/database/query/where-model-class-hash.js +7 -7
  63. package/build/database/query/with-count.js +9 -9
  64. package/build/database/record/acts-as-list.js +15 -15
  65. package/build/database/record/attachments/handle.js +2 -2
  66. package/build/database/record/attachments/normalize-input.js +12 -12
  67. package/build/database/record/attachments/storage-drivers/s3.js +6 -6
  68. package/build/database/record/attachments/store.js +13 -13
  69. package/build/database/record/index.js +115 -121
  70. package/build/database/record/instance-relationships/base.js +11 -11
  71. package/build/database/record/instance-relationships/belongs-to.js +3 -3
  72. package/build/database/record/instance-relationships/has-many.js +8 -8
  73. package/build/database/record/instance-relationships/has-one.js +7 -7
  74. package/build/database/record/relationships/base.js +2 -2
  75. package/build/database/record/state-machine.js +7 -7
  76. package/build/database/record/validators/presence.js +1 -1
  77. package/build/database/record/validators/uniqueness.js +5 -5
  78. package/build/database/table-data/index.js +4 -4
  79. package/build/environment-handlers/base.js +2 -2
  80. package/build/environment-handlers/browser.js +7 -7
  81. package/build/environment-handlers/node/cli/commands/cli-command-context.js +1 -1
  82. package/build/environment-handlers/node/cli/commands/console.js +4 -4
  83. package/build/environment-handlers/node/cli/commands/db/schema/dump.js +1 -1
  84. package/build/environment-handlers/node/cli/commands/db/schema/load.js +3 -3
  85. package/build/environment-handlers/node/cli/commands/generate/frontend-models.js +55 -17
  86. package/build/environment-handlers/node.js +6 -6
  87. package/build/frontend-model-controller.js +81 -82
  88. package/build/frontend-model-resource/base-resource.js +78 -115
  89. package/build/frontend-models/base.js +162 -149
  90. package/build/frontend-models/clear-pending-debounced-callback.js +1 -1
  91. package/build/frontend-models/event-hook-models.js +2 -2
  92. package/build/frontend-models/outgoing-event-buffer.js +2 -2
  93. package/build/frontend-models/preloader.js +5 -5
  94. package/build/frontend-models/query.js +43 -38
  95. package/build/frontend-models/resource-definition.js +6 -6
  96. package/build/frontend-models/transport-serialization.js +11 -11
  97. package/build/frontend-models/use-destroyed-event.js +10 -10
  98. package/build/frontend-models/use-model-class-event.js +11 -11
  99. package/build/frontend-models/use-updated-event.js +11 -11
  100. package/build/frontend-models/websocket-channel.js +26 -17
  101. package/build/frontend-models/websocket-publishers.js +9 -9
  102. package/build/http-client/response.js +2 -2
  103. package/build/http-server/client/index.js +8 -8
  104. package/build/http-server/client/params-to-object.js +10 -10
  105. package/build/http-server/client/request-buffer/form-data-part.js +2 -2
  106. package/build/http-server/client/request-buffer/index.js +8 -8
  107. package/build/http-server/client/request-parser.js +3 -3
  108. package/build/http-server/client/request-runner.js +6 -6
  109. package/build/http-server/client/request-timing.js +5 -5
  110. package/build/http-server/client/request.js +1 -1
  111. package/build/http-server/client/response.js +5 -5
  112. package/build/http-server/client/websocket-request.js +4 -4
  113. package/build/http-server/client/websocket-session.js +18 -18
  114. package/build/http-server/development-reloader.js +5 -5
  115. package/build/http-server/index.js +12 -12
  116. package/build/http-server/remote-address.js +4 -4
  117. package/build/http-server/server-client.js +3 -3
  118. package/build/http-server/server-lock.js +4 -4
  119. package/build/http-server/websocket-channel-subscribers.js +3 -3
  120. package/build/http-server/websocket-channel.js +1 -1
  121. package/build/http-server/websocket-connection.js +1 -1
  122. package/build/http-server/websocket-event-log-store.js +6 -6
  123. package/build/http-server/websocket-events-host.js +2 -2
  124. package/build/http-server/worker-handler/in-process.js +7 -7
  125. package/build/http-server/worker-handler/index.js +4 -4
  126. package/build/http-server/worker-handler/worker-thread.js +3 -3
  127. package/build/logger/outputs/array-output.js +3 -3
  128. package/build/logger/outputs/console-output.js +1 -1
  129. package/build/logger/outputs/file-output.js +4 -4
  130. package/build/logger/outputs/stdout-output.js +1 -1
  131. package/build/logger.js +10 -10
  132. package/build/mailer/backends/smtp.js +3 -3
  133. package/build/mailer/base.js +8 -8
  134. package/build/mailer/delivery.js +4 -4
  135. package/build/plugins/sqljs-wasm-route-controller.js +1 -1
  136. package/build/routes/base-route.js +6 -6
  137. package/build/routes/basic-route.js +1 -1
  138. package/build/routes/hooks/frontend-model-command-route-hook.js +1 -1
  139. package/build/routes/index.js +1 -1
  140. package/build/routes/plugin-routes.js +1 -1
  141. package/build/routes/resolver.js +11 -11
  142. package/build/routes/resource-route.js +1 -1
  143. package/build/src/application.d.ts +3 -3
  144. package/build/src/application.d.ts.map +1 -1
  145. package/build/src/application.js +5 -5
  146. package/build/src/authorization/ability.d.ts +7 -7
  147. package/build/src/authorization/ability.d.ts.map +1 -1
  148. package/build/src/authorization/ability.js +9 -9
  149. package/build/src/authorization/base-resource.d.ts +1 -1
  150. package/build/src/authorization/base-resource.d.ts.map +1 -1
  151. package/build/src/authorization/base-resource.js +5 -5
  152. package/build/src/background-jobs/cron-expression.js +2 -2
  153. package/build/src/background-jobs/forked-runner-child.js +2 -2
  154. package/build/src/background-jobs/job-registry.d.ts +1 -1
  155. package/build/src/background-jobs/job-registry.d.ts.map +1 -1
  156. package/build/src/background-jobs/job-registry.js +2 -2
  157. package/build/src/background-jobs/job-runner.js +2 -2
  158. package/build/src/background-jobs/job.js +2 -2
  159. package/build/src/background-jobs/json-socket.d.ts +4 -4
  160. package/build/src/background-jobs/json-socket.d.ts.map +1 -1
  161. package/build/src/background-jobs/json-socket.js +5 -5
  162. package/build/src/background-jobs/main.d.ts +18 -18
  163. package/build/src/background-jobs/main.d.ts.map +1 -1
  164. package/build/src/background-jobs/main.js +22 -22
  165. package/build/src/background-jobs/scheduler.d.ts +5 -5
  166. package/build/src/background-jobs/scheduler.d.ts.map +1 -1
  167. package/build/src/background-jobs/scheduler.js +8 -8
  168. package/build/src/background-jobs/store.js +8 -8
  169. package/build/src/background-jobs/web/controller.js +3 -3
  170. package/build/src/background-jobs/worker.d.ts +6 -6
  171. package/build/src/background-jobs/worker.d.ts.map +1 -1
  172. package/build/src/background-jobs/worker.js +13 -13
  173. package/build/src/beacon/client.d.ts +4 -4
  174. package/build/src/beacon/client.d.ts.map +1 -1
  175. package/build/src/beacon/client.js +12 -9
  176. package/build/src/beacon/in-process-broker.d.ts.map +1 -1
  177. package/build/src/beacon/in-process-broker.js +3 -3
  178. package/build/src/beacon/in-process-client.d.ts +1 -1
  179. package/build/src/beacon/in-process-client.d.ts.map +1 -1
  180. package/build/src/beacon/in-process-client.js +3 -3
  181. package/build/src/beacon/server.d.ts +2 -2
  182. package/build/src/beacon/server.d.ts.map +1 -1
  183. package/build/src/beacon/server.js +4 -4
  184. package/build/src/cli/browser-cli.js +2 -2
  185. package/build/src/cli/commands/db/base-command.d.ts +2 -2
  186. package/build/src/cli/commands/db/base-command.d.ts.map +1 -1
  187. package/build/src/cli/commands/db/base-command.js +3 -3
  188. package/build/src/cli/index.js +3 -3
  189. package/build/src/cli/tenant-database-command-helper.d.ts +1 -1
  190. package/build/src/cli/tenant-database-command-helper.d.ts.map +1 -1
  191. package/build/src/cli/tenant-database-command-helper.js +4 -4
  192. package/build/src/cli/use-browser-cli.js +2 -2
  193. package/build/src/configuration.d.ts +14 -14
  194. package/build/src/configuration.d.ts.map +1 -1
  195. package/build/src/configuration.js +39 -39
  196. package/build/src/controller.js +10 -10
  197. package/build/src/current-configuration.js +2 -2
  198. package/build/src/database/annotations-async-hooks.js +3 -3
  199. package/build/src/database/annotations.d.ts.map +1 -1
  200. package/build/src/database/annotations.js +4 -4
  201. package/build/src/database/drivers/base-column.d.ts +1 -1
  202. package/build/src/database/drivers/base-column.d.ts.map +1 -1
  203. package/build/src/database/drivers/base-column.js +2 -2
  204. package/build/src/database/drivers/base-foreign-key.d.ts +1 -1
  205. package/build/src/database/drivers/base-foreign-key.d.ts.map +1 -1
  206. package/build/src/database/drivers/base-foreign-key.js +2 -2
  207. package/build/src/database/drivers/base-table.d.ts +1 -1
  208. package/build/src/database/drivers/base-table.d.ts.map +1 -1
  209. package/build/src/database/drivers/base-table.js +2 -2
  210. package/build/src/database/drivers/base.d.ts +6 -6
  211. package/build/src/database/drivers/base.d.ts.map +1 -1
  212. package/build/src/database/drivers/base.js +11 -11
  213. package/build/src/database/drivers/mssql/index.js +2 -2
  214. package/build/src/database/drivers/mssql/table.js +2 -2
  215. package/build/src/database/drivers/mysql/index.js +4 -4
  216. package/build/src/database/drivers/mysql/query.js +2 -2
  217. package/build/src/database/drivers/mysql/table.js +2 -2
  218. package/build/src/database/drivers/pgsql/index.js +3 -3
  219. package/build/src/database/drivers/sqlite/base.d.ts +3 -3
  220. package/build/src/database/drivers/sqlite/base.d.ts.map +1 -1
  221. package/build/src/database/drivers/sqlite/base.js +17 -17
  222. package/build/src/database/drivers/sqlite/index.d.ts +4 -4
  223. package/build/src/database/drivers/sqlite/index.d.ts.map +1 -1
  224. package/build/src/database/drivers/sqlite/index.js +12 -12
  225. package/build/src/database/drivers/sqlite/index.native.js +2 -2
  226. package/build/src/database/drivers/sqlite/index.web.d.ts +2 -2
  227. package/build/src/database/drivers/sqlite/index.web.d.ts.map +1 -1
  228. package/build/src/database/drivers/sqlite/index.web.js +4 -4
  229. package/build/src/database/drivers/sqlite/query.js +2 -2
  230. package/build/src/database/drivers/sqlite/query.web.js +2 -2
  231. package/build/src/database/drivers/sqlite/sql/alter-table.js +3 -3
  232. package/build/src/database/drivers/sqlite/table.js +2 -2
  233. package/build/src/database/migrator/files-finder.js +2 -2
  234. package/build/src/database/migrator.d.ts +1 -1
  235. package/build/src/database/migrator.d.ts.map +1 -1
  236. package/build/src/database/migrator.js +7 -7
  237. package/build/src/database/pool/async-tracked-multi-connection.d.ts +9 -9
  238. package/build/src/database/pool/async-tracked-multi-connection.d.ts.map +1 -1
  239. package/build/src/database/pool/async-tracked-multi-connection.js +28 -28
  240. package/build/src/database/pool/base-methods-forward.js +7 -7
  241. package/build/src/database/pool/base.d.ts +1 -1
  242. package/build/src/database/pool/base.d.ts.map +1 -1
  243. package/build/src/database/pool/base.js +9 -9
  244. package/build/src/database/query/from-base.d.ts +1 -1
  245. package/build/src/database/query/from-base.d.ts.map +1 -1
  246. package/build/src/database/query/from-base.js +2 -2
  247. package/build/src/database/query/index.d.ts +4 -4
  248. package/build/src/database/query/index.d.ts.map +1 -1
  249. package/build/src/database/query/index.js +11 -11
  250. package/build/src/database/query/join-object.js +4 -4
  251. package/build/src/database/query/model-class-query.d.ts +4 -4
  252. package/build/src/database/query/model-class-query.d.ts.map +1 -1
  253. package/build/src/database/query/model-class-query.js +40 -40
  254. package/build/src/database/query/preloader/belongs-to.js +23 -23
  255. package/build/src/database/query/preloader/has-many.js +21 -21
  256. package/build/src/database/query/preloader/has-one.js +9 -9
  257. package/build/src/database/query/preloader/selection.js +4 -4
  258. package/build/src/database/query/preloader.js +9 -9
  259. package/build/src/database/query/query-data.js +10 -10
  260. package/build/src/database/query/where-model-class-hash.js +8 -8
  261. package/build/src/database/query/with-count.js +10 -10
  262. package/build/src/database/record/acts-as-list.js +20 -20
  263. package/build/src/database/record/attachments/handle.d.ts +1 -1
  264. package/build/src/database/record/attachments/handle.d.ts.map +1 -1
  265. package/build/src/database/record/attachments/handle.js +3 -3
  266. package/build/src/database/record/attachments/normalize-input.js +15 -15
  267. package/build/src/database/record/attachments/storage-drivers/s3.js +7 -7
  268. package/build/src/database/record/attachments/store.d.ts +2 -2
  269. package/build/src/database/record/attachments/store.d.ts.map +1 -1
  270. package/build/src/database/record/attachments/store.js +14 -14
  271. package/build/src/database/record/index.d.ts +18 -25
  272. package/build/src/database/record/index.d.ts.map +1 -1
  273. package/build/src/database/record/index.js +135 -141
  274. package/build/src/database/record/instance-relationships/base.d.ts +3 -3
  275. package/build/src/database/record/instance-relationships/base.d.ts.map +1 -1
  276. package/build/src/database/record/instance-relationships/base.js +13 -13
  277. package/build/src/database/record/instance-relationships/belongs-to.js +4 -4
  278. package/build/src/database/record/instance-relationships/has-many.js +9 -9
  279. package/build/src/database/record/instance-relationships/has-one.d.ts +1 -1
  280. package/build/src/database/record/instance-relationships/has-one.d.ts.map +1 -1
  281. package/build/src/database/record/instance-relationships/has-one.js +8 -8
  282. package/build/src/database/record/relationships/base.js +4 -4
  283. package/build/src/database/record/state-machine.js +8 -8
  284. package/build/src/database/record/validators/presence.js +2 -2
  285. package/build/src/database/record/validators/uniqueness.js +6 -6
  286. package/build/src/database/table-data/index.d.ts +4 -4
  287. package/build/src/database/table-data/index.d.ts.map +1 -1
  288. package/build/src/database/table-data/index.js +5 -5
  289. package/build/src/environment-handlers/base.js +3 -3
  290. package/build/src/environment-handlers/browser.d.ts +3 -3
  291. package/build/src/environment-handlers/browser.d.ts.map +1 -1
  292. package/build/src/environment-handlers/browser.js +8 -8
  293. package/build/src/environment-handlers/node/cli/commands/cli-command-context.js +2 -2
  294. package/build/src/environment-handlers/node/cli/commands/console.d.ts.map +1 -1
  295. package/build/src/environment-handlers/node/cli/commands/console.js +5 -5
  296. package/build/src/environment-handlers/node/cli/commands/db/schema/dump.d.ts +1 -1
  297. package/build/src/environment-handlers/node/cli/commands/db/schema/dump.d.ts.map +1 -1
  298. package/build/src/environment-handlers/node/cli/commands/db/schema/dump.js +2 -2
  299. package/build/src/environment-handlers/node/cli/commands/db/schema/load.d.ts +1 -1
  300. package/build/src/environment-handlers/node/cli/commands/db/schema/load.d.ts.map +1 -1
  301. package/build/src/environment-handlers/node/cli/commands/db/schema/load.js +4 -4
  302. package/build/src/environment-handlers/node/cli/commands/generate/frontend-models.d.ts +16 -1
  303. package/build/src/environment-handlers/node/cli/commands/generate/frontend-models.d.ts.map +1 -1
  304. package/build/src/environment-handlers/node/cli/commands/generate/frontend-models.js +51 -17
  305. package/build/src/environment-handlers/node.d.ts +2 -2
  306. package/build/src/environment-handlers/node.d.ts.map +1 -1
  307. package/build/src/environment-handlers/node.js +7 -7
  308. package/build/src/frontend-model-controller.d.ts +5 -6
  309. package/build/src/frontend-model-controller.d.ts.map +1 -1
  310. package/build/src/frontend-model-controller.js +88 -89
  311. package/build/src/frontend-model-resource/base-resource.d.ts +36 -27
  312. package/build/src/frontend-model-resource/base-resource.d.ts.map +1 -1
  313. package/build/src/frontend-model-resource/base-resource.js +67 -120
  314. package/build/src/frontend-models/base.d.ts +66 -58
  315. package/build/src/frontend-models/base.d.ts.map +1 -1
  316. package/build/src/frontend-models/base.js +171 -158
  317. package/build/src/frontend-models/clear-pending-debounced-callback.js +2 -2
  318. package/build/src/frontend-models/event-hook-models.d.ts.map +1 -1
  319. package/build/src/frontend-models/event-hook-models.js +3 -3
  320. package/build/src/frontend-models/outgoing-event-buffer.d.ts +1 -1
  321. package/build/src/frontend-models/outgoing-event-buffer.d.ts.map +1 -1
  322. package/build/src/frontend-models/outgoing-event-buffer.js +3 -3
  323. package/build/src/frontend-models/preloader.js +6 -6
  324. package/build/src/frontend-models/query.d.ts +16 -8
  325. package/build/src/frontend-models/query.d.ts.map +1 -1
  326. package/build/src/frontend-models/query.js +43 -39
  327. package/build/src/frontend-models/resource-definition.js +7 -7
  328. package/build/src/frontend-models/transport-serialization.js +12 -12
  329. package/build/src/frontend-models/use-destroyed-event.d.ts.map +1 -1
  330. package/build/src/frontend-models/use-destroyed-event.js +11 -11
  331. package/build/src/frontend-models/use-model-class-event.d.ts.map +1 -1
  332. package/build/src/frontend-models/use-model-class-event.js +12 -12
  333. package/build/src/frontend-models/use-updated-event.d.ts.map +1 -1
  334. package/build/src/frontend-models/use-updated-event.js +12 -12
  335. package/build/src/frontend-models/websocket-channel.d.ts +6 -1
  336. package/build/src/frontend-models/websocket-channel.d.ts.map +1 -1
  337. package/build/src/frontend-models/websocket-channel.js +26 -18
  338. package/build/src/frontend-models/websocket-publishers.js +11 -11
  339. package/build/src/http-client/response.d.ts +2 -2
  340. package/build/src/http-client/response.d.ts.map +1 -1
  341. package/build/src/http-client/response.js +3 -3
  342. package/build/src/http-server/client/index.d.ts +1 -1
  343. package/build/src/http-server/client/index.d.ts.map +1 -1
  344. package/build/src/http-server/client/index.js +9 -9
  345. package/build/src/http-server/client/params-to-object.js +11 -11
  346. package/build/src/http-server/client/request-buffer/form-data-part.d.ts +2 -2
  347. package/build/src/http-server/client/request-buffer/form-data-part.d.ts.map +1 -1
  348. package/build/src/http-server/client/request-buffer/form-data-part.js +3 -3
  349. package/build/src/http-server/client/request-buffer/index.d.ts +4 -4
  350. package/build/src/http-server/client/request-buffer/index.d.ts.map +1 -1
  351. package/build/src/http-server/client/request-buffer/index.js +9 -9
  352. package/build/src/http-server/client/request-parser.d.ts +1 -1
  353. package/build/src/http-server/client/request-parser.d.ts.map +1 -1
  354. package/build/src/http-server/client/request-parser.js +4 -4
  355. package/build/src/http-server/client/request-runner.js +7 -7
  356. package/build/src/http-server/client/request-timing.d.ts +5 -5
  357. package/build/src/http-server/client/request-timing.d.ts.map +1 -1
  358. package/build/src/http-server/client/request-timing.js +6 -6
  359. package/build/src/http-server/client/request.js +2 -2
  360. package/build/src/http-server/client/response.d.ts +3 -3
  361. package/build/src/http-server/client/response.d.ts.map +1 -1
  362. package/build/src/http-server/client/response.js +6 -6
  363. package/build/src/http-server/client/websocket-request.d.ts +3 -3
  364. package/build/src/http-server/client/websocket-request.d.ts.map +1 -1
  365. package/build/src/http-server/client/websocket-request.js +5 -5
  366. package/build/src/http-server/client/websocket-session.d.ts +6 -6
  367. package/build/src/http-server/client/websocket-session.d.ts.map +1 -1
  368. package/build/src/http-server/client/websocket-session.js +19 -19
  369. package/build/src/http-server/development-reloader.d.ts +3 -3
  370. package/build/src/http-server/development-reloader.d.ts.map +1 -1
  371. package/build/src/http-server/development-reloader.js +6 -6
  372. package/build/src/http-server/index.d.ts +7 -7
  373. package/build/src/http-server/index.d.ts.map +1 -1
  374. package/build/src/http-server/index.js +13 -13
  375. package/build/src/http-server/remote-address.js +6 -6
  376. package/build/src/http-server/server-client.js +4 -4
  377. package/build/src/http-server/server-lock.js +5 -5
  378. package/build/src/http-server/websocket-channel-subscribers.d.ts +1 -1
  379. package/build/src/http-server/websocket-channel-subscribers.d.ts.map +1 -1
  380. package/build/src/http-server/websocket-channel-subscribers.js +4 -4
  381. package/build/src/http-server/websocket-channel.d.ts +1 -1
  382. package/build/src/http-server/websocket-channel.d.ts.map +1 -1
  383. package/build/src/http-server/websocket-channel.js +2 -2
  384. package/build/src/http-server/websocket-connection.d.ts +1 -1
  385. package/build/src/http-server/websocket-connection.d.ts.map +1 -1
  386. package/build/src/http-server/websocket-connection.js +2 -2
  387. package/build/src/http-server/websocket-event-log-store.d.ts +1 -1
  388. package/build/src/http-server/websocket-event-log-store.d.ts.map +1 -1
  389. package/build/src/http-server/websocket-event-log-store.js +7 -7
  390. package/build/src/http-server/websocket-events-host.d.ts +1 -1
  391. package/build/src/http-server/websocket-events-host.d.ts.map +1 -1
  392. package/build/src/http-server/websocket-events-host.js +3 -3
  393. package/build/src/http-server/worker-handler/in-process.d.ts +3 -3
  394. package/build/src/http-server/worker-handler/in-process.d.ts.map +1 -1
  395. package/build/src/http-server/worker-handler/in-process.js +9 -9
  396. package/build/src/http-server/worker-handler/index.d.ts +4 -4
  397. package/build/src/http-server/worker-handler/index.d.ts.map +1 -1
  398. package/build/src/http-server/worker-handler/index.js +5 -5
  399. package/build/src/http-server/worker-handler/worker-thread.d.ts +2 -2
  400. package/build/src/http-server/worker-handler/worker-thread.d.ts.map +1 -1
  401. package/build/src/http-server/worker-handler/worker-thread.js +4 -4
  402. package/build/src/logger/outputs/array-output.d.ts +3 -3
  403. package/build/src/logger/outputs/array-output.d.ts.map +1 -1
  404. package/build/src/logger/outputs/array-output.js +4 -4
  405. package/build/src/logger/outputs/console-output.d.ts +1 -1
  406. package/build/src/logger/outputs/console-output.d.ts.map +1 -1
  407. package/build/src/logger/outputs/console-output.js +2 -2
  408. package/build/src/logger/outputs/file-output.d.ts +4 -4
  409. package/build/src/logger/outputs/file-output.d.ts.map +1 -1
  410. package/build/src/logger/outputs/file-output.js +5 -5
  411. package/build/src/logger/outputs/stdout-output.d.ts.map +1 -1
  412. package/build/src/logger/outputs/stdout-output.js +2 -2
  413. package/build/src/logger.d.ts.map +1 -1
  414. package/build/src/logger.js +11 -11
  415. package/build/src/mailer/backends/smtp.d.ts.map +1 -1
  416. package/build/src/mailer/backends/smtp.js +5 -5
  417. package/build/src/mailer/base.js +11 -11
  418. package/build/src/mailer/delivery.d.ts +3 -3
  419. package/build/src/mailer/delivery.d.ts.map +1 -1
  420. package/build/src/mailer/delivery.js +5 -5
  421. package/build/src/plugins/sqljs-wasm-route-controller.js +2 -2
  422. package/build/src/routes/base-route.d.ts +6 -6
  423. package/build/src/routes/base-route.d.ts.map +1 -1
  424. package/build/src/routes/base-route.js +7 -7
  425. package/build/src/routes/basic-route.js +2 -2
  426. package/build/src/routes/hooks/frontend-model-command-route-hook.js +2 -2
  427. package/build/src/routes/index.js +2 -2
  428. package/build/src/routes/plugin-routes.js +2 -2
  429. package/build/src/routes/resolver.d.ts +1 -1
  430. package/build/src/routes/resolver.d.ts.map +1 -1
  431. package/build/src/routes/resolver.js +13 -13
  432. package/build/src/routes/resource-route.d.ts +1 -1
  433. package/build/src/routes/resource-route.d.ts.map +1 -1
  434. package/build/src/routes/resource-route.js +2 -2
  435. package/build/src/testing/browser-frontend-model-event-hook-scenarios.d.ts.map +1 -1
  436. package/build/src/testing/browser-frontend-model-event-hook-scenarios.js +8 -8
  437. package/build/src/testing/expect-utils.js +13 -13
  438. package/build/src/testing/expect.d.ts +1 -1
  439. package/build/src/testing/expect.d.ts.map +1 -1
  440. package/build/src/testing/expect.js +9 -9
  441. package/build/src/testing/test-files-finder.d.ts +8 -8
  442. package/build/src/testing/test-files-finder.d.ts.map +1 -1
  443. package/build/src/testing/test-files-finder.js +9 -9
  444. package/build/src/testing/test-filter-parser.js +3 -3
  445. package/build/src/testing/test-runner.d.ts +2 -2
  446. package/build/src/testing/test-runner.d.ts.map +1 -1
  447. package/build/src/testing/test-runner.js +17 -17
  448. package/build/src/testing/test-suite-splitter.js +2 -2
  449. package/build/src/testing/test.d.ts +2 -2
  450. package/build/src/testing/test.d.ts.map +1 -1
  451. package/build/src/testing/test.js +16 -16
  452. package/build/src/utils/backtrace-cleaner.d.ts +1 -1
  453. package/build/src/utils/backtrace-cleaner.d.ts.map +1 -1
  454. package/build/src/utils/backtrace-cleaner.js +2 -2
  455. package/build/src/utils/format-value.js +2 -2
  456. package/build/src/utils/model-scope.js +2 -2
  457. package/build/src/utils/ransack.js +27 -27
  458. package/build/src/utils/with-tracked-stack-async-hooks.js +8 -8
  459. package/build/src/utils/with-tracked-stack.js +4 -4
  460. package/build/testing/browser-frontend-model-event-hook-scenarios.js +7 -7
  461. package/build/testing/expect-utils.js +11 -11
  462. package/build/testing/expect.js +7 -7
  463. package/build/testing/test-files-finder.js +8 -8
  464. package/build/testing/test-filter-parser.js +2 -2
  465. package/build/testing/test-runner.js +16 -16
  466. package/build/testing/test-suite-splitter.js +1 -1
  467. package/build/testing/test.js +15 -15
  468. package/build/utils/backtrace-cleaner.js +1 -1
  469. package/build/utils/format-value.js +1 -1
  470. package/build/utils/model-scope.js +1 -1
  471. package/build/utils/ransack.js +26 -26
  472. package/build/utils/with-tracked-stack-async-hooks.js +7 -7
  473. package/build/utils/with-tracked-stack.js +3 -3
  474. package/package.json +2 -1
  475. package/src/application.js +4 -4
  476. package/src/authorization/ability.js +8 -8
  477. package/src/authorization/base-resource.js +4 -4
  478. package/src/background-jobs/cron-expression.js +1 -1
  479. package/src/background-jobs/forked-runner-child.js +1 -1
  480. package/src/background-jobs/job-registry.js +1 -1
  481. package/src/background-jobs/job-runner.js +1 -1
  482. package/src/background-jobs/job.js +1 -1
  483. package/src/background-jobs/json-socket.js +4 -4
  484. package/src/background-jobs/main.js +21 -21
  485. package/src/background-jobs/scheduler.js +7 -7
  486. package/src/background-jobs/store.js +7 -7
  487. package/src/background-jobs/web/controller.js +2 -2
  488. package/src/background-jobs/worker.js +12 -12
  489. package/src/beacon/client.js +11 -8
  490. package/src/beacon/in-process-broker.js +2 -2
  491. package/src/beacon/in-process-client.js +2 -2
  492. package/src/beacon/server.js +3 -3
  493. package/src/cli/browser-cli.js +1 -1
  494. package/src/cli/commands/db/base-command.js +2 -2
  495. package/src/cli/index.js +2 -2
  496. package/src/cli/tenant-database-command-helper.js +3 -3
  497. package/src/cli/use-browser-cli.js +1 -1
  498. package/src/configuration.js +38 -38
  499. package/src/controller.js +8 -8
  500. package/src/current-configuration.js +1 -1
  501. package/src/database/annotations-async-hooks.js +2 -2
  502. package/src/database/annotations.js +3 -3
  503. package/src/database/drivers/base-column.js +1 -1
  504. package/src/database/drivers/base-foreign-key.js +1 -1
  505. package/src/database/drivers/base-table.js +1 -1
  506. package/src/database/drivers/base.js +10 -10
  507. package/src/database/drivers/mssql/index.js +1 -1
  508. package/src/database/drivers/mssql/table.js +1 -1
  509. package/src/database/drivers/mysql/index.js +3 -3
  510. package/src/database/drivers/mysql/query.js +1 -1
  511. package/src/database/drivers/mysql/table.js +1 -1
  512. package/src/database/drivers/pgsql/index.js +2 -2
  513. package/src/database/drivers/sqlite/base.js +16 -16
  514. package/src/database/drivers/sqlite/index.js +11 -11
  515. package/src/database/drivers/sqlite/index.native.js +1 -1
  516. package/src/database/drivers/sqlite/index.web.js +3 -3
  517. package/src/database/drivers/sqlite/query.js +1 -1
  518. package/src/database/drivers/sqlite/query.web.js +1 -1
  519. package/src/database/drivers/sqlite/sql/alter-table.js +2 -2
  520. package/src/database/drivers/sqlite/table.js +1 -1
  521. package/src/database/migrator/files-finder.js +1 -1
  522. package/src/database/migrator.js +6 -6
  523. package/src/database/pool/async-tracked-multi-connection.js +27 -27
  524. package/src/database/pool/base-methods-forward.js +4 -4
  525. package/src/database/pool/base.js +8 -8
  526. package/src/database/query/from-base.js +1 -1
  527. package/src/database/query/index.js +10 -10
  528. package/src/database/query/join-object.js +3 -3
  529. package/src/database/query/model-class-query.js +39 -39
  530. package/src/database/query/preloader/belongs-to.js +22 -22
  531. package/src/database/query/preloader/has-many.js +20 -20
  532. package/src/database/query/preloader/has-one.js +8 -8
  533. package/src/database/query/preloader/selection.js +3 -3
  534. package/src/database/query/preloader.js +8 -8
  535. package/src/database/query/query-data.js +9 -9
  536. package/src/database/query/where-model-class-hash.js +7 -7
  537. package/src/database/query/with-count.js +9 -9
  538. package/src/database/record/acts-as-list.js +15 -15
  539. package/src/database/record/attachments/handle.js +2 -2
  540. package/src/database/record/attachments/normalize-input.js +12 -12
  541. package/src/database/record/attachments/storage-drivers/s3.js +6 -6
  542. package/src/database/record/attachments/store.js +13 -13
  543. package/src/database/record/index.js +115 -121
  544. package/src/database/record/instance-relationships/base.js +11 -11
  545. package/src/database/record/instance-relationships/belongs-to.js +3 -3
  546. package/src/database/record/instance-relationships/has-many.js +8 -8
  547. package/src/database/record/instance-relationships/has-one.js +7 -7
  548. package/src/database/record/relationships/base.js +2 -2
  549. package/src/database/record/state-machine.js +7 -7
  550. package/src/database/record/validators/presence.js +1 -1
  551. package/src/database/record/validators/uniqueness.js +5 -5
  552. package/src/database/table-data/index.js +4 -4
  553. package/src/environment-handlers/base.js +2 -2
  554. package/src/environment-handlers/browser.js +7 -7
  555. package/src/environment-handlers/node/cli/commands/cli-command-context.js +1 -1
  556. package/src/environment-handlers/node/cli/commands/console.js +4 -4
  557. package/src/environment-handlers/node/cli/commands/db/schema/dump.js +1 -1
  558. package/src/environment-handlers/node/cli/commands/db/schema/load.js +3 -3
  559. package/src/environment-handlers/node/cli/commands/generate/frontend-models.js +55 -17
  560. package/src/environment-handlers/node.js +6 -6
  561. package/src/frontend-model-controller.js +81 -82
  562. package/src/frontend-model-resource/base-resource.js +78 -115
  563. package/src/frontend-models/base.js +162 -149
  564. package/src/frontend-models/clear-pending-debounced-callback.js +1 -1
  565. package/src/frontend-models/event-hook-models.js +2 -2
  566. package/src/frontend-models/outgoing-event-buffer.js +2 -2
  567. package/src/frontend-models/preloader.js +5 -5
  568. package/src/frontend-models/query.js +43 -38
  569. package/src/frontend-models/resource-definition.js +6 -6
  570. package/src/frontend-models/transport-serialization.js +11 -11
  571. package/src/frontend-models/use-destroyed-event.js +10 -10
  572. package/src/frontend-models/use-model-class-event.js +11 -11
  573. package/src/frontend-models/use-updated-event.js +11 -11
  574. package/src/frontend-models/websocket-channel.js +26 -17
  575. package/src/frontend-models/websocket-publishers.js +9 -9
  576. package/src/http-client/response.js +2 -2
  577. package/src/http-server/client/index.js +8 -8
  578. package/src/http-server/client/params-to-object.js +10 -10
  579. package/src/http-server/client/request-buffer/form-data-part.js +2 -2
  580. package/src/http-server/client/request-buffer/index.js +8 -8
  581. package/src/http-server/client/request-parser.js +3 -3
  582. package/src/http-server/client/request-runner.js +6 -6
  583. package/src/http-server/client/request-timing.js +5 -5
  584. package/src/http-server/client/request.js +1 -1
  585. package/src/http-server/client/response.js +5 -5
  586. package/src/http-server/client/websocket-request.js +4 -4
  587. package/src/http-server/client/websocket-session.js +18 -18
  588. package/src/http-server/development-reloader.js +5 -5
  589. package/src/http-server/index.js +12 -12
  590. package/src/http-server/remote-address.js +4 -4
  591. package/src/http-server/server-client.js +3 -3
  592. package/src/http-server/server-lock.js +4 -4
  593. package/src/http-server/websocket-channel-subscribers.js +3 -3
  594. package/src/http-server/websocket-channel.js +1 -1
  595. package/src/http-server/websocket-connection.js +1 -1
  596. package/src/http-server/websocket-event-log-store.js +6 -6
  597. package/src/http-server/websocket-events-host.js +2 -2
  598. package/src/http-server/worker-handler/in-process.js +7 -7
  599. package/src/http-server/worker-handler/index.js +4 -4
  600. package/src/http-server/worker-handler/worker-thread.js +3 -3
  601. package/src/logger/outputs/array-output.js +3 -3
  602. package/src/logger/outputs/console-output.js +1 -1
  603. package/src/logger/outputs/file-output.js +4 -4
  604. package/src/logger/outputs/stdout-output.js +1 -1
  605. package/src/logger.js +10 -10
  606. package/src/mailer/backends/smtp.js +3 -3
  607. package/src/mailer/base.js +8 -8
  608. package/src/mailer/delivery.js +4 -4
  609. package/src/plugins/sqljs-wasm-route-controller.js +1 -1
  610. package/src/routes/base-route.js +6 -6
  611. package/src/routes/basic-route.js +1 -1
  612. package/src/routes/hooks/frontend-model-command-route-hook.js +1 -1
  613. package/src/routes/index.js +1 -1
  614. package/src/routes/plugin-routes.js +1 -1
  615. package/src/routes/resolver.js +11 -11
  616. package/src/routes/resource-route.js +1 -1
  617. package/src/testing/browser-frontend-model-event-hook-scenarios.js +7 -7
  618. package/src/testing/expect-utils.js +11 -11
  619. package/src/testing/expect.js +7 -7
  620. package/src/testing/test-files-finder.js +8 -8
  621. package/src/testing/test-filter-parser.js +2 -2
  622. package/src/testing/test-runner.js +16 -16
  623. package/src/testing/test-suite-splitter.js +1 -1
  624. package/src/testing/test.js +15 -15
  625. package/src/utils/backtrace-cleaner.js +1 -1
  626. package/src/utils/format-value.js +1 -1
  627. package/src/utils/model-scope.js +1 -1
  628. package/src/utils/ransack.js +26 -26
  629. package/src/utils/with-tracked-stack-async-hooks.js +7 -7
  630. package/src/utils/with-tracked-stack.js +3 -3
@@ -149,7 +149,7 @@ function buildRelatedRecordWithInverse(parent, relationshipName, attributes, all
149
149
  parent,
150
150
  record: /**
151
151
  * Narrows the runtime value to the documented type.
152
- @type {{getRelationshipByName: VelociousDatabaseRecord["getRelationshipByName"]}} */ (record)
152
+ * @type {{getRelationshipByName: VelociousDatabaseRecord["getRelationshipByName"]}} */ (record)
153
153
  })
154
154
 
155
155
  return record
@@ -229,17 +229,17 @@ class TenantDatabaseScopeError extends Error {
229
229
  class VelociousDatabaseRecord {
230
230
  /**
231
231
  * Narrows the runtime value to the documented type.
232
- @type {string | undefined} */
232
+ * @type {string | undefined} */
233
233
  static modelName
234
234
 
235
235
  /**
236
236
  * Narrows the runtime value to the documented type.
237
- @type {Promise<void> | null | undefined} */
237
+ * @type {Promise<void> | null | undefined} */
238
238
  static _initializeRecordPromise
239
239
 
240
240
  /**
241
241
  * Narrows the runtime value to the documented type.
242
- @type {boolean | undefined} */
242
+ * @type {boolean | undefined} */
243
243
  static _eagerLoadRecordMetadata
244
244
 
245
245
  /**
@@ -258,7 +258,7 @@ class VelociousDatabaseRecord {
258
258
  if (!this._attributeNameToColumnName) {
259
259
  /**
260
260
  * Narrows the runtime value to the documented type.
261
- @type {Record<string, string>} */
261
+ * @type {Record<string, string>} */
262
262
  this._attributeNameToColumnName = {}
263
263
  }
264
264
 
@@ -359,7 +359,7 @@ class VelociousDatabaseRecord {
359
359
  if (!this._columnNameToAttributeName) {
360
360
  /**
361
361
  * Narrows the runtime value to the documented type.
362
- @type {Record<string, string>} */
362
+ * @type {Record<string, string>} */
363
363
  this._columnNameToAttributeName = {}
364
364
  }
365
365
 
@@ -370,7 +370,7 @@ class VelociousDatabaseRecord {
370
370
  if (!this._translations) {
371
371
  /**
372
372
  * Narrows the runtime value to the documented type.
373
- @type {Record<string, object>} */
373
+ * @type {Record<string, object>} */
374
374
  this._translations = {}
375
375
  }
376
376
 
@@ -381,7 +381,7 @@ class VelociousDatabaseRecord {
381
381
  if (!this._validators) {
382
382
  /**
383
383
  * Narrows the runtime value to the documented type.
384
- @type {Record<string, import("./validators/base.js").default[]>} */
384
+ * @type {Record<string, import("./validators/base.js").default[]>} */
385
385
  this._validators = {}
386
386
  }
387
387
 
@@ -396,7 +396,7 @@ class VelociousDatabaseRecord {
396
396
  if (!this._lifecycleCallbacks) {
397
397
  /**
398
398
  * Narrows the runtime value to the documented type.
399
- @type {Record<string, LifecycleCallbackType[]>} */
399
+ * @type {Record<string, LifecycleCallbackType[]>} */
400
400
  this._lifecycleCallbacks = {}
401
401
  }
402
402
 
@@ -407,7 +407,7 @@ class VelociousDatabaseRecord {
407
407
  if (!this._validatorTypes) {
408
408
  /**
409
409
  * Narrows the runtime value to the documented type.
410
- @type {Record<string, typeof import("./validators/base.js").default>} */
410
+ * @type {Record<string, typeof import("./validators/base.js").default>} */
411
411
  this._validatorTypes = {}
412
412
  }
413
413
 
@@ -422,7 +422,7 @@ class VelociousDatabaseRecord {
422
422
  if (!this._attachmentsMap) {
423
423
  /**
424
424
  * Narrows the runtime value to the documented type.
425
- @type {Record<string, {driver?: string | AttachmentDriverConstructor | Record<string, ?>, type: "hasOne" | "hasMany"}>} */
425
+ * @type {Record<string, {driver?: string | AttachmentDriverConstructor | Record<string, ?>, type: "hasOne" | "hasMany"}>} */
426
426
  this._attachmentsMap = {}
427
427
  }
428
428
 
@@ -431,37 +431,37 @@ class VelociousDatabaseRecord {
431
431
 
432
432
  /**
433
433
  * Attributes.
434
- @type {Record<string, ?>} */
434
+ * @type {Record<string, ?>} */
435
435
  _attributes = {}
436
436
 
437
437
  /**
438
438
  * Changes.
439
- @type {Record<string, ?>} */
439
+ * @type {Record<string, ?>} */
440
440
  _changes = {}
441
441
 
442
442
  /**
443
443
  * Attribute names explicitly assigned in the current update call.
444
- @type {Set<string> | undefined}
444
+ * @type {Set<string> | undefined}
445
445
  */
446
446
  _assignedAttributeNames = undefined
447
447
 
448
448
  /**
449
449
  * Columns as hash.
450
- @type {Record<string, import("../drivers/base-column.js").default>} */
450
+ * @type {Record<string, import("../drivers/base-column.js").default>} */
451
451
  _columnsAsHash = {}
452
452
 
453
453
  /**
454
454
  * Connection.
455
- @type {import("../drivers/base.js").default | undefined} */
455
+ * @type {import("../drivers/base.js").default | undefined} */
456
456
  __connection = undefined
457
457
 
458
458
  /**
459
459
  * Instance relationships.
460
- @type {Record<string, import("./instance-relationships/base.js").default>} */
460
+ * @type {Record<string, import("./instance-relationships/base.js").default>} */
461
461
  _instanceRelationships = {}
462
462
  /**
463
463
  * Attachments.
464
- @type {Record<string, RecordAttachmentHandle>} */
464
+ * @type {Record<string, RecordAttachmentHandle>} */
465
465
  _attachments = {}
466
466
 
467
467
  /**
@@ -472,12 +472,12 @@ class VelociousDatabaseRecord {
472
472
 
473
473
  /**
474
474
  * Table name.
475
- @type {string | undefined} */
475
+ * @type {string | undefined} */
476
476
  __tableName = undefined
477
477
 
478
478
  /**
479
479
  * Validation errors.
480
- @type {Record<string, ValidationErrorObjectType[]>} */
480
+ * @type {Record<string, ValidationErrorObjectType[]>} */
481
481
  _validationErrors = {}
482
482
 
483
483
  static validatorTypes() {
@@ -671,9 +671,9 @@ class VelociousDatabaseRecord {
671
671
  let relationship
672
672
  const prototype = /**
673
673
  * Narrows the runtime value to the documented type.
674
- @type {Record<string, ?>} */ (/**
674
+ * @type {Record<string, ?>} */ (/**
675
675
  * Narrows the runtime value to the documented type.
676
- @type {?} */ (this.prototype))
676
+ * @type {?} */ (this.prototype))
677
677
 
678
678
  if (actualData.type == "belongsTo") {
679
679
  relationship = new BelongsToRelationship(actualData)
@@ -686,10 +686,10 @@ class VelociousDatabaseRecord {
686
686
 
687
687
  prototype[`build${inflection.camelize(relationshipName)}`] = function(/**
688
688
  * Narrows the runtime value to the documented type.
689
- @type {Record<string, ?>} */ attributes) {
689
+ * @type {Record<string, ?>} */ attributes) {
690
690
  return buildRelatedRecordWithInverse(/**
691
691
  * Narrows the runtime value to the documented type.
692
- @type {VelociousDatabaseRecord} */ (this), relationshipName, attributes, true)
692
+ * @type {VelociousDatabaseRecord} */ (this), relationshipName, attributes, true)
693
693
  }
694
694
 
695
695
  prototype[`load${inflection.camelize(relationshipName)}`] = async function() {
@@ -702,7 +702,7 @@ class VelociousDatabaseRecord {
702
702
 
703
703
  prototype[`set${inflection.camelize(relationshipName)}`] = function(/**
704
704
  * Narrows the runtime value to the documented type.
705
- @type {?} */ model) {
705
+ * @type {?} */ model) {
706
706
  const relationship = this.getRelationshipByName(relationshipName)
707
707
 
708
708
  relationship.setLoaded(model)
@@ -712,7 +712,7 @@ class VelociousDatabaseRecord {
712
712
  relationship = new HasManyRelationship(actualData)
713
713
 
714
714
  prototype[relationshipName] = function() {
715
- return /** Narrows the runtime value to the documented type. @type {import("./instance-relationships/has-many.js").default<?, ?>} */ (this.getRelationshipByName(relationshipName))
715
+ return /** @type {import("./instance-relationships/has-many.js").default<?, ?>} */ (this.getRelationshipByName(relationshipName))
716
716
  }
717
717
 
718
718
  prototype[`${relationshipName}Loaded`] = function() {
@@ -735,10 +735,10 @@ class VelociousDatabaseRecord {
735
735
 
736
736
  prototype[`build${inflection.camelize(relationshipName)}`] = function(/**
737
737
  * Narrows the runtime value to the documented type.
738
- @type {Record<string, ?>} */ attributes) {
738
+ * @type {Record<string, ?>} */ attributes) {
739
739
  return buildRelatedRecordWithInverse(/**
740
740
  * Narrows the runtime value to the documented type.
741
- @type {VelociousDatabaseRecord} */ (this), relationshipName, attributes, false)
741
+ * @type {VelociousDatabaseRecord} */ (this), relationshipName, attributes, false)
742
742
  }
743
743
 
744
744
  prototype[`load${inflection.camelize(relationshipName)}`] = async function() {
@@ -766,7 +766,7 @@ class VelociousDatabaseRecord {
766
766
  return {
767
767
  scope: /**
768
768
  * Narrows the runtime value to the documented type.
769
- @type {RelationshipScopeCallback} */ (scopeOrOptions),
769
+ * @type {RelationshipScopeCallback} */ (scopeOrOptions),
770
770
  relationshipOptions: options || {}
771
771
  }
772
772
  }
@@ -839,7 +839,7 @@ class VelociousDatabaseRecord {
839
839
  ChildModel.beforeSave(async (record) => {
840
840
  const model = /**
841
841
  * Narrows the runtime value to the documented type.
842
- @type {?} */ (record)
842
+ * @type {?} */ (record)
843
843
 
844
844
  if (model.isNewRecord()) return
845
845
 
@@ -858,7 +858,7 @@ class VelociousDatabaseRecord {
858
858
  ChildModel.afterSave(async (record) => {
859
859
  const model = /**
860
860
  * Narrows the runtime value to the documented type.
861
- @type {?} */ (record)
861
+ * @type {?} */ (record)
862
862
  const prevKey = `_counterCachePrev_${relationshipName}`
863
863
  const previousParentId = model[prevKey]
864
864
 
@@ -899,11 +899,11 @@ class VelociousDatabaseRecord {
899
899
  if (!Object.hasOwn(this, "_relationships")) {
900
900
  /**
901
901
  * Narrows the runtime value to the documented type.
902
- @type {Record<string, import("./relationships/base.js").default>} */
902
+ * @type {Record<string, import("./relationships/base.js").default>} */
903
903
  this._relationships = {}
904
904
  }
905
905
 
906
- return /** Narrows the runtime value to the documented type. @type {Record<string, import("./relationships/base.js").default>} */ (this._relationships)
906
+ return /** @type {Record<string, import("./relationships/base.js").default>} */ (this._relationships)
907
907
  }
908
908
 
909
909
  /**
@@ -967,11 +967,11 @@ class VelociousDatabaseRecord {
967
967
  // Object.prototype members.
968
968
  /**
969
969
  * Narrows the runtime value to the documented type.
970
- @type {Record<string, import("../query/query-data.js").QueryDataFn>} */
970
+ * @type {Record<string, import("../query/query-data.js").QueryDataFn>} */
971
971
  this._queryDataRegistrations = Object.create(null)
972
972
  }
973
973
 
974
- return /** Narrows the runtime value to the documented type. @type {Record<string, import("../query/query-data.js").QueryDataFn>} */ (this._queryDataRegistrations)
974
+ return /** @type {Record<string, import("../query/query-data.js").QueryDataFn>} */ (this._queryDataRegistrations)
975
975
  }
976
976
 
977
977
  /**
@@ -1130,7 +1130,7 @@ class VelociousDatabaseRecord {
1130
1130
 
1131
1131
  if (/**
1132
1132
  * Narrows the runtime value to the documented type.
1133
- @type {?} */ (relationshipOptions)?.counterCache) {
1133
+ * @type {?} */ (relationshipOptions)?.counterCache) {
1134
1134
  this._registerCounterCacheCallbacks(relationshipName)
1135
1135
  }
1136
1136
  }
@@ -1165,7 +1165,7 @@ class VelociousDatabaseRecord {
1165
1165
 
1166
1166
  const record = /**
1167
1167
  * Narrows the runtime value to the documented type.
1168
- @type {Model} */ (new this(attributes))
1168
+ * @type {Model} */ (new this(attributes))
1169
1169
 
1170
1170
  await record.save()
1171
1171
 
@@ -1236,13 +1236,13 @@ class VelociousDatabaseRecord {
1236
1236
  if (!Object.prototype.hasOwnProperty.call(this, "_acceptedNestedAttributes")) {
1237
1237
  /**
1238
1238
  * Narrows the runtime value to the documented type.
1239
- @type {Record<string, {allowDestroy?: boolean, limit?: number, rejectIf?: (attributes: Record<string, ?>) => boolean}>} */
1239
+ * @type {Record<string, {allowDestroy?: boolean, limit?: number, rejectIf?: (attributes: Record<string, ?>) => boolean}>} */
1240
1240
  this._acceptedNestedAttributes = {}
1241
1241
  }
1242
1242
 
1243
1243
  /**
1244
1244
  * Narrows the runtime value to the documented type.
1245
- @type {Record<string, {allowDestroy?: boolean, limit?: number, rejectIf?: (attributes: Record<string, ?>) => boolean}>} */ (this._acceptedNestedAttributes)[relationshipName] = {...options}
1245
+ * @type {Record<string, {allowDestroy?: boolean, limit?: number, rejectIf?: (attributes: Record<string, ?>) => boolean}>} */ (this._acceptedNestedAttributes)[relationshipName] = {...options}
1246
1246
  }
1247
1247
 
1248
1248
  /**
@@ -1283,9 +1283,9 @@ class VelociousDatabaseRecord {
1283
1283
 
1284
1284
  const prototype = /**
1285
1285
  * Narrows the runtime value to the documented type.
1286
- @type {Record<string, ?>} */ (/**
1286
+ * @type {Record<string, ?>} */ (/**
1287
1287
  * Narrows the runtime value to the documented type.
1288
- @type {?} */ (this.prototype))
1288
+ * @type {?} */ (this.prototype))
1289
1289
 
1290
1290
  prototype[attachmentName] = function() {
1291
1291
  return this.getAttachmentByName(attachmentName)
@@ -1293,7 +1293,7 @@ class VelociousDatabaseRecord {
1293
1293
 
1294
1294
  prototype[`set${inflection.camelize(attachmentName)}`] = function(/**
1295
1295
  * Narrows the runtime value to the documented type.
1296
- @type {?} */ newValue) {
1296
+ * @type {?} */ newValue) {
1297
1297
  this.getAttachmentByName(attachmentName).queueAttach(newValue)
1298
1298
  return newValue
1299
1299
  }
@@ -1413,16 +1413,16 @@ class VelociousDatabaseRecord {
1413
1413
 
1414
1414
  /**
1415
1415
  * Narrows the runtime value to the documented type.
1416
- @type {Record<string, import("../drivers/base-column.js").default>} */
1416
+ * @type {Record<string, import("../drivers/base-column.js").default>} */
1417
1417
  this._columnsAsHash = {}
1418
1418
 
1419
1419
  const columnNameToAttributeName = this.getColumnNameToAttributeNameMap()
1420
1420
  const attributeNameToColumnName = this.getAttributeNameToColumnNameMap()
1421
1421
  const prototype = /**
1422
1422
  * Narrows the runtime value to the documented type.
1423
- @type {Record<string, ?>} */ (/**
1423
+ * @type {Record<string, ?>} */ (/**
1424
1424
  * Narrows the runtime value to the documented type.
1425
- @type {?} */ (this.prototype))
1425
+ * @type {?} */ (this.prototype))
1426
1426
 
1427
1427
  for (const column of this._columns) {
1428
1428
  this._columnsAsHash[column.getName()] = column
@@ -1443,7 +1443,7 @@ class VelociousDatabaseRecord {
1443
1443
  if (!(`set${camelizedColumnNameBigFirst}` in prototype)) {
1444
1444
  prototype[`set${camelizedColumnNameBigFirst}`] = function(/**
1445
1445
  * Narrows the runtime value to the documented type.
1446
- @type {?} */ newValue) {
1446
+ * @type {?} */ newValue) {
1447
1447
  return this._setColumnAttribute(camelizedColumnName, newValue)
1448
1448
  }
1449
1449
  }
@@ -1452,9 +1452,9 @@ class VelociousDatabaseRecord {
1452
1452
  prototype[`has${camelizedColumnNameBigFirst}`] = function() {
1453
1453
  const dynamicThis = /**
1454
1454
  * Narrows the runtime value to the documented type.
1455
- @type {Record<string, (...args: Array<?>) => ?>} */ (/**
1455
+ * @type {Record<string, (...args: Array<?>) => ?>} */ (/**
1456
1456
  * Narrows the runtime value to the documented type.
1457
- @type {?} */ (this))
1457
+ * @type {?} */ (this))
1458
1458
  const value = dynamicThis[camelizedColumnName]()
1459
1459
 
1460
1460
  return this._hasAttribute(value)
@@ -1550,9 +1550,9 @@ class VelociousDatabaseRecord {
1550
1550
  const setterMethodName = `set${nameCamelized}`
1551
1551
  const prototype = /**
1552
1552
  * Narrows the runtime value to the documented type.
1553
- @type {Record<string, ?>} */ (/**
1553
+ * @type {Record<string, ?>} */ (/**
1554
1554
  * Narrows the runtime value to the documented type.
1555
- @type {?} */ (this.prototype))
1555
+ * @type {?} */ (this.prototype))
1556
1556
 
1557
1557
  prototype[name] = function getTranslatedAttribute() {
1558
1558
  const locale = this._getConfiguration().getLocale()
@@ -1563,9 +1563,9 @@ class VelociousDatabaseRecord {
1563
1563
  prototype[`has${nameCamelized}`] = function hasTranslatedAttribute() {
1564
1564
  const dynamicThis = /**
1565
1565
  * Narrows the runtime value to the documented type.
1566
- @type {Record<string, ?>} */ (/**
1566
+ * @type {Record<string, ?>} */ (/**
1567
1567
  * Narrows the runtime value to the documented type.
1568
- @type {?} */ (this))
1568
+ * @type {?} */ (this))
1569
1569
  const candidate = dynamicThis[name]
1570
1570
 
1571
1571
  if (typeof candidate == "function") {
@@ -1579,7 +1579,7 @@ class VelociousDatabaseRecord {
1579
1579
 
1580
1580
  prototype[setterMethodName] = function setTranslatedAttribute(/**
1581
1581
  * Narrows the runtime value to the documented type.
1582
- @type {?} */ newValue) {
1582
+ * @type {?} */ newValue) {
1583
1583
  const locale = this._getConfiguration().getLocale()
1584
1584
 
1585
1585
  return this._setTranslatedAttribute(name, locale, newValue)
@@ -1597,16 +1597,16 @@ class VelociousDatabaseRecord {
1597
1597
 
1598
1598
  prototype[setterMethodNameLocalized] = function setTranslatedAttributeWithLocale(/**
1599
1599
  * Narrows the runtime value to the documented type.
1600
- @type {?} */ newValue) {
1600
+ * @type {?} */ newValue) {
1601
1601
  return this._setTranslatedAttribute(name, locale, newValue)
1602
1602
  }
1603
1603
 
1604
1604
  prototype[hasMethodNameLocalized] = function hasTranslatedAttribute() {
1605
1605
  const dynamicThis = /**
1606
1606
  * Narrows the runtime value to the documented type.
1607
- @type {Record<string, ?>} */ (/**
1607
+ * @type {Record<string, ?>} */ (/**
1608
1608
  * Narrows the runtime value to the documented type.
1609
- @type {?} */ (this))
1609
+ * @type {?} */ (this))
1610
1610
  const candidate = dynamicThis[getterMethodNameLocalized]
1611
1611
 
1612
1612
  if (typeof candidate == "function") {
@@ -1730,7 +1730,7 @@ class VelociousDatabaseRecord {
1730
1730
  getModelClass() {
1731
1731
  const modelClass = /**
1732
1732
  * Narrows the runtime value to the documented type.
1733
- @type {typeof VelociousDatabaseRecord} */ (this.constructor)
1733
+ * @type {typeof VelociousDatabaseRecord} */ (this.constructor)
1734
1734
 
1735
1735
  return modelClass
1736
1736
  }
@@ -1749,9 +1749,9 @@ class VelociousDatabaseRecord {
1749
1749
  const setterName = this.getModelClass().findMemberNameInsensitive(this, requestedSetterName)
1750
1750
  const dynamicThis = /**
1751
1751
  * Narrows the runtime value to the documented type.
1752
- @type {Record<string, (value: ?) => void>} */ (/**
1752
+ * @type {Record<string, (value: ?) => void>} */ (/**
1753
1753
  * Narrows the runtime value to the documented type.
1754
- @type {?} */ (this))
1754
+ * @type {?} */ (this))
1755
1755
 
1756
1756
  this.getModelClass()._assertHasBeenInitialized()
1757
1757
  if (!this.getModelClass().isInitialized()) throw new Error(`${this.constructor.name} model isn't initialized yet`)
@@ -1953,7 +1953,7 @@ class VelociousDatabaseRecord {
1953
1953
  if (!this._columnsAsHash) {
1954
1954
  /**
1955
1955
  * Narrows the runtime value to the documented type.
1956
- @type {Record<string, import("../drivers/base-column.js").default>} */
1956
+ * @type {Record<string, import("../drivers/base-column.js").default>} */
1957
1957
  this._columnsAsHash = {}
1958
1958
 
1959
1959
  for (const column of this.getColumns()) {
@@ -1973,7 +1973,7 @@ class VelociousDatabaseRecord {
1973
1973
  if (!this._columnTypeByName) {
1974
1974
  /**
1975
1975
  * Narrows the runtime value to the documented type.
1976
- @type {Record<string, string | undefined>} */
1976
+ * @type {Record<string, string | undefined>} */
1977
1977
  this._columnTypeByName = {}
1978
1978
 
1979
1979
  for (const column of this.getColumns()) {
@@ -2071,7 +2071,7 @@ class VelociousDatabaseRecord {
2071
2071
  } catch {
2072
2072
  /**
2073
2073
  * Results.
2074
- @type {{succeededRows: Array<?>[], failedRows: Array<?>[], errors: Array<{row: Array<?>, error: ?}>}} */
2074
+ * @type {{succeededRows: Array<?>[], failedRows: Array<?>[], errors: Array<{row: Array<?>, error: ?}>}} */
2075
2075
  const results = {
2076
2076
  succeededRows: [],
2077
2077
  failedRows: [],
@@ -2334,7 +2334,7 @@ class VelociousDatabaseRecord {
2334
2334
  if (!Object.prototype.hasOwnProperty.call(this, "_attributeCasts") || !this._attributeCasts) {
2335
2335
  /**
2336
2336
  * Narrows the runtime value to the documented type.
2337
- @type {Record<string, string>} */
2337
+ * @type {Record<string, string>} */
2338
2338
  this._attributeCasts = {}
2339
2339
  }
2340
2340
 
@@ -2485,7 +2485,7 @@ class VelociousDatabaseRecord {
2485
2485
 
2486
2486
  /**
2487
2487
  * Defines loaded.
2488
- @type {VelociousDatabaseRecord[]} */
2488
+ * @type {VelociousDatabaseRecord[]} */
2489
2489
  let loaded
2490
2490
 
2491
2491
  const hasManyOrOneLoaded = instanceRelationship.getLoadedOrUndefined()
@@ -2545,7 +2545,7 @@ class VelociousDatabaseRecord {
2545
2545
 
2546
2546
  /**
2547
2547
  * Defines loaded.
2548
- @type {VelociousDatabaseRecord[]} */
2548
+ * @type {VelociousDatabaseRecord[]} */
2549
2549
  let loaded
2550
2550
 
2551
2551
  if (hasManyOrOneLoaded === undefined) {
@@ -2865,12 +2865,12 @@ class VelociousDatabaseRecord {
2865
2865
  for (const validatorName in validators) {
2866
2866
  /**
2867
2867
  * Defines validatorArgs.
2868
- @type {Record<string, ?>} */
2868
+ * @type {Record<string, ?>} */
2869
2869
  let validatorArgs
2870
2870
 
2871
2871
  /**
2872
2872
  * Use validator.
2873
- @type {boolean} */
2873
+ * @type {boolean} */
2874
2874
  let useValidator = true
2875
2875
 
2876
2876
  const validatorArgsCandidate = validators[validatorName]
@@ -2939,12 +2939,12 @@ class VelociousDatabaseRecord {
2939
2939
  if (translation) {
2940
2940
  /**
2941
2941
  * Dict.
2942
- @type {Record<string, ?>} */
2942
+ * @type {Record<string, ?>} */
2943
2943
  const dict = translation
2944
2944
 
2945
2945
  const attributeMethod = /**
2946
2946
  * Narrows the runtime value to the documented type.
2947
- @type {function() : string | undefined} */ (dict[name])
2947
+ * @type {function() : string | undefined} */ (dict[name])
2948
2948
 
2949
2949
  if (typeof attributeMethod == "function") {
2950
2950
  return attributeMethod.bind(translation)()
@@ -2993,7 +2993,7 @@ class VelociousDatabaseRecord {
2993
2993
  _setTranslatedAttribute(name, locale, newValue) {
2994
2994
  /**
2995
2995
  * Defines translation.
2996
- @type {VelociousDatabaseRecord | TranslationBase | undefined} */
2996
+ * @type {VelociousDatabaseRecord | TranslationBase | undefined} */
2997
2997
  let translation
2998
2998
 
2999
2999
  translation = this.translationsLoaded()?.find((translation) => translation.locale() == locale)
@@ -3006,7 +3006,7 @@ class VelociousDatabaseRecord {
3006
3006
 
3007
3007
  /**
3008
3008
  * Assignments.
3009
- @type {Record<string, ?>} */
3009
+ * @type {Record<string, ?>} */
3010
3010
  const assignments = {}
3011
3011
 
3012
3012
  assignments[name] = newValue
@@ -3068,7 +3068,7 @@ class VelociousDatabaseRecord {
3068
3068
  throw new Error(`No ability in context for ${this.name}. Pass an ability or configure ability resolver on the request`)
3069
3069
  }
3070
3070
 
3071
- return /** Narrows the runtime value to the documented type. @type {ModelClassQuery<MC>} */ (currentAbility.applyToQuery({
3071
+ return /** @type {ModelClassQuery<MC>} */ (currentAbility.applyToQuery({
3072
3072
  action,
3073
3073
  modelClass: this,
3074
3074
  query
@@ -3294,7 +3294,7 @@ class VelociousDatabaseRecord {
3294
3294
  static preload(preload) {
3295
3295
  const query = /**
3296
3296
  * Narrows the runtime value to the documented type.
3297
- @type {ModelClassQuery<MC>} */ (this._newQuery().preload(preload))
3297
+ * @type {ModelClassQuery<MC>} */ (this._newQuery().preload(preload))
3298
3298
 
3299
3299
  return query
3300
3300
  }
@@ -3403,7 +3403,7 @@ class VelociousDatabaseRecord {
3403
3403
  const columnNameToAttributeName = this.getModelClass().getColumnNameToAttributeNameMap()
3404
3404
  /**
3405
3405
  * Attributes.
3406
- @type {Record<string, ?>} */
3406
+ * @type {Record<string, ?>} */
3407
3407
  const attributes = {}
3408
3408
 
3409
3409
  for (const columnName in data) {
@@ -3444,7 +3444,7 @@ class VelociousDatabaseRecord {
3444
3444
  if (relationship.getDependent() == "restrict") {
3445
3445
  const instanceRelationship = /**
3446
3446
  * Narrows the runtime value to the documented type.
3447
- @type {?} */ (this.getRelationshipByName(relationship.getRelationshipName()))
3447
+ * @type {?} */ (this.getRelationshipByName(relationship.getRelationshipName()))
3448
3448
  const count = await instanceRelationship.query().count()
3449
3449
 
3450
3450
  if (count > 0) {
@@ -3462,7 +3462,7 @@ class VelociousDatabaseRecord {
3462
3462
 
3463
3463
  /**
3464
3464
  * Defines models.
3465
- @type {VelociousDatabaseRecord[]} */
3465
+ * @type {VelociousDatabaseRecord[]} */
3466
3466
  let models
3467
3467
 
3468
3468
  if (instanceRelationship.getType() == "belongsTo") {
@@ -3502,7 +3502,7 @@ class VelociousDatabaseRecord {
3502
3502
 
3503
3503
  /**
3504
3504
  * Conditions.
3505
- @type {Record<string, ?>} */
3505
+ * @type {Record<string, ?>} */
3506
3506
  const conditions = {}
3507
3507
 
3508
3508
  conditions[this.getModelClass().primaryKey()] = this.id()
@@ -3532,9 +3532,9 @@ class VelociousDatabaseRecord {
3532
3532
  }
3533
3533
  const dynamicThis = /**
3534
3534
  * Narrows the runtime value to the documented type.
3535
- @type {Record<string, ?>} */ (/**
3535
+ * @type {Record<string, ?>} */ (/**
3536
3536
  * Narrows the runtime value to the documented type.
3537
- @type {?} */ (this))
3537
+ * @type {?} */ (this))
3538
3538
  const methodCallback = dynamicThis[callback]
3539
3539
 
3540
3540
  if (typeof methodCallback != "function") {
@@ -3549,9 +3549,9 @@ class VelociousDatabaseRecord {
3549
3549
 
3550
3550
  const dynamicThis = /**
3551
3551
  * Narrows the runtime value to the documented type.
3552
- @type {Record<string, ?>} */ (/**
3552
+ * @type {Record<string, ?>} */ (/**
3553
3553
  * Narrows the runtime value to the documented type.
3554
- @type {?} */ (this))
3554
+ * @type {?} */ (this))
3555
3555
  const instanceCallback = dynamicThis[callbackName]
3556
3556
 
3557
3557
  if (!callbackNameRegisteredAsString && typeof instanceCallback === "function") {
@@ -3605,7 +3605,7 @@ class VelociousDatabaseRecord {
3605
3605
  changes() {
3606
3606
  /**
3607
3607
  * Changes.
3608
- @type {Record<string, Array<?>>} */
3608
+ * @type {Record<string, Array<?>>} */
3609
3609
  const changes = {}
3610
3610
 
3611
3611
  for (const changeKey in this._changes) {
@@ -3657,9 +3657,9 @@ class VelociousDatabaseRecord {
3657
3657
  readCount(attributeName) {
3658
3658
  return readPayloadAssociationCount(/**
3659
3659
  * Narrows the runtime value to the documented type.
3660
- @type {import("../../record-payload-values.js").RecordPayloadValuesTarget} */ (/**
3660
+ * @type {import("../../record-payload-values.js").RecordPayloadValuesTarget} */ (/**
3661
3661
  * Narrows the runtime value to the documented type.
3662
- @type {?} */ (this)), attributeName)
3662
+ * @type {?} */ (this)), attributeName)
3663
3663
  }
3664
3664
 
3665
3665
  /**
@@ -3672,9 +3672,9 @@ class VelociousDatabaseRecord {
3672
3672
  _setAssociationCount(attributeName, value) {
3673
3673
  setPayloadAssociationCount(/**
3674
3674
  * Narrows the runtime value to the documented type.
3675
- @type {import("../../record-payload-values.js").RecordPayloadValuesTarget} */ (/**
3675
+ * @type {import("../../record-payload-values.js").RecordPayloadValuesTarget} */ (/**
3676
3676
  * Narrows the runtime value to the documented type.
3677
- @type {?} */ (this)), attributeName, value)
3677
+ * @type {?} */ (this)), attributeName, value)
3678
3678
  }
3679
3679
 
3680
3680
  /**
@@ -3686,14 +3686,14 @@ class VelociousDatabaseRecord {
3686
3686
  associationCounts() {
3687
3687
  /**
3688
3688
  * Result.
3689
- @type {Record<string, number>} */
3689
+ * @type {Record<string, number>} */
3690
3690
  const result = {}
3691
3691
 
3692
3692
  const target = /**
3693
3693
  * Narrows the runtime value to the documented type.
3694
- @type {import("../../record-payload-values.js").RecordPayloadValuesTarget} */ (/**
3694
+ * @type {import("../../record-payload-values.js").RecordPayloadValuesTarget} */ (/**
3695
3695
  * Narrows the runtime value to the documented type.
3696
- @type {?} */ (this))
3696
+ * @type {?} */ (this))
3697
3697
 
3698
3698
  if (!target._associationCounts) return result
3699
3699
 
@@ -3717,9 +3717,9 @@ class VelociousDatabaseRecord {
3717
3717
  queryData(name) {
3718
3718
  return readPayloadQueryData(/**
3719
3719
  * Narrows the runtime value to the documented type.
3720
- @type {import("../../record-payload-values.js").RecordPayloadValuesTarget} */ (/**
3720
+ * @type {import("../../record-payload-values.js").RecordPayloadValuesTarget} */ (/**
3721
3721
  * Narrows the runtime value to the documented type.
3722
- @type {?} */ (this)), name)
3722
+ * @type {?} */ (this)), name)
3723
3723
  }
3724
3724
 
3725
3725
  /**
@@ -3733,9 +3733,9 @@ class VelociousDatabaseRecord {
3733
3733
  _setQueryData(name, value) {
3734
3734
  setPayloadQueryData(/**
3735
3735
  * Narrows the runtime value to the documented type.
3736
- @type {import("../../record-payload-values.js").RecordPayloadValuesTarget} */ (/**
3736
+ * @type {import("../../record-payload-values.js").RecordPayloadValuesTarget} */ (/**
3737
3737
  * Narrows the runtime value to the documented type.
3738
- @type {?} */ (this)), name, value)
3738
+ * @type {?} */ (this)), name, value)
3739
3739
  }
3740
3740
 
3741
3741
  /**
@@ -3747,14 +3747,14 @@ class VelociousDatabaseRecord {
3747
3747
  queryDataValues() {
3748
3748
  /**
3749
3749
  * Result.
3750
- @type {Record<string, ?>} */
3750
+ * @type {Record<string, ?>} */
3751
3751
  const result = {}
3752
3752
 
3753
3753
  const target = /**
3754
3754
  * Narrows the runtime value to the documented type.
3755
- @type {import("../../record-payload-values.js").RecordPayloadValuesTarget} */ (/**
3755
+ * @type {import("../../record-payload-values.js").RecordPayloadValuesTarget} */ (/**
3756
3756
  * Narrows the runtime value to the documented type.
3757
- @type {?} */ (this))
3757
+ * @type {?} */ (this))
3758
3758
 
3759
3759
  if (!target._queryDataValues) return result
3760
3760
 
@@ -3779,9 +3779,9 @@ class VelociousDatabaseRecord {
3779
3779
  can(action) {
3780
3780
  return readPayloadComputedAbility(/**
3781
3781
  * Narrows the runtime value to the documented type.
3782
- @type {import("../../record-payload-values.js").RecordPayloadValuesTarget} */ (/**
3782
+ * @type {import("../../record-payload-values.js").RecordPayloadValuesTarget} */ (/**
3783
3783
  * Narrows the runtime value to the documented type.
3784
- @type {?} */ (this)), action)
3784
+ * @type {?} */ (this)), action)
3785
3785
  }
3786
3786
 
3787
3787
  /**
@@ -3795,9 +3795,9 @@ class VelociousDatabaseRecord {
3795
3795
  _setComputedAbility(action, value) {
3796
3796
  setPayloadComputedAbility(/**
3797
3797
  * Narrows the runtime value to the documented type.
3798
- @type {import("../../record-payload-values.js").RecordPayloadValuesTarget} */ (/**
3798
+ * @type {import("../../record-payload-values.js").RecordPayloadValuesTarget} */ (/**
3799
3799
  * Narrows the runtime value to the documented type.
3800
- @type {?} */ (this)), action, value)
3800
+ * @type {?} */ (this)), action, value)
3801
3801
  }
3802
3802
 
3803
3803
  /**
@@ -3809,14 +3809,14 @@ class VelociousDatabaseRecord {
3809
3809
  computedAbilities() {
3810
3810
  /**
3811
3811
  * Result.
3812
- @type {Record<string, boolean>} */
3812
+ * @type {Record<string, boolean>} */
3813
3813
  const result = {}
3814
3814
 
3815
3815
  const target = /**
3816
3816
  * Narrows the runtime value to the documented type.
3817
- @type {import("../../record-payload-values.js").RecordPayloadValuesTarget} */ (/**
3817
+ * @type {import("../../record-payload-values.js").RecordPayloadValuesTarget} */ (/**
3818
3818
  * Narrows the runtime value to the documented type.
3819
- @type {?} */ (this))
3819
+ * @type {?} */ (this))
3820
3820
 
3821
3821
  if (!target._computedAbilities) return result
3822
3822
 
@@ -3950,7 +3950,7 @@ class VelociousDatabaseRecord {
3950
3950
  _belongsToChanges() {
3951
3951
  /**
3952
3952
  * Belongs to changes.
3953
- @type {Record<string, ?>} */
3953
+ * @type {Record<string, ?>} */
3954
3954
  const belongsToChanges = {}
3955
3955
 
3956
3956
  if (this._instanceRelationships) {
@@ -4103,7 +4103,7 @@ class VelociousDatabaseRecord {
4103
4103
  async _updateRecordWithChanges() {
4104
4104
  /**
4105
4105
  * Conditions.
4106
- @type {Record<string, ?>} */
4106
+ * @type {Record<string, ?>} */
4107
4107
  const conditions = {}
4108
4108
 
4109
4109
  conditions[this.getModelClass().primaryKey()] = this.id()
@@ -4144,7 +4144,7 @@ class VelociousDatabaseRecord {
4144
4144
  throw new Error(`Primary key ${primaryKey} doesn't exist in columns: ${Object.keys(this.getModelClass().getColumnNameToAttributeNameMap()).join(", ")}`)
4145
4145
  }
4146
4146
 
4147
- return /** Narrows the runtime value to the documented type. @type {number | string} */ (this.readAttribute(attributeName))
4147
+ return /** @type {number | string} */ (this.readAttribute(attributeName))
4148
4148
  }
4149
4149
 
4150
4150
  /**
@@ -4179,14 +4179,14 @@ class VelociousDatabaseRecord {
4179
4179
 
4180
4180
  /**
4181
4181
  * Where object.
4182
- @type {Record<string, ?>} */
4182
+ * @type {Record<string, ?>} */
4183
4183
  const whereObject = {}
4184
4184
 
4185
4185
  whereObject[primaryKey] = id
4186
4186
 
4187
4187
  const query = /**
4188
4188
  * Narrows the runtime value to the documented type.
4189
- @type {import("../query/model-class-query.js").default<MC>} */ (this.getModelClass().where(whereObject))
4189
+ * @type {import("../query/model-class-query.js").default<MC>} */ (this.getModelClass().where(whereObject))
4190
4190
  const reloadedModel = await query.first()
4191
4191
 
4192
4192
  if (!reloadedModel) throw new Error(`${this.constructor.name}#${id} couldn't be reloaded - record didn't exist`)
@@ -4203,14 +4203,14 @@ class VelociousDatabaseRecord {
4203
4203
  async reload() {
4204
4204
  const recordId = /**
4205
4205
  * Narrows the runtime value to the documented type.
4206
- @type {string | number} */ (this.readAttribute("id"))
4206
+ * @type {string | number} */ (this.readAttribute("id"))
4207
4207
  await this._reloadWithId(recordId)
4208
4208
  }
4209
4209
 
4210
4210
  async _runValidations() {
4211
4211
  /**
4212
4212
  * Narrows the runtime value to the documented type.
4213
- @type {Record<string, {type: string, message: string}>} */
4213
+ * @type {Record<string, {type: string, message: string}>} */
4214
4214
  this._validationErrors = {}
4215
4215
 
4216
4216
  const validators = this.getModelClass()._validators
@@ -4243,7 +4243,7 @@ class VelociousDatabaseRecord {
4243
4243
  fullErrorMessages() {
4244
4244
  /**
4245
4245
  * Validation error messages.
4246
- @type {string[]} */
4246
+ * @type {string[]} */
4247
4247
  const validationErrorMessages = []
4248
4248
 
4249
4249
  if (this._validationErrors) {
@@ -4270,16 +4270,10 @@ class VelociousDatabaseRecord {
4270
4270
  }
4271
4271
  }
4272
4272
 
4273
- class TranslationBase extends VelociousDatabaseRecord {
4274
- /**
4275
- * Runs locale.
4276
- * @abstract
4277
- * @returns {string} - The locale.
4278
- */
4279
- locale() {
4280
- throw new Error("'locale' not implemented")
4281
- }
4282
- }
4273
+ /**
4274
+ * Translation record shape used by translated attributes.
4275
+ * @typedef {VelociousDatabaseRecord & {locale: function(): string}} TranslationBase
4276
+ */
4283
4277
 
4284
4278
  VelociousDatabaseRecord.registerValidatorType("format", ValidatorsFormat)
4285
4279
  VelociousDatabaseRecord.registerValidatorType("presence", ValidatorsPresence)