velocious 1.0.577 → 1.0.579

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 (1676) hide show
  1. package/README.md +12 -6
  2. package/build/application.js +3 -3
  3. package/build/authorization/ability.js +6 -6
  4. package/build/authorization/base-resource.js +1 -1
  5. package/build/background-jobs/client.js +2 -2
  6. package/build/background-jobs/forked-runner-child.js +4 -4
  7. package/build/background-jobs/job-runner.js +2 -2
  8. package/build/background-jobs/job.js +6 -6
  9. package/build/background-jobs/json-socket.js +1 -1
  10. package/build/background-jobs/main.js +13 -13
  11. package/build/background-jobs/normalize-error.js +2 -2
  12. package/build/background-jobs/pooled-runner-child.js +3 -3
  13. package/build/background-jobs/scheduler.js +1 -1
  14. package/build/background-jobs/status-reporter.js +2 -2
  15. package/build/background-jobs/store.js +23 -23
  16. package/build/background-jobs/types.js +6 -6
  17. package/build/background-jobs/web/controller.js +6 -6
  18. package/build/background-jobs/web/counts-channel.js +1 -1
  19. package/build/background-jobs/worker.js +8 -8
  20. package/build/beacon/client.js +3 -3
  21. package/build/beacon/in-process-client.js +3 -3
  22. package/build/beacon/types.js +1 -1
  23. package/build/cli/base-command.js +1 -1
  24. package/build/cli/commands/console.js +1 -1
  25. package/build/cli/commands/db/schema/dump.js +1 -1
  26. package/build/cli/commands/db/schema/load.js +1 -1
  27. package/build/cli/commands/db/seed.js +1 -1
  28. package/build/cli/commands/generate/frontend-models.js +1 -1
  29. package/build/cli/commands/lint/relationships.js +1 -1
  30. package/build/cli/commands/run-script.js +1 -1
  31. package/build/cli/commands/runner.js +1 -1
  32. package/build/cli/index.js +2 -2
  33. package/build/cli/tenant-database-command-helper.js +2 -2
  34. package/build/configuration-types.js +48 -47
  35. package/build/configuration.js +150 -65
  36. package/build/controller.js +11 -8
  37. package/build/current.js +2 -2
  38. package/build/database/annotations-async-hooks.js +3 -3
  39. package/build/database/annotations.js +1 -1
  40. package/build/database/drivers/base-column.js +1 -1
  41. package/build/database/drivers/base-foreign-key.js +1 -1
  42. package/build/database/drivers/base-table.js +1 -1
  43. package/build/database/drivers/base.js +18 -18
  44. package/build/database/drivers/mssql/column.js +1 -1
  45. package/build/database/drivers/mssql/index.js +2 -2
  46. package/build/database/drivers/mssql/options.js +1 -1
  47. package/build/database/drivers/mssql/structure-sql.js +1 -1
  48. package/build/database/drivers/mssql/table.js +1 -1
  49. package/build/database/drivers/mysql/column.js +1 -1
  50. package/build/database/drivers/mysql/index.js +4 -4
  51. package/build/database/drivers/mysql/options.js +1 -1
  52. package/build/database/drivers/mysql/query.js +7 -7
  53. package/build/database/drivers/mysql/structure-sql.js +71 -10
  54. package/build/database/drivers/pgsql/column.js +1 -1
  55. package/build/database/drivers/pgsql/index.js +6 -6
  56. package/build/database/drivers/pgsql/structure-sql.js +1 -1
  57. package/build/database/drivers/sqlite/base.js +7 -7
  58. package/build/database/drivers/sqlite/column.js +1 -1
  59. package/build/database/drivers/sqlite/connection-sql-js.js +1 -1
  60. package/build/database/drivers/sqlite/foreign-key.js +1 -1
  61. package/build/database/drivers/sqlite/index.js +1 -1
  62. package/build/database/drivers/sqlite/index.native.js +2 -2
  63. package/build/database/drivers/sqlite/index.web.js +2 -2
  64. package/build/database/drivers/sqlite/query.js +2 -2
  65. package/build/database/drivers/sqlite/query.native.js +2 -2
  66. package/build/database/drivers/sqlite/query.web.js +2 -2
  67. package/build/database/drivers/sqlite/table-rebuilder.js +1 -1
  68. package/build/database/migration/index.js +2 -2
  69. package/build/database/migrator/types.js +2 -2
  70. package/build/database/operation.js +59 -6
  71. package/build/database/pool/async-tracked-multi-connection.js +75 -24
  72. package/build/database/pool/base-methods-forward.js +2 -2
  73. package/build/database/pool/base.js +48 -17
  74. package/build/database/pool/single-multi-use.js +501 -103
  75. package/build/database/query/delete-base.js +1 -1
  76. package/build/database/query/index.js +3 -3
  77. package/build/database/query/insert-base.js +4 -4
  78. package/build/database/query/model-class-query.js +39 -39
  79. package/build/database/query/preloader/belongs-to.js +2 -2
  80. package/build/database/query/preloader/ensure-model-class-initialized.js +3 -2
  81. package/build/database/query/preloader/has-many.js +3 -3
  82. package/build/database/query/preloader/has-one.js +1 -1
  83. package/build/database/query/preloader.js +9 -2
  84. package/build/database/query/query-data.js +7 -7
  85. package/build/database/query/update-base.js +3 -3
  86. package/build/database/query/upsert-base.js +2 -2
  87. package/build/database/query/where-model-class-hash.js +13 -13
  88. package/build/database/query/with-count.js +12 -12
  89. package/build/database/query-parser/options.js +2 -2
  90. package/build/database/query-parser/select-parser.js +1 -1
  91. package/build/database/record/acts-as-list.js +2 -2
  92. package/build/database/record/attachments/handle.js +6 -6
  93. package/build/database/record/attachments/normalize-input.js +11 -11
  94. package/build/database/record/attachments/storage-drivers/filesystem.js +1 -1
  95. package/build/database/record/attachments/storage-drivers/native.js +5 -5
  96. package/build/database/record/attachments/storage-drivers/s3.js +10 -10
  97. package/build/database/record/attachments/store.js +24 -20
  98. package/build/database/record/auditing.js +123 -29
  99. package/build/database/record/counter-cache-magnitude.js +11 -11
  100. package/build/database/record/index.js +227 -174
  101. package/build/database/record/instance-relationships/base.js +4 -4
  102. package/build/database/record/instance-relationships/belongs-to.js +1 -1
  103. package/build/database/record/instance-relationships/has-many.js +3 -3
  104. package/build/database/record/instance-relationships/has-one.js +1 -1
  105. package/build/database/record/record-not-found-error.js +1 -0
  106. package/build/database/record/relationships/base.js +22 -0
  107. package/build/database/record/state-machine.js +6 -6
  108. package/build/database/record/validators/base.js +1 -1
  109. package/build/database/structure-sql-loader.js +3 -3
  110. package/build/database/table-data/table-column.js +3 -3
  111. package/build/database/use-live-query.js +3 -3
  112. package/build/environment-handlers/base.js +56 -37
  113. package/build/environment-handlers/browser.js +1 -1
  114. package/build/environment-handlers/node/cli/commands/console.js +4 -4
  115. package/build/environment-handlers/node/cli/commands/db/seed.js +2 -2
  116. package/build/environment-handlers/node/cli/commands/generate/base-models.js +1 -1
  117. package/build/environment-handlers/node/cli/commands/run-script.js +2 -2
  118. package/build/environment-handlers/node/cli/commands/runner.js +2 -2
  119. package/build/environment-handlers/node/cli/commands/server.js +1 -1
  120. package/build/environment-handlers/node.js +36 -36
  121. package/build/error-logger.js +2 -2
  122. package/build/error-reporting/request-details.js +32 -32
  123. package/build/frontend-model-controller.js +215 -213
  124. package/build/frontend-model-resource/base-resource.js +44 -44
  125. package/build/frontend-model-resource/velocious-attachment-resource.js +1 -1
  126. package/build/frontend-models/base.js +146 -142
  127. package/build/frontend-models/clear-pending-debounced-callback.js +2 -2
  128. package/build/frontend-models/model-registry.js +4 -4
  129. package/build/frontend-models/outgoing-event-buffer.js +1 -1
  130. package/build/frontend-models/preloader.js +1 -1
  131. package/build/frontend-models/query.js +60 -60
  132. package/build/frontend-models/resource-definition.js +9 -9
  133. package/build/frontend-models/transport-serialization.js +27 -27
  134. package/build/frontend-models/websocket-channel.js +4 -4
  135. package/build/frontend-models/websocket-publishers.js +1 -1
  136. package/build/http-client/request.js +1 -1
  137. package/build/http-client/response.js +1 -1
  138. package/build/http-server/client/index.js +4 -4
  139. package/build/http-server/client/params-to-object.js +16 -16
  140. package/build/http-server/client/request-buffer/index.js +5 -2
  141. package/build/http-server/client/request-parser.js +2 -2
  142. package/build/http-server/client/request-runner.js +2 -2
  143. package/build/http-server/client/request.js +2 -2
  144. package/build/http-server/client/websocket-request.js +6 -6
  145. package/build/http-server/client/websocket-session.js +28 -28
  146. package/build/http-server/cookie.js +2 -2
  147. package/build/http-server/development-reloader.js +1 -1
  148. package/build/http-server/index.js +5 -5
  149. package/build/http-server/remote-address.js +1 -1
  150. package/build/http-server/server-lock.js +4 -4
  151. package/build/http-server/websocket-channel-subscribers.js +4 -4
  152. package/build/http-server/websocket-channel.js +1 -1
  153. package/build/http-server/websocket-connection.js +3 -3
  154. package/build/http-server/websocket-event-log-store.js +9 -9
  155. package/build/http-server/websocket-events-host.js +7 -7
  156. package/build/http-server/websocket-events.js +4 -4
  157. package/build/http-server/worker-handler/channel-subscriber-dispatch.js +1 -1
  158. package/build/http-server/worker-handler/in-process.js +5 -5
  159. package/build/http-server/worker-handler/index.js +10 -10
  160. package/build/http-server/worker-handler/worker-thread.js +8 -8
  161. package/build/index.d.ts.map +1 -1
  162. package/build/logger/base-logger.js +1 -1
  163. package/build/logger.js +12 -12
  164. package/build/mailer/backends/smtp.js +3 -3
  165. package/build/mailer/base.js +14 -14
  166. package/build/mailer/delivery.js +3 -3
  167. package/build/mailer/index.js +1 -1
  168. package/build/mailer.js +1 -1
  169. package/build/plugins/sqljs-wasm-route-controller.js +1 -1
  170. package/build/record-payload-values.js +3 -3
  171. package/build/routes/base-route.js +5 -5
  172. package/build/routes/basic-route.js +4 -4
  173. package/build/routes/get-route.js +2 -2
  174. package/build/routes/hooks/frontend-model-command-route-hook.js +1 -1
  175. package/build/routes/index.js +3 -3
  176. package/build/routes/namespace-route.js +1 -1
  177. package/build/routes/plugin-routes.js +1 -1
  178. package/build/routes/post-route.js +2 -2
  179. package/build/routes/resolver.js +5 -5
  180. package/build/routes/resource-route.js +1 -1
  181. package/build/src/application.d.ts +26 -29
  182. package/build/src/application.d.ts.map +1 -1
  183. package/build/src/application.js +4 -4
  184. package/build/src/authorization/ability.d.ts +47 -53
  185. package/build/src/authorization/ability.d.ts.map +1 -1
  186. package/build/src/authorization/ability.js +7 -7
  187. package/build/src/authorization/base-resource.d.ts +13 -13
  188. package/build/src/authorization/base-resource.d.ts.map +1 -1
  189. package/build/src/authorization/base-resource.js +2 -2
  190. package/build/src/background-jobs/client.d.ts +9 -9
  191. package/build/src/background-jobs/client.d.ts.map +1 -1
  192. package/build/src/background-jobs/client.js +3 -3
  193. package/build/src/background-jobs/cron-expression.d.ts +25 -16
  194. package/build/src/background-jobs/cron-expression.d.ts.map +1 -1
  195. package/build/src/background-jobs/forked-runner-child.js +5 -5
  196. package/build/src/background-jobs/job-record.d.ts +4 -3
  197. package/build/src/background-jobs/job-record.d.ts.map +1 -1
  198. package/build/src/background-jobs/job-registry.d.ts +6 -6
  199. package/build/src/background-jobs/job-registry.d.ts.map +1 -1
  200. package/build/src/background-jobs/job-runner.d.ts +9 -9
  201. package/build/src/background-jobs/job-runner.d.ts.map +1 -1
  202. package/build/src/background-jobs/job-runner.js +3 -3
  203. package/build/src/background-jobs/job.d.ts +14 -14
  204. package/build/src/background-jobs/job.d.ts.map +1 -1
  205. package/build/src/background-jobs/job.js +7 -7
  206. package/build/src/background-jobs/json-socket.d.ts +9 -10
  207. package/build/src/background-jobs/json-socket.d.ts.map +1 -1
  208. package/build/src/background-jobs/json-socket.js +2 -2
  209. package/build/src/background-jobs/main.d.ts +56 -59
  210. package/build/src/background-jobs/main.d.ts.map +1 -1
  211. package/build/src/background-jobs/main.js +14 -14
  212. package/build/src/background-jobs/normalize-error.d.ts +2 -2
  213. package/build/src/background-jobs/normalize-error.d.ts.map +1 -1
  214. package/build/src/background-jobs/normalize-error.js +3 -3
  215. package/build/src/background-jobs/pooled-runner-child.js +4 -4
  216. package/build/src/background-jobs/runner-graceful-shutdown.d.ts +7 -12
  217. package/build/src/background-jobs/runner-graceful-shutdown.d.ts.map +1 -1
  218. package/build/src/background-jobs/runner-process-title.d.ts.map +1 -1
  219. package/build/src/background-jobs/scheduler.d.ts +41 -41
  220. package/build/src/background-jobs/scheduler.d.ts.map +1 -1
  221. package/build/src/background-jobs/scheduler.js +2 -2
  222. package/build/src/background-jobs/socket-request.d.ts +14 -14
  223. package/build/src/background-jobs/socket-request.d.ts.map +1 -1
  224. package/build/src/background-jobs/status-reporter.d.ts +28 -28
  225. package/build/src/background-jobs/status-reporter.d.ts.map +1 -1
  226. package/build/src/background-jobs/status-reporter.js +3 -3
  227. package/build/src/background-jobs/store.d.ts +100 -103
  228. package/build/src/background-jobs/store.d.ts.map +1 -1
  229. package/build/src/background-jobs/store.js +24 -24
  230. package/build/src/background-jobs/types.d.ts +124 -124
  231. package/build/src/background-jobs/types.d.ts.map +1 -1
  232. package/build/src/background-jobs/types.js +7 -7
  233. package/build/src/background-jobs/web/authorization.d.ts +2 -2
  234. package/build/src/background-jobs/web/authorization.d.ts.map +1 -1
  235. package/build/src/background-jobs/web/controller.d.ts +13 -13
  236. package/build/src/background-jobs/web/controller.d.ts.map +1 -1
  237. package/build/src/background-jobs/web/controller.js +7 -7
  238. package/build/src/background-jobs/web/counts-channel.d.ts +8 -8
  239. package/build/src/background-jobs/web/counts-channel.d.ts.map +1 -1
  240. package/build/src/background-jobs/web/counts-channel.js +2 -2
  241. package/build/src/background-jobs/web/index.d.ts +4 -4
  242. package/build/src/background-jobs/web/index.d.ts.map +1 -1
  243. package/build/src/background-jobs/web/path-matcher.d.ts +18 -13
  244. package/build/src/background-jobs/web/path-matcher.d.ts.map +1 -1
  245. package/build/src/background-jobs/web/registry.d.ts +21 -24
  246. package/build/src/background-jobs/web/registry.d.ts.map +1 -1
  247. package/build/src/background-jobs/worker.d.ts +74 -77
  248. package/build/src/background-jobs/worker.d.ts.map +1 -1
  249. package/build/src/background-jobs/worker.js +9 -9
  250. package/build/src/beacon/client.d.ts +30 -34
  251. package/build/src/beacon/client.d.ts.map +1 -1
  252. package/build/src/beacon/client.js +4 -4
  253. package/build/src/beacon/in-process-broker.d.ts +6 -9
  254. package/build/src/beacon/in-process-broker.d.ts.map +1 -1
  255. package/build/src/beacon/in-process-client.d.ts +17 -21
  256. package/build/src/beacon/in-process-client.d.ts.map +1 -1
  257. package/build/src/beacon/in-process-client.js +4 -4
  258. package/build/src/beacon/server.d.ts +15 -15
  259. package/build/src/beacon/server.d.ts.map +1 -1
  260. package/build/src/beacon/types.d.ts +21 -46
  261. package/build/src/beacon/types.d.ts.map +1 -1
  262. package/build/src/beacon/types.js +2 -2
  263. package/build/src/cli/base-command.d.ts +25 -28
  264. package/build/src/cli/base-command.d.ts.map +1 -1
  265. package/build/src/cli/base-command.js +2 -2
  266. package/build/src/cli/browser-cli.d.ts +1 -1
  267. package/build/src/cli/browser-cli.d.ts.map +1 -1
  268. package/build/src/cli/commands/background-jobs-main.d.ts +2 -1
  269. package/build/src/cli/commands/background-jobs-main.d.ts.map +1 -1
  270. package/build/src/cli/commands/background-jobs-runner.d.ts +2 -1
  271. package/build/src/cli/commands/background-jobs-runner.d.ts.map +1 -1
  272. package/build/src/cli/commands/background-jobs-worker.d.ts +2 -1
  273. package/build/src/cli/commands/background-jobs-worker.d.ts.map +1 -1
  274. package/build/src/cli/commands/beacon.d.ts +2 -1
  275. package/build/src/cli/commands/beacon.d.ts.map +1 -1
  276. package/build/src/cli/commands/console.d.ts +6 -1
  277. package/build/src/cli/commands/console.d.ts.map +1 -1
  278. package/build/src/cli/commands/console.js +2 -2
  279. package/build/src/cli/commands/db/base-command.d.ts +1 -1
  280. package/build/src/cli/commands/db/base-command.d.ts.map +1 -1
  281. package/build/src/cli/commands/db/create.d.ts +1 -1
  282. package/build/src/cli/commands/db/create.d.ts.map +1 -1
  283. package/build/src/cli/commands/db/drop.d.ts +1 -1
  284. package/build/src/cli/commands/db/drop.d.ts.map +1 -1
  285. package/build/src/cli/commands/db/migrate.d.ts +1 -1
  286. package/build/src/cli/commands/db/migrate.d.ts.map +1 -1
  287. package/build/src/cli/commands/db/reset.d.ts +1 -1
  288. package/build/src/cli/commands/db/reset.d.ts.map +1 -1
  289. package/build/src/cli/commands/db/rollback.d.ts +1 -1
  290. package/build/src/cli/commands/db/rollback.d.ts.map +1 -1
  291. package/build/src/cli/commands/db/schema/dump.d.ts +6 -1
  292. package/build/src/cli/commands/db/schema/dump.d.ts.map +1 -1
  293. package/build/src/cli/commands/db/schema/dump.js +2 -2
  294. package/build/src/cli/commands/db/schema/load.d.ts +6 -1
  295. package/build/src/cli/commands/db/schema/load.d.ts.map +1 -1
  296. package/build/src/cli/commands/db/schema/load.js +2 -2
  297. package/build/src/cli/commands/db/seed.d.ts +6 -1
  298. package/build/src/cli/commands/db/seed.d.ts.map +1 -1
  299. package/build/src/cli/commands/db/seed.js +2 -2
  300. package/build/src/cli/commands/db/tenants/check.d.ts +1 -1
  301. package/build/src/cli/commands/db/tenants/check.d.ts.map +1 -1
  302. package/build/src/cli/commands/db/tenants/create.d.ts +1 -1
  303. package/build/src/cli/commands/db/tenants/create.d.ts.map +1 -1
  304. package/build/src/cli/commands/db/tenants/drop.d.ts +1 -1
  305. package/build/src/cli/commands/db/tenants/drop.d.ts.map +1 -1
  306. package/build/src/cli/commands/db/tenants/migrate.d.ts +1 -1
  307. package/build/src/cli/commands/db/tenants/migrate.d.ts.map +1 -1
  308. package/build/src/cli/commands/destroy/migration.d.ts +2 -1
  309. package/build/src/cli/commands/destroy/migration.d.ts.map +1 -1
  310. package/build/src/cli/commands/generate/base-models.d.ts +2 -1
  311. package/build/src/cli/commands/generate/base-models.d.ts.map +1 -1
  312. package/build/src/cli/commands/generate/frontend-models.d.ts +6 -1
  313. package/build/src/cli/commands/generate/frontend-models.d.ts.map +1 -1
  314. package/build/src/cli/commands/generate/frontend-models.js +2 -2
  315. package/build/src/cli/commands/generate/migration.d.ts +2 -1
  316. package/build/src/cli/commands/generate/migration.d.ts.map +1 -1
  317. package/build/src/cli/commands/generate/model.d.ts +2 -1
  318. package/build/src/cli/commands/generate/model.d.ts.map +1 -1
  319. package/build/src/cli/commands/init.d.ts +4 -2
  320. package/build/src/cli/commands/init.d.ts.map +1 -1
  321. package/build/src/cli/commands/lint/relationships.d.ts +6 -1
  322. package/build/src/cli/commands/lint/relationships.d.ts.map +1 -1
  323. package/build/src/cli/commands/lint/relationships.js +2 -2
  324. package/build/src/cli/commands/routes.d.ts +2 -1
  325. package/build/src/cli/commands/routes.d.ts.map +1 -1
  326. package/build/src/cli/commands/run-script.d.ts +6 -1
  327. package/build/src/cli/commands/run-script.d.ts.map +1 -1
  328. package/build/src/cli/commands/run-script.js +2 -2
  329. package/build/src/cli/commands/runner.d.ts +6 -1
  330. package/build/src/cli/commands/runner.d.ts.map +1 -1
  331. package/build/src/cli/commands/runner.js +2 -2
  332. package/build/src/cli/commands/server.d.ts +2 -1
  333. package/build/src/cli/commands/server.d.ts.map +1 -1
  334. package/build/src/cli/commands/test.d.ts +2 -1
  335. package/build/src/cli/commands/test.d.ts.map +1 -1
  336. package/build/src/cli/index.d.ts +20 -20
  337. package/build/src/cli/index.d.ts.map +1 -1
  338. package/build/src/cli/index.js +3 -3
  339. package/build/src/cli/tenant-database-command-helper.d.ts +13 -13
  340. package/build/src/cli/tenant-database-command-helper.d.ts.map +1 -1
  341. package/build/src/cli/tenant-database-command-helper.js +3 -3
  342. package/build/src/cli/use-browser-cli.d.ts +1 -1
  343. package/build/src/cli/use-browser-cli.d.ts.map +1 -1
  344. package/build/src/configuration-resolver.d.ts +1 -1
  345. package/build/src/configuration-resolver.d.ts.map +1 -1
  346. package/build/src/configuration-types.d.ts +947 -1038
  347. package/build/src/configuration-types.d.ts.map +1 -1
  348. package/build/src/configuration-types.js +49 -48
  349. package/build/src/configuration.d.ts +145 -139
  350. package/build/src/configuration.d.ts.map +1 -1
  351. package/build/src/configuration.js +149 -66
  352. package/build/src/controller.d.ts +37 -35
  353. package/build/src/controller.d.ts.map +1 -1
  354. package/build/src/controller.js +11 -9
  355. package/build/src/current-configuration.d.ts +5 -4
  356. package/build/src/current-configuration.d.ts.map +1 -1
  357. package/build/src/current.d.ts +3 -3
  358. package/build/src/current.d.ts.map +1 -1
  359. package/build/src/current.js +3 -3
  360. package/build/src/database/advisory-lock-runner.d.ts +61 -60
  361. package/build/src/database/advisory-lock-runner.d.ts.map +1 -1
  362. package/build/src/database/annotations-async-hooks.js +4 -4
  363. package/build/src/database/annotations.d.ts +4 -6
  364. package/build/src/database/annotations.d.ts.map +1 -1
  365. package/build/src/database/annotations.js +2 -2
  366. package/build/src/database/column-types.d.ts +1 -1
  367. package/build/src/database/column-types.d.ts.map +1 -1
  368. package/build/src/database/datetime-storage.d.ts +6 -6
  369. package/build/src/database/datetime-storage.d.ts.map +1 -1
  370. package/build/src/database/drivers/base-column.d.ts +3 -3
  371. package/build/src/database/drivers/base-column.d.ts.map +1 -1
  372. package/build/src/database/drivers/base-column.js +2 -2
  373. package/build/src/database/drivers/base-columns-index.d.ts +2 -2
  374. package/build/src/database/drivers/base-columns-index.d.ts.map +1 -1
  375. package/build/src/database/drivers/base-foreign-key.d.ts +7 -7
  376. package/build/src/database/drivers/base-foreign-key.d.ts.map +1 -1
  377. package/build/src/database/drivers/base-foreign-key.js +2 -2
  378. package/build/src/database/drivers/base-table.d.ts +3 -3
  379. package/build/src/database/drivers/base-table.d.ts.map +1 -1
  380. package/build/src/database/drivers/base-table.js +2 -2
  381. package/build/src/database/drivers/base.d.ts +297 -342
  382. package/build/src/database/drivers/base.d.ts.map +1 -1
  383. package/build/src/database/drivers/base.js +19 -19
  384. package/build/src/database/drivers/index-metadata.d.ts +15 -18
  385. package/build/src/database/drivers/index-metadata.d.ts.map +1 -1
  386. package/build/src/database/drivers/mssql/column.d.ts +10 -5
  387. package/build/src/database/drivers/mssql/column.d.ts.map +1 -1
  388. package/build/src/database/drivers/mssql/column.js +2 -2
  389. package/build/src/database/drivers/mssql/columns-index.d.ts +30 -22
  390. package/build/src/database/drivers/mssql/columns-index.d.ts.map +1 -1
  391. package/build/src/database/drivers/mssql/connect-connection.d.ts.map +1 -1
  392. package/build/src/database/drivers/mssql/foreign-key.d.ts +1 -1
  393. package/build/src/database/drivers/mssql/foreign-key.d.ts.map +1 -1
  394. package/build/src/database/drivers/mssql/index.d.ts +250 -9
  395. package/build/src/database/drivers/mssql/index.d.ts.map +1 -1
  396. package/build/src/database/drivers/mssql/index.js +3 -3
  397. package/build/src/database/drivers/mssql/options.d.ts +31 -1
  398. package/build/src/database/drivers/mssql/options.d.ts.map +1 -1
  399. package/build/src/database/drivers/mssql/options.js +2 -2
  400. package/build/src/database/drivers/mssql/query-parser.d.ts +1 -1
  401. package/build/src/database/drivers/mssql/query-parser.d.ts.map +1 -1
  402. package/build/src/database/drivers/mssql/sql/alter-table.d.ts +1 -1
  403. package/build/src/database/drivers/mssql/sql/alter-table.d.ts.map +1 -1
  404. package/build/src/database/drivers/mssql/sql/create-database.d.ts +3 -2
  405. package/build/src/database/drivers/mssql/sql/create-database.d.ts.map +1 -1
  406. package/build/src/database/drivers/mssql/sql/create-index.d.ts +1 -1
  407. package/build/src/database/drivers/mssql/sql/create-index.d.ts.map +1 -1
  408. package/build/src/database/drivers/mssql/sql/create-table.d.ts +1 -1
  409. package/build/src/database/drivers/mssql/sql/create-table.d.ts.map +1 -1
  410. package/build/src/database/drivers/mssql/sql/delete.d.ts +1 -1
  411. package/build/src/database/drivers/mssql/sql/delete.d.ts.map +1 -1
  412. package/build/src/database/drivers/mssql/sql/drop-database.d.ts +14 -1
  413. package/build/src/database/drivers/mssql/sql/drop-database.d.ts.map +1 -1
  414. package/build/src/database/drivers/mssql/sql/drop-table.d.ts +1 -1
  415. package/build/src/database/drivers/mssql/sql/drop-table.d.ts.map +1 -1
  416. package/build/src/database/drivers/mssql/sql/insert.d.ts +1 -1
  417. package/build/src/database/drivers/mssql/sql/insert.d.ts.map +1 -1
  418. package/build/src/database/drivers/mssql/sql/remove-index.d.ts +1 -1
  419. package/build/src/database/drivers/mssql/sql/remove-index.d.ts.map +1 -1
  420. package/build/src/database/drivers/mssql/sql/update.d.ts +1 -1
  421. package/build/src/database/drivers/mssql/sql/update.d.ts.map +1 -1
  422. package/build/src/database/drivers/mssql/sql/upsert.d.ts +1 -1
  423. package/build/src/database/drivers/mssql/sql/upsert.d.ts.map +1 -1
  424. package/build/src/database/drivers/mssql/structure-sql.d.ts +3 -3
  425. package/build/src/database/drivers/mssql/structure-sql.d.ts.map +1 -1
  426. package/build/src/database/drivers/mssql/structure-sql.js +2 -2
  427. package/build/src/database/drivers/mssql/table.d.ts +39 -29
  428. package/build/src/database/drivers/mssql/table.d.ts.map +1 -1
  429. package/build/src/database/drivers/mssql/table.js +2 -2
  430. package/build/src/database/drivers/mysql/column.d.ts +10 -6
  431. package/build/src/database/drivers/mysql/column.d.ts.map +1 -1
  432. package/build/src/database/drivers/mysql/column.js +2 -2
  433. package/build/src/database/drivers/mysql/columns-index.d.ts +3 -1
  434. package/build/src/database/drivers/mysql/columns-index.d.ts.map +1 -1
  435. package/build/src/database/drivers/mysql/foreign-key.d.ts +1 -1
  436. package/build/src/database/drivers/mysql/foreign-key.d.ts.map +1 -1
  437. package/build/src/database/drivers/mysql/index.d.ts +225 -6
  438. package/build/src/database/drivers/mysql/index.d.ts.map +1 -1
  439. package/build/src/database/drivers/mysql/index.js +5 -5
  440. package/build/src/database/drivers/mysql/options.d.ts +7 -1
  441. package/build/src/database/drivers/mysql/options.d.ts.map +1 -1
  442. package/build/src/database/drivers/mysql/options.js +2 -2
  443. package/build/src/database/drivers/mysql/query-parser.d.ts +1 -1
  444. package/build/src/database/drivers/mysql/query-parser.d.ts.map +1 -1
  445. package/build/src/database/drivers/mysql/query-stream.d.ts.map +1 -1
  446. package/build/src/database/drivers/mysql/query.d.ts +2 -2
  447. package/build/src/database/drivers/mysql/query.d.ts.map +1 -1
  448. package/build/src/database/drivers/mysql/query.js +8 -8
  449. package/build/src/database/drivers/mysql/sql/alter-table.d.ts +12 -1
  450. package/build/src/database/drivers/mysql/sql/alter-table.d.ts.map +1 -1
  451. package/build/src/database/drivers/mysql/sql/create-database.d.ts +6 -1
  452. package/build/src/database/drivers/mysql/sql/create-database.d.ts.map +1 -1
  453. package/build/src/database/drivers/mysql/sql/create-index.d.ts +1 -1
  454. package/build/src/database/drivers/mysql/sql/create-index.d.ts.map +1 -1
  455. package/build/src/database/drivers/mysql/sql/create-table.d.ts +1 -1
  456. package/build/src/database/drivers/mysql/sql/create-table.d.ts.map +1 -1
  457. package/build/src/database/drivers/mysql/sql/delete.d.ts +1 -1
  458. package/build/src/database/drivers/mysql/sql/delete.d.ts.map +1 -1
  459. package/build/src/database/drivers/mysql/sql/drop-database.d.ts +1 -1
  460. package/build/src/database/drivers/mysql/sql/drop-database.d.ts.map +1 -1
  461. package/build/src/database/drivers/mysql/sql/drop-table.d.ts +1 -1
  462. package/build/src/database/drivers/mysql/sql/drop-table.d.ts.map +1 -1
  463. package/build/src/database/drivers/mysql/sql/insert.d.ts +1 -1
  464. package/build/src/database/drivers/mysql/sql/insert.d.ts.map +1 -1
  465. package/build/src/database/drivers/mysql/sql/remove-index.d.ts +1 -1
  466. package/build/src/database/drivers/mysql/sql/remove-index.d.ts.map +1 -1
  467. package/build/src/database/drivers/mysql/sql/update.d.ts +1 -1
  468. package/build/src/database/drivers/mysql/sql/update.d.ts.map +1 -1
  469. package/build/src/database/drivers/mysql/sql/upsert.d.ts +1 -1
  470. package/build/src/database/drivers/mysql/sql/upsert.d.ts.map +1 -1
  471. package/build/src/database/drivers/mysql/structure-sql.d.ts +14 -3
  472. package/build/src/database/drivers/mysql/structure-sql.d.ts.map +1 -1
  473. package/build/src/database/drivers/mysql/structure-sql.js +62 -11
  474. package/build/src/database/drivers/mysql/table.d.ts +11 -6
  475. package/build/src/database/drivers/mysql/table.d.ts.map +1 -1
  476. package/build/src/database/drivers/pgsql/column.d.ts +10 -5
  477. package/build/src/database/drivers/pgsql/column.d.ts.map +1 -1
  478. package/build/src/database/drivers/pgsql/column.js +2 -2
  479. package/build/src/database/drivers/pgsql/columns-index.d.ts +30 -22
  480. package/build/src/database/drivers/pgsql/columns-index.d.ts.map +1 -1
  481. package/build/src/database/drivers/pgsql/foreign-key.d.ts +1 -1
  482. package/build/src/database/drivers/pgsql/foreign-key.d.ts.map +1 -1
  483. package/build/src/database/drivers/pgsql/index.d.ts +157 -6
  484. package/build/src/database/drivers/pgsql/index.d.ts.map +1 -1
  485. package/build/src/database/drivers/pgsql/index.js +7 -7
  486. package/build/src/database/drivers/pgsql/options.d.ts +1 -1
  487. package/build/src/database/drivers/pgsql/options.d.ts.map +1 -1
  488. package/build/src/database/drivers/pgsql/query-parser.d.ts +1 -1
  489. package/build/src/database/drivers/pgsql/query-parser.d.ts.map +1 -1
  490. package/build/src/database/drivers/pgsql/sql/alter-table.d.ts +1 -1
  491. package/build/src/database/drivers/pgsql/sql/alter-table.d.ts.map +1 -1
  492. package/build/src/database/drivers/pgsql/sql/create-database.d.ts +2 -1
  493. package/build/src/database/drivers/pgsql/sql/create-database.d.ts.map +1 -1
  494. package/build/src/database/drivers/pgsql/sql/create-index.d.ts +1 -1
  495. package/build/src/database/drivers/pgsql/sql/create-index.d.ts.map +1 -1
  496. package/build/src/database/drivers/pgsql/sql/create-table.d.ts +1 -1
  497. package/build/src/database/drivers/pgsql/sql/create-table.d.ts.map +1 -1
  498. package/build/src/database/drivers/pgsql/sql/delete.d.ts +1 -1
  499. package/build/src/database/drivers/pgsql/sql/delete.d.ts.map +1 -1
  500. package/build/src/database/drivers/pgsql/sql/drop-database.d.ts +1 -1
  501. package/build/src/database/drivers/pgsql/sql/drop-database.d.ts.map +1 -1
  502. package/build/src/database/drivers/pgsql/sql/drop-table.d.ts +1 -1
  503. package/build/src/database/drivers/pgsql/sql/drop-table.d.ts.map +1 -1
  504. package/build/src/database/drivers/pgsql/sql/insert.d.ts +1 -1
  505. package/build/src/database/drivers/pgsql/sql/insert.d.ts.map +1 -1
  506. package/build/src/database/drivers/pgsql/sql/remove-index.d.ts +1 -1
  507. package/build/src/database/drivers/pgsql/sql/remove-index.d.ts.map +1 -1
  508. package/build/src/database/drivers/pgsql/sql/update.d.ts +1 -1
  509. package/build/src/database/drivers/pgsql/sql/update.d.ts.map +1 -1
  510. package/build/src/database/drivers/pgsql/sql/upsert.d.ts +1 -1
  511. package/build/src/database/drivers/pgsql/sql/upsert.d.ts.map +1 -1
  512. package/build/src/database/drivers/pgsql/structure-sql.d.ts +3 -3
  513. package/build/src/database/drivers/pgsql/structure-sql.d.ts.map +1 -1
  514. package/build/src/database/drivers/pgsql/structure-sql.js +2 -2
  515. package/build/src/database/drivers/pgsql/table.d.ts +33 -31
  516. package/build/src/database/drivers/pgsql/table.d.ts.map +1 -1
  517. package/build/src/database/drivers/sqlite/base.d.ts +162 -12
  518. package/build/src/database/drivers/sqlite/base.d.ts.map +1 -1
  519. package/build/src/database/drivers/sqlite/base.js +8 -8
  520. package/build/src/database/drivers/sqlite/column.d.ts +12 -6
  521. package/build/src/database/drivers/sqlite/column.d.ts.map +1 -1
  522. package/build/src/database/drivers/sqlite/column.js +2 -2
  523. package/build/src/database/drivers/sqlite/columns-index.d.ts +5 -1
  524. package/build/src/database/drivers/sqlite/columns-index.d.ts.map +1 -1
  525. package/build/src/database/drivers/sqlite/connection-sql-js.d.ts +9 -9
  526. package/build/src/database/drivers/sqlite/connection-sql-js.d.ts.map +1 -1
  527. package/build/src/database/drivers/sqlite/connection-sql-js.js +2 -2
  528. package/build/src/database/drivers/sqlite/foreign-key.d.ts +5 -4
  529. package/build/src/database/drivers/sqlite/foreign-key.d.ts.map +1 -1
  530. package/build/src/database/drivers/sqlite/foreign-key.js +2 -2
  531. package/build/src/database/drivers/sqlite/index.d.ts +53 -3
  532. package/build/src/database/drivers/sqlite/index.d.ts.map +1 -1
  533. package/build/src/database/drivers/sqlite/index.js +2 -2
  534. package/build/src/database/drivers/sqlite/index.native.d.ts +13 -5
  535. package/build/src/database/drivers/sqlite/index.native.d.ts.map +1 -1
  536. package/build/src/database/drivers/sqlite/index.native.js +3 -3
  537. package/build/src/database/drivers/sqlite/index.web.d.ts +48 -14
  538. package/build/src/database/drivers/sqlite/index.web.d.ts.map +1 -1
  539. package/build/src/database/drivers/sqlite/index.web.js +3 -3
  540. package/build/src/database/drivers/sqlite/options.d.ts +1 -1
  541. package/build/src/database/drivers/sqlite/options.d.ts.map +1 -1
  542. package/build/src/database/drivers/sqlite/query-parser.d.ts +1 -1
  543. package/build/src/database/drivers/sqlite/query-parser.d.ts.map +1 -1
  544. package/build/src/database/drivers/sqlite/query.d.ts +2 -2
  545. package/build/src/database/drivers/sqlite/query.d.ts.map +1 -1
  546. package/build/src/database/drivers/sqlite/query.js +3 -3
  547. package/build/src/database/drivers/sqlite/query.native.d.ts +4 -4
  548. package/build/src/database/drivers/sqlite/query.native.d.ts.map +1 -1
  549. package/build/src/database/drivers/sqlite/query.native.js +3 -3
  550. package/build/src/database/drivers/sqlite/query.web.d.ts +2 -2
  551. package/build/src/database/drivers/sqlite/query.web.d.ts.map +1 -1
  552. package/build/src/database/drivers/sqlite/query.web.js +3 -3
  553. package/build/src/database/drivers/sqlite/sql/alter-table.d.ts +19 -4
  554. package/build/src/database/drivers/sqlite/sql/alter-table.d.ts.map +1 -1
  555. package/build/src/database/drivers/sqlite/sql/create-index.d.ts +1 -1
  556. package/build/src/database/drivers/sqlite/sql/create-index.d.ts.map +1 -1
  557. package/build/src/database/drivers/sqlite/sql/create-table.d.ts +1 -1
  558. package/build/src/database/drivers/sqlite/sql/create-table.d.ts.map +1 -1
  559. package/build/src/database/drivers/sqlite/sql/delete.d.ts +1 -1
  560. package/build/src/database/drivers/sqlite/sql/delete.d.ts.map +1 -1
  561. package/build/src/database/drivers/sqlite/sql/drop-table.d.ts +1 -1
  562. package/build/src/database/drivers/sqlite/sql/drop-table.d.ts.map +1 -1
  563. package/build/src/database/drivers/sqlite/sql/insert.d.ts +1 -1
  564. package/build/src/database/drivers/sqlite/sql/insert.d.ts.map +1 -1
  565. package/build/src/database/drivers/sqlite/sql/remove-index.d.ts +1 -1
  566. package/build/src/database/drivers/sqlite/sql/remove-index.d.ts.map +1 -1
  567. package/build/src/database/drivers/sqlite/sql/update.d.ts +1 -1
  568. package/build/src/database/drivers/sqlite/sql/update.d.ts.map +1 -1
  569. package/build/src/database/drivers/sqlite/sql/upsert.d.ts +1 -1
  570. package/build/src/database/drivers/sqlite/sql/upsert.d.ts.map +1 -1
  571. package/build/src/database/drivers/sqlite/structure-sql.d.ts +1 -1
  572. package/build/src/database/drivers/sqlite/structure-sql.d.ts.map +1 -1
  573. package/build/src/database/drivers/sqlite/table-rebuilder.d.ts +5 -5
  574. package/build/src/database/drivers/sqlite/table-rebuilder.d.ts.map +1 -1
  575. package/build/src/database/drivers/sqlite/table-rebuilder.js +2 -2
  576. package/build/src/database/drivers/sqlite/table.d.ts +15 -5
  577. package/build/src/database/drivers/sqlite/table.d.ts.map +1 -1
  578. package/build/src/database/drivers/sqlite/web-persistence.d.ts +28 -34
  579. package/build/src/database/drivers/sqlite/web-persistence.d.ts.map +1 -1
  580. package/build/src/database/drivers/structure-sql/utils.d.ts +2 -2
  581. package/build/src/database/drivers/structure-sql/utils.d.ts.map +1 -1
  582. package/build/src/database/handler.d.ts.map +1 -1
  583. package/build/src/database/initializer-from-require-context.d.ts +18 -16
  584. package/build/src/database/initializer-from-require-context.d.ts.map +1 -1
  585. package/build/src/database/live-query.d.ts +13 -24
  586. package/build/src/database/live-query.d.ts.map +1 -1
  587. package/build/src/database/migration/index.d.ts +146 -169
  588. package/build/src/database/migration/index.d.ts.map +1 -1
  589. package/build/src/database/migration/index.js +3 -3
  590. package/build/src/database/migrations-ledger.d.ts.map +1 -1
  591. package/build/src/database/migrator/files-finder.d.ts +1 -1
  592. package/build/src/database/migrator/files-finder.d.ts.map +1 -1
  593. package/build/src/database/migrator/types.d.ts +26 -2
  594. package/build/src/database/migrator/types.d.ts.map +1 -1
  595. package/build/src/database/migrator/types.js +24 -1
  596. package/build/src/database/migrator.d.ts +10 -10
  597. package/build/src/database/migrator.d.ts.map +1 -1
  598. package/build/src/database/operation-connection.d.ts +3 -3
  599. package/build/src/database/operation-connection.d.ts.map +1 -1
  600. package/build/src/database/operation-lease.d.ts +4 -4
  601. package/build/src/database/operation-lease.d.ts.map +1 -1
  602. package/build/src/database/operation.d.ts +38 -7
  603. package/build/src/database/operation.d.ts.map +1 -1
  604. package/build/src/database/operation.js +55 -8
  605. package/build/src/database/pool/async-tracked-multi-connection.d.ts +174 -79
  606. package/build/src/database/pool/async-tracked-multi-connection.d.ts.map +1 -1
  607. package/build/src/database/pool/async-tracked-multi-connection.js +70 -25
  608. package/build/src/database/pool/base-methods-forward.d.ts.map +1 -1
  609. package/build/src/database/pool/base-methods-forward.js +3 -3
  610. package/build/src/database/pool/base.d.ts +93 -71
  611. package/build/src/database/pool/base.d.ts.map +1 -1
  612. package/build/src/database/pool/base.js +47 -17
  613. package/build/src/database/pool/single-multi-use.d.ts +243 -10
  614. package/build/src/database/pool/single-multi-use.d.ts.map +1 -1
  615. package/build/src/database/pool/single-multi-use.js +467 -103
  616. package/build/src/database/query/alter-table-base.d.ts +8 -3
  617. package/build/src/database/query/alter-table-base.d.ts.map +1 -1
  618. package/build/src/database/query/base.d.ts +3 -3
  619. package/build/src/database/query/base.d.ts.map +1 -1
  620. package/build/src/database/query/create-database-base.d.ts +28 -22
  621. package/build/src/database/query/create-database-base.d.ts.map +1 -1
  622. package/build/src/database/query/create-index-base.d.ts +32 -30
  623. package/build/src/database/query/create-index-base.d.ts.map +1 -1
  624. package/build/src/database/query/create-table-base.d.ts +7 -7
  625. package/build/src/database/query/create-table-base.d.ts.map +1 -1
  626. package/build/src/database/query/delete-base.d.ts +5 -5
  627. package/build/src/database/query/delete-base.d.ts.map +1 -1
  628. package/build/src/database/query/delete-base.js +2 -2
  629. package/build/src/database/query/drop-database-base.d.ts +22 -18
  630. package/build/src/database/query/drop-database-base.d.ts.map +1 -1
  631. package/build/src/database/query/drop-table-base.d.ts +11 -6
  632. package/build/src/database/query/drop-table-base.d.ts.map +1 -1
  633. package/build/src/database/query/from-base.d.ts.map +1 -1
  634. package/build/src/database/query/from-plain.d.ts +3 -2
  635. package/build/src/database/query/from-plain.d.ts.map +1 -1
  636. package/build/src/database/query/from-table.d.ts +3 -2
  637. package/build/src/database/query/from-table.d.ts.map +1 -1
  638. package/build/src/database/query/index.d.ts +92 -107
  639. package/build/src/database/query/index.d.ts.map +1 -1
  640. package/build/src/database/query/index.js +4 -4
  641. package/build/src/database/query/insert-base.d.ts +18 -18
  642. package/build/src/database/query/insert-base.d.ts.map +1 -1
  643. package/build/src/database/query/insert-base.js +5 -5
  644. package/build/src/database/query/join-base.d.ts +1 -1
  645. package/build/src/database/query/join-base.d.ts.map +1 -1
  646. package/build/src/database/query/join-object.d.ts +9 -15
  647. package/build/src/database/query/join-object.d.ts.map +1 -1
  648. package/build/src/database/query/join-plain.d.ts +2 -2
  649. package/build/src/database/query/join-plain.d.ts.map +1 -1
  650. package/build/src/database/query/join-tracker.d.ts +3 -3
  651. package/build/src/database/query/join-tracker.d.ts.map +1 -1
  652. package/build/src/database/query/model-class-query.d.ts +39 -36
  653. package/build/src/database/query/model-class-query.d.ts.map +1 -1
  654. package/build/src/database/query/model-class-query.js +40 -40
  655. package/build/src/database/query/order-base.d.ts +1 -1
  656. package/build/src/database/query/order-base.d.ts.map +1 -1
  657. package/build/src/database/query/order-column.d.ts +19 -22
  658. package/build/src/database/query/order-column.d.ts.map +1 -1
  659. package/build/src/database/query/order-plain.d.ts +3 -3
  660. package/build/src/database/query/order-plain.d.ts.map +1 -1
  661. package/build/src/database/query/preloader/belongs-to.d.ts +5 -5
  662. package/build/src/database/query/preloader/belongs-to.d.ts.map +1 -1
  663. package/build/src/database/query/preloader/belongs-to.js +3 -3
  664. package/build/src/database/query/preloader/ensure-model-class-initialized.d.ts +2 -1
  665. package/build/src/database/query/preloader/ensure-model-class-initialized.d.ts.map +1 -1
  666. package/build/src/database/query/preloader/ensure-model-class-initialized.js +4 -3
  667. package/build/src/database/query/preloader/has-many.d.ts +6 -6
  668. package/build/src/database/query/preloader/has-many.d.ts.map +1 -1
  669. package/build/src/database/query/preloader/has-many.js +4 -4
  670. package/build/src/database/query/preloader/has-one.d.ts +5 -5
  671. package/build/src/database/query/preloader/has-one.d.ts.map +1 -1
  672. package/build/src/database/query/preloader/has-one.js +2 -2
  673. package/build/src/database/query/preloader/query-for-model.d.ts.map +1 -1
  674. package/build/src/database/query/preloader/selection.d.ts +6 -6
  675. package/build/src/database/query/preloader/selection.d.ts.map +1 -1
  676. package/build/src/database/query/preloader.d.ts +8 -8
  677. package/build/src/database/query/preloader.d.ts.map +1 -1
  678. package/build/src/database/query/preloader.js +9 -3
  679. package/build/src/database/query/query-data.d.ts +43 -55
  680. package/build/src/database/query/query-data.d.ts.map +1 -1
  681. package/build/src/database/query/query-data.js +8 -8
  682. package/build/src/database/query/remove-index-base.d.ts +21 -19
  683. package/build/src/database/query/remove-index-base.d.ts.map +1 -1
  684. package/build/src/database/query/select-base.d.ts +1 -1
  685. package/build/src/database/query/select-base.d.ts.map +1 -1
  686. package/build/src/database/query/select-plain.d.ts +3 -2
  687. package/build/src/database/query/select-plain.d.ts.map +1 -1
  688. package/build/src/database/query/select-table-and-column.d.ts +4 -3
  689. package/build/src/database/query/select-table-and-column.d.ts.map +1 -1
  690. package/build/src/database/query/update-base.d.ts +10 -10
  691. package/build/src/database/query/update-base.d.ts.map +1 -1
  692. package/build/src/database/query/update-base.js +4 -4
  693. package/build/src/database/query/upsert-base.d.ts +9 -9
  694. package/build/src/database/query/upsert-base.d.ts.map +1 -1
  695. package/build/src/database/query/upsert-base.js +3 -3
  696. package/build/src/database/query/where-base.d.ts +1 -1
  697. package/build/src/database/query/where-base.d.ts.map +1 -1
  698. package/build/src/database/query/where-combinator.d.ts +9 -4
  699. package/build/src/database/query/where-combinator.d.ts.map +1 -1
  700. package/build/src/database/query/where-hash.d.ts +11 -9
  701. package/build/src/database/query/where-hash.d.ts.map +1 -1
  702. package/build/src/database/query/where-model-class-hash.d.ts +28 -26
  703. package/build/src/database/query/where-model-class-hash.d.ts.map +1 -1
  704. package/build/src/database/query/where-model-class-hash.js +14 -14
  705. package/build/src/database/query/where-not.d.ts +8 -3
  706. package/build/src/database/query/where-not.d.ts.map +1 -1
  707. package/build/src/database/query/where-plain.d.ts +4 -3
  708. package/build/src/database/query/where-plain.d.ts.map +1 -1
  709. package/build/src/database/query/with-count.d.ts +22 -28
  710. package/build/src/database/query/with-count.d.ts.map +1 -1
  711. package/build/src/database/query/with-count.js +12 -12
  712. package/build/src/database/query-aborted-error.d.ts +5 -5
  713. package/build/src/database/query-aborted-error.d.ts.map +1 -1
  714. package/build/src/database/query-parser/base-query-parser.d.ts +3 -3
  715. package/build/src/database/query-parser/base-query-parser.d.ts.map +1 -1
  716. package/build/src/database/query-parser/from-parser.d.ts +2 -2
  717. package/build/src/database/query-parser/from-parser.d.ts.map +1 -1
  718. package/build/src/database/query-parser/group-parser.d.ts +2 -2
  719. package/build/src/database/query-parser/group-parser.d.ts.map +1 -1
  720. package/build/src/database/query-parser/joins-parser.d.ts +3 -3
  721. package/build/src/database/query-parser/joins-parser.d.ts.map +1 -1
  722. package/build/src/database/query-parser/limit-parser.d.ts +2 -2
  723. package/build/src/database/query-parser/limit-parser.d.ts.map +1 -1
  724. package/build/src/database/query-parser/options.d.ts +31 -34
  725. package/build/src/database/query-parser/options.d.ts.map +1 -1
  726. package/build/src/database/query-parser/options.js +3 -3
  727. package/build/src/database/query-parser/order-parser.d.ts +2 -2
  728. package/build/src/database/query-parser/order-parser.d.ts.map +1 -1
  729. package/build/src/database/query-parser/select-parser.d.ts +2 -2
  730. package/build/src/database/query-parser/select-parser.d.ts.map +1 -1
  731. package/build/src/database/query-parser/select-parser.js +2 -2
  732. package/build/src/database/query-parser/where-parser.d.ts +2 -2
  733. package/build/src/database/query-parser/where-parser.d.ts.map +1 -1
  734. package/build/src/database/record/acts-as-list.d.ts.map +1 -1
  735. package/build/src/database/record/acts-as-list.js +3 -3
  736. package/build/src/database/record/attachments/attachment-record.d.ts +7 -3
  737. package/build/src/database/record/attachments/attachment-record.d.ts.map +1 -1
  738. package/build/src/database/record/attachments/download.d.ts +9 -9
  739. package/build/src/database/record/attachments/download.d.ts.map +1 -1
  740. package/build/src/database/record/attachments/handle.d.ts +12 -12
  741. package/build/src/database/record/attachments/handle.d.ts.map +1 -1
  742. package/build/src/database/record/attachments/handle.js +7 -7
  743. package/build/src/database/record/attachments/normalize-input.d.ts +16 -22
  744. package/build/src/database/record/attachments/normalize-input.d.ts.map +1 -1
  745. package/build/src/database/record/attachments/normalize-input.js +12 -12
  746. package/build/src/database/record/attachments/storage-drivers/filesystem.d.ts +4 -4
  747. package/build/src/database/record/attachments/storage-drivers/filesystem.d.ts.map +1 -1
  748. package/build/src/database/record/attachments/storage-drivers/filesystem.js +2 -2
  749. package/build/src/database/record/attachments/storage-drivers/native.d.ts +12 -12
  750. package/build/src/database/record/attachments/storage-drivers/native.d.ts.map +1 -1
  751. package/build/src/database/record/attachments/storage-drivers/native.js +6 -6
  752. package/build/src/database/record/attachments/storage-drivers/s3.d.ts +17 -17
  753. package/build/src/database/record/attachments/storage-drivers/s3.d.ts.map +1 -1
  754. package/build/src/database/record/attachments/storage-drivers/s3.js +11 -11
  755. package/build/src/database/record/attachments/store.d.ts +38 -41
  756. package/build/src/database/record/attachments/store.d.ts.map +1 -1
  757. package/build/src/database/record/attachments/store.js +24 -21
  758. package/build/src/database/record/auditing.d.ts +67 -87
  759. package/build/src/database/record/auditing.d.ts.map +1 -1
  760. package/build/src/database/record/auditing.js +109 -30
  761. package/build/src/database/record/counter-cache-magnitude.d.ts +15 -35
  762. package/build/src/database/record/counter-cache-magnitude.d.ts.map +1 -1
  763. package/build/src/database/record/counter-cache-magnitude.js +12 -12
  764. package/build/src/database/record/index.d.ts +2390 -488
  765. package/build/src/database/record/index.d.ts.map +1 -1
  766. package/build/src/database/record/index.js +222 -172
  767. package/build/src/database/record/instance-relationships/base.d.ts +20 -23
  768. package/build/src/database/record/instance-relationships/base.d.ts.map +1 -1
  769. package/build/src/database/record/instance-relationships/base.js +5 -5
  770. package/build/src/database/record/instance-relationships/belongs-to.d.ts +9 -1
  771. package/build/src/database/record/instance-relationships/belongs-to.d.ts.map +1 -1
  772. package/build/src/database/record/instance-relationships/belongs-to.js +2 -2
  773. package/build/src/database/record/instance-relationships/has-many.d.ts +15 -3
  774. package/build/src/database/record/instance-relationships/has-many.d.ts.map +1 -1
  775. package/build/src/database/record/instance-relationships/has-many.js +4 -4
  776. package/build/src/database/record/instance-relationships/has-one.d.ts +19 -1
  777. package/build/src/database/record/instance-relationships/has-one.d.ts.map +1 -1
  778. package/build/src/database/record/instance-relationships/has-one.js +2 -2
  779. package/build/src/database/record/record-not-found-error.d.ts +1 -0
  780. package/build/src/database/record/record-not-found-error.d.ts.map +1 -1
  781. package/build/src/database/record/record-not-found-error.js +2 -1
  782. package/build/src/database/record/relationships/base.d.ts +83 -71
  783. package/build/src/database/record/relationships/base.d.ts.map +1 -1
  784. package/build/src/database/record/relationships/base.js +21 -1
  785. package/build/src/database/record/relationships/belongs-to.d.ts +11 -1
  786. package/build/src/database/record/relationships/belongs-to.d.ts.map +1 -1
  787. package/build/src/database/record/relationships/has-many.d.ts +11 -1
  788. package/build/src/database/record/relationships/has-many.d.ts.map +1 -1
  789. package/build/src/database/record/relationships/has-one.d.ts +11 -1
  790. package/build/src/database/record/relationships/has-one.d.ts.map +1 -1
  791. package/build/src/database/record/state-machine.d.ts +20 -29
  792. package/build/src/database/record/state-machine.d.ts.map +1 -1
  793. package/build/src/database/record/state-machine.js +7 -7
  794. package/build/src/database/record/user-module.d.ts +1 -1
  795. package/build/src/database/record/user-module.d.ts.map +1 -1
  796. package/build/src/database/record/validation-messages.d.ts +19 -22
  797. package/build/src/database/record/validation-messages.d.ts.map +1 -1
  798. package/build/src/database/record/validators/base.d.ts +4 -4
  799. package/build/src/database/record/validators/base.d.ts.map +1 -1
  800. package/build/src/database/record/validators/base.js +2 -2
  801. package/build/src/database/record/validators/format.d.ts +12 -1
  802. package/build/src/database/record/validators/format.d.ts.map +1 -1
  803. package/build/src/database/record/validators/length.d.ts +14 -1
  804. package/build/src/database/record/validators/length.d.ts.map +1 -1
  805. package/build/src/database/record/validators/presence.d.ts +11 -1
  806. package/build/src/database/record/validators/presence.d.ts.map +1 -1
  807. package/build/src/database/record/validators/uniqueness.d.ts +12 -1
  808. package/build/src/database/record/validators/uniqueness.d.ts.map +1 -1
  809. package/build/src/database/record-changes.d.ts +7 -18
  810. package/build/src/database/record-changes.d.ts.map +1 -1
  811. package/build/src/database/structure-sql-loader.d.ts +2 -2
  812. package/build/src/database/structure-sql-loader.d.ts.map +1 -1
  813. package/build/src/database/structure-sql-loader.js +4 -4
  814. package/build/src/database/table-data/index.d.ts +21 -24
  815. package/build/src/database/table-data/index.d.ts.map +1 -1
  816. package/build/src/database/table-data/table-column.d.ts +74 -80
  817. package/build/src/database/table-data/table-column.d.ts.map +1 -1
  818. package/build/src/database/table-data/table-column.js +4 -4
  819. package/build/src/database/table-data/table-foreign-key.d.ts +10 -10
  820. package/build/src/database/table-data/table-foreign-key.d.ts.map +1 -1
  821. package/build/src/database/table-data/table-index.d.ts +12 -15
  822. package/build/src/database/table-data/table-index.d.ts.map +1 -1
  823. package/build/src/database/table-data/table-reference.d.ts +2 -2
  824. package/build/src/database/table-data/table-reference.d.ts.map +1 -1
  825. package/build/src/database/tenants/data-copier.d.ts +7 -7
  826. package/build/src/database/tenants/data-copier.d.ts.map +1 -1
  827. package/build/src/database/tenants/schema-cloner.d.ts +3 -3
  828. package/build/src/database/tenants/schema-cloner.d.ts.map +1 -1
  829. package/build/src/database/tenants/tenant-table-plan.d.ts +20 -14
  830. package/build/src/database/tenants/tenant-table-plan.d.ts.map +1 -1
  831. package/build/src/database/tenants/tenant-table-plan.js +17 -1
  832. package/build/src/database/use-database.d.ts.map +1 -1
  833. package/build/src/database/use-live-query.d.ts +17 -29
  834. package/build/src/database/use-live-query.d.ts.map +1 -1
  835. package/build/src/database/use-live-query.js +4 -4
  836. package/build/src/environment-handlers/base.d.ts +112 -103
  837. package/build/src/environment-handlers/base.d.ts.map +1 -1
  838. package/build/src/environment-handlers/base.js +54 -38
  839. package/build/src/environment-handlers/browser.d.ts +63 -56
  840. package/build/src/environment-handlers/browser.d.ts.map +1 -1
  841. package/build/src/environment-handlers/browser.js +2 -2
  842. package/build/src/environment-handlers/node/attachment-path-source.d.ts +9 -9
  843. package/build/src/environment-handlers/node/attachment-path-source.d.ts.map +1 -1
  844. package/build/src/environment-handlers/node/cli/commands/background-jobs-main.d.ts +1 -1
  845. package/build/src/environment-handlers/node/cli/commands/background-jobs-main.d.ts.map +1 -1
  846. package/build/src/environment-handlers/node/cli/commands/background-jobs-runner.d.ts +1 -1
  847. package/build/src/environment-handlers/node/cli/commands/background-jobs-runner.d.ts.map +1 -1
  848. package/build/src/environment-handlers/node/cli/commands/background-jobs-worker.d.ts +1 -1
  849. package/build/src/environment-handlers/node/cli/commands/background-jobs-worker.d.ts.map +1 -1
  850. package/build/src/environment-handlers/node/cli/commands/beacon.d.ts +1 -1
  851. package/build/src/environment-handlers/node/cli/commands/beacon.d.ts.map +1 -1
  852. package/build/src/environment-handlers/node/cli/commands/cli-command-context.d.ts +7 -10
  853. package/build/src/environment-handlers/node/cli/commands/cli-command-context.d.ts.map +1 -1
  854. package/build/src/environment-handlers/node/cli/commands/console.d.ts +9 -7
  855. package/build/src/environment-handlers/node/cli/commands/console.d.ts.map +1 -1
  856. package/build/src/environment-handlers/node/cli/commands/console.js +5 -5
  857. package/build/src/environment-handlers/node/cli/commands/db/schema/dump.d.ts +1 -1
  858. package/build/src/environment-handlers/node/cli/commands/db/schema/dump.d.ts.map +1 -1
  859. package/build/src/environment-handlers/node/cli/commands/db/schema/load.d.ts +1 -1
  860. package/build/src/environment-handlers/node/cli/commands/db/schema/load.d.ts.map +1 -1
  861. package/build/src/environment-handlers/node/cli/commands/db/seed.d.ts +7 -5
  862. package/build/src/environment-handlers/node/cli/commands/db/seed.d.ts.map +1 -1
  863. package/build/src/environment-handlers/node/cli/commands/db/seed.js +3 -3
  864. package/build/src/environment-handlers/node/cli/commands/destroy/migration.d.ts +4 -7
  865. package/build/src/environment-handlers/node/cli/commands/destroy/migration.d.ts.map +1 -1
  866. package/build/src/environment-handlers/node/cli/commands/generate/base-models.d.ts +1 -1
  867. package/build/src/environment-handlers/node/cli/commands/generate/base-models.d.ts.map +1 -1
  868. package/build/src/environment-handlers/node/cli/commands/generate/base-models.js +2 -2
  869. package/build/src/environment-handlers/node/cli/commands/generate/frontend-models.d.ts +93 -108
  870. package/build/src/environment-handlers/node/cli/commands/generate/frontend-models.d.ts.map +1 -1
  871. package/build/src/environment-handlers/node/cli/commands/generate/generated-file-banner.d.ts.map +1 -1
  872. package/build/src/environment-handlers/node/cli/commands/generate/migration.d.ts +9 -12
  873. package/build/src/environment-handlers/node/cli/commands/generate/migration.d.ts.map +1 -1
  874. package/build/src/environment-handlers/node/cli/commands/generate/model.d.ts +8 -11
  875. package/build/src/environment-handlers/node/cli/commands/generate/model.d.ts.map +1 -1
  876. package/build/src/environment-handlers/node/cli/commands/init.d.ts +7 -9
  877. package/build/src/environment-handlers/node/cli/commands/init.d.ts.map +1 -1
  878. package/build/src/environment-handlers/node/cli/commands/lint/relationships.d.ts +7 -7
  879. package/build/src/environment-handlers/node/cli/commands/lint/relationships.d.ts.map +1 -1
  880. package/build/src/environment-handlers/node/cli/commands/routes.d.ts +1 -1
  881. package/build/src/environment-handlers/node/cli/commands/routes.d.ts.map +1 -1
  882. package/build/src/environment-handlers/node/cli/commands/run-script.d.ts +7 -5
  883. package/build/src/environment-handlers/node/cli/commands/run-script.d.ts.map +1 -1
  884. package/build/src/environment-handlers/node/cli/commands/run-script.js +3 -3
  885. package/build/src/environment-handlers/node/cli/commands/runner.d.ts +9 -7
  886. package/build/src/environment-handlers/node/cli/commands/runner.d.ts.map +1 -1
  887. package/build/src/environment-handlers/node/cli/commands/runner.js +3 -3
  888. package/build/src/environment-handlers/node/cli/commands/server.d.ts +24 -30
  889. package/build/src/environment-handlers/node/cli/commands/server.d.ts.map +1 -1
  890. package/build/src/environment-handlers/node/cli/commands/server.js +2 -2
  891. package/build/src/environment-handlers/node/cli/commands/test.d.ts +5 -5
  892. package/build/src/environment-handlers/node/cli/commands/test.d.ts.map +1 -1
  893. package/build/src/environment-handlers/node/source-peer-package.d.ts +5 -7
  894. package/build/src/environment-handlers/node/source-peer-package.d.ts.map +1 -1
  895. package/build/src/environment-handlers/node/source-peer-package.js +1 -1
  896. package/build/src/environment-handlers/node.d.ts +362 -13
  897. package/build/src/environment-handlers/node.d.ts.map +1 -1
  898. package/build/src/environment-handlers/node.js +37 -37
  899. package/build/src/error-logger.d.ts +3 -3
  900. package/build/src/error-logger.d.ts.map +1 -1
  901. package/build/src/error-logger.js +3 -3
  902. package/build/src/error-reporting/request-details.d.ts +1 -1
  903. package/build/src/error-reporting/request-details.d.ts.map +1 -1
  904. package/build/src/error-reporting/request-details.js +33 -33
  905. package/build/src/frontend-model-controller.d.ts +216 -230
  906. package/build/src/frontend-model-controller.d.ts.map +1 -1
  907. package/build/src/frontend-model-controller.js +217 -211
  908. package/build/src/frontend-model-resource/base-resource.d.ts +315 -365
  909. package/build/src/frontend-model-resource/base-resource.d.ts.map +1 -1
  910. package/build/src/frontend-model-resource/base-resource.js +45 -45
  911. package/build/src/frontend-model-resource/velocious-attachment-resource.d.ts +11 -5
  912. package/build/src/frontend-model-resource/velocious-attachment-resource.d.ts.map +1 -1
  913. package/build/src/frontend-model-resource/velocious-attachment-resource.js +2 -2
  914. package/build/src/frontend-models/base.d.ts +632 -726
  915. package/build/src/frontend-models/base.d.ts.map +1 -1
  916. package/build/src/frontend-models/base.js +147 -143
  917. package/build/src/frontend-models/built-in-resources.d.ts +2 -2
  918. package/build/src/frontend-models/built-in-resources.d.ts.map +1 -1
  919. package/build/src/frontend-models/clear-pending-debounced-callback.d.ts +2 -2
  920. package/build/src/frontend-models/clear-pending-debounced-callback.d.ts.map +1 -1
  921. package/build/src/frontend-models/clear-pending-debounced-callback.js +3 -3
  922. package/build/src/frontend-models/event-hook-models.d.ts +3 -6
  923. package/build/src/frontend-models/event-hook-models.d.ts.map +1 -1
  924. package/build/src/frontend-models/model-registry.d.ts +5 -5
  925. package/build/src/frontend-models/model-registry.d.ts.map +1 -1
  926. package/build/src/frontend-models/model-registry.js +5 -5
  927. package/build/src/frontend-models/outgoing-event-buffer.d.ts +20 -17
  928. package/build/src/frontend-models/outgoing-event-buffer.d.ts.map +1 -1
  929. package/build/src/frontend-models/outgoing-event-buffer.js +2 -2
  930. package/build/src/frontend-models/preloader.d.ts.map +1 -1
  931. package/build/src/frontend-models/preloader.js +2 -2
  932. package/build/src/frontend-models/query.d.ts +286 -331
  933. package/build/src/frontend-models/query.d.ts.map +1 -1
  934. package/build/src/frontend-models/query.js +61 -61
  935. package/build/src/frontend-models/resource-config-validation.d.ts +2 -2
  936. package/build/src/frontend-models/resource-config-validation.d.ts.map +1 -1
  937. package/build/src/frontend-models/resource-definition.d.ts +30 -33
  938. package/build/src/frontend-models/resource-definition.d.ts.map +1 -1
  939. package/build/src/frontend-models/resource-definition.js +10 -10
  940. package/build/src/frontend-models/transport-deadline.d.ts.map +1 -1
  941. package/build/src/frontend-models/transport-serialization.d.ts +26 -32
  942. package/build/src/frontend-models/transport-serialization.d.ts.map +1 -1
  943. package/build/src/frontend-models/transport-serialization.js +28 -28
  944. package/build/src/frontend-models/use-created-event.d.ts +4 -4
  945. package/build/src/frontend-models/use-created-event.d.ts.map +1 -1
  946. package/build/src/frontend-models/use-destroyed-event.d.ts +8 -29
  947. package/build/src/frontend-models/use-destroyed-event.d.ts.map +1 -1
  948. package/build/src/frontend-models/use-model-class-event.d.ts +9 -33
  949. package/build/src/frontend-models/use-model-class-event.d.ts.map +1 -1
  950. package/build/src/frontend-models/use-updated-event.d.ts +8 -29
  951. package/build/src/frontend-models/use-updated-event.d.ts.map +1 -1
  952. package/build/src/frontend-models/websocket-channel.d.ts +30 -34
  953. package/build/src/frontend-models/websocket-channel.d.ts.map +1 -1
  954. package/build/src/frontend-models/websocket-channel.js +5 -5
  955. package/build/src/frontend-models/websocket-publishers.d.ts +4 -4
  956. package/build/src/frontend-models/websocket-publishers.d.ts.map +1 -1
  957. package/build/src/frontend-models/websocket-publishers.js +2 -2
  958. package/build/src/http-client/header.d.ts +2 -2
  959. package/build/src/http-client/header.d.ts.map +1 -1
  960. package/build/src/http-client/index.d.ts +23 -23
  961. package/build/src/http-client/index.d.ts.map +1 -1
  962. package/build/src/http-client/request.d.ts +9 -9
  963. package/build/src/http-client/request.d.ts.map +1 -1
  964. package/build/src/http-client/request.js +2 -2
  965. package/build/src/http-client/response.d.ts +12 -12
  966. package/build/src/http-client/response.d.ts.map +1 -1
  967. package/build/src/http-client/response.js +2 -2
  968. package/build/src/http-client/websocket-client.d.ts +20 -4
  969. package/build/src/http-client/websocket-client.d.ts.map +1 -1
  970. package/build/src/http-server/client/index.d.ts +26 -26
  971. package/build/src/http-server/client/index.d.ts.map +1 -1
  972. package/build/src/http-server/client/index.js +5 -5
  973. package/build/src/http-server/client/params-to-object.d.ts +11 -11
  974. package/build/src/http-server/client/params-to-object.d.ts.map +1 -1
  975. package/build/src/http-server/client/params-to-object.js +17 -17
  976. package/build/src/http-server/client/request-buffer/form-data-part.d.ts +9 -9
  977. package/build/src/http-server/client/request-buffer/form-data-part.d.ts.map +1 -1
  978. package/build/src/http-server/client/request-buffer/header.d.ts +3 -3
  979. package/build/src/http-server/client/request-buffer/header.d.ts.map +1 -1
  980. package/build/src/http-server/client/request-buffer/index.d.ts +28 -30
  981. package/build/src/http-server/client/request-buffer/index.d.ts.map +1 -1
  982. package/build/src/http-server/client/request-buffer/index.js +5 -3
  983. package/build/src/http-server/client/request-parser.d.ts +11 -11
  984. package/build/src/http-server/client/request-parser.d.ts.map +1 -1
  985. package/build/src/http-server/client/request-parser.js +3 -3
  986. package/build/src/http-server/client/request-runner.d.ts +11 -11
  987. package/build/src/http-server/client/request-runner.d.ts.map +1 -1
  988. package/build/src/http-server/client/request-runner.js +3 -3
  989. package/build/src/http-server/client/request-timing.d.ts +5 -11
  990. package/build/src/http-server/client/request-timing.d.ts.map +1 -1
  991. package/build/src/http-server/client/request.d.ts +10 -10
  992. package/build/src/http-server/client/request.d.ts.map +1 -1
  993. package/build/src/http-server/client/request.js +3 -3
  994. package/build/src/http-server/client/response-compression.d.ts +5 -5
  995. package/build/src/http-server/client/response-compression.d.ts.map +1 -1
  996. package/build/src/http-server/client/response.d.ts +13 -13
  997. package/build/src/http-server/client/response.d.ts.map +1 -1
  998. package/build/src/http-server/client/uploaded-file/memory-uploaded-file.d.ts +8 -2
  999. package/build/src/http-server/client/uploaded-file/memory-uploaded-file.d.ts.map +1 -1
  1000. package/build/src/http-server/client/uploaded-file/temporary-uploaded-file.d.ts +8 -2
  1001. package/build/src/http-server/client/uploaded-file/temporary-uploaded-file.d.ts.map +1 -1
  1002. package/build/src/http-server/client/uploaded-file/uploaded-file.d.ts +4 -4
  1003. package/build/src/http-server/client/uploaded-file/uploaded-file.d.ts.map +1 -1
  1004. package/build/src/http-server/client/websocket-request.d.ts +26 -26
  1005. package/build/src/http-server/client/websocket-request.d.ts.map +1 -1
  1006. package/build/src/http-server/client/websocket-request.js +7 -7
  1007. package/build/src/http-server/client/websocket-session.d.ts +105 -108
  1008. package/build/src/http-server/client/websocket-session.d.ts.map +1 -1
  1009. package/build/src/http-server/client/websocket-session.js +29 -29
  1010. package/build/src/http-server/client-delivery-queue.d.ts +30 -30
  1011. package/build/src/http-server/client-delivery-queue.d.ts.map +1 -1
  1012. package/build/src/http-server/cookie.d.ts +80 -108
  1013. package/build/src/http-server/cookie.d.ts.map +1 -1
  1014. package/build/src/http-server/cookie.js +3 -3
  1015. package/build/src/http-server/development-reloader.d.ts +24 -24
  1016. package/build/src/http-server/development-reloader.d.ts.map +1 -1
  1017. package/build/src/http-server/development-reloader.js +2 -2
  1018. package/build/src/http-server/index.d.ts +66 -72
  1019. package/build/src/http-server/index.d.ts.map +1 -1
  1020. package/build/src/http-server/index.js +6 -6
  1021. package/build/src/http-server/remote-address.d.ts.map +1 -1
  1022. package/build/src/http-server/remote-address.js +2 -2
  1023. package/build/src/http-server/server-client.d.ts +9 -9
  1024. package/build/src/http-server/server-client.d.ts.map +1 -1
  1025. package/build/src/http-server/server-lock.d.ts +11 -11
  1026. package/build/src/http-server/server-lock.d.ts.map +1 -1
  1027. package/build/src/http-server/server-lock.js +5 -5
  1028. package/build/src/http-server/websocket-channel-subscribers.d.ts +11 -10
  1029. package/build/src/http-server/websocket-channel-subscribers.d.ts.map +1 -1
  1030. package/build/src/http-server/websocket-channel-subscribers.js +6 -6
  1031. package/build/src/http-server/websocket-channel.d.ts +8 -14
  1032. package/build/src/http-server/websocket-channel.d.ts.map +1 -1
  1033. package/build/src/http-server/websocket-channel.js +2 -2
  1034. package/build/src/http-server/websocket-connection.d.ts +10 -10
  1035. package/build/src/http-server/websocket-connection.d.ts.map +1 -1
  1036. package/build/src/http-server/websocket-connection.js +4 -4
  1037. package/build/src/http-server/websocket-event-log-store.d.ts +58 -64
  1038. package/build/src/http-server/websocket-event-log-store.d.ts.map +1 -1
  1039. package/build/src/http-server/websocket-event-log-store.js +10 -10
  1040. package/build/src/http-server/websocket-events-host.d.ts +17 -16
  1041. package/build/src/http-server/websocket-events-host.d.ts.map +1 -1
  1042. package/build/src/http-server/websocket-events-host.js +8 -8
  1043. package/build/src/http-server/websocket-events.d.ts +9 -9
  1044. package/build/src/http-server/websocket-events.d.ts.map +1 -1
  1045. package/build/src/http-server/websocket-events.js +5 -5
  1046. package/build/src/http-server/worker-handler/channel-subscriber-dispatch.d.ts +2 -2
  1047. package/build/src/http-server/worker-handler/channel-subscriber-dispatch.d.ts.map +1 -1
  1048. package/build/src/http-server/worker-handler/channel-subscriber-dispatch.js +2 -2
  1049. package/build/src/http-server/worker-handler/in-process.d.ts +22 -22
  1050. package/build/src/http-server/worker-handler/in-process.d.ts.map +1 -1
  1051. package/build/src/http-server/worker-handler/in-process.js +6 -6
  1052. package/build/src/http-server/worker-handler/index.d.ts +50 -50
  1053. package/build/src/http-server/worker-handler/index.d.ts.map +1 -1
  1054. package/build/src/http-server/worker-handler/index.js +11 -11
  1055. package/build/src/http-server/worker-handler/worker-thread.d.ts +61 -61
  1056. package/build/src/http-server/worker-handler/worker-thread.d.ts.map +1 -1
  1057. package/build/src/http-server/worker-handler/worker-thread.js +9 -9
  1058. package/build/src/initializer.d.ts +2 -2
  1059. package/build/src/initializer.d.ts.map +1 -1
  1060. package/build/src/jobs/mail-delivery.d.ts +7 -2
  1061. package/build/src/jobs/mail-delivery.d.ts.map +1 -1
  1062. package/build/src/jobs/prune-terminal-background-jobs.d.ts +15 -2
  1063. package/build/src/jobs/prune-terminal-background-jobs.d.ts.map +1 -1
  1064. package/build/src/jobs/prune-terminal-background-jobs.js +1 -1
  1065. package/build/src/logger/base-logger.d.ts.map +1 -1
  1066. package/build/src/logger/base-logger.js +2 -2
  1067. package/build/src/logger/console-logger.d.ts +3 -3
  1068. package/build/src/logger/console-logger.d.ts.map +1 -1
  1069. package/build/src/logger/file-logger.d.ts +4 -4
  1070. package/build/src/logger/file-logger.d.ts.map +1 -1
  1071. package/build/src/logger/outputs/array-output.d.ts +9 -12
  1072. package/build/src/logger/outputs/array-output.d.ts.map +1 -1
  1073. package/build/src/logger/outputs/console-output.d.ts +1 -4
  1074. package/build/src/logger/outputs/console-output.d.ts.map +1 -1
  1075. package/build/src/logger/outputs/file-output.d.ts +13 -16
  1076. package/build/src/logger/outputs/file-output.d.ts.map +1 -1
  1077. package/build/src/logger/outputs/stdout-output.d.ts +1 -4
  1078. package/build/src/logger/outputs/stdout-output.d.ts.map +1 -1
  1079. package/build/src/logger.d.ts +30 -29
  1080. package/build/src/logger.d.ts.map +1 -1
  1081. package/build/src/logger.js +13 -13
  1082. package/build/src/mailer/backends/smtp.d.ts +8 -11
  1083. package/build/src/mailer/backends/smtp.d.ts.map +1 -1
  1084. package/build/src/mailer/backends/smtp.js +4 -4
  1085. package/build/src/mailer/base.d.ts +61 -61
  1086. package/build/src/mailer/base.d.ts.map +1 -1
  1087. package/build/src/mailer/base.js +15 -15
  1088. package/build/src/mailer/delivery.d.ts +16 -16
  1089. package/build/src/mailer/delivery.d.ts.map +1 -1
  1090. package/build/src/mailer/delivery.js +4 -4
  1091. package/build/src/mailer/index.d.ts +8 -13
  1092. package/build/src/mailer/index.d.ts.map +1 -1
  1093. package/build/src/mailer/index.js +2 -2
  1094. package/build/src/mailer.d.ts +9 -7
  1095. package/build/src/mailer.d.ts.map +1 -1
  1096. package/build/src/mailer.js +2 -2
  1097. package/build/src/packages/velocious-package.d.ts +5 -5
  1098. package/build/src/packages/velocious-package.d.ts.map +1 -1
  1099. package/build/src/plugins/sqljs-wasm-route-controller.d.ts +1 -1
  1100. package/build/src/plugins/sqljs-wasm-route-controller.d.ts.map +1 -1
  1101. package/build/src/plugins/sqljs-wasm-route-controller.js +2 -2
  1102. package/build/src/plugins/sqljs-wasm-route.d.ts +14 -20
  1103. package/build/src/plugins/sqljs-wasm-route.d.ts.map +1 -1
  1104. package/build/src/plugins/sqljs-wasm-route.js +1 -1
  1105. package/build/src/record-payload-values.d.ts +14 -14
  1106. package/build/src/record-payload-values.d.ts.map +1 -1
  1107. package/build/src/record-payload-values.js +4 -4
  1108. package/build/src/routes/app-routes.d.ts.map +1 -1
  1109. package/build/src/routes/base-route.d.ts +11 -10
  1110. package/build/src/routes/base-route.d.ts.map +1 -1
  1111. package/build/src/routes/base-route.js +6 -6
  1112. package/build/src/routes/basic-route.d.ts +36 -3
  1113. package/build/src/routes/basic-route.d.ts.map +1 -1
  1114. package/build/src/routes/basic-route.js +5 -5
  1115. package/build/src/routes/built-in/api-manifest/controller.d.ts +1 -1
  1116. package/build/src/routes/built-in/api-manifest/controller.d.ts.map +1 -1
  1117. package/build/src/routes/built-in/debug/controller.d.ts +1 -1
  1118. package/build/src/routes/built-in/debug/controller.d.ts.map +1 -1
  1119. package/build/src/routes/built-in/errors/controller.d.ts +1 -1
  1120. package/build/src/routes/built-in/errors/controller.d.ts.map +1 -1
  1121. package/build/src/routes/get-route.d.ts +19 -4
  1122. package/build/src/routes/get-route.d.ts.map +1 -1
  1123. package/build/src/routes/get-route.js +3 -3
  1124. package/build/src/routes/hooks/frontend-model-command-route-hook.d.ts +1 -1
  1125. package/build/src/routes/hooks/frontend-model-command-route-hook.d.ts.map +1 -1
  1126. package/build/src/routes/hooks/frontend-model-command-route-hook.js +2 -2
  1127. package/build/src/routes/index.d.ts +5 -5
  1128. package/build/src/routes/index.d.ts.map +1 -1
  1129. package/build/src/routes/index.js +4 -4
  1130. package/build/src/routes/namespace-route.d.ts +19 -4
  1131. package/build/src/routes/namespace-route.d.ts.map +1 -1
  1132. package/build/src/routes/namespace-route.js +2 -2
  1133. package/build/src/routes/plugin-routes.d.ts +16 -19
  1134. package/build/src/routes/plugin-routes.d.ts.map +1 -1
  1135. package/build/src/routes/plugin-routes.js +2 -2
  1136. package/build/src/routes/post-route.d.ts +19 -4
  1137. package/build/src/routes/post-route.d.ts.map +1 -1
  1138. package/build/src/routes/post-route.js +3 -3
  1139. package/build/src/routes/resolver.d.ts +16 -16
  1140. package/build/src/routes/resolver.d.ts.map +1 -1
  1141. package/build/src/routes/resolver.js +6 -6
  1142. package/build/src/routes/resource-route.d.ts +23 -8
  1143. package/build/src/routes/resource-route.d.ts.map +1 -1
  1144. package/build/src/routes/resource-route.js +2 -2
  1145. package/build/src/routes/root-route.d.ts +1 -1
  1146. package/build/src/routes/root-route.d.ts.map +1 -1
  1147. package/build/src/sync/conflict-strategy.d.ts +50 -35
  1148. package/build/src/sync/conflict-strategy.d.ts.map +1 -1
  1149. package/build/src/sync/conflict-strategy.js +2 -2
  1150. package/build/src/sync/device-identity.d.ts +109 -79
  1151. package/build/src/sync/device-identity.d.ts.map +1 -1
  1152. package/build/src/sync/local-mutation-log.d.ts +115 -92
  1153. package/build/src/sync/local-mutation-log.d.ts.map +1 -1
  1154. package/build/src/sync/offline-grant.d.ts +80 -63
  1155. package/build/src/sync/offline-grant.d.ts.map +1 -1
  1156. package/build/src/sync/peer-mutation-bundle.d.ts +33 -39
  1157. package/build/src/sync/peer-mutation-bundle.d.ts.map +1 -1
  1158. package/build/src/sync/query-scope.d.ts +3 -3
  1159. package/build/src/sync/query-scope.d.ts.map +1 -1
  1160. package/build/src/sync/query-scope.js +8 -8
  1161. package/build/src/sync/server-change-feed.d.ts +129 -129
  1162. package/build/src/sync/server-change-feed.d.ts.map +1 -1
  1163. package/build/src/sync/server-change-feed.js +14 -14
  1164. package/build/src/sync/server-sequence-allocator.d.ts +36 -36
  1165. package/build/src/sync/server-sequence-allocator.d.ts.map +1 -1
  1166. package/build/src/sync/server-sequence-allocator.js +6 -6
  1167. package/build/src/sync/signed-sync-envelope-replay-service.d.ts +60 -48
  1168. package/build/src/sync/signed-sync-envelope-replay-service.d.ts.map +1 -1
  1169. package/build/src/sync/signed-sync-envelope-replay-service.js +21 -21
  1170. package/build/src/sync/stable-json.d.ts +2 -2
  1171. package/build/src/sync/stable-json.d.ts.map +1 -1
  1172. package/build/src/sync/stable-json.js +5 -5
  1173. package/build/src/sync/sync-api-client-types.d.ts +98 -25
  1174. package/build/src/sync/sync-api-client-types.d.ts.map +1 -1
  1175. package/build/src/sync/sync-api-client-types.js +73 -1
  1176. package/build/src/sync/sync-api-client.d.ts +71 -71
  1177. package/build/src/sync/sync-api-client.d.ts.map +1 -1
  1178. package/build/src/sync/sync-api-client.js +30 -30
  1179. package/build/src/sync/sync-api-controller.d.ts +23 -23
  1180. package/build/src/sync/sync-api-controller.d.ts.map +1 -1
  1181. package/build/src/sync/sync-change-fanout.d.ts +32 -38
  1182. package/build/src/sync/sync-change-fanout.d.ts.map +1 -1
  1183. package/build/src/sync/sync-change-fanout.js +7 -7
  1184. package/build/src/sync/sync-channel-name.d.ts +1 -1
  1185. package/build/src/sync/sync-channel-name.d.ts.map +1 -1
  1186. package/build/src/sync/sync-client-registry.d.ts +4 -4
  1187. package/build/src/sync/sync-client-registry.d.ts.map +1 -1
  1188. package/build/src/sync/sync-client-registry.js +4 -4
  1189. package/build/src/sync/sync-client-types.d.ts +130 -82
  1190. package/build/src/sync/sync-client-types.d.ts.map +1 -1
  1191. package/build/src/sync/sync-client-types.js +89 -1
  1192. package/build/src/sync/sync-client.d.ts +76 -76
  1193. package/build/src/sync/sync-client.d.ts.map +1 -1
  1194. package/build/src/sync/sync-client.js +19 -19
  1195. package/build/src/sync/sync-envelope-replay-service.d.ts +266 -298
  1196. package/build/src/sync/sync-envelope-replay-service.d.ts.map +1 -1
  1197. package/build/src/sync/sync-envelope-replay-service.js +77 -77
  1198. package/build/src/sync/sync-model-change-feed-service.d.ts +23 -23
  1199. package/build/src/sync/sync-model-change-feed-service.d.ts.map +1 -1
  1200. package/build/src/sync/sync-model-change-feed-service.js +8 -8
  1201. package/build/src/sync/sync-publish-suppression.d.ts +5 -5
  1202. package/build/src/sync/sync-publish-suppression.d.ts.map +1 -1
  1203. package/build/src/sync/sync-publish-suppression.js +3 -3
  1204. package/build/src/sync/sync-publisher-types.d.ts +98 -55
  1205. package/build/src/sync/sync-publisher-types.d.ts.map +1 -1
  1206. package/build/src/sync/sync-publisher-types.js +75 -1
  1207. package/build/src/sync/sync-publisher.d.ts +43 -43
  1208. package/build/src/sync/sync-publisher.d.ts.map +1 -1
  1209. package/build/src/sync/sync-publisher.js +20 -20
  1210. package/build/src/sync/sync-realtime-bridge.d.ts +23 -23
  1211. package/build/src/sync/sync-realtime-bridge.d.ts.map +1 -1
  1212. package/build/src/sync/sync-realtime-bridge.js +9 -9
  1213. package/build/src/sync/sync-replay-upsert-applier.d.ts +70 -70
  1214. package/build/src/sync/sync-replay-upsert-applier.d.ts.map +1 -1
  1215. package/build/src/sync/sync-replay-upsert-applier.js +17 -17
  1216. package/build/src/sync/sync-resource-base.d.ts +52 -51
  1217. package/build/src/sync/sync-resource-base.d.ts.map +1 -1
  1218. package/build/src/sync/sync-resource-base.js +15 -15
  1219. package/build/src/sync/sync-scope-attributes.d.ts +2 -2
  1220. package/build/src/sync/sync-scope-attributes.d.ts.map +1 -1
  1221. package/build/src/sync/sync-scope-attributes.js +2 -2
  1222. package/build/src/sync/sync-scope-store.d.ts +36 -36
  1223. package/build/src/sync/sync-scope-store.d.ts.map +1 -1
  1224. package/build/src/sync/sync-scope-store.js +6 -6
  1225. package/build/src/sync/sync-websocket-channel.d.ts +11 -6
  1226. package/build/src/sync/sync-websocket-channel.d.ts.map +1 -1
  1227. package/build/src/sync/sync-websocket-channel.js +6 -6
  1228. package/build/src/tenants/default-tenant-database-provisioning.d.ts +4 -4
  1229. package/build/src/tenants/default-tenant-database-provisioning.d.ts.map +1 -1
  1230. package/build/src/tenants/default-tenant-database-provisioning.js +2 -2
  1231. package/build/src/tenants/tenant-aggregator.d.ts +81 -81
  1232. package/build/src/tenants/tenant-aggregator.d.ts.map +1 -1
  1233. package/build/src/tenants/tenant-aggregator.js +13 -13
  1234. package/build/src/tenants/tenant-handle.d.ts +64 -0
  1235. package/build/src/tenants/tenant-handle.d.ts.map +1 -0
  1236. package/build/src/tenants/tenant-handle.js +221 -0
  1237. package/build/src/tenants/tenant-iterator.d.ts +17 -17
  1238. package/build/src/tenants/tenant-iterator.d.ts.map +1 -1
  1239. package/build/src/tenants/tenant-iterator.js +7 -7
  1240. package/build/src/tenants/tenant-model-scope.d.ts +73 -0
  1241. package/build/src/tenants/tenant-model-scope.d.ts.map +1 -0
  1242. package/build/src/tenants/tenant-model-scope.js +115 -0
  1243. package/build/src/tenants/tenant.d.ts +16 -6
  1244. package/build/src/tenants/tenant.d.ts.map +1 -1
  1245. package/build/src/tenants/tenant.js +15 -3
  1246. package/build/src/testing/base-expect.d.ts.map +1 -1
  1247. package/build/src/testing/browser-frontend-model-event-hook-scenarios.d.ts +19 -31
  1248. package/build/src/testing/browser-frontend-model-event-hook-scenarios.d.ts.map +1 -1
  1249. package/build/src/testing/browser-test-app.js +6 -6
  1250. package/build/src/testing/expect-to-change.d.ts +9 -7
  1251. package/build/src/testing/expect-to-change.d.ts.map +1 -1
  1252. package/build/src/testing/expect-to-change.js +2 -2
  1253. package/build/src/testing/expect-utils.d.ts +30 -29
  1254. package/build/src/testing/expect-utils.d.ts.map +1 -1
  1255. package/build/src/testing/expect-utils.js +30 -30
  1256. package/build/src/testing/expect.d.ts +30 -30
  1257. package/build/src/testing/expect.d.ts.map +1 -1
  1258. package/build/src/testing/expect.js +19 -19
  1259. package/build/src/testing/factory/association-declaration.d.ts +16 -16
  1260. package/build/src/testing/factory/association-declaration.d.ts.map +1 -1
  1261. package/build/src/testing/factory/association-declaration.js +3 -3
  1262. package/build/src/testing/factory/declarations.d.ts +90 -115
  1263. package/build/src/testing/factory/declarations.d.ts.map +1 -1
  1264. package/build/src/testing/factory/declarations.js +6 -6
  1265. package/build/src/testing/factory/definition-builder.d.ts +72 -70
  1266. package/build/src/testing/factory/definition-builder.d.ts.map +1 -1
  1267. package/build/src/testing/factory/definition-builder.js +40 -40
  1268. package/build/src/testing/factory/errors.d.ts +30 -29
  1269. package/build/src/testing/factory/errors.d.ts.map +1 -1
  1270. package/build/src/testing/factory/evaluation-context.d.ts +29 -29
  1271. package/build/src/testing/factory/evaluation-context.d.ts.map +1 -1
  1272. package/build/src/testing/factory/evaluation-context.js +17 -17
  1273. package/build/src/testing/factory/events.d.ts +4 -5
  1274. package/build/src/testing/factory/events.d.ts.map +1 -1
  1275. package/build/src/testing/factory/factory-definition.d.ts +14 -14
  1276. package/build/src/testing/factory/factory-definition.d.ts.map +1 -1
  1277. package/build/src/testing/factory/factory-definition.js +3 -3
  1278. package/build/src/testing/factory/factory-registry.d.ts +56 -54
  1279. package/build/src/testing/factory/factory-registry.d.ts.map +1 -1
  1280. package/build/src/testing/factory/factory-registry.js +35 -35
  1281. package/build/src/testing/factory/factory-runner.d.ts +67 -73
  1282. package/build/src/testing/factory/factory-runner.d.ts.map +1 -1
  1283. package/build/src/testing/factory/factory-runner.js +9 -9
  1284. package/build/src/testing/factory/index.d.ts +7 -7
  1285. package/build/src/testing/factory/index.d.ts.map +1 -1
  1286. package/build/src/testing/factory/linter.d.ts +7 -7
  1287. package/build/src/testing/factory/linter.d.ts.map +1 -1
  1288. package/build/src/testing/factory/linter.js +3 -3
  1289. package/build/src/testing/factory/model-contract.d.ts +3 -3
  1290. package/build/src/testing/factory/model-contract.d.ts.map +1 -1
  1291. package/build/src/testing/factory/model-contract.js +4 -4
  1292. package/build/src/testing/factory/node/load-definitions.d.ts +2 -2
  1293. package/build/src/testing/factory/node/load-definitions.d.ts.map +1 -1
  1294. package/build/src/testing/factory/sequence.d.ts +19 -23
  1295. package/build/src/testing/factory/sequence.d.ts.map +1 -1
  1296. package/build/src/testing/factory/sequence.js +3 -3
  1297. package/build/src/testing/factory/strategies/attributes-for.d.ts +3 -3
  1298. package/build/src/testing/factory/strategies/attributes-for.d.ts.map +1 -1
  1299. package/build/src/testing/factory/strategies/attributes-for.js +2 -2
  1300. package/build/src/testing/factory/strategies/base.d.ts +32 -32
  1301. package/build/src/testing/factory/strategies/base.d.ts.map +1 -1
  1302. package/build/src/testing/factory/strategies/base.js +25 -25
  1303. package/build/src/testing/factory/strategies/build.d.ts +3 -3
  1304. package/build/src/testing/factory/strategies/build.d.ts.map +1 -1
  1305. package/build/src/testing/factory/strategies/build.js +3 -3
  1306. package/build/src/testing/factory/strategies/create.d.ts +6 -6
  1307. package/build/src/testing/factory/strategies/create.d.ts.map +1 -1
  1308. package/build/src/testing/factory/strategies/create.js +5 -5
  1309. package/build/src/testing/factory/trait-definition.d.ts +4 -4
  1310. package/build/src/testing/factory/trait-definition.d.ts.map +1 -1
  1311. package/build/src/testing/request-client.d.ts +19 -19
  1312. package/build/src/testing/request-client.d.ts.map +1 -1
  1313. package/build/src/testing/test-files-finder.d.ts +15 -15
  1314. package/build/src/testing/test-files-finder.d.ts.map +1 -1
  1315. package/build/src/testing/test-files-finder.js +2 -2
  1316. package/build/src/testing/test-filter-parser.d.ts +19 -12
  1317. package/build/src/testing/test-filter-parser.d.ts.map +1 -1
  1318. package/build/src/testing/test-runner.d.ts +204 -251
  1319. package/build/src/testing/test-runner.d.ts.map +1 -1
  1320. package/build/src/testing/test-runner.js +15 -15
  1321. package/build/src/testing/test-suite-splitter.d.ts +25 -31
  1322. package/build/src/testing/test-suite-splitter.d.ts.map +1 -1
  1323. package/build/src/testing/test.d.ts +51 -55
  1324. package/build/src/testing/test.d.ts.map +1 -1
  1325. package/build/src/testing/test.js +20 -18
  1326. package/build/src/testing/wait-for-event.d.ts +25 -25
  1327. package/build/src/testing/wait-for-event.d.ts.map +1 -1
  1328. package/build/src/testing/wait-for-event.js +6 -6
  1329. package/build/src/time-zone.d.ts +3 -3
  1330. package/build/src/time-zone.d.ts.map +1 -1
  1331. package/build/src/utils/backtrace-cleaner-node.d.ts +35 -2
  1332. package/build/src/utils/backtrace-cleaner-node.d.ts.map +1 -1
  1333. package/build/src/utils/backtrace-cleaner-node.js +1 -1
  1334. package/build/src/utils/backtrace-cleaner.d.ts +33 -28
  1335. package/build/src/utils/backtrace-cleaner.d.ts.map +1 -1
  1336. package/build/src/utils/bearer-token.d.ts +2 -2
  1337. package/build/src/utils/bearer-token.d.ts.map +1 -1
  1338. package/build/src/utils/deburr-column-name.d.ts.map +1 -1
  1339. package/build/src/utils/event-emitter.d.ts +1 -1
  1340. package/build/src/utils/event-emitter.d.ts.map +1 -1
  1341. package/build/src/utils/event-emitter.js +2 -2
  1342. package/build/src/utils/file-exists.d.ts.map +1 -1
  1343. package/build/src/utils/format-value.d.ts +9 -8
  1344. package/build/src/utils/format-value.d.ts.map +1 -1
  1345. package/build/src/utils/format-value.js +7 -7
  1346. package/build/src/utils/is-date.d.ts +2 -2
  1347. package/build/src/utils/is-date.d.ts.map +1 -1
  1348. package/build/src/utils/is-date.js +2 -2
  1349. package/build/src/utils/model-scope.d.ts +29 -24
  1350. package/build/src/utils/model-scope.d.ts.map +1 -1
  1351. package/build/src/utils/model-scope.js +11 -11
  1352. package/build/src/utils/mount-prefix.d.ts +2 -2
  1353. package/build/src/utils/mount-prefix.d.ts.map +1 -1
  1354. package/build/src/utils/nest-callbacks.d.ts.map +1 -1
  1355. package/build/src/utils/plain-object.d.ts +3 -3
  1356. package/build/src/utils/plain-object.d.ts.map +1 -1
  1357. package/build/src/utils/plain-object.js +3 -3
  1358. package/build/src/utils/ransack.d.ts +69 -90
  1359. package/build/src/utils/ransack.d.ts.map +1 -1
  1360. package/build/src/utils/ransack.js +36 -36
  1361. package/build/src/utils/rest-args-error.d.ts.map +1 -1
  1362. package/build/src/utils/sha256-hex.d.ts.map +1 -1
  1363. package/build/src/utils/shutdown-lifecycle.d.ts +1 -1
  1364. package/build/src/utils/shutdown-lifecycle.d.ts.map +1 -1
  1365. package/build/src/utils/singularize-model-name.d.ts.map +1 -1
  1366. package/build/src/utils/split-sql-statements.d.ts.map +1 -1
  1367. package/build/src/utils/to-import-specifier.d.ts.map +1 -1
  1368. package/build/src/utils/with-tracked-stack-async-hooks.d.ts +6 -5
  1369. package/build/src/utils/with-tracked-stack-async-hooks.d.ts.map +1 -1
  1370. package/build/src/utils/with-tracked-stack-async-hooks.js +9 -9
  1371. package/build/src/utils/with-tracked-stack.d.ts +6 -5
  1372. package/build/src/utils/with-tracked-stack.d.ts.map +1 -1
  1373. package/build/src/utils/with-tracked-stack.js +7 -7
  1374. package/build/src/velocious-error.d.ts +27 -17
  1375. package/build/src/velocious-error.d.ts.map +1 -1
  1376. package/build/src/velocious-error.js +10 -4
  1377. package/build/sync/conflict-strategy.js +1 -1
  1378. package/build/sync/query-scope.js +7 -7
  1379. package/build/sync/server-change-feed.js +13 -13
  1380. package/build/sync/server-sequence-allocator.js +5 -5
  1381. package/build/sync/signed-sync-envelope-replay-service.js +20 -20
  1382. package/build/sync/stable-json.js +4 -4
  1383. package/build/sync/sync-api-client-types.js +7 -7
  1384. package/build/sync/sync-api-client.js +26 -26
  1385. package/build/sync/sync-change-fanout.js +6 -6
  1386. package/build/sync/sync-client-registry.js +3 -3
  1387. package/build/sync/sync-client-types.js +10 -10
  1388. package/build/sync/sync-client.js +18 -18
  1389. package/build/sync/sync-envelope-replay-service.js +76 -76
  1390. package/build/sync/sync-model-change-feed-service.js +7 -7
  1391. package/build/sync/sync-publish-suppression.js +2 -2
  1392. package/build/sync/sync-publisher-types.js +11 -11
  1393. package/build/sync/sync-publisher.js +19 -19
  1394. package/build/sync/sync-realtime-bridge.js +8 -8
  1395. package/build/sync/sync-replay-upsert-applier.js +16 -16
  1396. package/build/sync/sync-resource-base.js +14 -14
  1397. package/build/sync/sync-scope-attributes.js +1 -1
  1398. package/build/sync/sync-scope-store.js +5 -5
  1399. package/build/sync/sync-websocket-channel.js +5 -5
  1400. package/build/tenants/default-tenant-database-provisioning.js +1 -1
  1401. package/build/tenants/tenant-aggregator.js +13 -13
  1402. package/build/tenants/tenant-handle.js +252 -0
  1403. package/build/tenants/tenant-iterator.js +6 -6
  1404. package/build/tenants/tenant-model-scope.js +132 -0
  1405. package/build/tenants/tenant.js +15 -2
  1406. package/build/testing/browser-test-app.js +2 -2
  1407. package/build/testing/expect-to-change.js +1 -1
  1408. package/build/testing/expect-utils.js +29 -29
  1409. package/build/testing/expect.js +18 -18
  1410. package/build/testing/factory/association-declaration.js +2 -2
  1411. package/build/testing/factory/declarations.js +5 -5
  1412. package/build/testing/factory/definition-builder.js +39 -39
  1413. package/build/testing/factory/evaluation-context.js +16 -16
  1414. package/build/testing/factory/factory-definition.js +2 -2
  1415. package/build/testing/factory/factory-registry.js +34 -34
  1416. package/build/testing/factory/factory-runner.js +8 -8
  1417. package/build/testing/factory/linter.js +2 -2
  1418. package/build/testing/factory/model-contract.js +3 -3
  1419. package/build/testing/factory/sequence.js +2 -2
  1420. package/build/testing/factory/strategies/attributes-for.js +1 -1
  1421. package/build/testing/factory/strategies/base.js +24 -24
  1422. package/build/testing/factory/strategies/build.js +2 -2
  1423. package/build/testing/factory/strategies/create.js +4 -4
  1424. package/build/testing/test-files-finder.js +1 -1
  1425. package/build/testing/test-runner.js +14 -14
  1426. package/build/testing/test.js +19 -17
  1427. package/build/testing/wait-for-event.js +5 -5
  1428. package/build/tsconfig.tsbuildinfo +1 -1
  1429. package/build/utils/event-emitter.js +1 -1
  1430. package/build/utils/format-value.js +6 -6
  1431. package/build/utils/is-date.js +1 -1
  1432. package/build/utils/model-scope.js +10 -10
  1433. package/build/utils/plain-object.js +2 -2
  1434. package/build/utils/ransack.js +35 -35
  1435. package/build/utils/with-tracked-stack-async-hooks.js +8 -8
  1436. package/build/utils/with-tracked-stack.js +6 -6
  1437. package/build/velocious-error.js +9 -3
  1438. package/package.json +3 -3
  1439. package/src/application.js +3 -3
  1440. package/src/authorization/ability.js +6 -6
  1441. package/src/authorization/base-resource.js +1 -1
  1442. package/src/background-jobs/client.js +2 -2
  1443. package/src/background-jobs/forked-runner-child.js +4 -4
  1444. package/src/background-jobs/job-runner.js +2 -2
  1445. package/src/background-jobs/job.js +6 -6
  1446. package/src/background-jobs/json-socket.js +1 -1
  1447. package/src/background-jobs/main.js +13 -13
  1448. package/src/background-jobs/normalize-error.js +2 -2
  1449. package/src/background-jobs/pooled-runner-child.js +3 -3
  1450. package/src/background-jobs/scheduler.js +1 -1
  1451. package/src/background-jobs/status-reporter.js +2 -2
  1452. package/src/background-jobs/store.js +23 -23
  1453. package/src/background-jobs/types.js +6 -6
  1454. package/src/background-jobs/web/controller.js +6 -6
  1455. package/src/background-jobs/web/counts-channel.js +1 -1
  1456. package/src/background-jobs/worker.js +8 -8
  1457. package/src/beacon/client.js +3 -3
  1458. package/src/beacon/in-process-client.js +3 -3
  1459. package/src/beacon/types.js +1 -1
  1460. package/src/cli/base-command.js +1 -1
  1461. package/src/cli/commands/console.js +1 -1
  1462. package/src/cli/commands/db/schema/dump.js +1 -1
  1463. package/src/cli/commands/db/schema/load.js +1 -1
  1464. package/src/cli/commands/db/seed.js +1 -1
  1465. package/src/cli/commands/generate/frontend-models.js +1 -1
  1466. package/src/cli/commands/lint/relationships.js +1 -1
  1467. package/src/cli/commands/run-script.js +1 -1
  1468. package/src/cli/commands/runner.js +1 -1
  1469. package/src/cli/index.js +2 -2
  1470. package/src/cli/tenant-database-command-helper.js +2 -2
  1471. package/src/configuration-types.js +48 -47
  1472. package/src/configuration.js +150 -65
  1473. package/src/controller.js +11 -8
  1474. package/src/current.js +2 -2
  1475. package/src/database/annotations-async-hooks.js +3 -3
  1476. package/src/database/annotations.js +1 -1
  1477. package/src/database/drivers/base-column.js +1 -1
  1478. package/src/database/drivers/base-foreign-key.js +1 -1
  1479. package/src/database/drivers/base-table.js +1 -1
  1480. package/src/database/drivers/base.js +18 -18
  1481. package/src/database/drivers/mssql/column.js +1 -1
  1482. package/src/database/drivers/mssql/index.js +2 -2
  1483. package/src/database/drivers/mssql/options.js +1 -1
  1484. package/src/database/drivers/mssql/structure-sql.js +1 -1
  1485. package/src/database/drivers/mssql/table.js +1 -1
  1486. package/src/database/drivers/mysql/column.js +1 -1
  1487. package/src/database/drivers/mysql/index.js +4 -4
  1488. package/src/database/drivers/mysql/options.js +1 -1
  1489. package/src/database/drivers/mysql/query.js +7 -7
  1490. package/src/database/drivers/mysql/structure-sql.js +71 -10
  1491. package/src/database/drivers/pgsql/column.js +1 -1
  1492. package/src/database/drivers/pgsql/index.js +6 -6
  1493. package/src/database/drivers/pgsql/structure-sql.js +1 -1
  1494. package/src/database/drivers/sqlite/base.js +7 -7
  1495. package/src/database/drivers/sqlite/column.js +1 -1
  1496. package/src/database/drivers/sqlite/connection-sql-js.js +1 -1
  1497. package/src/database/drivers/sqlite/foreign-key.js +1 -1
  1498. package/src/database/drivers/sqlite/index.js +1 -1
  1499. package/src/database/drivers/sqlite/index.native.js +2 -2
  1500. package/src/database/drivers/sqlite/index.web.js +2 -2
  1501. package/src/database/drivers/sqlite/query.js +2 -2
  1502. package/src/database/drivers/sqlite/query.native.js +2 -2
  1503. package/src/database/drivers/sqlite/query.web.js +2 -2
  1504. package/src/database/drivers/sqlite/table-rebuilder.js +1 -1
  1505. package/src/database/migration/index.js +2 -2
  1506. package/src/database/migrator/types.js +2 -2
  1507. package/src/database/operation.js +59 -6
  1508. package/src/database/pool/async-tracked-multi-connection.js +75 -24
  1509. package/src/database/pool/base-methods-forward.js +2 -2
  1510. package/src/database/pool/base.js +48 -17
  1511. package/src/database/pool/single-multi-use.js +501 -103
  1512. package/src/database/query/delete-base.js +1 -1
  1513. package/src/database/query/index.js +3 -3
  1514. package/src/database/query/insert-base.js +4 -4
  1515. package/src/database/query/model-class-query.js +39 -39
  1516. package/src/database/query/preloader/belongs-to.js +2 -2
  1517. package/src/database/query/preloader/ensure-model-class-initialized.js +3 -2
  1518. package/src/database/query/preloader/has-many.js +3 -3
  1519. package/src/database/query/preloader/has-one.js +1 -1
  1520. package/src/database/query/preloader.js +9 -2
  1521. package/src/database/query/query-data.js +7 -7
  1522. package/src/database/query/update-base.js +3 -3
  1523. package/src/database/query/upsert-base.js +2 -2
  1524. package/src/database/query/where-model-class-hash.js +13 -13
  1525. package/src/database/query/with-count.js +12 -12
  1526. package/src/database/query-parser/options.js +2 -2
  1527. package/src/database/query-parser/select-parser.js +1 -1
  1528. package/src/database/record/acts-as-list.js +2 -2
  1529. package/src/database/record/attachments/handle.js +6 -6
  1530. package/src/database/record/attachments/normalize-input.js +11 -11
  1531. package/src/database/record/attachments/storage-drivers/filesystem.js +1 -1
  1532. package/src/database/record/attachments/storage-drivers/native.js +5 -5
  1533. package/src/database/record/attachments/storage-drivers/s3.js +10 -10
  1534. package/src/database/record/attachments/store.js +24 -20
  1535. package/src/database/record/auditing.js +123 -29
  1536. package/src/database/record/counter-cache-magnitude.js +11 -11
  1537. package/src/database/record/index.js +227 -174
  1538. package/src/database/record/instance-relationships/base.js +4 -4
  1539. package/src/database/record/instance-relationships/belongs-to.js +1 -1
  1540. package/src/database/record/instance-relationships/has-many.js +3 -3
  1541. package/src/database/record/instance-relationships/has-one.js +1 -1
  1542. package/src/database/record/record-not-found-error.js +1 -0
  1543. package/src/database/record/relationships/base.js +22 -0
  1544. package/src/database/record/state-machine.js +6 -6
  1545. package/src/database/record/validators/base.js +1 -1
  1546. package/src/database/structure-sql-loader.js +3 -3
  1547. package/src/database/table-data/table-column.js +3 -3
  1548. package/src/database/use-live-query.js +3 -3
  1549. package/src/environment-handlers/base.js +56 -37
  1550. package/src/environment-handlers/browser.js +1 -1
  1551. package/src/environment-handlers/node/cli/commands/console.js +4 -4
  1552. package/src/environment-handlers/node/cli/commands/db/seed.js +2 -2
  1553. package/src/environment-handlers/node/cli/commands/generate/base-models.js +1 -1
  1554. package/src/environment-handlers/node/cli/commands/run-script.js +2 -2
  1555. package/src/environment-handlers/node/cli/commands/runner.js +2 -2
  1556. package/src/environment-handlers/node/cli/commands/server.js +1 -1
  1557. package/src/environment-handlers/node.js +36 -36
  1558. package/src/error-logger.js +2 -2
  1559. package/src/error-reporting/request-details.js +32 -32
  1560. package/src/frontend-model-controller.js +215 -213
  1561. package/src/frontend-model-resource/base-resource.js +44 -44
  1562. package/src/frontend-model-resource/velocious-attachment-resource.js +1 -1
  1563. package/src/frontend-models/base.js +146 -142
  1564. package/src/frontend-models/clear-pending-debounced-callback.js +2 -2
  1565. package/src/frontend-models/model-registry.js +4 -4
  1566. package/src/frontend-models/outgoing-event-buffer.js +1 -1
  1567. package/src/frontend-models/preloader.js +1 -1
  1568. package/src/frontend-models/query.js +60 -60
  1569. package/src/frontend-models/resource-definition.js +9 -9
  1570. package/src/frontend-models/transport-serialization.js +27 -27
  1571. package/src/frontend-models/websocket-channel.js +4 -4
  1572. package/src/frontend-models/websocket-publishers.js +1 -1
  1573. package/src/http-client/request.js +1 -1
  1574. package/src/http-client/response.js +1 -1
  1575. package/src/http-server/client/index.js +4 -4
  1576. package/src/http-server/client/params-to-object.js +16 -16
  1577. package/src/http-server/client/request-buffer/index.js +5 -2
  1578. package/src/http-server/client/request-parser.js +2 -2
  1579. package/src/http-server/client/request-runner.js +2 -2
  1580. package/src/http-server/client/request.js +2 -2
  1581. package/src/http-server/client/websocket-request.js +6 -6
  1582. package/src/http-server/client/websocket-session.js +28 -28
  1583. package/src/http-server/cookie.js +2 -2
  1584. package/src/http-server/development-reloader.js +1 -1
  1585. package/src/http-server/index.js +5 -5
  1586. package/src/http-server/remote-address.js +1 -1
  1587. package/src/http-server/server-lock.js +4 -4
  1588. package/src/http-server/websocket-channel-subscribers.js +4 -4
  1589. package/src/http-server/websocket-channel.js +1 -1
  1590. package/src/http-server/websocket-connection.js +3 -3
  1591. package/src/http-server/websocket-event-log-store.js +9 -9
  1592. package/src/http-server/websocket-events-host.js +7 -7
  1593. package/src/http-server/websocket-events.js +4 -4
  1594. package/src/http-server/worker-handler/channel-subscriber-dispatch.js +1 -1
  1595. package/src/http-server/worker-handler/in-process.js +5 -5
  1596. package/src/http-server/worker-handler/index.js +10 -10
  1597. package/src/http-server/worker-handler/worker-thread.js +8 -8
  1598. package/src/logger/base-logger.js +1 -1
  1599. package/src/logger.js +12 -12
  1600. package/src/mailer/backends/smtp.js +3 -3
  1601. package/src/mailer/base.js +14 -14
  1602. package/src/mailer/delivery.js +3 -3
  1603. package/src/mailer/index.js +1 -1
  1604. package/src/mailer.js +1 -1
  1605. package/src/plugins/sqljs-wasm-route-controller.js +1 -1
  1606. package/src/record-payload-values.js +3 -3
  1607. package/src/routes/base-route.js +5 -5
  1608. package/src/routes/basic-route.js +4 -4
  1609. package/src/routes/get-route.js +2 -2
  1610. package/src/routes/hooks/frontend-model-command-route-hook.js +1 -1
  1611. package/src/routes/index.js +3 -3
  1612. package/src/routes/namespace-route.js +1 -1
  1613. package/src/routes/plugin-routes.js +1 -1
  1614. package/src/routes/post-route.js +2 -2
  1615. package/src/routes/resolver.js +5 -5
  1616. package/src/routes/resource-route.js +1 -1
  1617. package/src/sync/conflict-strategy.js +1 -1
  1618. package/src/sync/query-scope.js +7 -7
  1619. package/src/sync/server-change-feed.js +13 -13
  1620. package/src/sync/server-sequence-allocator.js +5 -5
  1621. package/src/sync/signed-sync-envelope-replay-service.js +20 -20
  1622. package/src/sync/stable-json.js +4 -4
  1623. package/src/sync/sync-api-client-types.js +7 -7
  1624. package/src/sync/sync-api-client.js +26 -26
  1625. package/src/sync/sync-change-fanout.js +6 -6
  1626. package/src/sync/sync-client-registry.js +3 -3
  1627. package/src/sync/sync-client-types.js +10 -10
  1628. package/src/sync/sync-client.js +18 -18
  1629. package/src/sync/sync-envelope-replay-service.js +76 -76
  1630. package/src/sync/sync-model-change-feed-service.js +7 -7
  1631. package/src/sync/sync-publish-suppression.js +2 -2
  1632. package/src/sync/sync-publisher-types.js +11 -11
  1633. package/src/sync/sync-publisher.js +19 -19
  1634. package/src/sync/sync-realtime-bridge.js +8 -8
  1635. package/src/sync/sync-replay-upsert-applier.js +16 -16
  1636. package/src/sync/sync-resource-base.js +14 -14
  1637. package/src/sync/sync-scope-attributes.js +1 -1
  1638. package/src/sync/sync-scope-store.js +5 -5
  1639. package/src/sync/sync-websocket-channel.js +5 -5
  1640. package/src/tenants/default-tenant-database-provisioning.js +1 -1
  1641. package/src/tenants/tenant-aggregator.js +13 -13
  1642. package/src/tenants/tenant-handle.js +252 -0
  1643. package/src/tenants/tenant-iterator.js +6 -6
  1644. package/src/tenants/tenant-model-scope.js +132 -0
  1645. package/src/tenants/tenant.js +15 -2
  1646. package/src/testing/browser-test-app.js +2 -2
  1647. package/src/testing/expect-to-change.js +1 -1
  1648. package/src/testing/expect-utils.js +29 -29
  1649. package/src/testing/expect.js +18 -18
  1650. package/src/testing/factory/association-declaration.js +2 -2
  1651. package/src/testing/factory/declarations.js +5 -5
  1652. package/src/testing/factory/definition-builder.js +39 -39
  1653. package/src/testing/factory/evaluation-context.js +16 -16
  1654. package/src/testing/factory/factory-definition.js +2 -2
  1655. package/src/testing/factory/factory-registry.js +34 -34
  1656. package/src/testing/factory/factory-runner.js +8 -8
  1657. package/src/testing/factory/linter.js +2 -2
  1658. package/src/testing/factory/model-contract.js +3 -3
  1659. package/src/testing/factory/sequence.js +2 -2
  1660. package/src/testing/factory/strategies/attributes-for.js +1 -1
  1661. package/src/testing/factory/strategies/base.js +24 -24
  1662. package/src/testing/factory/strategies/build.js +2 -2
  1663. package/src/testing/factory/strategies/create.js +4 -4
  1664. package/src/testing/test-files-finder.js +1 -1
  1665. package/src/testing/test-runner.js +14 -14
  1666. package/src/testing/test.js +19 -17
  1667. package/src/testing/wait-for-event.js +5 -5
  1668. package/src/utils/event-emitter.js +1 -1
  1669. package/src/utils/format-value.js +6 -6
  1670. package/src/utils/is-date.js +1 -1
  1671. package/src/utils/model-scope.js +10 -10
  1672. package/src/utils/plain-object.js +2 -2
  1673. package/src/utils/ransack.js +35 -35
  1674. package/src/utils/with-tracked-stack-async-hooks.js +8 -8
  1675. package/src/utils/with-tracked-stack.js +6 -6
  1676. package/src/velocious-error.js +9 -3
@@ -1,58 +1,51 @@
1
- export default VelociousDatabaseRecord;
2
- /**
3
- * Defines this typedef.
4
- */
5
1
  export type ValidationErrorObjectType = {
6
2
  type: string;
7
3
  message: string;
8
4
  };
9
- /**
10
- * LifecycleCallbackType type.
11
- */
12
- export type LifecycleCallbackType<T = VelociousDatabaseRecord<Record<string, any>>> = ((model: T) => void | Promise<void>) | string;
13
- /**
14
- * Model class constructor type used for static `this` typing.
15
- */
5
+ export type LifecycleCallbackType<T = VelociousDatabaseRecord> = ((model: T) => void | Promise<void>) | string;
16
6
  export type ModelConstructor<T> = {
17
7
  new (changes?: Record<string, unknown>): T;
18
8
  };
19
- /**
20
- * RestrictInstanceRelationship type.
21
- */
22
9
  export type RestrictInstanceRelationship = import("./instance-relationships/base.js").default & {
23
10
  query: () => ModelClassQuery<typeof VelociousDatabaseRecord>;
24
11
  };
25
12
  export type TenantDatabaseProviderType = import("../../configuration-types.js").TenantDatabaseProviderType;
26
13
  /**
27
- * Translation record shape used by translated attributes.
14
+ * Defines this typedef.
15
+ * @typedef {{type: string, message: string}} ValidationErrorObjectType
16
+ */
17
+ /**
18
+ * LifecycleCallbackType type.
19
+ * @template [T=VelociousDatabaseRecord]
20
+ * @typedef {((model: T) => void | Promise<void>) | string} LifecycleCallbackType
21
+ */
22
+ /**
23
+ * Model class constructor type used for static `this` typing.
24
+ * @template T
25
+ * @typedef {{new (changes?: Record<string, unknown>): T}} ModelConstructor
26
+ */
27
+ /**
28
+ * RestrictInstanceRelationship type.
29
+ * @typedef {import("./instance-relationships/base.js").default & {query: () => ModelClassQuery<typeof VelociousDatabaseRecord>}} RestrictInstanceRelationship
28
30
  */
31
+ /** @typedef {import("../../configuration-types.js").TenantDatabaseProviderType} TenantDatabaseProviderType */
32
+ import { AdvisoryLockBusyError, AdvisoryLockHoldTimeoutError, AdvisoryLockTimeoutError } from "../advisory-lock-runner.js";
33
+ import Configuration from "../../configuration.js";
34
+ import RecordAttachmentHandle from "./attachments/handle.js";
35
+ import ModelClassQuery from "../query/model-class-query.js";
36
+ import TenantModelScope from "../../tenants/tenant-model-scope.js";
29
37
  export type TranslationBase = VelociousDatabaseRecord & {
30
38
  locale: () => string;
31
39
  };
32
- /**
33
- * AttachmentDriverConstructor type.
34
- */
35
40
  export type AttachmentDriverConstructor = import("../../configuration-types.js").AttachmentDriverConstructor;
36
- import { AdvisoryLockBusyError } from "../advisory-lock-runner.js";
37
- import { AdvisoryLockHoldTimeoutError } from "../advisory-lock-runner.js";
38
- import { AdvisoryLockTimeoutError } from "../advisory-lock-runner.js";
39
- export class TenantDatabaseScopeError extends Error {
40
- /**
41
- * Runs constructor.
42
- * @param {string} message - Error message.
43
- * @param {{modelName: string}} args - Context for the failed tenant-scoped model.
44
- */
45
- constructor(message: string, { modelName }: {
46
- modelName: string;
47
- });
48
- modelName: string;
49
- }
50
- export class ValidationError extends Error {
41
+ declare class ValidationError extends Error {
42
+ _model: VelociousDatabaseRecord<Record<string, any>> | undefined;
43
+ _validationErrors: Record<string, ValidationErrorObjectType[]> | undefined;
51
44
  /**
52
45
  * Narrows the runtime value to the documented type.
53
- * @type {Record<string, ?> | undefined} - Velocious metadata for frontend-model error reporting.
46
+ * @type {Record<string, ReturnType<typeof JSON.parse>> | undefined} - Velocious metadata for frontend-model error reporting.
54
47
  */
55
- velocious: Record<string, unknown> | undefined;
48
+ velocious: Record<string, ReturnType<typeof JSON.parse>> | undefined;
56
49
  /**
57
50
  * Runs get model.
58
51
  * @returns {VelociousDatabaseRecord} - The model.
@@ -64,7 +57,6 @@ export class ValidationError extends Error {
64
57
  * @returns {void} - No return value.
65
58
  */
66
59
  setModel(model: VelociousDatabaseRecord): void;
67
- _model: VelociousDatabaseRecord<Record<string, any>> | undefined;
68
60
  /**
69
61
  * Runs get validation errors.
70
62
  * @returns {Record<string, ValidationErrorObjectType[]>} - The validation errors.
@@ -75,13 +67,1945 @@ export class ValidationError extends Error {
75
67
  * @param {Record<string, ValidationErrorObjectType[]>} validationErrors - Validation errors to assign.
76
68
  */
77
69
  setValidationErrors(validationErrors: Record<string, ValidationErrorObjectType[]>): void;
78
- _validationErrors: Record<string, ValidationErrorObjectType[]> | undefined;
79
70
  }
71
+ declare class TenantDatabaseScopeError extends Error {
72
+ modelName: string;
73
+ /**
74
+ * Runs constructor.
75
+ * @param {string} message - Error message.
76
+ * @param {{modelName: string}} args - Context for the failed tenant-scoped model.
77
+ */
78
+ constructor(message: string, { modelName }: {
79
+ modelName: string;
80
+ });
81
+ }
82
+ export type RelationshipScopeCallback = (query: import("../query/model-class-query.js").default<typeof VelociousDatabaseRecord>) => (import("../query/model-class-query.js").default<typeof VelociousDatabaseRecord> | void);
83
+ export type RelationshipDataArgumentType = {
84
+ /**
85
+ * - Disable auto-batch-preload for this relationship by passing false. Default true.
86
+ */
87
+ autoload?: boolean;
88
+ /**
89
+ * - Model class name for the related record.
90
+ */
91
+ className?: string;
92
+ /**
93
+ * - Dependent action when parent is destroyed (e.g. "destroy").
94
+ */
95
+ dependent?: string;
96
+ /**
97
+ * - Model class for the related record.
98
+ */
99
+ klass?: typeof VelociousDatabaseRecord;
100
+ /**
101
+ * - Optional scope callback for the relationship.
102
+ */
103
+ scope?: RelationshipScopeCallback;
104
+ /**
105
+ * - Relationship type (e.g. "hasMany", "belongsTo").
106
+ */
107
+ type?: string;
108
+ };
80
109
  /**
81
110
  * Base database record.
82
- * @template {Record<string, ?>} [WriteAttributes=Record<string, ?>]
111
+ * @template {Record<string, ReturnType<typeof JSON.parse>>} [WriteAttributes=Record<string, ReturnType<typeof JSON.parse>>]
83
112
  */
84
- declare class VelociousDatabaseRecord<WriteAttributes extends Record<string, unknown> = Record<string, any>> {
113
+ declare class VelociousDatabaseRecord<WriteAttributes extends Record<string, ReturnType<typeof JSON.parse>> = Record<string, ReturnType<typeof JSON.parse>>> {
114
+ static _configuration: Configuration | undefined;
115
+ static _initialized: boolean | undefined;
116
+ static _databaseType: string | undefined;
117
+ static _table: import("../drivers/base-table.js").default | undefined;
118
+ static _columns: import("../drivers/base-column.js").default[] | undefined;
119
+ static _databaseIdentifier: string | undefined;
120
+ static _tenantDatabaseIdentifierResolver: string | ((args: {
121
+ modelClass: typeof VelociousDatabaseRecord;
122
+ tenant: Record<string, unknown> | null | undefined;
123
+ }) => string | undefined) | undefined;
124
+ static _primaryKey: string | undefined;
125
+ static _tableName: string | undefined;
126
+ static _translationClass: {
127
+ new (changes?: Record<string, any>): {
128
+ /**
129
+ * Attributes.
130
+ * @type {Record<string, ReturnType<typeof JSON.parse>>} */
131
+ _attributes: Record<string, ReturnType<typeof JSON.parse>>;
132
+ /**
133
+ * Changes.
134
+ * @type {Record<string, ReturnType<typeof JSON.parse>>} */
135
+ _changes: Record<string, ReturnType<typeof JSON.parse>>;
136
+ /**
137
+ * Changes captured before a create audit is written.
138
+ * @type {import("./auditing.js").AuditChanges | undefined} */
139
+ _pendingCreateAuditChanges: import("./auditing.js").AuditChanges | undefined;
140
+ /**
141
+ * Changes captured before an update audit is written.
142
+ * @type {import("./auditing.js").AuditChanges | undefined} */
143
+ _pendingUpdateAuditChanges: import("./auditing.js").AuditChanges | undefined;
144
+ /**
145
+ * Attribute names explicitly assigned in the current update call.
146
+ * @type {Set<string> | undefined}
147
+ */
148
+ _assignedAttributeNames: Set<string> | undefined;
149
+ /**
150
+ * Columns as hash.
151
+ * @type {Record<string, import("../drivers/base-column.js").default>} */
152
+ _columnsAsHash: Record<string, import("../drivers/base-column.js").default>;
153
+ /**
154
+ * Connection.
155
+ * @type {import("../drivers/base.js").default | undefined} */
156
+ __connection: import("../drivers/base.js").default | undefined;
157
+ /**
158
+ * Explicit operation owning this record's database work.
159
+ * @type {import("../operation.js").default | undefined} */
160
+ _databaseOperation: import("../operation.js").default | undefined;
161
+ /**
162
+ * Instance relationships.
163
+ * @type {Record<string, import("./instance-relationships/base.js").default>} */
164
+ _instanceRelationships: Record<string, import("./instance-relationships/base.js").default>;
165
+ /**
166
+ * Attachments.
167
+ * @type {Record<string, RecordAttachmentHandle>} */
168
+ _attachments: Record<string, RecordAttachmentHandle>;
169
+ /**
170
+ * Load cohort.
171
+ * @type {Array<VelociousDatabaseRecord> | undefined} - Shared reference to sibling records loaded in the same batch. Used by auto-preload.
172
+ */
173
+ _loadCohort: Array<VelociousDatabaseRecord> | undefined;
174
+ /**
175
+ * Table name.
176
+ * @type {string | undefined} */
177
+ __tableName: string | undefined;
178
+ /**
179
+ * Validation errors.
180
+ * @type {Record<string, ValidationErrorObjectType[]>} */
181
+ _validationErrors: Record<string, ValidationErrorObjectType[]>;
182
+ /**
183
+ * Runs get relationship by name.
184
+ * @param {string} relationshipName - Relationship name.
185
+ * @returns {import("./instance-relationships/base.js").default} - The relationship by name.
186
+ */
187
+ getRelationshipByName(relationshipName: string): import("./instance-relationships/base.js").default;
188
+ /**
189
+ * Preloads relationship(s) onto this already-loaded record. Accepts either a
190
+ * query built via `Model.preload(...).select(...)` or a raw preload spec
191
+ * (string / array / nested object). A relationship that is already preloaded
192
+ * with all the required columns present is left untouched unless `force` is
193
+ * set. Preloading onto the relationship cache lets later accessors reuse the
194
+ * loaded data instead of issuing identical queries.
195
+ * @param {import("../query/model-class-query.js").default | import("../query/index.js").NestedPreloadRecord | string | Array<string | import("../query/index.js").NestedPreloadRecord>} queryOrSpec - Preload source.
196
+ * @param {{force?: boolean}} [options] - Options.
197
+ * @returns {Promise<void>} - Resolves when preloading completes.
198
+ */
199
+ preload(queryOrSpec: import("../query/model-class-query.js").default | import("../query/index.js").NestedPreloadRecord | string | Array<string | import("../query/index.js").NestedPreloadRecord>, options?: {
200
+ force?: boolean;
201
+ }): Promise<void>;
202
+ /**
203
+ * Runs load relationship.
204
+ * @param {string} relationshipName - Relationship name.
205
+ * @returns {Promise<ReturnType<typeof JSON.parse>>} - Loaded relationship value.
206
+ */
207
+ loadRelationship(relationshipName: string): Promise<ReturnType<typeof JSON.parse>>;
208
+ /**
209
+ * Runs relationship or load.
210
+ * @param {string} relationshipName - Relationship name.
211
+ * @param {{preloadTranslations?: boolean}} [options] - Load options.
212
+ * @returns {Promise<ReturnType<typeof JSON.parse>>} - Loaded relationship value.
213
+ */
214
+ relationshipOrLoad(relationshipName: string, options?: {
215
+ preloadTranslations?: boolean;
216
+ }): Promise<ReturnType<typeof JSON.parse>>;
217
+ /**
218
+ * Preloads translations on a loaded relationship target when explicitly requested.
219
+ * @param {ReturnType<typeof JSON.parse>} loaded - Loaded relationship value.
220
+ * @returns {Promise<ReturnType<typeof JSON.parse>>} - Relationship value after translation preload.
221
+ */
222
+ _preloadLoadedRelationshipTranslations(loaded: ReturnType<typeof JSON.parse>): Promise<ReturnType<typeof JSON.parse>>;
223
+ /**
224
+ * Runs get attachment by name.
225
+ * @param {string} attachmentName - Attachment name.
226
+ * @returns {RecordAttachmentHandle} - Attachment handle.
227
+ */
228
+ getAttachmentByName(attachmentName: string): RecordAttachmentHandle;
229
+ /**
230
+ * Runs get configuration.
231
+ * @returns {import("../../configuration.js").default} - The configuration.
232
+ */
233
+ _getConfiguration(): import("../../configuration.js").default;
234
+ /**
235
+ * Runs has attribute.
236
+ * @param {ReturnType<typeof JSON.parse>} value - Value to use.
237
+ * @returns {boolean} - Whether attribute.
238
+ */
239
+ _hasAttribute(value: ReturnType<typeof JSON.parse>): boolean;
240
+ /**
241
+ * Runs get attribute.
242
+ * @param {string} name - Name.
243
+ * @returns {ReturnType<typeof JSON.parse>} - The attribute.
244
+ */
245
+ getAttribute(name: string): ReturnType<typeof JSON.parse>;
246
+ /**
247
+ * Runs get model class.
248
+ * @abstract
249
+ * @returns {typeof VelociousDatabaseRecord} - The model class.
250
+ */
251
+ getModelClass(): typeof VelociousDatabaseRecord;
252
+ /**
253
+ * Runs set attribute.
254
+ * @param {string} name - Name.
255
+ * @param {ReturnType<typeof JSON.parse>} newValue - New value.
256
+ * @returns {void} - No return value.
257
+ */
258
+ setAttribute(name: string, newValue: ReturnType<typeof JSON.parse>): void;
259
+ /**
260
+ * Runs set column attribute.
261
+ * @param {string} name - Name.
262
+ * @param {ReturnType<typeof JSON.parse>} newValue - New value.
263
+ */
264
+ _setColumnAttribute(name: string, newValue: ReturnType<typeof JSON.parse>): void;
265
+ /**
266
+ * Clears loaded belongs-to caches when callers assign the foreign key directly.
267
+ * @param {string} columnName - Changed database column name.
268
+ * @param {ReturnType<typeof JSON.parse>} normalizedValue - New normalized column value.
269
+ * @returns {void} - No return value.
270
+ */
271
+ _clearBelongsToRelationshipForChangedForeignKey(columnName: string, normalizedValue: ReturnType<typeof JSON.parse>): void;
272
+ /**
273
+ * Runs belongs to relationships for foreign key.
274
+ * @param {string} columnName - Changed database column name.
275
+ * @returns {Array<ReturnType<typeof JSON.parse>>} - Loaded relationship instances that use the changed foreign key.
276
+ */
277
+ _belongsToRelationshipsForForeignKey(columnName: string): Array<ReturnType<typeof JSON.parse>>;
278
+ /**
279
+ * Runs belongs to relationship uses foreign key.
280
+ * @param {object} args - Relationship match arguments.
281
+ * @param {string} args.columnName - Changed database column name.
282
+ * @param {ReturnType<typeof JSON.parse>} args.relationship - Relationship instance.
283
+ * @returns {boolean} - Whether the relationship is a belongs-to using the changed foreign key.
284
+ */
285
+ _belongsToRelationshipUsesForeignKey({ columnName, relationship }: {
286
+ columnName: string;
287
+ relationship: ReturnType<typeof JSON.parse>;
288
+ }): boolean;
289
+ /**
290
+ * Runs belongs to relationship matches foreign key value.
291
+ * @param {object} args - Relationship cache arguments.
292
+ * @param {ReturnType<typeof JSON.parse>} args.normalizedValue - New normalized column value.
293
+ * @param {ReturnType<typeof JSON.parse>} args.relationship - Relationship instance.
294
+ * @returns {boolean} - Whether the loaded related record still matches the changed foreign key.
295
+ */
296
+ _belongsToRelationshipMatchesForeignKeyValue({ normalizedValue, relationship }: {
297
+ normalizedValue: ReturnType<typeof JSON.parse>;
298
+ relationship: ReturnType<typeof JSON.parse>;
299
+ }): boolean;
300
+ /**
301
+ * Returns the foreign key value for a belongs-to relationship assignment.
302
+ * @param {object} args - Relationship assignment arguments.
303
+ * @param {VelociousDatabaseRecord | null | undefined} args.model - Assigned model.
304
+ * @param {import("./instance-relationships/base.js").default} args.relationship - Belongs-to relationship instance.
305
+ * @returns {string | number | null | undefined} - Foreign key value for the assignment.
306
+ */
307
+ _belongsToForeignKeyValue({ model, relationship }: {
308
+ model: VelociousDatabaseRecord | null | undefined;
309
+ relationship: import("./instance-relationships/base.js").default;
310
+ }): string | number | null | undefined;
311
+ /**
312
+ * Runs clear loaded belongs to relationship.
313
+ * @param {ReturnType<typeof JSON.parse>} relationship - Relationship instance.
314
+ * @returns {void} - No return value.
315
+ */
316
+ _clearLoadedBelongsToRelationship(relationship: ReturnType<typeof JSON.parse>): void;
317
+ /**
318
+ * Runs normalize date value.
319
+ * @param {ReturnType<typeof JSON.parse>} value - Value to use.
320
+ * @returns {ReturnType<typeof JSON.parse>} - The date value.
321
+ */
322
+ _normalizeDateValue(value: ReturnType<typeof JSON.parse>): ReturnType<typeof JSON.parse>;
323
+ /**
324
+ * Runs normalize sqlite boolean value.
325
+ * @param {object} args - Options object.
326
+ * @param {string | undefined} args.columnType - Column type.
327
+ * @param {ReturnType<typeof JSON.parse>} args.value - Value to normalize.
328
+ * @returns {ReturnType<typeof JSON.parse>} - Normalized value.
329
+ */
330
+ _normalizeSqliteBooleanValue({ columnType, value }: {
331
+ columnType: string | undefined;
332
+ value: ReturnType<typeof JSON.parse>;
333
+ }): ReturnType<typeof JSON.parse>;
334
+ /**
335
+ * Normalizes a boolean value before storing. A declared `"boolean"` attribute cast stores
336
+ * booleans as 1/0 only for integer-backed columns (e.g. an MSSQL `bit`). Columns whose
337
+ * underlying type is already a native boolean (e.g. Postgres `boolean`) keep `true`/`false`
338
+ * so the driver can emit the proper boolean literal; otherwise the sqlite-only normalizer applies.
339
+ * @param {object} args - Options object.
340
+ * @param {string} args.attributeName - Attribute name being written.
341
+ * @param {string | undefined} args.columnType - Column type.
342
+ * @param {ReturnType<typeof JSON.parse>} args.value - Value to normalize.
343
+ * @returns {ReturnType<typeof JSON.parse>} - Normalized value.
344
+ */
345
+ _normalizeBooleanValueForWrite({ attributeName, columnType, value }: {
346
+ attributeName: string;
347
+ columnType: string | undefined;
348
+ value: ReturnType<typeof JSON.parse>;
349
+ }): ReturnType<typeof JSON.parse>;
350
+ /**
351
+ * Runs save.
352
+ * @returns {Promise<void>} - Resolves when complete.
353
+ */
354
+ save(): Promise<void>;
355
+ _autoSaveBelongsToRelationships(): Promise<{
356
+ savedCount: number;
357
+ }>;
358
+ _autoSaveHasManyAndHasOneRelationshipsToSave(): import("./instance-relationships/base.js").default<typeof VelociousDatabaseRecord, typeof VelociousDatabaseRecord>[];
359
+ /**
360
+ * Resolves a relationship foreign-key column to this model's public attribute name.
361
+ * @param {import("./instance-relationships/base.js").default<typeof VelociousDatabaseRecord, typeof VelociousDatabaseRecord>} instanceRelationship - Relationship instance.
362
+ * @returns {string} Attribute name accepted by setAttribute/assign.
363
+ */
364
+ _relationshipForeignKeyAttribute(instanceRelationship: import("./instance-relationships/base.js").default<typeof VelociousDatabaseRecord, typeof VelociousDatabaseRecord>): string;
365
+ /**
366
+ * Runs auto save has many and has one relationships.
367
+ * @param {object} args - Options object.
368
+ * @param {boolean} args.isNewRecord - Whether is new record.
369
+ */
370
+ _autoSaveHasManyAndHasOneRelationships({ isNewRecord }: {
371
+ isNewRecord: boolean;
372
+ }): Promise<void>;
373
+ /**
374
+ * Runs auto save attachments.
375
+ * @returns {Promise<void>} - Resolves when pending attachments have been saved.
376
+ */
377
+ _autoSaveAttachments(): Promise<void>;
378
+ /**
379
+ * Runs translations loaded.
380
+ * @abstract
381
+ * @returns {TranslationBase[]} - The translations loaded.
382
+ */
383
+ translationsLoaded(): TranslationBase[];
384
+ /**
385
+ * Runs get translated attribute.
386
+ * @param {string} name - Name.
387
+ * @param {string} locale - Locale.
388
+ * @returns {string | undefined} - The translated attribute, if found.
389
+ */
390
+ _getTranslatedAttribute(name: string, locale: string): string | undefined;
391
+ /**
392
+ * Runs get translated attribute with fallback.
393
+ * @param {string} name - Name.
394
+ * @param {string} locale - Locale.
395
+ * @returns {string | undefined} - The translated attribute with fallback, if found.
396
+ */
397
+ _getTranslatedAttributeWithFallback(name: string, locale: string): string | undefined;
398
+ /**
399
+ * Runs set translated attribute.
400
+ * @param {string} name - Name.
401
+ * @param {string} locale - Locale.
402
+ * @param {ReturnType<typeof JSON.parse>} newValue - New value.
403
+ * @returns {void} - No return value.
404
+ */
405
+ _setTranslatedAttribute(name: string, locale: string, newValue: ReturnType<typeof JSON.parse>): void;
406
+ _isNewRecord: boolean;
407
+ /**
408
+ * Binds future query, lifecycle, relationship, and persistence work to an operation.
409
+ * @param {import("../operation.js").default} operation - Owning operation.
410
+ * @returns {this} - Bound record.
411
+ */
412
+ bindDatabaseOperation(operation: import("../operation.js").default): /*elided*/ any;
413
+ /**
414
+ * Releases this record from a completed eager-helper operation while
415
+ * preserving the legacy ambient follow-up behavior of `usingTenant` finders.
416
+ * @param {import("../operation.js").default} operation - Releasing operation.
417
+ * @returns {this} - Record.
418
+ */
419
+ releaseDatabaseOperation(operation: import("../operation.js").default): /*elided*/ any;
420
+ /**
421
+ * Returns the explicit operation owning this record, if any.
422
+ * @returns {import("../operation.js").default | undefined} - Owning operation.
423
+ */
424
+ databaseOperation(): import("../operation.js").default | undefined;
425
+ /**
426
+ * Binds a related record to the same operation as this record.
427
+ * @template {VelociousDatabaseRecord} Model
428
+ * @param {Model} record - Related record.
429
+ * @returns {Model} - Related record.
430
+ */
431
+ bindRelatedRecord<Model extends VelociousDatabaseRecord>(record: Model): Model;
432
+ /**
433
+ * Builds a model query preserving this record's operation ownership.
434
+ * @template {typeof VelociousDatabaseRecord} MC
435
+ * @param {MC} ModelClass - Target model class.
436
+ * @returns {ModelClassQuery<MC>} - Target query.
437
+ */
438
+ queryForModel<MC extends typeof VelociousDatabaseRecord>(ModelClass: MC): ModelClassQuery<MC>;
439
+ /**
440
+ * Initializes a relationship/preload target without dropping this record's
441
+ * explicit operation connection.
442
+ * @param {typeof VelociousDatabaseRecord} ModelClass - Target model class.
443
+ * @param {import("../../configuration.js").default} configuration - Owning configuration.
444
+ * @returns {Promise<void>} - Resolves when initialized.
445
+ */
446
+ ensureModelClassInitialized(ModelClass: typeof VelociousDatabaseRecord, configuration: import("../../configuration.js").default): Promise<void>;
447
+ /**
448
+ * Runs load existing record.
449
+ * @param {object} attributes - Attributes.
450
+ * @returns {void} - No return value.
451
+ */
452
+ loadExistingRecord(attributes: object): void;
453
+ /**
454
+ * Assigns the given attributes to the record.
455
+ * @param {Record<string, ReturnType<typeof JSON.parse>>} attributesToAssign - Attributes to assign.
456
+ * @returns {void} - No return value.
457
+ */
458
+ assign(attributesToAssign: Record<string, ReturnType<typeof JSON.parse>>): void;
459
+ /**
460
+ * Returns a the current attributes of the record (original attributes from database plus changes)
461
+ * @returns {Record<string, ReturnType<typeof JSON.parse>>} - The attributes.
462
+ */
463
+ attributes(): Record<string, ReturnType<typeof JSON.parse>>;
464
+ /**
465
+ * Returns column-name keyed data (original attributes from database plus changes)
466
+ * @returns {Record<string, ReturnType<typeof JSON.parse>>} - The raw attributes.
467
+ */
468
+ rawAttributes(): Record<string, ReturnType<typeof JSON.parse>>;
469
+ /**
470
+ * Runs connection.
471
+ * @returns {import("../drivers/base.js").default} - The connection.
472
+ */
473
+ _connection(): import("../drivers/base.js").default;
474
+ /**
475
+ * Returns the connection that owns this record's database work.
476
+ * @returns {import("../drivers/base.js").default} - Connection.
477
+ */
478
+ connection(): import("../drivers/base.js").default;
479
+ /**
480
+ * Counts dependent records for a `dependent: "restrict"` relationship.
481
+ * @param {RestrictInstanceRelationship} instanceRelationship - Relationship instance to count.
482
+ * @returns {Promise<number>} - Dependent row count.
483
+ */
484
+ _dependentRestrictCount(instanceRelationship: RestrictInstanceRelationship): Promise<number>;
485
+ /**
486
+ * Counts tenant-scoped dependent records across all provider-listed tenants.
487
+ * @param {RestrictInstanceRelationship} instanceRelationship - Relationship instance to count.
488
+ * @param {typeof VelociousDatabaseRecord} TargetModelClass - Related model class.
489
+ * @returns {Promise<number>} - Dependent row count.
490
+ */
491
+ _dependentRestrictTenantCount(instanceRelationship: RestrictInstanceRelationship, TargetModelClass: typeof VelociousDatabaseRecord): Promise<number>;
492
+ /**
493
+ * Counts tenant-scoped dependent records for one configured tenant provider.
494
+ * @param {RestrictInstanceRelationship} instanceRelationship - Relationship instance to count.
495
+ * @param {typeof VelociousDatabaseRecord} TargetModelClass - Related model class.
496
+ * @param {string} identifier - Tenant database identifier.
497
+ * @param {TenantDatabaseProviderType} provider - Tenant database provider.
498
+ * @returns {Promise<number>} - Dependent row count.
499
+ */
500
+ _dependentRestrictProviderCount(instanceRelationship: RestrictInstanceRelationship, TargetModelClass: typeof VelociousDatabaseRecord, identifier: string, provider: TenantDatabaseProviderType): Promise<number>;
501
+ /**
502
+ * Lists restrict-check tenants for one configured tenant provider.
503
+ * @param {RestrictInstanceRelationship} instanceRelationship - Relationship instance to count.
504
+ * @param {typeof VelociousDatabaseRecord} TargetModelClass - Related model class.
505
+ * @param {string} identifier - Tenant database identifier.
506
+ * @param {TenantDatabaseProviderType} provider - Tenant database provider.
507
+ * @returns {Promise<Array<ReturnType<typeof JSON.parse>>>} - Listed tenant objects.
508
+ */
509
+ _dependentRestrictProviderTenants(instanceRelationship: RestrictInstanceRelationship, TargetModelClass: typeof VelociousDatabaseRecord, identifier: string, provider: TenantDatabaseProviderType): Promise<Array<ReturnType<typeof JSON.parse>>>;
510
+ /**
511
+ * Destroys the record in the database and all of its dependent records.
512
+ * @returns {Promise<void>} - Resolves when complete.
513
+ */
514
+ destroy(): Promise<void>;
515
+ /**
516
+ * Emits a committed record-change event after the surrounding transaction
517
+ * commits, so live queries re-run uniformly for local writes, pull applies, and
518
+ * realtime applies (which all end as local saves/destroys). Registered through
519
+ * the connection's afterCommit hook so a rolled-back save emits nothing, and
520
+ * skipped entirely when nothing observes this model class so server-side saves
521
+ * stay free of live-query overhead.
522
+ * @param {import("../record-changes.js").RecordChangeOperation} operation - The committed operation.
523
+ * @returns {Promise<void>}
524
+ */
525
+ _emitRecordChangeAfterCommit(operation: import("../record-changes.js").RecordChangeOperation): Promise<void>;
526
+ /**
527
+ * Stores an audit row for this record.
528
+ * @param {import("./auditing.js").CreateAuditArgs} args - Audit row options.
529
+ * @returns {Promise<number | string>} Created audit row id.
530
+ */
531
+ createAudit(args: import("./auditing.js").CreateAuditArgs): Promise<number | string>;
532
+ /**
533
+ * Captures create changes before persistence clears the change set.
534
+ * @returns {void}
535
+ */
536
+ captureCreateAuditChanges(): void;
537
+ /**
538
+ * Writes the create audit row.
539
+ * @returns {Promise<void>}
540
+ */
541
+ createCreateAudit(): Promise<void>;
542
+ /**
543
+ * Captures update changes before persistence clears the change set.
544
+ * @returns {void}
545
+ */
546
+ captureUpdateAuditChanges(): void;
547
+ /**
548
+ * Writes the update audit row.
549
+ * @returns {Promise<void>}
550
+ */
551
+ createUpdateAudit(): Promise<void>;
552
+ /**
553
+ * Writes the destroy audit row.
554
+ * @returns {Promise<void>}
555
+ */
556
+ createDestroyAudit(): Promise<void>;
557
+ /**
558
+ * Runs run lifecycle callbacks.
559
+ * @param {"afterCreate" | "afterDestroy" | "afterSave" | "afterUpdate" | "beforeCreate" | "beforeDestroy" | "beforeSave" | "beforeUpdate" | "beforeValidation"} callbackName - Callback type.
560
+ * @returns {Promise<void>}
561
+ */
562
+ _runLifecycleCallbacks(callbackName: "afterCreate" | "afterDestroy" | "afterSave" | "afterUpdate" | "beforeCreate" | "beforeDestroy" | "beforeSave" | "beforeUpdate" | "beforeValidation"): Promise<void>;
563
+ /**
564
+ * Runs has changes.
565
+ * @returns {boolean} - Whether changes.
566
+ */
567
+ _hasChanges(): boolean;
568
+ /**
569
+ * Returns true if the model has been changed since it was loaded from the database.
570
+ * @returns {boolean} - Whether changed.
571
+ */
572
+ isChanged(): boolean;
573
+ /**
574
+ * Returns the changes that have been made to this record since it was loaded from the database.
575
+ * @returns {Record<string, Array<ReturnType<typeof JSON.parse>>>} - The changes.
576
+ */
577
+ changes(): Record<string, Array<ReturnType<typeof JSON.parse>>>;
578
+ /**
579
+ * Runs table name.
580
+ * @returns {string} - The table name.
581
+ */
582
+ _tableName(): string;
583
+ /**
584
+ * Reads an attribute value from the record. Read dynamically by name, so the value can be any
585
+ * column type and may be overridden by a user-defined getter on the model.
586
+ * @template V
587
+ * @param {string} attributeName The name of the attribute to read. This is the attribute name, not the column name.
588
+ * @returns {V} The attribute value, typed by the caller's accessor contract.
589
+ */
590
+ readAttribute<V>(attributeName: string): V;
591
+ /**
592
+ * Read an association count attached by `.withCount(...)`. Counts are
593
+ * stored on a separate map from the record's `_attributes` so a
594
+ * virtual count like `tasksCount` cannot silently shadow a real
595
+ * column of the same name. Returns the attached number, or 0 when
596
+ * `.withCount(...)` wasn't requested for this attribute.
597
+ * @param {string} attributeName - Attribute name, e.g. `"tasksCount"` or a custom `"activeMembersCount"` from `.withCount({activeMembersCount: {...}})`.
598
+ * @returns {number} - Attached association count, or zero when absent.
599
+ */
600
+ readCount(attributeName: string): number;
601
+ /**
602
+ * Attach an association count to this record. Internal helper used by
603
+ * the `withCount` runner; outside code should not call this directly.
604
+ * @param {string} attributeName - Attribute name.
605
+ * @param {number} value - Count value.
606
+ * @returns {void}
607
+ */
608
+ _setAssociationCount(attributeName: string, value: number): void;
609
+ /**
610
+ * All attached association counts as a plain object. Used by the
611
+ * frontend-model serializer to ship counts alongside the record
612
+ * attributes on the wire.
613
+ * @returns {Record<string, number>} - Association counts keyed by attribute name.
614
+ */
615
+ associationCounts(): Record<string, number>;
616
+ /**
617
+ * Read a value attached by `.queryData(...)`. Stored on a dedicated
618
+ * map rather than on `_attributes`, so a virtual queryData key like
619
+ * `transportSecondsSum` cannot silently shadow a real column of the
620
+ * same name. Returns `null` when the key wasn't produced by any
621
+ * registered fn for this record (e.g. no child rows matched the
622
+ * aggregate).
623
+ * @param {string} name - queryData attribute name (matches a SELECT alias from the registered fn).
624
+ * @returns {ReturnType<typeof JSON.parse>} - Attached query-data value.
625
+ */
626
+ queryData(name: string): ReturnType<typeof JSON.parse>;
627
+ /**
628
+ * Attach a queryData value to this record. Internal helper used by
629
+ * the `queryData` runner and by frontend-model hydration; outside
630
+ * code should not call this directly.
631
+ * @param {string} name - queryData attribute name.
632
+ * @param {ReturnType<typeof JSON.parse>} value - Value to attach.
633
+ * @returns {void}
634
+ */
635
+ _setQueryData(name: string, value: ReturnType<typeof JSON.parse>): void;
636
+ /**
637
+ * All attached queryData values as a plain object. Used by the
638
+ * frontend-model serializer to ship queryData alongside the record
639
+ * attributes on the wire.
640
+ * @returns {Record<string, ReturnType<typeof JSON.parse>>} - Query-data values keyed by name.
641
+ */
642
+ queryDataValues(): Record<string, ReturnType<typeof JSON.parse>>;
643
+ /**
644
+ * Read a per-record ability result attached by `.abilities(...)`. The
645
+ * backend evaluates each requested action against the current ability
646
+ * for this record instance and ships the result alongside the
647
+ * record's attributes. Returns `false` when the action wasn't
648
+ * requested for this record — so UI code can safely branch on
649
+ * `record.can("update")` without first checking whether the ability
650
+ * was loaded.
651
+ * @param {string} action - Ability action name, e.g. `"update"`.
652
+ * @returns {boolean} - Whether the requested ability is allowed.
653
+ */
654
+ can(action: string): boolean;
655
+ /**
656
+ * Attach a per-record ability result to this record. Internal helper
657
+ * used by the `abilities` runner and by frontend-model hydration;
658
+ * outside code should not call this directly.
659
+ * @param {string} action - Ability action name.
660
+ * @param {boolean} value - Whether the current ability permits the action on this record.
661
+ * @returns {void}
662
+ */
663
+ _setComputedAbility(action: string, value: boolean): void;
664
+ /**
665
+ * All attached per-record ability results as a plain object. Used
666
+ * by the frontend-model serializer to ship results alongside the
667
+ * record attributes on the wire.
668
+ * @returns {Record<string, boolean>} - Ability results keyed by action.
669
+ */
670
+ computedAbilities(): Record<string, boolean>;
671
+ /**
672
+ * Reads a column value from the record.
673
+ * @param {string} attributeName The name of the column to read. This is the column name, not the attribute name.
674
+ * @returns {ReturnType<typeof JSON.parse>} - The column.
675
+ */
676
+ readColumn(attributeName: string): ReturnType<typeof JSON.parse>;
677
+ /**
678
+ * Resolves any declared per-attribute cast for a database column name.
679
+ * @param {string} columnName - Database column name.
680
+ * @returns {string | undefined} - Declared cast type, or undefined when none is declared.
681
+ */
682
+ _declaredAttributeCastForColumn(columnName: string): string | undefined;
683
+ /**
684
+ * Converts a stored value to a real boolean for a declared `"boolean"` cast.
685
+ * Leaves null/undefined untouched; treats 1/true/"1" as true and 0/false/"0" as false.
686
+ * @param {ReturnType<typeof JSON.parse>} value - Stored database value.
687
+ * @returns {ReturnType<typeof JSON.parse>} - Converted boolean, or the original value when not recognized.
688
+ */
689
+ _castDeclaredBooleanForRead(value: ReturnType<typeof JSON.parse>): ReturnType<typeof JSON.parse>;
690
+ /**
691
+ * Whether a column value is currently loaded on this record (either as a
692
+ * persisted attribute or a pending change). Used to decide whether a preload
693
+ * can be skipped because the required columns are already present.
694
+ * @param {string} columnName - The column name to check.
695
+ * @returns {boolean} - Whether the column is loaded.
696
+ */
697
+ hasLoadedColumn(columnName: string): boolean;
698
+ /**
699
+ * Runs normalize boolean value for read. A declared `"boolean"` attribute cast converts the
700
+ * stored value (e.g. an MSSQL `bit` 0/1) to a real boolean; otherwise the existing
701
+ * introspected-type normalization applies (no behaviour change for non-declared columns).
702
+ * @param {object} args - Options object.
703
+ * @param {string} args.columnName - Database column name being read.
704
+ * @param {string | undefined} args.columnType - Column type.
705
+ * @param {ReturnType<typeof JSON.parse>} args.value - Value to normalize.
706
+ * @returns {ReturnType<typeof JSON.parse>} - Normalized value.
707
+ */
708
+ _normalizeBooleanValueForRead({ columnName, columnType, value }: {
709
+ columnName: string;
710
+ columnType: string | undefined;
711
+ value: ReturnType<typeof JSON.parse>;
712
+ }): ReturnType<typeof JSON.parse>;
713
+ /**
714
+ * Runs normalize date value for read.
715
+ * @param {ReturnType<typeof JSON.parse>} value - Value from database.
716
+ * @returns {ReturnType<typeof JSON.parse>} - Normalized value.
717
+ */
718
+ _normalizeDateValueForRead(value: ReturnType<typeof JSON.parse>): ReturnType<typeof JSON.parse>;
719
+ _belongsToChanges(): Record<string, any>;
720
+ /**
721
+ * Runs create new record.
722
+ * @returns {Promise<void>} - Resolves when complete.
723
+ */
724
+ _createNewRecord(): Promise<void>;
725
+ /**
726
+ * Marks only relationships with in-memory loaded values as preloaded after create.
727
+ * @returns {void} - No return value.
728
+ */
729
+ _markLoadedRelationshipsPreloadedAfterCreate(): void;
730
+ /**
731
+ * Applies the database insert response to this record.
732
+ * @param {{connection: import("../drivers/base.js").default, data: Record<string, string | number | boolean | Date | null | undefined>, insertResult: Array<Record<string, string | number | boolean | Date | null | undefined>> | null | undefined, primaryKey: string}} options - Pinned insert connection, inserted data, connection result, and primary key column name.
733
+ * @returns {Promise<void>} - Resolves when complete.
734
+ */
735
+ _applyInsertResult({ connection, data, insertResult, primaryKey }: {
736
+ connection: import("../drivers/base.js").default;
737
+ data: Record<string, string | number | boolean | Date | null | undefined>;
738
+ insertResult: Array<Record<string, string | number | boolean | Date | null | undefined>> | null | undefined;
739
+ primaryKey: string;
740
+ }): Promise<void>;
741
+ /**
742
+ * Sets timestamp defaults for a new record insert.
743
+ * @param {Record<string, ReturnType<typeof JSON.parse>>} data - Column-keyed data.
744
+ * @returns {void} - No return value.
745
+ */
746
+ _setDefaultTimestampValues(data: Record<string, ReturnType<typeof JSON.parse>>): void;
747
+ /**
748
+ * Runs normalize date values for write.
749
+ * @param {Record<string, ReturnType<typeof JSON.parse>>} data - Column-keyed data.
750
+ * @returns {void} - No return value.
751
+ */
752
+ _normalizeDateValuesForWrite(data: Record<string, ReturnType<typeof JSON.parse>>): void;
753
+ /**
754
+ * Runs update record with changes.
755
+ * @returns {Promise<void>} - Resolves when complete.
756
+ */
757
+ _updateRecordWithChanges(): Promise<void>;
758
+ /**
759
+ * Runs id.
760
+ * @returns {number|string} - The id.
761
+ */
762
+ id(): number | string;
763
+ /**
764
+ * Runs is persisted.
765
+ * @returns {boolean} - Whether persisted.
766
+ */
767
+ isPersisted(): boolean;
768
+ /**
769
+ * Runs is new record.
770
+ * @returns {boolean} - Whether new record.
771
+ */
772
+ isNewRecord(): boolean;
773
+ /**
774
+ * Runs set is new record.
775
+ * @param {boolean} newIsNewRecord - New is new record.
776
+ * @returns {void} - No return value.
777
+ */
778
+ setIsNewRecord(newIsNewRecord: boolean): void;
779
+ /**
780
+ * Runs reload with id.
781
+ * @template {typeof VelociousDatabaseRecord} MC
782
+ * @param {string | number} id - Record identifier.
783
+ * @returns {Promise<void>} - Resolves when complete.
784
+ */
785
+ _reloadWithId<MC extends typeof VelociousDatabaseRecord>(id: string | number): Promise<void>;
786
+ /**
787
+ * Runs reload.
788
+ * @returns {Promise<void>} - Resolves when complete.
789
+ */
790
+ reload(): Promise<void>;
791
+ _runValidations(): Promise<void>;
792
+ /**
793
+ * Runs full error messages.
794
+ * @returns {string[]} - The full error messages.
795
+ */
796
+ fullErrorMessages(): string[];
797
+ /**
798
+ * Assigns the attributes to the record and saves it.
799
+ * @param {WriteAttributes} attributesToAssign - The attributes to assign to the record.
800
+ */
801
+ update(attributesToAssign: Record<string, any>): Promise<void>;
802
+ };
803
+ /** @type {Record<string, string> | undefined} */
804
+ _attributeNameToColumnName: Record<string, string> | undefined;
805
+ /** @type {Record<string, string> | undefined} */
806
+ _columnNameToAttributeName: Record<string, string> | undefined;
807
+ /** @type {Record<string, object> | undefined} */
808
+ _translations: Record<string, object> | undefined;
809
+ /** @type {Record<string, import("./validators/base.js").default[]> | undefined} */
810
+ _validators: Record<string, import("./validators/base.js").default[]> | undefined;
811
+ /** @type {Record<string, LifecycleCallbackType[]> | undefined} */
812
+ _lifecycleCallbacks: Record<string, LifecycleCallbackType[]> | undefined;
813
+ /** @type {Record<string, typeof import("./validators/base.js").default> | undefined} */
814
+ _validatorTypes: Record<string, typeof import("./validators/base.js").default> | undefined;
815
+ /** @type {Record<string, {driver?: string | AttachmentDriverConstructor | Record<string, ReturnType<typeof JSON.parse>>, type: "hasOne" | "hasMany"}> | undefined} */
816
+ _attachmentsMap: Record<string, {
817
+ driver?: string | AttachmentDriverConstructor | Record<string, ReturnType<typeof JSON.parse>>;
818
+ type: "hasOne" | "hasMany";
819
+ }> | undefined;
820
+ /** @type {Record<string, import("./relationships/base.js").default> | undefined} */
821
+ _relationships: Record<string, import("./relationships/base.js").default> | undefined;
822
+ /** @type {Record<string, import("../query/query-data.js").QueryDataFn> | undefined} */
823
+ _queryDataRegistrations: Record<string, import("../query/query-data.js").QueryDataFn> | undefined;
824
+ /** @type {Record<string, {allowDestroy?: boolean, limit?: number, rejectIf?: (attributes: Record<string, ReturnType<typeof JSON.parse>>) => boolean}> | undefined} */
825
+ _acceptedNestedAttributes: Record<string, {
826
+ allowDestroy?: boolean;
827
+ limit?: number;
828
+ rejectIf?: (attributes: Record<string, ReturnType<typeof JSON.parse>>) => boolean;
829
+ }> | undefined;
830
+ /** @type {Record<string, string> | undefined} */
831
+ _attributeCasts: Record<string, string> | undefined;
832
+ /** @type {Record<string, import("../drivers/base-column.js").default> | undefined} */
833
+ _columnsAsHash: Record<string, import("../drivers/base-column.js").default> | undefined;
834
+ /** @type {Array<string> | undefined} */
835
+ _columnNames: Array<string> | undefined;
836
+ /** @type {Record<string, string> | undefined} */
837
+ _columnTypeByName: Record<string, string> | undefined;
838
+ /**
839
+ * Narrows the runtime value to the documented type.
840
+ * @type {string | undefined} */
841
+ modelName: string | undefined;
842
+ /**
843
+ * Opt-in client sync declaration consumed by `SyncClient.fromConfiguration(...)`.
844
+ * Declare `static sync = true` (all defaults) or a declaration object like
845
+ * `static sync = {track: ["create", "update"], syncType: "upsert"}` to have the
846
+ * sync client auto-discover this model and derive its resource config from
847
+ * column metadata.
848
+ * @type {import("../../sync/sync-client-types.js").ModelSyncDeclaration | undefined} */
849
+ sync: import("../../sync/sync-client-types.js").ModelSyncDeclaration | undefined;
850
+ /**
851
+ * Narrows the runtime value to the documented type.
852
+ * @type {Promise<void> | null | undefined} */
853
+ _initializeRecordPromise: Promise<void> | null | undefined;
854
+ /**
855
+ * Narrows the runtime value to the documented type.
856
+ * @type {boolean | undefined} */
857
+ _eagerLoadRecordMetadata: boolean | undefined;
858
+ /**
859
+ * Narrows the runtime value to the documented type.
860
+ * @type {Record<string, import("./auditing.js").AuditCallback[]> | undefined} */
861
+ _auditCallbacks: Record<string, import("./auditing.js").AuditCallback[]> | undefined;
862
+ /**
863
+ * Narrows the runtime value to the documented type.
864
+ * @type {boolean | undefined} */
865
+ _auditLifecycleCallbacksRegistered: boolean | undefined;
866
+ /**
867
+ * Returns the model name, preferring an explicit `static modelName` declaration
868
+ * over the JavaScript class `.name` property. This allows minified builds to
869
+ * preserve correct model names without relying on `keep_classnames`.
870
+ * @returns {string} - The model name.
871
+ */
872
+ getModelName(): string;
873
+ getAttributeNameToColumnNameMap(): Record<string, string>;
874
+ /**
875
+ * Resolves the database column name for a record attribute name.
876
+ * @param {string} attributeName - Attribute name to resolve.
877
+ * @returns {string} - Mapped column name, or the underscored attribute name when no mapping exists.
878
+ */
879
+ getColumnNameForAttributeName(attributeName: string): string;
880
+ /**
881
+ * Resolves an incoming attribute or column name to the canonical attribute name this model exposes.
882
+ * Accepts the canonical (deburred) attribute name, a raw umlaut/acronym column name, a pre-deburr
883
+ * camelization, and camelCase casing variants (e.g. "vAFunktionID" vs "vAFunktionid"). Returns null
884
+ * when nothing matches, so callers keep their own not-found handling.
885
+ * @param {string} name - Attribute name or column name to resolve.
886
+ * @returns {string | null} - Canonical attribute name, or null.
887
+ */
888
+ resolveAttributeName(name: string): string | null;
889
+ /**
890
+ * Finds the member name on a target's prototype chain matching `memberName`, falling back to a
891
+ * case-insensitive match. Resolves setters when a read-only attribute alias differs only in camelCase
892
+ * casing from the generated accessor (e.g. a "vAFunktionID" alias whose setter is "setVAFunktionid").
893
+ * @param {object} target - Instance or prototype to search.
894
+ * @param {string} memberName - Member name to find.
895
+ * @returns {string | null} - Matching member name, or null when absent.
896
+ */
897
+ findMemberNameInsensitive(target: object, memberName: string): string | null;
898
+ /**
899
+ * Runs define scope.
900
+ * @param {(...args: Array<ReturnType<typeof JSON.parse>>) => ReturnType<typeof JSON.parse>} callback - Scope callback.
901
+ * @returns {((...args: Array<ReturnType<typeof JSON.parse>>) => import("../query/model-class-query.js").default<typeof VelociousDatabaseRecord>) & {scope: (...args: Array<ReturnType<typeof JSON.parse>>) => import("../../utils/model-scope.js").ModelScopeDescriptor}} - Scope helper.
902
+ */
903
+ defineScope(callback: (...args: Array<ReturnType<typeof JSON.parse>>) => ReturnType<typeof JSON.parse>): ((...args: Array<ReturnType<typeof JSON.parse>>) => import("../query/model-class-query.js").default<typeof VelociousDatabaseRecord>) & {
904
+ scope: (...args: Array<ReturnType<typeof JSON.parse>>) => import("../../utils/model-scope.js").ModelScopeDescriptor;
905
+ };
906
+ getColumnNameToAttributeNameMap(): Record<string, string>;
907
+ getTranslationsMap(): Record<string, object>;
908
+ getValidatorsMap(): Record<string, import("./validators/base.js").default[]>;
909
+ /**
910
+ * Runs get lifecycle callbacks map.
911
+ * @returns {Record<string, LifecycleCallbackType[]>} - Lifecycle callbacks keyed by name.
912
+ */
913
+ getLifecycleCallbacksMap(): Record<string, LifecycleCallbackType[]>;
914
+ getValidatorTypesMap(): Record<string, typeof import("./validators/base.js").default>;
915
+ /**
916
+ * Runs get attachments map.
917
+ * @returns {Record<string, {driver?: string | AttachmentDriverConstructor | Record<string, ReturnType<typeof JSON.parse>>, type: "hasOne" | "hasMany"}>} - Attachment definitions keyed by name.
918
+ */
919
+ getAttachmentsMap(): Record<string, {
920
+ driver?: string | AttachmentDriverConstructor | Record<string, ReturnType<typeof JSON.parse>>;
921
+ type: "hasOne" | "hasMany";
922
+ }>;
923
+ validatorTypes(): Record<string, typeof import("./validators/base.js").default>;
924
+ /**
925
+ * Runs register validator type.
926
+ * @param {string} name - Name.
927
+ * @param {typeof import("./validators/base.js").default} validatorClass - Validator class.
928
+ */
929
+ registerValidatorType(name: string, validatorClass: typeof import("./validators/base.js").default): void;
930
+ /**
931
+ * Runs register lifecycle callback.
932
+ * @param {"afterCreate" | "afterDestroy" | "afterSave" | "afterUpdate" | "beforeCreate" | "beforeDestroy" | "beforeSave" | "beforeUpdate" | "beforeValidation"} callbackName - Callback type.
933
+ * @param {LifecycleCallbackType} callback - Callback function or instance method name.
934
+ * @returns {void}
935
+ */
936
+ registerLifecycleCallback(callbackName: "afterCreate" | "afterDestroy" | "afterSave" | "afterUpdate" | "beforeCreate" | "beforeDestroy" | "beforeSave" | "beforeUpdate" | "beforeValidation", callback: LifecycleCallbackType): void;
937
+ /**
938
+ * Runs unregister lifecycle callback.
939
+ * @param {"afterCreate" | "afterDestroy" | "afterSave" | "afterUpdate" | "beforeCreate" | "beforeDestroy" | "beforeSave" | "beforeUpdate" | "beforeValidation"} callbackName - Callback type.
940
+ * @param {LifecycleCallbackType} callback - Previously registered callback.
941
+ * @returns {void}
942
+ */
943
+ unregisterLifecycleCallback(callbackName: "afterCreate" | "afterDestroy" | "afterSave" | "afterUpdate" | "beforeCreate" | "beforeDestroy" | "beforeSave" | "beforeUpdate" | "beforeValidation", callback: LifecycleCallbackType): void;
944
+ /**
945
+ * Runs before validation.
946
+ * @template R
947
+ * @this {ModelConstructor<R>}
948
+ * @param {LifecycleCallbackType<R>} callback - Callback function or instance method name.
949
+ * @returns {void}
950
+ */
951
+ beforeValidation<R>(this: ModelConstructor<R>, callback: LifecycleCallbackType<R>): void;
952
+ /**
953
+ * Runs before save.
954
+ * @template R
955
+ * @this {ModelConstructor<R>}
956
+ * @param {LifecycleCallbackType<R>} callback - Callback function or instance method name.
957
+ * @returns {void}
958
+ */
959
+ beforeSave<R>(this: ModelConstructor<R>, callback: LifecycleCallbackType<R>): void;
960
+ /**
961
+ * Runs before create.
962
+ * @template R
963
+ * @this {ModelConstructor<R>}
964
+ * @param {LifecycleCallbackType<R>} callback - Callback function or instance method name.
965
+ * @returns {void}
966
+ */
967
+ beforeCreate<R>(this: ModelConstructor<R>, callback: LifecycleCallbackType<R>): void;
968
+ /**
969
+ * Runs before update.
970
+ * @template R
971
+ * @this {ModelConstructor<R>}
972
+ * @param {LifecycleCallbackType<R>} callback - Callback function or instance method name.
973
+ * @returns {void}
974
+ */
975
+ beforeUpdate<R>(this: ModelConstructor<R>, callback: LifecycleCallbackType<R>): void;
976
+ /**
977
+ * Runs before destroy.
978
+ * @template R
979
+ * @this {ModelConstructor<R>}
980
+ * @param {LifecycleCallbackType<R>} callback - Callback function or instance method name.
981
+ * @returns {void}
982
+ */
983
+ beforeDestroy<R>(this: ModelConstructor<R>, callback: LifecycleCallbackType<R>): void;
984
+ /**
985
+ * Runs after save.
986
+ * @template R
987
+ * @this {ModelConstructor<R>}
988
+ * @param {LifecycleCallbackType<R>} callback - Callback function or instance method name.
989
+ * @returns {void}
990
+ */
991
+ afterSave<R>(this: ModelConstructor<R>, callback: LifecycleCallbackType<R>): void;
992
+ /**
993
+ * Runs after create.
994
+ * @template R
995
+ * @this {ModelConstructor<R>}
996
+ * @param {LifecycleCallbackType<R>} callback - Callback function or instance method name.
997
+ * @returns {void}
998
+ */
999
+ afterCreate<R>(this: ModelConstructor<R>, callback: LifecycleCallbackType<R>): void;
1000
+ /**
1001
+ * Runs after update.
1002
+ * @template R
1003
+ * @this {ModelConstructor<R>}
1004
+ * @param {LifecycleCallbackType<R>} callback - Callback function or instance method name.
1005
+ * @returns {void}
1006
+ */
1007
+ afterUpdate<R>(this: ModelConstructor<R>, callback: LifecycleCallbackType<R>): void;
1008
+ /**
1009
+ * Runs after destroy.
1010
+ * @template R
1011
+ * @this {ModelConstructor<R>}
1012
+ * @param {LifecycleCallbackType<R>} callback - Callback function or instance method name.
1013
+ * @returns {void}
1014
+ */
1015
+ afterDestroy<R>(this: ModelConstructor<R>, callback: LifecycleCallbackType<R>): void;
1016
+ /**
1017
+ * Enables automatic create/update/destroy auditing for this model.
1018
+ * @returns {void}
1019
+ */
1020
+ audited(): void;
1021
+ /**
1022
+ * Declares an aasm-style state machine on this model: named states, events
1023
+ * (guarded transitions), and enter/exit + before/after transition hooks. See
1024
+ * `state-machine.js`. Generates `event()` / `eventAndSave()` / `canEvent()`
1025
+ * transition methods per declared event.
1026
+ * @param {import("./state-machine.js").StateMachineDefinition} definition - State machine definition.
1027
+ * @returns {void}
1028
+ */
1029
+ stateMachine(definition: import("./state-machine.js").StateMachineDefinition): void;
1030
+ /**
1031
+ * Returns this model's state machine definition, or null when it declares none.
1032
+ * `Model.stateMachine(...)` overrides this on classes that declare a machine.
1033
+ * @returns {import("./state-machine.js").StateMachineDefinition | null} - The state machine definition, or null when none is declared.
1034
+ */
1035
+ getStateMachineDefinition(): import("./state-machine.js").StateMachineDefinition | null;
1036
+ /**
1037
+ * Returns this model's state column, or null when it declares no state machine.
1038
+ * @returns {string | null} - The state column name, or null when no state machine is declared.
1039
+ */
1040
+ getStateMachineColumn(): string | null;
1041
+ /**
1042
+ * Returns this model's declared state names (empty when it has no state machine).
1043
+ * @returns {string[]} - The declared state names, or an empty array when no state machine is declared.
1044
+ */
1045
+ getStateMachineStateNames(): string[];
1046
+ /**
1047
+ * Maintains a counter column on a `belongsTo` parent as the sum of a per-record
1048
+ * magnitude, kept current by atomic increments diffed on every create/update/
1049
+ * destroy (and moved between parents when the foreign key changes). See
1050
+ * `counter-cache-magnitude.js`.
1051
+ * @param {import("./counter-cache-magnitude.js").MagnitudeCounterCacheDefinition} definition - Counter cache definition.
1052
+ * @returns {void}
1053
+ */
1054
+ magnitudeCounterCache(definition: import("./counter-cache-magnitude.js").MagnitudeCounterCacheDefinition): void;
1055
+ /**
1056
+ * Registers a callback invoked after this model writes an audit row for the action.
1057
+ * @template {typeof VelociousDatabaseRecord} MC
1058
+ * @this {MC}
1059
+ * @param {string} action - Audit action name.
1060
+ * @param {import("./auditing.js").AuditCallback} callback - Callback to run after audit creation.
1061
+ * @returns {() => void} Unsubscribe function.
1062
+ */
1063
+ onAudit<MC extends typeof VelociousDatabaseRecord>(this: MC, action: string, callback: import("./auditing.js").AuditCallback): () => void;
1064
+ /**
1065
+ * Returns records that do not have an audit row for the given action.
1066
+ * @template {typeof VelociousDatabaseRecord} MC
1067
+ * @this {MC}
1068
+ * @param {string} action - Audit action name.
1069
+ * @returns {ModelClassQuery<MC>} Query scoped to records without that audit action.
1070
+ */
1071
+ withoutAudit<MC extends typeof VelociousDatabaseRecord>(this: MC, action: string): ModelClassQuery<MC>;
1072
+ /**
1073
+ * Runs get validator type.
1074
+ * @param {string} validatorName - Validator name.
1075
+ * @returns {typeof import("./validators/base.js").default} - The validator type.
1076
+ */
1077
+ getValidatorType(validatorName: string): typeof import("./validators/base.js").default;
1078
+ /**
1079
+ * Runs relationship exists.
1080
+ * @param {string} relationshipName - Relationship name.
1081
+ * @returns {boolean} - Whether relationship exists.
1082
+ */
1083
+ _relationshipExists(relationshipName: string): boolean;
1084
+ /**
1085
+ * RelationshipScopeCallback type.
1086
+ * @typedef {(query: import("../query/model-class-query.js").default<typeof VelociousDatabaseRecord>) => (import("../query/model-class-query.js").default<typeof VelociousDatabaseRecord> | void)} RelationshipScopeCallback
1087
+ */
1088
+ /**
1089
+ * RelationshipDataArgumentType type.
1090
+ * @typedef {object} RelationshipDataArgumentType
1091
+ * @property {boolean} [autoload] - Disable auto-batch-preload for this relationship by passing false. Default true.
1092
+ * @property {string} [className] - Model class name for the related record.
1093
+ * @property {string} [dependent] - Dependent action when parent is destroyed (e.g. "destroy").
1094
+ * @property {typeof VelociousDatabaseRecord} [klass] - Model class for the related record.
1095
+ * @property {RelationshipScopeCallback} [scope] - Optional scope callback for the relationship.
1096
+ * @property {string} [type] - Relationship type (e.g. "hasMany", "belongsTo").
1097
+ */
1098
+ /**
1099
+ * Runs define relationship.
1100
+ * @param {string} relationshipName - Relationship name.
1101
+ * @param {RelationshipDataArgumentType} data - Data payload.
1102
+ */
1103
+ _defineRelationship(relationshipName: string, data: RelationshipDataArgumentType): void;
1104
+ /**
1105
+ * Runs normalize relationship args.
1106
+ * @param {RelationshipScopeCallback | object | undefined} scopeOrOptions - Scope callback or options.
1107
+ * @param {object | undefined} options - Options.
1108
+ * @returns {{scope: (RelationshipScopeCallback | undefined), relationshipOptions: object}} - Normalized arguments.
1109
+ */
1110
+ _normalizeRelationshipArgs(scopeOrOptions: RelationshipScopeCallback | object | undefined, options: object | undefined): {
1111
+ scope: (RelationshipScopeCallback | undefined);
1112
+ relationshipOptions: object;
1113
+ };
1114
+ /**
1115
+ * Registers afterCreate, afterSave, and afterDestroy callbacks to sync
1116
+ * a counter cache column on the parent model. The column name follows
1117
+ * the convention `<childModelPluralCamelCase>Count`.
1118
+ * @param {string} relationshipName - The belongsTo relationship name.
1119
+ */
1120
+ _registerCounterCacheCallbacks(relationshipName: string): void;
1121
+ /**
1122
+ * Runs get relationship by name.
1123
+ * @param {string} relationshipName - Relationship name.
1124
+ * @returns {import("./relationships/base.js").default} - The relationship by name.
1125
+ */
1126
+ getRelationshipByName(relationshipName: string): import("./relationships/base.js").default;
1127
+ /**
1128
+ * Runs get relationships.
1129
+ * @returns {Array<import("./relationships/base.js").default>} - The relationships.
1130
+ */
1131
+ getRelationships(): Array<import("./relationships/base.js").default>;
1132
+ /**
1133
+ * Runs get relationships map.
1134
+ * @returns {Record<string, import("./relationships/base.js").default>} - Relationship definitions keyed by name.
1135
+ */
1136
+ getRelationshipsMap(): Record<string, import("./relationships/base.js").default>;
1137
+ /**
1138
+ * Runs get relationship names.
1139
+ * @returns {Array<string>} - The relationship names.
1140
+ */
1141
+ getRelationshipNames(): Array<string>;
1142
+ /**
1143
+ * Register a consumer-defined queryData entry. The callback receives
1144
+ * a grouped query already joined down the relationship chain from the
1145
+ * root of `.queryData(...)` to this model, already filtered by the
1146
+ * root parent IDs, and with `parent_id` pre-selected — so the fn
1147
+ * only needs to add its own SELECT (and optionally joins/where). Any
1148
+ * aliases the fn selects are attached to each **root** record via
1149
+ * `record.queryData(aliasName)`. Multi-column selects are fine — one
1150
+ * alias maps to one queryData key.
1151
+ *
1152
+ * **Quote AS aliases on PostgreSQL.** PostgreSQL folds unquoted
1153
+ * identifiers (including SELECT aliases) to lowercase, so a
1154
+ * `... AS manualTasksCount` lands in the result row as
1155
+ * `manualtaskscount` while the lookup `record.queryData("manualTasksCount")`
1156
+ * never finds it. Use `driver.quoteColumn("manualTasksCount")` for the
1157
+ * alias to preserve the case on every supported driver:
1158
+ * query.select(`COUNT(...) AS ${driver.quoteColumn("manualTasksCount")}`)
1159
+ * @param {string} name - Identifier used in the `.queryData(...)` spec.
1160
+ * @param {import("../query/query-data.js").QueryDataFn} fn - Callback that mutates the query.
1161
+ * @returns {void}
1162
+ */
1163
+ queryData(name: string, fn: import("../query/query-data.js").QueryDataFn): void;
1164
+ /**
1165
+ * Runs get query data map.
1166
+ * @returns {Record<string, import("../query/query-data.js").QueryDataFn>} - queryData registrations keyed by name.
1167
+ */
1168
+ getQueryDataMap(): Record<string, import("../query/query-data.js").QueryDataFn>;
1169
+ /**
1170
+ * Runs get query data by name.
1171
+ * @param {string} name - queryData name.
1172
+ * @returns {import("../query/query-data.js").QueryDataFn | null} - Registered fn or null when not found.
1173
+ */
1174
+ getQueryDataByName(name: string): import("../query/query-data.js").QueryDataFn | null;
1175
+ /**
1176
+ * Runs get attachments.
1177
+ * @returns {Record<string, {driver?: string | AttachmentDriverConstructor | Record<string, ReturnType<typeof JSON.parse>>, type: "hasOne" | "hasMany"}>} - Attachment definitions.
1178
+ */
1179
+ getAttachments(): Record<string, {
1180
+ driver?: string | AttachmentDriverConstructor | Record<string, ReturnType<typeof JSON.parse>>;
1181
+ type: "hasOne" | "hasMany";
1182
+ }>;
1183
+ /**
1184
+ * Runs get attachment by name.
1185
+ * @param {string} attachmentName - Attachment name.
1186
+ * @returns {{driver?: string | AttachmentDriverConstructor | Record<string, ReturnType<typeof JSON.parse>>, type: "hasOne" | "hasMany"}} - Attachment definition.
1187
+ */
1188
+ getAttachmentByName(attachmentName: string): {
1189
+ driver?: string | AttachmentDriverConstructor | Record<string, ReturnType<typeof JSON.parse>>;
1190
+ type: "hasOne" | "hasMany";
1191
+ };
1192
+ /**
1193
+ * Adds a belongs-to-relationship to the model.
1194
+ * @param {string} relationshipName The name of the relationship.
1195
+ * @param {RelationshipScopeCallback | object} [scopeOrOptions] The scope callback or options for the relationship.
1196
+ * @param {object} [options] The options for the relationship.
1197
+ */
1198
+ belongsTo(relationshipName: string, scopeOrOptions?: RelationshipScopeCallback | object, options?: object): void;
1199
+ /**
1200
+ * Runs connection.
1201
+ * @param {object} [args] - Options.
1202
+ * @param {boolean} [args.enforceTenantDatabaseScope] - Whether tenant-switched models must resolve a tenant database identifier.
1203
+ * @returns {import("../drivers/base.js").default} - The connection.
1204
+ */
1205
+ connection({ enforceTenantDatabaseScope, ...restArgs }?: {
1206
+ enforceTenantDatabaseScope?: boolean;
1207
+ }): import("../drivers/base.js").default;
1208
+ /**
1209
+ * Runs create.
1210
+ * @template {Record<string, ReturnType<typeof JSON.parse>>} CreateAttributes
1211
+ * @template {VelociousDatabaseRecord<CreateAttributes>} Model
1212
+ * @this {{new (changes?: CreateAttributes): Model} & typeof VelociousDatabaseRecord}
1213
+ * @param {CreateAttributes} [attributes] - Attributes.
1214
+ * @returns {Promise<Model>} - Resolves with the create.
1215
+ */
1216
+ create<CreateAttributes extends Record<string, ReturnType<typeof JSON.parse>>, Model extends VelociousDatabaseRecord<CreateAttributes>>(this: {
1217
+ new (changes?: CreateAttributes): Model;
1218
+ } & typeof VelociousDatabaseRecord, attributes?: CreateAttributes): Promise<Model>;
1219
+ /**
1220
+ * Runs get configuration.
1221
+ * @returns {import("../../configuration.js").default} - The configuration.
1222
+ */
1223
+ _getConfiguration(): import("../../configuration.js").default;
1224
+ _configuration: Configuration | undefined;
1225
+ /**
1226
+ * Adds a has-many-relationship to the model class.
1227
+ * @param {string} relationshipName The name of the relationship (e.g. "posts")
1228
+ * @param {RelationshipScopeCallback | object} [scopeOrOptions] The scope callback or options for the relationship.
1229
+ * @param {object} [options] The options for the relationship (e.g. {className: "Post"})
1230
+ * @returns {void} - No return value.
1231
+ */
1232
+ hasMany(relationshipName: string, scopeOrOptions?: RelationshipScopeCallback | object, options?: object): void;
1233
+ /**
1234
+ * Rails-style declaration that this model accepts nested-attribute writes
1235
+ * for a relationship when saved through a parent. Required — Velocious
1236
+ * will refuse nested writes for any relationship not listed here, even
1237
+ * if a frontend-model resource permits them.
1238
+ *
1239
+ * Options:
1240
+ * - allowDestroy: whether `_destroy: true` entries are allowed. Default false.
1241
+ * - limit: optional upper bound on the number of nested entries per request.
1242
+ * - rejectIf: optional predicate `(attributes) => boolean` that silently skips entries.
1243
+ *
1244
+ * Usage:
1245
+ * class Project extends Record {}
1246
+ * Project.hasMany("tasks")
1247
+ * Project.acceptsNestedAttributesFor("tasks", {allowDestroy: true})
1248
+ * @param {string} relationshipName - Relationship name on this model.
1249
+ * @param {{allowDestroy?: boolean, limit?: number, rejectIf?: (attributes: Record<string, ReturnType<typeof JSON.parse>>) => boolean}} [options] - Policy options.
1250
+ * @returns {void}
1251
+ */
1252
+ acceptsNestedAttributesFor(relationshipName: string, options?: {
1253
+ allowDestroy?: boolean;
1254
+ limit?: number;
1255
+ rejectIf?: (attributes: Record<string, ReturnType<typeof JSON.parse>>) => boolean;
1256
+ }): void;
1257
+ /**
1258
+ * Runs accepted nested attributes for.
1259
+ * @param {string} relationshipName - Relationship name.
1260
+ * @returns {{allowDestroy?: boolean, limit?: number, rejectIf?: (attributes: Record<string, ReturnType<typeof JSON.parse>>) => boolean} | null} - Policy declared via `acceptsNestedAttributesFor`, or null when not accepted.
1261
+ */
1262
+ acceptedNestedAttributesFor(relationshipName: string): {
1263
+ allowDestroy?: boolean;
1264
+ limit?: number;
1265
+ rejectIf?: (attributes: Record<string, ReturnType<typeof JSON.parse>>) => boolean;
1266
+ } | null;
1267
+ /**
1268
+ * Adds a has-one-relationship to the model class.
1269
+ * @param {string} relationshipName The name of the relationship (e.g. "post")
1270
+ * @param {RelationshipScopeCallback | object} [scopeOrOptions] The scope callback or options for the relationship.
1271
+ * @param {object} [options] The options for the relationship (e.g. {className: "Post"})
1272
+ * @returns {void} - No return value.
1273
+ */
1274
+ hasOne(relationshipName: string, scopeOrOptions?: RelationshipScopeCallback | object, options?: object): void;
1275
+ /**
1276
+ * Runs define attachment.
1277
+ * @param {string} attachmentName - Attachment name.
1278
+ * @param {object} args - Attachment args.
1279
+ * @param {string | AttachmentDriverConstructor | Record<string, ReturnType<typeof JSON.parse>>} [args.driver] - Attachment driver name, class, or instance.
1280
+ * @param {"hasOne" | "hasMany"} args.type - Attachment type.
1281
+ * @returns {void} - No return value.
1282
+ */
1283
+ _defineAttachment(attachmentName: string, { driver, type }: {
1284
+ driver?: string | AttachmentDriverConstructor | Record<string, ReturnType<typeof JSON.parse>>;
1285
+ type: "hasOne" | "hasMany";
1286
+ }): void;
1287
+ /**
1288
+ * Adds a single attachment helper to the model.
1289
+ * @param {string} attachmentName - Attachment name.
1290
+ * @param {{driver?: string | AttachmentDriverConstructor | Record<string, ReturnType<typeof JSON.parse>>}} [args] - Attachment options.
1291
+ * @returns {void} - No return value.
1292
+ */
1293
+ hasOneAttachment(attachmentName: string, args?: {
1294
+ driver?: string | AttachmentDriverConstructor | Record<string, ReturnType<typeof JSON.parse>>;
1295
+ }): void;
1296
+ /**
1297
+ * Adds a collection attachment helper to the model.
1298
+ * @param {string} attachmentName - Attachment name.
1299
+ * @param {{driver?: string | AttachmentDriverConstructor | Record<string, ReturnType<typeof JSON.parse>>}} [args] - Attachment options.
1300
+ * @returns {void} - No return value.
1301
+ */
1302
+ hasManyAttachments(attachmentName: string, args?: {
1303
+ driver?: string | AttachmentDriverConstructor | Record<string, ReturnType<typeof JSON.parse>>;
1304
+ }): void;
1305
+ /**
1306
+ * Runs human attribute name.
1307
+ * @param {string} attributeName - Attribute name.
1308
+ * @returns {string} - The human attribute name.
1309
+ */
1310
+ humanAttributeName(attributeName: string): string;
1311
+ /**
1312
+ * Runs get database type.
1313
+ * @returns {string} - The database type.
1314
+ */
1315
+ getDatabaseType(): string;
1316
+ /**
1317
+ * Runs set eager load record metadata.
1318
+ * @param {boolean} eagerLoadRecordMetadata - Whether require-context initialization should load table metadata for this model.
1319
+ * @returns {void} - No return value.
1320
+ */
1321
+ setEagerLoadRecordMetadata(eagerLoadRecordMetadata: boolean): void;
1322
+ /**
1323
+ * Runs get eager load record metadata.
1324
+ * @returns {boolean} - Whether require-context initialization should load table metadata for this model.
1325
+ */
1326
+ getEagerLoadRecordMetadata(): boolean;
1327
+ /**
1328
+ * Runs reset record metadata.
1329
+ * @returns {void} - No return value.
1330
+ */
1331
+ resetRecordMetadata(): void;
1332
+ _initialized: boolean | undefined;
1333
+ _databaseType: string | undefined;
1334
+ _table: import("../drivers/base-table.js").default | undefined;
1335
+ _columns: import("../drivers/base-column.js").default[] | undefined;
1336
+ /**
1337
+ * Registers the model class with a configuration without loading table metadata.
1338
+ * @param {object} args - Options object.
1339
+ * @param {import("../../configuration.js").default} args.configuration - Configuration instance.
1340
+ * @returns {void} - No return value.
1341
+ */
1342
+ registerRecordClass({ configuration, ...restArgs }: {
1343
+ configuration: import("../../configuration.js").default;
1344
+ }): void;
1345
+ /**
1346
+ * Runs initialize record.
1347
+ * @param {object} args - Options object.
1348
+ * @param {import("../../configuration.js").default} args.configuration - Configuration instance.
1349
+ * @param {import("../drivers/base.js").default} [args.connection] - Explicit metadata connection.
1350
+ * @returns {Promise<void>} - Resolves when complete.
1351
+ */
1352
+ initializeRecord({ configuration, connection: explicitConnection, ...restArgs }: {
1353
+ configuration: import("../../configuration.js").default;
1354
+ connection?: import("../drivers/base.js").default;
1355
+ }): Promise<void>;
1356
+ /**
1357
+ * Initializes the model class the first time an async record API needs table
1358
+ * metadata. Concurrent callers share the same initialization promise, and a
1359
+ * failed initialization can be retried by a later call.
1360
+ * @param {{configuration?: import("../../configuration.js").default, connection?: import("../drivers/base.js").default}} [args] - Optional configuration and explicit metadata connection.
1361
+ * @returns {Promise<void>} - Resolves when the model class is initialized.
1362
+ */
1363
+ ensureInitialized(args?: {
1364
+ configuration?: import("../../configuration.js").default;
1365
+ connection?: import("../drivers/base.js").default;
1366
+ }): Promise<void>;
1367
+ /**
1368
+ * Runs is initialized.
1369
+ * @returns {boolean} - Whether initialized.
1370
+ */
1371
+ isInitialized(): boolean;
1372
+ /**
1373
+ * Runs assert has been initialized.
1374
+ * @returns {void} - No return value.
1375
+ */
1376
+ _assertHasBeenInitialized(): void;
1377
+ /**
1378
+ * Defines translation accessors and initializes the generated translation
1379
+ * class through the same metadata connection as the translated model.
1380
+ * @param {import("../drivers/base.js").default} connection - Metadata connection.
1381
+ * @returns {Promise<void>} - Resolves when translation metadata is ready.
1382
+ */
1383
+ _defineTranslationMethods(connection: import("../drivers/base.js").default): Promise<void>;
1384
+ /**
1385
+ * Runs get configured database identifier.
1386
+ * @returns {string} - The configured non-tenant database identifier.
1387
+ */
1388
+ getConfiguredDatabaseIdentifier(): string;
1389
+ /**
1390
+ * Runs get database identifier.
1391
+ * @param {object} [args] - Options.
1392
+ * @param {boolean} [args.enforceTenantDatabaseScope] - Whether tenant-switched models must resolve a tenant database identifier.
1393
+ * @param {object} [args.tenant] - Explicit tenant descriptor instead of the ambient tenant.
1394
+ * @returns {string} - The database identifier.
1395
+ */
1396
+ getDatabaseIdentifier({ enforceTenantDatabaseScope, tenant, ...restArgs }?: {
1397
+ enforceTenantDatabaseScope?: boolean;
1398
+ tenant?: object;
1399
+ }): string;
1400
+ /**
1401
+ * Runs set database identifier.
1402
+ * @param {string} databaseIdentifier - Database identifier.
1403
+ * @returns {void} - No return value.
1404
+ */
1405
+ setDatabaseIdentifier(databaseIdentifier: string): void;
1406
+ _databaseIdentifier: string | undefined;
1407
+ /**
1408
+ * Declares a tenant-aware database identifier resolver for this model class.
1409
+ * @param {string | ((args: {modelClass: typeof VelociousDatabaseRecord, tenant: Record<string, unknown> | null | undefined}) => string | undefined)} databaseIdentifierOrResolver - Static identifier or resolver.
1410
+ * @returns {void} - No return value.
1411
+ */
1412
+ switchesTenantDatabase(databaseIdentifierOrResolver: string | ((args: {
1413
+ modelClass: typeof VelociousDatabaseRecord;
1414
+ tenant: Record<string, unknown> | null | undefined;
1415
+ }) => string | undefined)): void;
1416
+ _tenantDatabaseIdentifierResolver: string | ((args: {
1417
+ modelClass: typeof VelociousDatabaseRecord;
1418
+ tenant: Record<string, unknown> | null | undefined;
1419
+ }) => string | undefined) | undefined;
1420
+ /**
1421
+ * Runs has tenant database identifier resolver.
1422
+ * @returns {boolean} - Whether this model resolves its database from the current tenant.
1423
+ */
1424
+ hasTenantDatabaseIdentifierResolver(): boolean;
1425
+ /**
1426
+ * Runs get tenant database identifier.
1427
+ * @param {ReturnType<typeof JSON.parse>} [tenant] - Tenant override.
1428
+ * @returns {string | undefined} - Tenant-scoped database identifier when configured.
1429
+ */
1430
+ getTenantDatabaseIdentifier(tenant?: ReturnType<typeof JSON.parse>): string | undefined;
1431
+ /**
1432
+ * Whether a declared `"boolean"` attribute cast is backed by an integer column (e.g. an MSSQL
1433
+ * `bit`), so booleans must be stored as 1/0. A native boolean column (e.g. Postgres `boolean`)
1434
+ * returns false and keeps `true`/`false` for the driver.
1435
+ * @param {string} attributeName - Attribute name.
1436
+ * @returns {boolean} - Whether the declared boolean is stored as an integer.
1437
+ */
1438
+ _declaredBooleanStoresAsInteger(attributeName: string): boolean;
1439
+ /**
1440
+ * Runs get columns.
1441
+ * @returns {import("../drivers/base-column.js").default[]} - The columns.
1442
+ */
1443
+ getColumns(): import("../drivers/base-column.js").default[];
1444
+ /**
1445
+ * Runs get columns hash.
1446
+ * @returns {Record<string, import("../drivers/base-column.js").default>} - The columns hash.
1447
+ */
1448
+ getColumnsHash(): Record<string, import("../drivers/base-column.js").default>;
1449
+ /**
1450
+ * Runs get column type by name.
1451
+ * @param {string} name - Name.
1452
+ * @returns {string | undefined} - The column type by name.
1453
+ */
1454
+ getColumnTypeByName(name: string): string | undefined;
1455
+ /**
1456
+ * Runs is date like type.
1457
+ * @param {string} type - Type identifier.
1458
+ * @returns {boolean} - Whether date like type.
1459
+ */
1460
+ _isDateLikeType(type: string): boolean;
1461
+ /**
1462
+ * Runs get column names.
1463
+ * @returns {Array<string>} - The column names.
1464
+ */
1465
+ getColumnNames(): Array<string>;
1466
+ /**
1467
+ * Runs get table.
1468
+ * @returns {import("../drivers/base-table.js").default} - The table.
1469
+ */
1470
+ _getTable(): import("../drivers/base-table.js").default;
1471
+ /**
1472
+ * Runs insert multiple.
1473
+ * @param {Array<string>} columns - Column names.
1474
+ * @param {Array<Array<ReturnType<typeof JSON.parse>>>} rows - Rows to insert.
1475
+ * @param {object} [args] - Options object.
1476
+ * @param {boolean} [args.cast] - Whether to cast values based on column types.
1477
+ * @param {boolean} [args.retryIndividuallyOnFailure] - Retry rows individually if a batch insert fails.
1478
+ * @param {boolean} [args.returnResults] - Return succeeded/failed rows instead of throwing when retries fail.
1479
+ * @returns {Promise<void | {succeededRows: Array<Array<ReturnType<typeof JSON.parse>>>, failedRows: Array<Array<ReturnType<typeof JSON.parse>>>, errors: Array<{row: Array<ReturnType<typeof JSON.parse>>, error: ReturnType<typeof JSON.parse>}>}>} - Resolves when complete.
1480
+ */
1481
+ insertMultiple(columns: Array<string>, rows: Array<Array<ReturnType<typeof JSON.parse>>>, args?: {
1482
+ cast?: boolean;
1483
+ retryIndividuallyOnFailure?: boolean;
1484
+ returnResults?: boolean;
1485
+ }): Promise<void | {
1486
+ succeededRows: Array<Array<ReturnType<typeof JSON.parse>>>;
1487
+ failedRows: Array<Array<ReturnType<typeof JSON.parse>>>;
1488
+ errors: Array<{
1489
+ row: Array<ReturnType<typeof JSON.parse>>;
1490
+ error: ReturnType<typeof JSON.parse>;
1491
+ }>;
1492
+ }>;
1493
+ /**
1494
+ * Runs normalize insert multiple rows.
1495
+ * @param {object} args - Options object.
1496
+ * @param {Array<string>} args.columns - Column names.
1497
+ * @param {Array<Array<ReturnType<typeof JSON.parse>>>} args.rows - Rows to insert.
1498
+ * @returns {Array<Array<ReturnType<typeof JSON.parse>>>} - Normalized rows.
1499
+ */
1500
+ _normalizeInsertMultipleRows({ columns, rows }: {
1501
+ columns: Array<string>;
1502
+ rows: Array<Array<ReturnType<typeof JSON.parse>>>;
1503
+ }): Array<Array<ReturnType<typeof JSON.parse>>>;
1504
+ /**
1505
+ * Runs safe serialize insert row.
1506
+ * @param {Array<ReturnType<typeof JSON.parse>>} row - Row to serialize.
1507
+ * @returns {string} - Safe row representation.
1508
+ */
1509
+ _safeSerializeInsertRow(row: Array<ReturnType<typeof JSON.parse>>): string;
1510
+ /**
1511
+ * Runs normalize insert value for column.
1512
+ * @param {object} args - Options object.
1513
+ * @param {string} args.columnName - Column name.
1514
+ * @param {ReturnType<typeof JSON.parse>} args.value - Column value.
1515
+ * @returns {ReturnType<typeof JSON.parse>} - Normalized value.
1516
+ */
1517
+ _normalizeInsertValueForColumn({ columnName, value }: {
1518
+ columnName: string;
1519
+ value: ReturnType<typeof JSON.parse>;
1520
+ }): ReturnType<typeof JSON.parse>;
1521
+ /**
1522
+ * Runs is string type.
1523
+ * @param {string | undefined} columnType - Column type.
1524
+ * @returns {boolean} - Whether string-like type.
1525
+ */
1526
+ _isStringType(columnType: string | undefined): boolean;
1527
+ /**
1528
+ * Runs is numeric type.
1529
+ * @param {string} columnType - Column type.
1530
+ * @returns {boolean} - Whether numeric-like type.
1531
+ */
1532
+ _isNumericType(columnType: string): boolean;
1533
+ /**
1534
+ * Runs normalize numeric value.
1535
+ * @param {object} args - Options object.
1536
+ * @param {string} args.columnType - Column type.
1537
+ * @param {ReturnType<typeof JSON.parse>} args.value - Value to normalize.
1538
+ * @returns {ReturnType<typeof JSON.parse>} - Normalized value.
1539
+ */
1540
+ _normalizeNumericValue({ columnType, value }: {
1541
+ columnType: string;
1542
+ value: ReturnType<typeof JSON.parse>;
1543
+ }): ReturnType<typeof JSON.parse>;
1544
+ /**
1545
+ * Runs normalize date value for insert.
1546
+ * @param {ReturnType<typeof JSON.parse>} value - Value to normalize.
1547
+ * @returns {ReturnType<typeof JSON.parse>} - Normalized value.
1548
+ */
1549
+ _normalizeDateValueForInsert(value: ReturnType<typeof JSON.parse>): ReturnType<typeof JSON.parse>;
1550
+ /**
1551
+ * Runs normalize date string for insert.
1552
+ * @param {string} value - Date string value.
1553
+ * @returns {string | Date} - Parsed date or original string.
1554
+ */
1555
+ _normalizeDateStringForInsert(value: string): string | Date;
1556
+ /**
1557
+ * Runs time zone for date writes.
1558
+ * @returns {string | undefined} - Active timezone identifier.
1559
+ */
1560
+ _timeZoneForDateWrite(): string | undefined;
1561
+ /**
1562
+ * Runs normalize sqlite boolean value for insert.
1563
+ * @param {object} args - Options object.
1564
+ * @param {string | undefined} args.columnType - Column type.
1565
+ * @param {ReturnType<typeof JSON.parse>} args.value - Value to normalize.
1566
+ * @returns {ReturnType<typeof JSON.parse>} - Normalized value.
1567
+ */
1568
+ _normalizeSqliteBooleanValueForInsert({ columnType, value }: {
1569
+ columnType: string | undefined;
1570
+ value: ReturnType<typeof JSON.parse>;
1571
+ }): ReturnType<typeof JSON.parse>;
1572
+ /**
1573
+ * Runs next primary key.
1574
+ * @returns {Promise<number>} - Resolves with the next primary key.
1575
+ */
1576
+ nextPrimaryKey(): Promise<number>;
1577
+ /**
1578
+ * Runs set primary key.
1579
+ * @param {string} primaryKey - Primary key.
1580
+ * @returns {void} - No return value.
1581
+ */
1582
+ setPrimaryKey(primaryKey: string): void;
1583
+ _primaryKey: string | undefined;
1584
+ /**
1585
+ * Returns this class's own attribute-cast map, creating it on the class itself
1586
+ * (never inherited from a parent) so subclasses don't share the same object.
1587
+ * @returns {Record<string, string>} - Declared casts keyed by attribute name.
1588
+ */
1589
+ getAttributeCastsMap(): Record<string, string>;
1590
+ /**
1591
+ * Declares a Rails-style per-attribute cast so a column whose introspected type
1592
+ * isn't what the app wants (e.g. an MSSQL `bit` mapped to `number`) can be
1593
+ * exposed as another type with real runtime conversion. Currently fully
1594
+ * implements the `"boolean"` cast (0/1 <-> false/true); other types only record
1595
+ * the label so the effective type and generated typings reflect them.
1596
+ * @param {string} attributeName - Attribute name (camelCase), e.g. `"sichtbarVVK"`.
1597
+ * @param {string} type - Declared type, e.g. `"boolean"`.
1598
+ * @returns {void} - No return value.
1599
+ */
1600
+ attribute(attributeName: string, type: string): void;
1601
+ /**
1602
+ * Returns the declared cast type for an attribute, if any.
1603
+ * @param {string} attributeName - Attribute name (camelCase).
1604
+ * @returns {string | undefined} - Declared cast type, or undefined when none is declared.
1605
+ */
1606
+ getAttributeCast(attributeName: string): string | undefined;
1607
+ /**
1608
+ * Runs primary key.
1609
+ * @returns {string} - The primary key.
1610
+ */
1611
+ primaryKey(): string;
1612
+ /**
1613
+ * Whether the model has a single primary key column. `setPrimaryKey(null)` (e.g. composite-key
1614
+ * legacy tables) declares no single primary key; `primaryKey()` still falls back to "id" for the
1615
+ * default case, so callers that must distinguish "no primary key" use this instead.
1616
+ * @returns {boolean} - False only when the primary key was explicitly set to null.
1617
+ */
1618
+ hasPrimaryKey(): boolean;
1619
+ /**
1620
+ * Runs table name.
1621
+ * @returns {string} - The table name.
1622
+ */
1623
+ tableName(): string;
1624
+ _tableName: string | undefined;
1625
+ /**
1626
+ * Runs set table name.
1627
+ * @param {string} tableName - Table name.
1628
+ * @returns {void} - No return value.
1629
+ */
1630
+ setTableName(tableName: string): void;
1631
+ /**
1632
+ * Runs transaction.
1633
+ * @param {() => Promise<void>} callback - Callback function.
1634
+ * @returns {Promise<ReturnType<typeof JSON.parse>>} - Resolves with the transaction.
1635
+ */
1636
+ transaction(callback: () => Promise<void>): Promise<ReturnType<typeof JSON.parse>>;
1637
+ /**
1638
+ * Runs the callback while holding a named advisory lock. Calls without
1639
+ * By default calls use the caller connection. Calls with `dedicatedConnection`
1640
+ * use a spawned lock connection that is released after the callback finishes,
1641
+ * while the callback itself still runs against the caller/model connection.
1642
+ * Calls with a positive `holdTimeoutMs` use a dedicated lock connection so
1643
+ * timeout cleanup can release the lock even when callback database work is
1644
+ * stuck. Advisory locks are cooperative and session-scoped: they serialize
1645
+ * callers that opt into the same `name`, without touching row or table locks,
1646
+ * so unrelated traffic is free to proceed.
1647
+ *
1648
+ * The lock is acquired before the callback runs and released in a
1649
+ * `finally` block afterwards, so the callback's return value is
1650
+ * propagated and thrown errors still release the lock.
1651
+ * @template T
1652
+ * @param {string} name - Lock name.
1653
+ * @param {() => Promise<T>} callback - Callback to invoke while the lock is held.
1654
+ * @param {{timeoutMs?: number | null, holdTimeoutMs?: number | null, dedicatedConnection?: boolean}} [args] - `timeoutMs` caps how long we wait to acquire the lock; `holdTimeoutMs` caps how long the callback may hold it before the lock is released and `AdvisoryLockHoldTimeoutError` is thrown; `dedicatedConnection` spawns a separate lock session without enabling a hold timeout.
1655
+ * @returns {Promise<T>} - Resolves with the callback's return value.
1656
+ * @throws {AdvisoryLockTimeoutError} - If `timeoutMs` elapses before the lock is granted.
1657
+ * @throws {AdvisoryLockHoldTimeoutError} - If `holdTimeoutMs` elapses while the callback holds the lock.
1658
+ */
1659
+ withAdvisoryLock<T>(name: string, callback: () => Promise<T>, args?: {
1660
+ timeoutMs?: number | null;
1661
+ holdTimeoutMs?: number | null;
1662
+ dedicatedConnection?: boolean;
1663
+ }): Promise<T>;
1664
+ /**
1665
+ * Runs the callback only if the named advisory lock can be acquired
1666
+ * immediately. If the lock is already held by any session, throws
1667
+ * `AdvisoryLockBusyError` without waiting.
1668
+ * Use this when contention is a signal that somebody else is already
1669
+ * doing the work and you want to bail out rather than queue up.
1670
+ * @template T
1671
+ * @param {string} name - Lock name.
1672
+ * @param {() => Promise<T>} callback - Callback to invoke while the lock is held.
1673
+ * @param {{holdTimeoutMs?: number | null, dedicatedConnection?: boolean}} [args] - `holdTimeoutMs` caps how long the callback may hold the lock before it is released and `AdvisoryLockHoldTimeoutError` is thrown; `dedicatedConnection` spawns a separate lock session without enabling a hold timeout.
1674
+ * @returns {Promise<T>} - Resolves with the callback's return value.
1675
+ * @throws {AdvisoryLockBusyError} - If the lock is already held.
1676
+ * @throws {AdvisoryLockHoldTimeoutError} - If `holdTimeoutMs` elapses while the callback holds the lock.
1677
+ */
1678
+ withAdvisoryLockOrFail<T>(name: string, callback: () => Promise<T>, args?: {
1679
+ holdTimeoutMs?: number | null;
1680
+ dedicatedConnection?: boolean;
1681
+ }): Promise<T>;
1682
+ /**
1683
+ * Runs `callback`, rejecting with `AdvisoryLockHoldTimeoutError` if it has
1684
+ * not settled within `holdTimeoutMs`. The callback is not cancelled — this is
1685
+ * a safety net, not cancellation.
1686
+ * @template T
1687
+ * @param {string} name - Lock name (for the error message).
1688
+ * @param {() => Promise<T>} callback - Callback holding the lock.
1689
+ * @param {number | null} [holdTimeoutMs] - Max hold time; falsy disables the timeout.
1690
+ * @returns {Promise<T>} - Callback result after the lock-protected operation.
1691
+ */
1692
+ runWithAdvisoryLockHoldTimeout<T>(name: string, callback: () => Promise<T>, holdTimeoutMs?: number | null): Promise<T>;
1693
+ /**
1694
+ * Returns true if the named advisory lock is currently held by any
1695
+ * session. Primarily useful as a diagnostic; callers that want to act
1696
+ * on the result should prefer `withAdvisoryLockOrFail` to avoid a
1697
+ * TOCTOU window between the check and the action.
1698
+ * @param {string} name - Lock name.
1699
+ * @returns {Promise<boolean>} - Whether the advisory lock is currently held.
1700
+ */
1701
+ hasAdvisoryLock(name: string): Promise<boolean>;
1702
+ /**
1703
+ * Runs translates.
1704
+ * @param {...string} names - Names.
1705
+ * @returns {void} - No return value.
1706
+ */
1707
+ translates(...names: string[]): void;
1708
+ /**
1709
+ * Runs current translation scope.
1710
+ * @param {ModelClassQuery} query - Translation query.
1711
+ * @returns {ModelClassQuery} - Scoped query.
1712
+ */
1713
+ currentTranslationScope(query: ModelClassQuery): ModelClassQuery;
1714
+ /**
1715
+ * Runs get translation class.
1716
+ * @returns {typeof VelociousDatabaseRecord} - The translation class.
1717
+ */
1718
+ getTranslationClass(): typeof VelociousDatabaseRecord;
1719
+ readonly name: string;
1720
+ _translationClass: /*elided*/ any | undefined;
1721
+ /**
1722
+ * Runs get translations table name.
1723
+ * @returns {string} - The translations table name.
1724
+ */
1725
+ getTranslationsTableName(): string;
1726
+ /**
1727
+ * Runs has translations table.
1728
+ * @returns {Promise<boolean>} - Resolves with Whether it has translations table.
1729
+ */
1730
+ hasTranslationsTable(): Promise<boolean>;
1731
+ /**
1732
+ * Adds a validation to an attribute.
1733
+ * @param {string} attributeName The name of the attribute to validate.
1734
+ * @param {Record<string, boolean | Record<string, ReturnType<typeof JSON.parse>>>} validators The validators to add. Key is the validator name, value is the validator arguments.
1735
+ */
1736
+ validates(attributeName: string, validators: Record<string, boolean | Record<string, ReturnType<typeof JSON.parse>>>): Promise<void>;
1737
+ /**
1738
+ * Registers gap-less positional list callbacks for a column scoped by
1739
+ * another column. Inserts and moves shift surrounding positions so the
1740
+ * list stays compact (1,2,3,...). Destroys close the resulting gap.
1741
+ *
1742
+ * Callers must ensure a UNIQUE index on (scopeColumn, positionColumn)
1743
+ * exists in the database — use `Migration.addActsAsList()` for the
1744
+ * schema half.
1745
+ * @param {string} positionColumn - camelCase position attribute (e.g. "rowNumber").
1746
+ * @param {object} options - Options with a required scope attribute.
1747
+ * @param {string} options.scope - camelCase scope attribute (e.g. "boardColumnId").
1748
+ */
1749
+ actsAsList(positionColumn: string, options: {
1750
+ scope: string;
1751
+ }): void;
1752
+ /**
1753
+ * Runs new query.
1754
+ * @template {typeof VelociousDatabaseRecord} MC
1755
+ * @this {MC}
1756
+ * @param {{driver?: import("../drivers/base.js").default | (() => import("../drivers/base.js").default), operation?: import("../operation.js").default}} [args] - Explicit query ownership.
1757
+ * @returns {ModelClassQuery<MC>} - The new query.
1758
+ */
1759
+ _newQuery<MC extends typeof VelociousDatabaseRecord>(this: MC, args?: {
1760
+ driver?: import("../drivers/base.js").default | (() => import("../drivers/base.js").default);
1761
+ operation?: import("../operation.js").default;
1762
+ }): ModelClassQuery<MC>;
1763
+ /**
1764
+ * Runs orderable column.
1765
+ * @returns {string} - The orderable column.
1766
+ */
1767
+ orderableColumn(): string;
1768
+ /**
1769
+ * Runs all.
1770
+ * @template {typeof VelociousDatabaseRecord} MC
1771
+ * @this {MC}
1772
+ * @returns {ModelClassQuery<MC>} - The all.
1773
+ */
1774
+ all<MC extends typeof VelociousDatabaseRecord>(this: MC): ModelClassQuery<MC>;
1775
+ /**
1776
+ * Runs accessible for.
1777
+ * @template {typeof VelociousDatabaseRecord} MC
1778
+ * @this {MC}
1779
+ * @param {string} action - Ability action to scope by.
1780
+ * @param {import("../../authorization/ability.js").default | undefined} [ability] - Ability instance.
1781
+ * @returns {ModelClassQuery<MC>} - Authorized query.
1782
+ */
1783
+ accessibleFor<MC extends typeof VelociousDatabaseRecord>(this: MC, action: string, ability?: import("../../authorization/ability.js").default | undefined): ModelClassQuery<MC>;
1784
+ /**
1785
+ * Runs accessible.
1786
+ * @template {typeof VelociousDatabaseRecord} MC
1787
+ * @this {MC}
1788
+ * @param {import("../../authorization/ability.js").default | undefined} [ability] - Ability instance.
1789
+ * @returns {ModelClassQuery<MC>} - Authorized query.
1790
+ */
1791
+ accessible<MC extends typeof VelociousDatabaseRecord>(this: MC, ability?: import("../../authorization/ability.js").default | undefined): ModelClassQuery<MC>;
1792
+ /**
1793
+ * Runs accessible by.
1794
+ * @template {typeof VelociousDatabaseRecord} MC
1795
+ * @this {MC}
1796
+ * @param {import("../../authorization/ability.js").default} ability - Ability instance.
1797
+ * @returns {ModelClassQuery<MC>} - Authorized query.
1798
+ */
1799
+ accessibleBy<MC extends typeof VelociousDatabaseRecord>(this: MC, ability: import("../../authorization/ability.js").default): ModelClassQuery<MC>;
1800
+ /**
1801
+ * Runs count.
1802
+ * @returns {Promise<number>} - Resolves with the count.
1803
+ */
1804
+ count(): Promise<number>;
1805
+ /**
1806
+ * Runs group.
1807
+ * @template {typeof VelociousDatabaseRecord} MC
1808
+ * @this {MC}
1809
+ * @param {string} group - Group.
1810
+ * @returns {ModelClassQuery<MC>} - The group.
1811
+ */
1812
+ group<MC extends typeof VelociousDatabaseRecord>(this: MC, group: string): ModelClassQuery<MC>;
1813
+ destroyAll(): Promise<void>;
1814
+ /**
1815
+ * Runs pluck.
1816
+ * @template {typeof VelociousDatabaseRecord} MC
1817
+ * @this {MC}
1818
+ * @param {...string|string[]} columns - Column names.
1819
+ * @returns {Promise<Array<ReturnType<typeof JSON.parse>>>} - Resolves with the pluck.
1820
+ */
1821
+ pluck<MC extends typeof VelociousDatabaseRecord>(this: MC, ...columns: (string | string[])[]): Promise<Array<ReturnType<typeof JSON.parse>>>;
1822
+ /**
1823
+ * Runs find.
1824
+ * @template {typeof VelociousDatabaseRecord} MC
1825
+ * @this {MC}
1826
+ * @param {number|string} recordId - Record id.
1827
+ * @returns {Promise<InstanceType<MC>>} - Resolves with the find.
1828
+ */
1829
+ find<MC extends typeof VelociousDatabaseRecord>(this: MC, recordId: number | string): Promise<InstanceType<MC>>;
1830
+ /**
1831
+ * Runs find by.
1832
+ * @template {typeof VelociousDatabaseRecord} MC
1833
+ * @this {MC}
1834
+ * @param {{[key: string]: string | number}} conditions - Conditions hash keyed by attribute name.
1835
+ * @returns {Promise<InstanceType<MC> | null>} - Resolves with the by.
1836
+ */
1837
+ findBy<MC extends typeof VelociousDatabaseRecord>(this: MC, conditions: {
1838
+ [key: string]: string | number;
1839
+ }): Promise<InstanceType<MC> | null>;
1840
+ /**
1841
+ * Runs find by or fail.
1842
+ * @template {typeof VelociousDatabaseRecord} MC
1843
+ * @this {MC}
1844
+ * @param {{[key: string]: string | number}} conditions - Conditions hash keyed by attribute name.
1845
+ * @returns {Promise<InstanceType<MC>>} - Resolves with the by or fail.
1846
+ */
1847
+ findByOrFail<MC extends typeof VelociousDatabaseRecord>(this: MC, conditions: {
1848
+ [key: string]: string | number;
1849
+ }): Promise<InstanceType<MC>>;
1850
+ /**
1851
+ * Returns an immutable tenant-bound model scope. Eager helpers and explicit
1852
+ * databaseOperation/transaction callbacks execute from a captured physical
1853
+ * database configuration instead of ambient tenant state.
1854
+ * @template {typeof VelociousDatabaseRecord} MC
1855
+ * @this {MC}
1856
+ * @param {object} tenant - Ordinary or null-prototype JSON-compatible tenant descriptor to scope the model to.
1857
+ * @returns {TenantModelScope<MC>} - Model scope bound to the captured tenant database.
1858
+ */
1859
+ usingTenant<MC extends typeof VelociousDatabaseRecord>(this: MC, tenant: object): TenantModelScope<MC>;
1860
+ /**
1861
+ * Runs find or create by.
1862
+ * @template {typeof VelociousDatabaseRecord} MC
1863
+ * @this {MC}
1864
+ * @param {{[key: string]: string | number}} conditions - Conditions hash keyed by attribute name.
1865
+ * @param {() => void} [callback] - Callback function.
1866
+ * @returns {Promise<InstanceType<MC>>} - Resolves with the or create by.
1867
+ */
1868
+ findOrCreateBy<MC extends typeof VelociousDatabaseRecord>(this: MC, conditions: {
1869
+ [key: string]: string | number;
1870
+ }, callback?: () => void): Promise<InstanceType<MC>>;
1871
+ /**
1872
+ * Runs find or initialize by.
1873
+ * @template {typeof VelociousDatabaseRecord} MC
1874
+ * @this {MC}
1875
+ * @param {Record<string, string | number>} conditions - Conditions.
1876
+ * @param {(arg: InstanceType<MC>) => void} [callback] - Callback function.
1877
+ * @returns {Promise<InstanceType<MC>>} - Resolves with the or initialize by.
1878
+ */
1879
+ findOrInitializeBy<MC extends typeof VelociousDatabaseRecord>(this: MC, conditions: Record<string, string | number>, callback?: (arg: InstanceType<MC>) => void): Promise<InstanceType<MC>>;
1880
+ /**
1881
+ * Runs first.
1882
+ * @template {typeof VelociousDatabaseRecord} MC
1883
+ * @this {MC}
1884
+ * @returns {Promise<InstanceType<MC>>} - Resolves with the first.
1885
+ */
1886
+ first<MC extends typeof VelociousDatabaseRecord>(this: MC): Promise<InstanceType<MC>>;
1887
+ /**
1888
+ * Runs joins.
1889
+ * @template {typeof VelociousDatabaseRecord} MC
1890
+ * @this {MC}
1891
+ * @param {string | import("../query/join-object.js").JoinObject} join - Join clause or join descriptor.
1892
+ * @returns {ModelClassQuery<MC>} - The joins.
1893
+ */
1894
+ joins<MC extends typeof VelociousDatabaseRecord>(this: MC, join: string | import("../query/join-object.js").JoinObject): ModelClassQuery<MC>;
1895
+ /**
1896
+ * Runs last.
1897
+ * @template {typeof VelociousDatabaseRecord} MC
1898
+ * @this {MC}
1899
+ * @returns {Promise<InstanceType<MC>>} - Resolves with the last.
1900
+ */
1901
+ last<MC extends typeof VelociousDatabaseRecord>(this: MC): Promise<InstanceType<MC>>;
1902
+ /**
1903
+ * Runs limit.
1904
+ * @template {typeof VelociousDatabaseRecord} MC
1905
+ * @this {MC}
1906
+ * @param {number} value - Value to use.
1907
+ * @returns {ModelClassQuery<MC>} - The limit.
1908
+ */
1909
+ limit<MC extends typeof VelociousDatabaseRecord>(this: MC, value: number): ModelClassQuery<MC>;
1910
+ /**
1911
+ * Runs order.
1912
+ * @template {typeof VelociousDatabaseRecord} MC
1913
+ * @this {MC}
1914
+ * @param {import("../query/index.js").OrderArgumentType} order - Order.
1915
+ * @returns {ModelClassQuery<MC>} - The order.
1916
+ */
1917
+ order<MC extends typeof VelociousDatabaseRecord>(this: MC, order: import("../query/index.js").OrderArgumentType): ModelClassQuery<MC>;
1918
+ /**
1919
+ * Runs distinct.
1920
+ * @template {typeof VelociousDatabaseRecord} MC
1921
+ * @this {MC}
1922
+ * @param {boolean} [value] - Value to use.
1923
+ * @returns {ModelClassQuery<MC>} - The distinct.
1924
+ */
1925
+ distinct<MC extends typeof VelociousDatabaseRecord>(this: MC, value?: boolean): ModelClassQuery<MC>;
1926
+ /**
1927
+ * Runs preload.
1928
+ * @template {typeof VelociousDatabaseRecord} MC
1929
+ * @this {MC}
1930
+ * @param {import("../query/index.js").NestedPreloadRecord | string | Array<string | import("../query/index.js").NestedPreloadRecord>} preload - Preload.
1931
+ * @returns {ModelClassQuery<MC>} - The preload.
1932
+ */
1933
+ preload<MC extends typeof VelociousDatabaseRecord>(this: MC, preload: import("../query/index.js").NestedPreloadRecord | string | Array<string | import("../query/index.js").NestedPreloadRecord>): ModelClassQuery<MC>;
1934
+ /**
1935
+ * Runs select.
1936
+ * @template {typeof VelociousDatabaseRecord} MC
1937
+ * @this {MC}
1938
+ * @param {import("../query/index.js").SelectArgumentType} select - Select.
1939
+ * @returns {ModelClassQuery<MC>} - The select.
1940
+ */
1941
+ select<MC extends typeof VelociousDatabaseRecord>(this: MC, select: import("../query/index.js").SelectArgumentType): ModelClassQuery<MC>;
1942
+ /**
1943
+ * Runs to array.
1944
+ * @template {typeof VelociousDatabaseRecord} MC
1945
+ * @this {MC}
1946
+ * @returns {Promise<InstanceType<MC>[]>} - Resolves with the array.
1947
+ */
1948
+ toArray<MC extends typeof VelociousDatabaseRecord>(this: MC): Promise<InstanceType<MC>[]>;
1949
+ /**
1950
+ * Runs load.
1951
+ * @template {typeof VelociousDatabaseRecord} MC
1952
+ * @this {MC}
1953
+ * @returns {Promise<InstanceType<MC>[]>} - Resolves with the array.
1954
+ */
1955
+ load<MC extends typeof VelociousDatabaseRecord>(this: MC): Promise<InstanceType<MC>[]>;
1956
+ /**
1957
+ * Runs where.
1958
+ * @template {typeof VelociousDatabaseRecord} MC
1959
+ * @this {MC}
1960
+ * @param {import("../query/index.js").WhereArgumentType} where - Where.
1961
+ * @returns {ModelClassQuery<MC>} - The where.
1962
+ */
1963
+ where<MC extends typeof VelociousDatabaseRecord>(this: MC, where: import("../query/index.js").WhereArgumentType): ModelClassQuery<MC>;
1964
+ /**
1965
+ * Runs ransack.
1966
+ * @template {typeof VelociousDatabaseRecord} MC
1967
+ * @this {MC}
1968
+ * @param {Record<string, ReturnType<typeof JSON.parse>>} params - Ransack-style params hash.
1969
+ * @returns {ModelClassQuery<MC>} - Query with Ransack filters applied.
1970
+ */
1971
+ ransack<MC extends typeof VelociousDatabaseRecord>(this: MC, params: Record<string, ReturnType<typeof JSON.parse>>): ModelClassQuery<MC>;
1972
+ } | undefined;
1973
+ _isNewRecord: boolean;
1974
+ /** @type {Record<string, string> | undefined} */
1975
+ static _attributeNameToColumnName: Record<string, string> | undefined;
1976
+ /** @type {Record<string, string> | undefined} */
1977
+ static _columnNameToAttributeName: Record<string, string> | undefined;
1978
+ /** @type {Record<string, object> | undefined} */
1979
+ static _translations: Record<string, object> | undefined;
1980
+ /** @type {Record<string, import("./validators/base.js").default[]> | undefined} */
1981
+ static _validators: Record<string, import("./validators/base.js").default[]> | undefined;
1982
+ /** @type {Record<string, LifecycleCallbackType[]> | undefined} */
1983
+ static _lifecycleCallbacks: Record<string, LifecycleCallbackType[]> | undefined;
1984
+ /** @type {Record<string, typeof import("./validators/base.js").default> | undefined} */
1985
+ static _validatorTypes: Record<string, typeof import("./validators/base.js").default> | undefined;
1986
+ /** @type {Record<string, {driver?: string | AttachmentDriverConstructor | Record<string, ReturnType<typeof JSON.parse>>, type: "hasOne" | "hasMany"}> | undefined} */
1987
+ static _attachmentsMap: Record<string, {
1988
+ driver?: string | AttachmentDriverConstructor | Record<string, ReturnType<typeof JSON.parse>>;
1989
+ type: "hasOne" | "hasMany";
1990
+ }> | undefined;
1991
+ /** @type {Record<string, import("./relationships/base.js").default> | undefined} */
1992
+ static _relationships: Record<string, import("./relationships/base.js").default> | undefined;
1993
+ /** @type {Record<string, import("../query/query-data.js").QueryDataFn> | undefined} */
1994
+ static _queryDataRegistrations: Record<string, import("../query/query-data.js").QueryDataFn> | undefined;
1995
+ /** @type {Record<string, {allowDestroy?: boolean, limit?: number, rejectIf?: (attributes: Record<string, ReturnType<typeof JSON.parse>>) => boolean}> | undefined} */
1996
+ static _acceptedNestedAttributes: Record<string, {
1997
+ allowDestroy?: boolean;
1998
+ limit?: number;
1999
+ rejectIf?: (attributes: Record<string, ReturnType<typeof JSON.parse>>) => boolean;
2000
+ }> | undefined;
2001
+ /** @type {Record<string, string> | undefined} */
2002
+ static _attributeCasts: Record<string, string> | undefined;
2003
+ /** @type {Record<string, import("../drivers/base-column.js").default> | undefined} */
2004
+ static _columnsAsHash: Record<string, import("../drivers/base-column.js").default> | undefined;
2005
+ /** @type {Array<string> | undefined} */
2006
+ static _columnNames: Array<string> | undefined;
2007
+ /** @type {Record<string, string> | undefined} */
2008
+ static _columnTypeByName: Record<string, string> | undefined;
85
2009
  /**
86
2010
  * Narrows the runtime value to the documented type.
87
2011
  * @type {string | undefined} */
@@ -144,11 +2068,11 @@ declare class VelociousDatabaseRecord<WriteAttributes extends Record<string, unk
144
2068
  static findMemberNameInsensitive(target: object, memberName: string): string | null;
145
2069
  /**
146
2070
  * Runs define scope.
147
- * @param {(...args: Array<?>) => ?} callback - Scope callback.
148
- * @returns {((...args: Array<?>) => import("../query/model-class-query.js").default<typeof VelociousDatabaseRecord>) & {scope: (...args: Array<?>) => import("../../utils/model-scope.js").ModelScopeDescriptor}} - Scope helper.
2071
+ * @param {(...args: Array<ReturnType<typeof JSON.parse>>) => ReturnType<typeof JSON.parse>} callback - Scope callback.
2072
+ * @returns {((...args: Array<ReturnType<typeof JSON.parse>>) => import("../query/model-class-query.js").default<typeof VelociousDatabaseRecord>) & {scope: (...args: Array<ReturnType<typeof JSON.parse>>) => import("../../utils/model-scope.js").ModelScopeDescriptor}} - Scope helper.
149
2073
  */
150
- static defineScope(callback: (...args: Array<unknown>) => unknown): ((...args: Array<unknown>) => import("../query/model-class-query.js").default<typeof VelociousDatabaseRecord>) & {
151
- scope: (...args: Array<unknown>) => import("../../utils/model-scope.js").ModelScopeDescriptor;
2074
+ static defineScope(callback: (...args: Array<ReturnType<typeof JSON.parse>>) => ReturnType<typeof JSON.parse>): ((...args: Array<ReturnType<typeof JSON.parse>>) => import("../query/model-class-query.js").default<typeof VelociousDatabaseRecord>) & {
2075
+ scope: (...args: Array<ReturnType<typeof JSON.parse>>) => import("../../utils/model-scope.js").ModelScopeDescriptor;
152
2076
  };
153
2077
  static getColumnNameToAttributeNameMap(): Record<string, string>;
154
2078
  static getTranslationsMap(): Record<string, object>;
@@ -161,12 +2085,66 @@ declare class VelociousDatabaseRecord<WriteAttributes extends Record<string, unk
161
2085
  static getValidatorTypesMap(): Record<string, typeof import("./validators/base.js").default>;
162
2086
  /**
163
2087
  * Runs get attachments map.
164
- * @returns {Record<string, {driver?: string | AttachmentDriverConstructor | Record<string, ?>, type: "hasOne" | "hasMany"}>} - Attachment definitions keyed by name.
2088
+ * @returns {Record<string, {driver?: string | AttachmentDriverConstructor | Record<string, ReturnType<typeof JSON.parse>>, type: "hasOne" | "hasMany"}>} - Attachment definitions keyed by name.
165
2089
  */
166
2090
  static getAttachmentsMap(): Record<string, {
167
- driver?: string | AttachmentDriverConstructor | Record<string, unknown>;
2091
+ driver?: string | AttachmentDriverConstructor | Record<string, ReturnType<typeof JSON.parse>>;
168
2092
  type: "hasOne" | "hasMany";
169
2093
  }>;
2094
+ /**
2095
+ * Attributes.
2096
+ * @type {Record<string, ReturnType<typeof JSON.parse>>} */
2097
+ _attributes: Record<string, ReturnType<typeof JSON.parse>>;
2098
+ /**
2099
+ * Changes.
2100
+ * @type {Record<string, ReturnType<typeof JSON.parse>>} */
2101
+ _changes: Record<string, ReturnType<typeof JSON.parse>>;
2102
+ /**
2103
+ * Changes captured before a create audit is written.
2104
+ * @type {import("./auditing.js").AuditChanges | undefined} */
2105
+ _pendingCreateAuditChanges: import("./auditing.js").AuditChanges | undefined;
2106
+ /**
2107
+ * Changes captured before an update audit is written.
2108
+ * @type {import("./auditing.js").AuditChanges | undefined} */
2109
+ _pendingUpdateAuditChanges: import("./auditing.js").AuditChanges | undefined;
2110
+ /**
2111
+ * Attribute names explicitly assigned in the current update call.
2112
+ * @type {Set<string> | undefined}
2113
+ */
2114
+ _assignedAttributeNames: Set<string> | undefined;
2115
+ /**
2116
+ * Columns as hash.
2117
+ * @type {Record<string, import("../drivers/base-column.js").default>} */
2118
+ _columnsAsHash: Record<string, import("../drivers/base-column.js").default>;
2119
+ /**
2120
+ * Connection.
2121
+ * @type {import("../drivers/base.js").default | undefined} */
2122
+ __connection: import("../drivers/base.js").default | undefined;
2123
+ /**
2124
+ * Explicit operation owning this record's database work.
2125
+ * @type {import("../operation.js").default | undefined} */
2126
+ _databaseOperation: import("../operation.js").default | undefined;
2127
+ /**
2128
+ * Instance relationships.
2129
+ * @type {Record<string, import("./instance-relationships/base.js").default>} */
2130
+ _instanceRelationships: Record<string, import("./instance-relationships/base.js").default>;
2131
+ /**
2132
+ * Attachments.
2133
+ * @type {Record<string, RecordAttachmentHandle>} */
2134
+ _attachments: Record<string, RecordAttachmentHandle>;
2135
+ /**
2136
+ * Load cohort.
2137
+ * @type {Array<VelociousDatabaseRecord> | undefined} - Shared reference to sibling records loaded in the same batch. Used by auto-preload.
2138
+ */
2139
+ _loadCohort: Array<VelociousDatabaseRecord> | undefined;
2140
+ /**
2141
+ * Table name.
2142
+ * @type {string | undefined} */
2143
+ __tableName: string | undefined;
2144
+ /**
2145
+ * Validation errors.
2146
+ * @type {Record<string, ValidationErrorObjectType[]>} */
2147
+ _validationErrors: Record<string, ValidationErrorObjectType[]>;
170
2148
  static validatorTypes(): Record<string, typeof import("./validators/base.js").default>;
171
2149
  /**
172
2150
  * Runs register validator type.
@@ -347,40 +2325,15 @@ declare class VelociousDatabaseRecord<WriteAttributes extends Record<string, unk
347
2325
  * @param {string} relationshipName - Relationship name.
348
2326
  * @param {RelationshipDataArgumentType} data - Data payload.
349
2327
  */
350
- static _defineRelationship(relationshipName: string, data: {
351
- /**
352
- * - Disable auto-batch-preload for this relationship by passing false. Default true.
353
- */
354
- autoload?: boolean | undefined;
355
- /**
356
- * - Model class name for the related record.
357
- */
358
- className?: string | undefined;
359
- /**
360
- * - Dependent action when parent is destroyed (e.g. "destroy").
361
- */
362
- dependent?: string | undefined;
363
- /**
364
- * - Model class for the related record.
365
- */
366
- klass?: typeof VelociousDatabaseRecord | undefined;
367
- /**
368
- * - Optional scope callback for the relationship.
369
- */
370
- scope?: ((query: import("../query/model-class-query.js").default<typeof VelociousDatabaseRecord>) => (import("../query/model-class-query.js").default<typeof VelociousDatabaseRecord> | void)) | undefined;
371
- /**
372
- * - Relationship type (e.g. "hasMany", "belongsTo").
373
- */
374
- type?: string | undefined;
375
- }): void;
2328
+ static _defineRelationship(relationshipName: string, data: RelationshipDataArgumentType): void;
376
2329
  /**
377
2330
  * Runs normalize relationship args.
378
2331
  * @param {RelationshipScopeCallback | object | undefined} scopeOrOptions - Scope callback or options.
379
2332
  * @param {object | undefined} options - Options.
380
2333
  * @returns {{scope: (RelationshipScopeCallback | undefined), relationshipOptions: object}} - Normalized arguments.
381
2334
  */
382
- static _normalizeRelationshipArgs(scopeOrOptions: ((query: import("../query/model-class-query.js").default<typeof VelociousDatabaseRecord>) => (import("../query/model-class-query.js").default<typeof VelociousDatabaseRecord> | void)) | object | undefined, options: object | undefined): {
383
- scope: (((query: import("../query/model-class-query.js").default<typeof VelociousDatabaseRecord>) => (import("../query/model-class-query.js").default<typeof VelociousDatabaseRecord> | void)) | undefined);
2335
+ static _normalizeRelationshipArgs(scopeOrOptions: RelationshipScopeCallback | object | undefined, options: object | undefined): {
2336
+ scope: (RelationshipScopeCallback | undefined);
384
2337
  relationshipOptions: object;
385
2338
  };
386
2339
  /**
@@ -446,28 +2399,75 @@ declare class VelociousDatabaseRecord<WriteAttributes extends Record<string, unk
446
2399
  static getQueryDataByName(name: string): import("../query/query-data.js").QueryDataFn | null;
447
2400
  /**
448
2401
  * Runs get attachments.
449
- * @returns {Record<string, {driver?: string | AttachmentDriverConstructor | Record<string, ?>, type: "hasOne" | "hasMany"}>} - Attachment definitions.
2402
+ * @returns {Record<string, {driver?: string | AttachmentDriverConstructor | Record<string, ReturnType<typeof JSON.parse>>, type: "hasOne" | "hasMany"}>} - Attachment definitions.
450
2403
  */
451
2404
  static getAttachments(): Record<string, {
452
- driver?: string | AttachmentDriverConstructor | Record<string, unknown>;
2405
+ driver?: string | AttachmentDriverConstructor | Record<string, ReturnType<typeof JSON.parse>>;
453
2406
  type: "hasOne" | "hasMany";
454
2407
  }>;
455
2408
  /**
456
2409
  * Runs get attachment by name.
457
2410
  * @param {string} attachmentName - Attachment name.
458
- * @returns {{driver?: string | AttachmentDriverConstructor | Record<string, ?>, type: "hasOne" | "hasMany"}} - Attachment definition.
2411
+ * @returns {{driver?: string | AttachmentDriverConstructor | Record<string, ReturnType<typeof JSON.parse>>, type: "hasOne" | "hasMany"}} - Attachment definition.
459
2412
  */
460
2413
  static getAttachmentByName(attachmentName: string): {
461
- driver?: string | AttachmentDriverConstructor | Record<string, unknown>;
2414
+ driver?: string | AttachmentDriverConstructor | Record<string, ReturnType<typeof JSON.parse>>;
462
2415
  type: "hasOne" | "hasMany";
463
2416
  };
2417
+ /**
2418
+ * Runs get relationship by name.
2419
+ * @param {string} relationshipName - Relationship name.
2420
+ * @returns {import("./instance-relationships/base.js").default} - The relationship by name.
2421
+ */
2422
+ getRelationshipByName(relationshipName: string): import("./instance-relationships/base.js").default;
2423
+ /**
2424
+ * Preloads relationship(s) onto this already-loaded record. Accepts either a
2425
+ * query built via `Model.preload(...).select(...)` or a raw preload spec
2426
+ * (string / array / nested object). A relationship that is already preloaded
2427
+ * with all the required columns present is left untouched unless `force` is
2428
+ * set. Preloading onto the relationship cache lets later accessors reuse the
2429
+ * loaded data instead of issuing identical queries.
2430
+ * @param {import("../query/model-class-query.js").default | import("../query/index.js").NestedPreloadRecord | string | Array<string | import("../query/index.js").NestedPreloadRecord>} queryOrSpec - Preload source.
2431
+ * @param {{force?: boolean}} [options] - Options.
2432
+ * @returns {Promise<void>} - Resolves when preloading completes.
2433
+ */
2434
+ preload(queryOrSpec: import("../query/model-class-query.js").default | import("../query/index.js").NestedPreloadRecord | string | Array<string | import("../query/index.js").NestedPreloadRecord>, options?: {
2435
+ force?: boolean;
2436
+ }): Promise<void>;
2437
+ /**
2438
+ * Runs load relationship.
2439
+ * @param {string} relationshipName - Relationship name.
2440
+ * @returns {Promise<ReturnType<typeof JSON.parse>>} - Loaded relationship value.
2441
+ */
2442
+ loadRelationship(relationshipName: string): Promise<ReturnType<typeof JSON.parse>>;
2443
+ /**
2444
+ * Runs relationship or load.
2445
+ * @param {string} relationshipName - Relationship name.
2446
+ * @param {{preloadTranslations?: boolean}} [options] - Load options.
2447
+ * @returns {Promise<ReturnType<typeof JSON.parse>>} - Loaded relationship value.
2448
+ */
2449
+ relationshipOrLoad(relationshipName: string, options?: {
2450
+ preloadTranslations?: boolean;
2451
+ }): Promise<ReturnType<typeof JSON.parse>>;
2452
+ /**
2453
+ * Preloads translations on a loaded relationship target when explicitly requested.
2454
+ * @param {ReturnType<typeof JSON.parse>} loaded - Loaded relationship value.
2455
+ * @returns {Promise<ReturnType<typeof JSON.parse>>} - Relationship value after translation preload.
2456
+ */
2457
+ _preloadLoadedRelationshipTranslations(loaded: ReturnType<typeof JSON.parse>): Promise<ReturnType<typeof JSON.parse>>;
2458
+ /**
2459
+ * Runs get attachment by name.
2460
+ * @param {string} attachmentName - Attachment name.
2461
+ * @returns {RecordAttachmentHandle} - Attachment handle.
2462
+ */
2463
+ getAttachmentByName(attachmentName: string): RecordAttachmentHandle;
464
2464
  /**
465
2465
  * Adds a belongs-to-relationship to the model.
466
2466
  * @param {string} relationshipName The name of the relationship.
467
2467
  * @param {RelationshipScopeCallback | object} [scopeOrOptions] The scope callback or options for the relationship.
468
2468
  * @param {object} [options] The options for the relationship.
469
2469
  */
470
- static belongsTo(relationshipName: string, scopeOrOptions?: ((query: import("../query/model-class-query.js").default<typeof VelociousDatabaseRecord>) => (import("../query/model-class-query.js").default<typeof VelociousDatabaseRecord> | void)) | object, options?: object): void;
2470
+ static belongsTo(relationshipName: string, scopeOrOptions?: RelationshipScopeCallback | object, options?: object): void;
471
2471
  /**
472
2472
  * Runs connection.
473
2473
  * @param {object} [args] - Options.
@@ -475,22 +2475,29 @@ declare class VelociousDatabaseRecord<WriteAttributes extends Record<string, unk
475
2475
  * @returns {import("../drivers/base.js").default} - The connection.
476
2476
  */
477
2477
  static connection({ enforceTenantDatabaseScope, ...restArgs }?: {
478
- enforceTenantDatabaseScope?: boolean | undefined;
2478
+ enforceTenantDatabaseScope?: boolean;
479
2479
  }): import("../drivers/base.js").default;
480
2480
  /**
481
2481
  * Runs create.
482
- * @template {Record<string, ?>} CreateAttributes
2482
+ * @template {Record<string, ReturnType<typeof JSON.parse>>} CreateAttributes
483
2483
  * @template {VelociousDatabaseRecord<CreateAttributes>} Model
484
2484
  * @this {{new (changes?: CreateAttributes): Model} & typeof VelociousDatabaseRecord}
485
2485
  * @param {CreateAttributes} [attributes] - Attributes.
486
2486
  * @returns {Promise<Model>} - Resolves with the create.
487
2487
  */
488
- static create<CreateAttributes extends Record<string, unknown>, Model extends VelociousDatabaseRecord<CreateAttributes>>(this: (new (changes?: CreateAttributes) => Model) & typeof VelociousDatabaseRecord, attributes?: CreateAttributes): Promise<Model>;
2488
+ static create<CreateAttributes extends Record<string, ReturnType<typeof JSON.parse>>, Model extends VelociousDatabaseRecord<CreateAttributes>>(this: {
2489
+ new (changes?: CreateAttributes): Model;
2490
+ } & typeof VelociousDatabaseRecord, attributes?: CreateAttributes): Promise<Model>;
489
2491
  /**
490
2492
  * Runs get configuration.
491
2493
  * @returns {import("../../configuration.js").default} - The configuration.
492
2494
  */
493
2495
  static _getConfiguration(): import("../../configuration.js").default;
2496
+ /**
2497
+ * Runs get configuration.
2498
+ * @returns {import("../../configuration.js").default} - The configuration.
2499
+ */
2500
+ _getConfiguration(): import("../../configuration.js").default;
494
2501
  /**
495
2502
  * Adds a has-many-relationship to the model class.
496
2503
  * @param {string} relationshipName The name of the relationship (e.g. "posts")
@@ -498,7 +2505,7 @@ declare class VelociousDatabaseRecord<WriteAttributes extends Record<string, unk
498
2505
  * @param {object} [options] The options for the relationship (e.g. {className: "Post"})
499
2506
  * @returns {void} - No return value.
500
2507
  */
501
- static hasMany(relationshipName: string, scopeOrOptions?: ((query: import("../query/model-class-query.js").default<typeof VelociousDatabaseRecord>) => (import("../query/model-class-query.js").default<typeof VelociousDatabaseRecord> | void)) | object, options?: object): void;
2508
+ static hasMany(relationshipName: string, scopeOrOptions?: RelationshipScopeCallback | object, options?: object): void;
502
2509
  /**
503
2510
  * Rails-style declaration that this model accepts nested-attribute writes
504
2511
  * for a relationship when saved through a parent. Required — Velocious
@@ -515,23 +2522,23 @@ declare class VelociousDatabaseRecord<WriteAttributes extends Record<string, unk
515
2522
  * Project.hasMany("tasks")
516
2523
  * Project.acceptsNestedAttributesFor("tasks", {allowDestroy: true})
517
2524
  * @param {string} relationshipName - Relationship name on this model.
518
- * @param {{allowDestroy?: boolean, limit?: number, rejectIf?: (attributes: Record<string, ?>) => boolean}} [options] - Policy options.
2525
+ * @param {{allowDestroy?: boolean, limit?: number, rejectIf?: (attributes: Record<string, ReturnType<typeof JSON.parse>>) => boolean}} [options] - Policy options.
519
2526
  * @returns {void}
520
2527
  */
521
2528
  static acceptsNestedAttributesFor(relationshipName: string, options?: {
522
2529
  allowDestroy?: boolean;
523
2530
  limit?: number;
524
- rejectIf?: (attributes: Record<string, unknown>) => boolean;
2531
+ rejectIf?: (attributes: Record<string, ReturnType<typeof JSON.parse>>) => boolean;
525
2532
  }): void;
526
2533
  /**
527
2534
  * Runs accepted nested attributes for.
528
2535
  * @param {string} relationshipName - Relationship name.
529
- * @returns {{allowDestroy?: boolean, limit?: number, rejectIf?: (attributes: Record<string, ?>) => boolean} | null} - Policy declared via `acceptsNestedAttributesFor`, or null when not accepted.
2536
+ * @returns {{allowDestroy?: boolean, limit?: number, rejectIf?: (attributes: Record<string, ReturnType<typeof JSON.parse>>) => boolean} | null} - Policy declared via `acceptsNestedAttributesFor`, or null when not accepted.
530
2537
  */
531
2538
  static acceptedNestedAttributesFor(relationshipName: string): {
532
2539
  allowDestroy?: boolean;
533
2540
  limit?: number;
534
- rejectIf?: (attributes: Record<string, unknown>) => boolean;
2541
+ rejectIf?: (attributes: Record<string, ReturnType<typeof JSON.parse>>) => boolean;
535
2542
  } | null;
536
2543
  /**
537
2544
  * Adds a has-one-relationship to the model class.
@@ -540,36 +2547,36 @@ declare class VelociousDatabaseRecord<WriteAttributes extends Record<string, unk
540
2547
  * @param {object} [options] The options for the relationship (e.g. {className: "Post"})
541
2548
  * @returns {void} - No return value.
542
2549
  */
543
- static hasOne(relationshipName: string, scopeOrOptions?: ((query: import("../query/model-class-query.js").default<typeof VelociousDatabaseRecord>) => (import("../query/model-class-query.js").default<typeof VelociousDatabaseRecord> | void)) | object, options?: object): void;
2550
+ static hasOne(relationshipName: string, scopeOrOptions?: RelationshipScopeCallback | object, options?: object): void;
544
2551
  /**
545
2552
  * Runs define attachment.
546
2553
  * @param {string} attachmentName - Attachment name.
547
2554
  * @param {object} args - Attachment args.
548
- * @param {string | AttachmentDriverConstructor | Record<string, ?>} [args.driver] - Attachment driver name, class, or instance.
2555
+ * @param {string | AttachmentDriverConstructor | Record<string, ReturnType<typeof JSON.parse>>} [args.driver] - Attachment driver name, class, or instance.
549
2556
  * @param {"hasOne" | "hasMany"} args.type - Attachment type.
550
2557
  * @returns {void} - No return value.
551
2558
  */
552
2559
  static _defineAttachment(attachmentName: string, { driver, type }: {
553
- driver?: string | Record<string, any> | import("../../configuration-types.js").AttachmentDriverConstructor | undefined;
2560
+ driver?: string | AttachmentDriverConstructor | Record<string, ReturnType<typeof JSON.parse>>;
554
2561
  type: "hasOne" | "hasMany";
555
2562
  }): void;
556
2563
  /**
557
2564
  * Adds a single attachment helper to the model.
558
2565
  * @param {string} attachmentName - Attachment name.
559
- * @param {{driver?: string | AttachmentDriverConstructor | Record<string, ?>}} [args] - Attachment options.
2566
+ * @param {{driver?: string | AttachmentDriverConstructor | Record<string, ReturnType<typeof JSON.parse>>}} [args] - Attachment options.
560
2567
  * @returns {void} - No return value.
561
2568
  */
562
2569
  static hasOneAttachment(attachmentName: string, args?: {
563
- driver?: string | AttachmentDriverConstructor | Record<string, unknown>;
2570
+ driver?: string | AttachmentDriverConstructor | Record<string, ReturnType<typeof JSON.parse>>;
564
2571
  }): void;
565
2572
  /**
566
2573
  * Adds a collection attachment helper to the model.
567
2574
  * @param {string} attachmentName - Attachment name.
568
- * @param {{driver?: string | AttachmentDriverConstructor | Record<string, ?>}} [args] - Attachment options.
2575
+ * @param {{driver?: string | AttachmentDriverConstructor | Record<string, ReturnType<typeof JSON.parse>>}} [args] - Attachment options.
569
2576
  * @returns {void} - No return value.
570
2577
  */
571
2578
  static hasManyAttachments(attachmentName: string, args?: {
572
- driver?: string | AttachmentDriverConstructor | Record<string, unknown>;
2579
+ driver?: string | AttachmentDriverConstructor | Record<string, ReturnType<typeof JSON.parse>>;
573
2580
  }): void;
574
2581
  /**
575
2582
  * Runs human attribute name.
@@ -616,18 +2623,25 @@ declare class VelociousDatabaseRecord<WriteAttributes extends Record<string, unk
616
2623
  */
617
2624
  static initializeRecord({ configuration, connection: explicitConnection, ...restArgs }: {
618
2625
  configuration: import("../../configuration.js").default;
619
- connection?: import("../drivers/base.js").default | undefined;
2626
+ connection?: import("../drivers/base.js").default;
620
2627
  }): Promise<void>;
621
2628
  /**
622
2629
  * Initializes the model class the first time an async record API needs table
623
2630
  * metadata. Concurrent callers share the same initialization promise, and a
624
2631
  * failed initialization can be retried by a later call.
625
- * @param {{configuration?: import("../../configuration.js").default}} [args] - Optional configuration override.
2632
+ * @param {{configuration?: import("../../configuration.js").default, connection?: import("../drivers/base.js").default}} [args] - Optional configuration and explicit metadata connection.
626
2633
  * @returns {Promise<void>} - Resolves when the model class is initialized.
627
2634
  */
628
2635
  static ensureInitialized(args?: {
629
2636
  configuration?: import("../../configuration.js").default;
2637
+ connection?: import("../drivers/base.js").default;
630
2638
  }): Promise<void>;
2639
+ /**
2640
+ * Runs has attribute.
2641
+ * @param {ReturnType<typeof JSON.parse>} value - Value to use.
2642
+ * @returns {boolean} - Whether attribute.
2643
+ */
2644
+ _hasAttribute(value: ReturnType<typeof JSON.parse>): boolean;
631
2645
  /**
632
2646
  * Runs is initialized.
633
2647
  * @returns {boolean} - Whether initialized.
@@ -638,7 +2652,13 @@ declare class VelociousDatabaseRecord<WriteAttributes extends Record<string, unk
638
2652
  * @returns {void} - No return value.
639
2653
  */
640
2654
  static _assertHasBeenInitialized(): void;
641
- static _defineTranslationMethods(): Promise<void>;
2655
+ /**
2656
+ * Defines translation accessors and initializes the generated translation
2657
+ * class through the same metadata connection as the translated model.
2658
+ * @param {import("../drivers/base.js").default} connection - Metadata connection.
2659
+ * @returns {Promise<void>} - Resolves when translation metadata is ready.
2660
+ */
2661
+ static _defineTranslationMethods(connection: import("../drivers/base.js").default): Promise<void>;
642
2662
  /**
643
2663
  * Runs get configured database identifier.
644
2664
  * @returns {string} - The configured non-tenant database identifier.
@@ -648,10 +2668,12 @@ declare class VelociousDatabaseRecord<WriteAttributes extends Record<string, unk
648
2668
  * Runs get database identifier.
649
2669
  * @param {object} [args] - Options.
650
2670
  * @param {boolean} [args.enforceTenantDatabaseScope] - Whether tenant-switched models must resolve a tenant database identifier.
2671
+ * @param {object} [args.tenant] - Explicit tenant descriptor instead of the ambient tenant.
651
2672
  * @returns {string} - The database identifier.
652
2673
  */
653
- static getDatabaseIdentifier({ enforceTenantDatabaseScope, ...restArgs }?: {
654
- enforceTenantDatabaseScope?: boolean | undefined;
2674
+ static getDatabaseIdentifier({ enforceTenantDatabaseScope, tenant, ...restArgs }?: {
2675
+ enforceTenantDatabaseScope?: boolean;
2676
+ tenant?: object;
655
2677
  }): string;
656
2678
  /**
657
2679
  * Runs set database identifier.
@@ -675,10 +2697,120 @@ declare class VelociousDatabaseRecord<WriteAttributes extends Record<string, unk
675
2697
  static hasTenantDatabaseIdentifierResolver(): boolean;
676
2698
  /**
677
2699
  * Runs get tenant database identifier.
678
- * @param {?} [tenant] - Tenant override.
2700
+ * @param {ReturnType<typeof JSON.parse>} [tenant] - Tenant override.
679
2701
  * @returns {string | undefined} - Tenant-scoped database identifier when configured.
680
2702
  */
681
- static getTenantDatabaseIdentifier(tenant?: unknown): string | undefined;
2703
+ static getTenantDatabaseIdentifier(tenant?: ReturnType<typeof JSON.parse>): string | undefined;
2704
+ /**
2705
+ * Runs get attribute.
2706
+ * @param {string} name - Name.
2707
+ * @returns {ReturnType<typeof JSON.parse>} - The attribute.
2708
+ */
2709
+ getAttribute(name: string): ReturnType<typeof JSON.parse>;
2710
+ /**
2711
+ * Runs get model class.
2712
+ * @abstract
2713
+ * @returns {typeof VelociousDatabaseRecord} - The model class.
2714
+ */
2715
+ getModelClass(): typeof VelociousDatabaseRecord;
2716
+ /**
2717
+ * Runs set attribute.
2718
+ * @param {string} name - Name.
2719
+ * @param {ReturnType<typeof JSON.parse>} newValue - New value.
2720
+ * @returns {void} - No return value.
2721
+ */
2722
+ setAttribute(name: string, newValue: ReturnType<typeof JSON.parse>): void;
2723
+ /**
2724
+ * Runs set column attribute.
2725
+ * @param {string} name - Name.
2726
+ * @param {ReturnType<typeof JSON.parse>} newValue - New value.
2727
+ */
2728
+ _setColumnAttribute(name: string, newValue: ReturnType<typeof JSON.parse>): void;
2729
+ /**
2730
+ * Clears loaded belongs-to caches when callers assign the foreign key directly.
2731
+ * @param {string} columnName - Changed database column name.
2732
+ * @param {ReturnType<typeof JSON.parse>} normalizedValue - New normalized column value.
2733
+ * @returns {void} - No return value.
2734
+ */
2735
+ _clearBelongsToRelationshipForChangedForeignKey(columnName: string, normalizedValue: ReturnType<typeof JSON.parse>): void;
2736
+ /**
2737
+ * Runs belongs to relationships for foreign key.
2738
+ * @param {string} columnName - Changed database column name.
2739
+ * @returns {Array<ReturnType<typeof JSON.parse>>} - Loaded relationship instances that use the changed foreign key.
2740
+ */
2741
+ _belongsToRelationshipsForForeignKey(columnName: string): Array<ReturnType<typeof JSON.parse>>;
2742
+ /**
2743
+ * Runs belongs to relationship uses foreign key.
2744
+ * @param {object} args - Relationship match arguments.
2745
+ * @param {string} args.columnName - Changed database column name.
2746
+ * @param {ReturnType<typeof JSON.parse>} args.relationship - Relationship instance.
2747
+ * @returns {boolean} - Whether the relationship is a belongs-to using the changed foreign key.
2748
+ */
2749
+ _belongsToRelationshipUsesForeignKey({ columnName, relationship }: {
2750
+ columnName: string;
2751
+ relationship: ReturnType<typeof JSON.parse>;
2752
+ }): boolean;
2753
+ /**
2754
+ * Runs belongs to relationship matches foreign key value.
2755
+ * @param {object} args - Relationship cache arguments.
2756
+ * @param {ReturnType<typeof JSON.parse>} args.normalizedValue - New normalized column value.
2757
+ * @param {ReturnType<typeof JSON.parse>} args.relationship - Relationship instance.
2758
+ * @returns {boolean} - Whether the loaded related record still matches the changed foreign key.
2759
+ */
2760
+ _belongsToRelationshipMatchesForeignKeyValue({ normalizedValue, relationship }: {
2761
+ normalizedValue: ReturnType<typeof JSON.parse>;
2762
+ relationship: ReturnType<typeof JSON.parse>;
2763
+ }): boolean;
2764
+ /**
2765
+ * Returns the foreign key value for a belongs-to relationship assignment.
2766
+ * @param {object} args - Relationship assignment arguments.
2767
+ * @param {VelociousDatabaseRecord | null | undefined} args.model - Assigned model.
2768
+ * @param {import("./instance-relationships/base.js").default} args.relationship - Belongs-to relationship instance.
2769
+ * @returns {string | number | null | undefined} - Foreign key value for the assignment.
2770
+ */
2771
+ _belongsToForeignKeyValue({ model, relationship }: {
2772
+ model: VelociousDatabaseRecord | null | undefined;
2773
+ relationship: import("./instance-relationships/base.js").default;
2774
+ }): string | number | null | undefined;
2775
+ /**
2776
+ * Runs clear loaded belongs to relationship.
2777
+ * @param {ReturnType<typeof JSON.parse>} relationship - Relationship instance.
2778
+ * @returns {void} - No return value.
2779
+ */
2780
+ _clearLoadedBelongsToRelationship(relationship: ReturnType<typeof JSON.parse>): void;
2781
+ /**
2782
+ * Runs normalize date value.
2783
+ * @param {ReturnType<typeof JSON.parse>} value - Value to use.
2784
+ * @returns {ReturnType<typeof JSON.parse>} - The date value.
2785
+ */
2786
+ _normalizeDateValue(value: ReturnType<typeof JSON.parse>): ReturnType<typeof JSON.parse>;
2787
+ /**
2788
+ * Runs normalize sqlite boolean value.
2789
+ * @param {object} args - Options object.
2790
+ * @param {string | undefined} args.columnType - Column type.
2791
+ * @param {ReturnType<typeof JSON.parse>} args.value - Value to normalize.
2792
+ * @returns {ReturnType<typeof JSON.parse>} - Normalized value.
2793
+ */
2794
+ _normalizeSqliteBooleanValue({ columnType, value }: {
2795
+ columnType: string | undefined;
2796
+ value: ReturnType<typeof JSON.parse>;
2797
+ }): ReturnType<typeof JSON.parse>;
2798
+ /**
2799
+ * Normalizes a boolean value before storing. A declared `"boolean"` attribute cast stores
2800
+ * booleans as 1/0 only for integer-backed columns (e.g. an MSSQL `bit`). Columns whose
2801
+ * underlying type is already a native boolean (e.g. Postgres `boolean`) keep `true`/`false`
2802
+ * so the driver can emit the proper boolean literal; otherwise the sqlite-only normalizer applies.
2803
+ * @param {object} args - Options object.
2804
+ * @param {string} args.attributeName - Attribute name being written.
2805
+ * @param {string | undefined} args.columnType - Column type.
2806
+ * @param {ReturnType<typeof JSON.parse>} args.value - Value to normalize.
2807
+ * @returns {ReturnType<typeof JSON.parse>} - Normalized value.
2808
+ */
2809
+ _normalizeBooleanValueForWrite({ attributeName, columnType, value }: {
2810
+ attributeName: string;
2811
+ columnType: string | undefined;
2812
+ value: ReturnType<typeof JSON.parse>;
2813
+ }): ReturnType<typeof JSON.parse>;
682
2814
  /**
683
2815
  * Whether a declared `"boolean"` attribute cast is backed by an integer column (e.g. an MSSQL
684
2816
  * `bit`), so booleans must be stored as 1/0. A native boolean column (e.g. Postgres `boolean`)
@@ -722,53 +2854,53 @@ declare class VelociousDatabaseRecord<WriteAttributes extends Record<string, unk
722
2854
  /**
723
2855
  * Runs insert multiple.
724
2856
  * @param {Array<string>} columns - Column names.
725
- * @param {Array<Array<?>>} rows - Rows to insert.
2857
+ * @param {Array<Array<ReturnType<typeof JSON.parse>>>} rows - Rows to insert.
726
2858
  * @param {object} [args] - Options object.
727
2859
  * @param {boolean} [args.cast] - Whether to cast values based on column types.
728
2860
  * @param {boolean} [args.retryIndividuallyOnFailure] - Retry rows individually if a batch insert fails.
729
2861
  * @param {boolean} [args.returnResults] - Return succeeded/failed rows instead of throwing when retries fail.
730
- * @returns {Promise<void | {succeededRows: Array<Array<?>>, failedRows: Array<Array<?>>, errors: Array<{row: Array<?>, error: ?}>}>} - Resolves when complete.
2862
+ * @returns {Promise<void | {succeededRows: Array<Array<ReturnType<typeof JSON.parse>>>, failedRows: Array<Array<ReturnType<typeof JSON.parse>>>, errors: Array<{row: Array<ReturnType<typeof JSON.parse>>, error: ReturnType<typeof JSON.parse>}>}>} - Resolves when complete.
731
2863
  */
732
- static insertMultiple(columns: Array<string>, rows: Array<Array<unknown>>, args?: {
733
- cast?: boolean | undefined;
734
- retryIndividuallyOnFailure?: boolean | undefined;
735
- returnResults?: boolean | undefined;
2864
+ static insertMultiple(columns: Array<string>, rows: Array<Array<ReturnType<typeof JSON.parse>>>, args?: {
2865
+ cast?: boolean;
2866
+ retryIndividuallyOnFailure?: boolean;
2867
+ returnResults?: boolean;
736
2868
  }): Promise<void | {
737
- succeededRows: Array<Array<unknown>>;
738
- failedRows: Array<Array<unknown>>;
2869
+ succeededRows: Array<Array<ReturnType<typeof JSON.parse>>>;
2870
+ failedRows: Array<Array<ReturnType<typeof JSON.parse>>>;
739
2871
  errors: Array<{
740
- row: Array<unknown>;
741
- error: unknown;
2872
+ row: Array<ReturnType<typeof JSON.parse>>;
2873
+ error: ReturnType<typeof JSON.parse>;
742
2874
  }>;
743
2875
  }>;
744
2876
  /**
745
2877
  * Runs normalize insert multiple rows.
746
2878
  * @param {object} args - Options object.
747
2879
  * @param {Array<string>} args.columns - Column names.
748
- * @param {Array<Array<?>>} args.rows - Rows to insert.
749
- * @returns {Array<Array<?>>} - Normalized rows.
2880
+ * @param {Array<Array<ReturnType<typeof JSON.parse>>>} args.rows - Rows to insert.
2881
+ * @returns {Array<Array<ReturnType<typeof JSON.parse>>>} - Normalized rows.
750
2882
  */
751
2883
  static _normalizeInsertMultipleRows({ columns, rows }: {
752
2884
  columns: Array<string>;
753
- rows: Array<Array<unknown>>;
754
- }): Array<Array<unknown>>;
2885
+ rows: Array<Array<ReturnType<typeof JSON.parse>>>;
2886
+ }): Array<Array<ReturnType<typeof JSON.parse>>>;
755
2887
  /**
756
2888
  * Runs safe serialize insert row.
757
- * @param {Array<?>} row - Row to serialize.
2889
+ * @param {Array<ReturnType<typeof JSON.parse>>} row - Row to serialize.
758
2890
  * @returns {string} - Safe row representation.
759
2891
  */
760
- static _safeSerializeInsertRow(row: Array<unknown>): string;
2892
+ static _safeSerializeInsertRow(row: Array<ReturnType<typeof JSON.parse>>): string;
761
2893
  /**
762
2894
  * Runs normalize insert value for column.
763
2895
  * @param {object} args - Options object.
764
2896
  * @param {string} args.columnName - Column name.
765
- * @param {?} args.value - Column value.
766
- * @returns {?} - Normalized value.
2897
+ * @param {ReturnType<typeof JSON.parse>} args.value - Column value.
2898
+ * @returns {ReturnType<typeof JSON.parse>} - Normalized value.
767
2899
  */
768
2900
  static _normalizeInsertValueForColumn({ columnName, value }: {
769
2901
  columnName: string;
770
- value: unknown;
771
- }): unknown;
2902
+ value: ReturnType<typeof JSON.parse>;
2903
+ }): ReturnType<typeof JSON.parse>;
772
2904
  /**
773
2905
  * Runs is string type.
774
2906
  * @param {string | undefined} columnType - Column type.
@@ -785,19 +2917,19 @@ declare class VelociousDatabaseRecord<WriteAttributes extends Record<string, unk
785
2917
  * Runs normalize numeric value.
786
2918
  * @param {object} args - Options object.
787
2919
  * @param {string} args.columnType - Column type.
788
- * @param {?} args.value - Value to normalize.
789
- * @returns {?} - Normalized value.
2920
+ * @param {ReturnType<typeof JSON.parse>} args.value - Value to normalize.
2921
+ * @returns {ReturnType<typeof JSON.parse>} - Normalized value.
790
2922
  */
791
2923
  static _normalizeNumericValue({ columnType, value }: {
792
2924
  columnType: string;
793
- value: unknown;
794
- }): unknown;
2925
+ value: ReturnType<typeof JSON.parse>;
2926
+ }): ReturnType<typeof JSON.parse>;
795
2927
  /**
796
2928
  * Runs normalize date value for insert.
797
- * @param {?} value - Value to normalize.
798
- * @returns {?} - Normalized value.
2929
+ * @param {ReturnType<typeof JSON.parse>} value - Value to normalize.
2930
+ * @returns {ReturnType<typeof JSON.parse>} - Normalized value.
799
2931
  */
800
- static _normalizeDateValueForInsert(value: unknown): unknown;
2932
+ static _normalizeDateValueForInsert(value: ReturnType<typeof JSON.parse>): ReturnType<typeof JSON.parse>;
801
2933
  /**
802
2934
  * Runs normalize date string for insert.
803
2935
  * @param {string} value - Date string value.
@@ -813,13 +2945,13 @@ declare class VelociousDatabaseRecord<WriteAttributes extends Record<string, unk
813
2945
  * Runs normalize sqlite boolean value for insert.
814
2946
  * @param {object} args - Options object.
815
2947
  * @param {string | undefined} args.columnType - Column type.
816
- * @param {?} args.value - Value to normalize.
817
- * @returns {?} - Normalized value.
2948
+ * @param {ReturnType<typeof JSON.parse>} args.value - Value to normalize.
2949
+ * @returns {ReturnType<typeof JSON.parse>} - Normalized value.
818
2950
  */
819
2951
  static _normalizeSqliteBooleanValueForInsert({ columnType, value }: {
820
2952
  columnType: string | undefined;
821
- value: unknown;
822
- }): unknown;
2953
+ value: ReturnType<typeof JSON.parse>;
2954
+ }): ReturnType<typeof JSON.parse>;
823
2955
  /**
824
2956
  * Runs next primary key.
825
2957
  * @returns {Promise<number>} - Resolves with the next primary key.
@@ -866,6 +2998,34 @@ declare class VelociousDatabaseRecord<WriteAttributes extends Record<string, unk
866
2998
  * @returns {boolean} - False only when the primary key was explicitly set to null.
867
2999
  */
868
3000
  static hasPrimaryKey(): boolean;
3001
+ /**
3002
+ * Runs save.
3003
+ * @returns {Promise<void>} - Resolves when complete.
3004
+ */
3005
+ save(): Promise<void>;
3006
+ _autoSaveBelongsToRelationships(): Promise<{
3007
+ savedCount: number;
3008
+ }>;
3009
+ _autoSaveHasManyAndHasOneRelationshipsToSave(): import("./instance-relationships/base.js").default<typeof VelociousDatabaseRecord, typeof VelociousDatabaseRecord>[];
3010
+ /**
3011
+ * Resolves a relationship foreign-key column to this model's public attribute name.
3012
+ * @param {import("./instance-relationships/base.js").default<typeof VelociousDatabaseRecord, typeof VelociousDatabaseRecord>} instanceRelationship - Relationship instance.
3013
+ * @returns {string} Attribute name accepted by setAttribute/assign.
3014
+ */
3015
+ _relationshipForeignKeyAttribute(instanceRelationship: import("./instance-relationships/base.js").default<typeof VelociousDatabaseRecord, typeof VelociousDatabaseRecord>): string;
3016
+ /**
3017
+ * Runs auto save has many and has one relationships.
3018
+ * @param {object} args - Options object.
3019
+ * @param {boolean} args.isNewRecord - Whether is new record.
3020
+ */
3021
+ _autoSaveHasManyAndHasOneRelationships({ isNewRecord }: {
3022
+ isNewRecord: boolean;
3023
+ }): Promise<void>;
3024
+ /**
3025
+ * Runs auto save attachments.
3026
+ * @returns {Promise<void>} - Resolves when pending attachments have been saved.
3027
+ */
3028
+ _autoSaveAttachments(): Promise<void>;
869
3029
  /**
870
3030
  * Runs table name.
871
3031
  * @returns {string} - The table name.
@@ -879,10 +3039,10 @@ declare class VelociousDatabaseRecord<WriteAttributes extends Record<string, unk
879
3039
  static setTableName(tableName: string): void;
880
3040
  /**
881
3041
  * Runs transaction.
882
- * @param {function() : Promise<void>} callback - Callback function.
883
- * @returns {Promise<?>} - Resolves with the transaction.
3042
+ * @param {() => Promise<void>} callback - Callback function.
3043
+ * @returns {Promise<ReturnType<typeof JSON.parse>>} - Resolves with the transaction.
884
3044
  */
885
- static transaction(callback: () => Promise<void>): Promise<unknown>;
3045
+ static transaction(callback: () => Promise<void>): Promise<ReturnType<typeof JSON.parse>>;
886
3046
  /**
887
3047
  * Runs the callback while holding a named advisory lock. Calls without
888
3048
  * By default calls use the caller connection. Calls with `dedicatedConnection`
@@ -978,9 +3138,9 @@ declare class VelociousDatabaseRecord<WriteAttributes extends Record<string, unk
978
3138
  /**
979
3139
  * Adds a validation to an attribute.
980
3140
  * @param {string} attributeName The name of the attribute to validate.
981
- * @param {Record<string, boolean | Record<string, ?>>} validators The validators to add. Key is the validator name, value is the validator arguments.
3141
+ * @param {Record<string, boolean | Record<string, ReturnType<typeof JSON.parse>>>} validators The validators to add. Key is the validator name, value is the validator arguments.
982
3142
  */
983
- static validates(attributeName: string, validators: Record<string, boolean | Record<string, unknown>>): Promise<void>;
3143
+ static validates(attributeName: string, validators: Record<string, boolean | Record<string, ReturnType<typeof JSON.parse>>>): Promise<void>;
984
3144
  /**
985
3145
  * Registers gap-less positional list callbacks for a column scoped by
986
3146
  * another column. Inserts and moves shift surrounding positions so the
@@ -993,9 +3153,37 @@ declare class VelociousDatabaseRecord<WriteAttributes extends Record<string, unk
993
3153
  * @param {object} options - Options with a required scope attribute.
994
3154
  * @param {string} options.scope - camelCase scope attribute (e.g. "boardColumnId").
995
3155
  */
996
- static actsAsList(positionColumn: string, options: {
997
- scope: string;
998
- }): void;
3156
+ static actsAsList(positionColumn: string, options: {
3157
+ scope: string;
3158
+ }): void;
3159
+ /**
3160
+ * Runs translations loaded.
3161
+ * @abstract
3162
+ * @returns {TranslationBase[]} - The translations loaded.
3163
+ */
3164
+ translationsLoaded(): TranslationBase[];
3165
+ /**
3166
+ * Runs get translated attribute.
3167
+ * @param {string} name - Name.
3168
+ * @param {string} locale - Locale.
3169
+ * @returns {string | undefined} - The translated attribute, if found.
3170
+ */
3171
+ _getTranslatedAttribute(name: string, locale: string): string | undefined;
3172
+ /**
3173
+ * Runs get translated attribute with fallback.
3174
+ * @param {string} name - Name.
3175
+ * @param {string} locale - Locale.
3176
+ * @returns {string | undefined} - The translated attribute with fallback, if found.
3177
+ */
3178
+ _getTranslatedAttributeWithFallback(name: string, locale: string): string | undefined;
3179
+ /**
3180
+ * Runs set translated attribute.
3181
+ * @param {string} name - Name.
3182
+ * @param {string} locale - Locale.
3183
+ * @param {ReturnType<typeof JSON.parse>} newValue - New value.
3184
+ * @returns {void} - No return value.
3185
+ */
3186
+ _setTranslatedAttribute(name: string, locale: string, newValue: ReturnType<typeof JSON.parse>): void;
999
3187
  /**
1000
3188
  * Runs new query.
1001
3189
  * @template {typeof VelociousDatabaseRecord} MC
@@ -1003,7 +3191,7 @@ declare class VelociousDatabaseRecord<WriteAttributes extends Record<string, unk
1003
3191
  * @param {{driver?: import("../drivers/base.js").default | (() => import("../drivers/base.js").default), operation?: import("../operation.js").default}} [args] - Explicit query ownership.
1004
3192
  * @returns {ModelClassQuery<MC>} - The new query.
1005
3193
  */
1006
- static _newQuery<MC extends typeof VelociousDatabaseRecord>(this: MC, { driver, operation, ...restArgs }?: {
3194
+ static _newQuery<MC extends typeof VelociousDatabaseRecord>(this: MC, args?: {
1007
3195
  driver?: import("../drivers/base.js").default | (() => import("../drivers/base.js").default);
1008
3196
  operation?: import("../operation.js").default;
1009
3197
  }): ModelClassQuery<MC>;
@@ -1063,9 +3251,9 @@ declare class VelociousDatabaseRecord<WriteAttributes extends Record<string, unk
1063
3251
  * @template {typeof VelociousDatabaseRecord} MC
1064
3252
  * @this {MC}
1065
3253
  * @param {...string|string[]} columns - Column names.
1066
- * @returns {Promise<Array<?>>} - Resolves with the pluck.
3254
+ * @returns {Promise<Array<ReturnType<typeof JSON.parse>>>} - Resolves with the pluck.
1067
3255
  */
1068
- static pluck<MC extends typeof VelociousDatabaseRecord>(this: MC, ...columns: (string | string[])[]): Promise<Array<unknown>>;
3256
+ static pluck<MC extends typeof VelociousDatabaseRecord>(this: MC, ...columns: (string | string[])[]): Promise<Array<ReturnType<typeof JSON.parse>>>;
1069
3257
  /**
1070
3258
  * Runs find.
1071
3259
  * @template {typeof VelociousDatabaseRecord} MC
@@ -1095,42 +3283,21 @@ declare class VelociousDatabaseRecord<WriteAttributes extends Record<string, unk
1095
3283
  [key: string]: string | number;
1096
3284
  }): Promise<InstanceType<MC>>;
1097
3285
  /**
1098
- * Returns a scope whose eager finders run against an explicit `tenant` (and
1099
- * therefore its database) instead of whatever tenant is ambient in
1100
- * `Current.tenant()`. Use it to read a model that may live in a specific
1101
- * tenant or in the default database from another tenant context — for example
1102
- * `GithubWebhook.usingTenant(tenant).findBy({id})` — without depending on
1103
- * which tenant happens to be active. The target tenant's connections are
1104
- * ensured for the duration of each query.
3286
+ * Returns an immutable tenant-bound model scope. Eager helpers and explicit
3287
+ * databaseOperation/transaction callbacks execute from a captured physical
3288
+ * database configuration instead of ambient tenant state.
1105
3289
  * @template {typeof VelociousDatabaseRecord} MC
1106
3290
  * @this {MC}
1107
- * @param {?} tenant - Tenant descriptor to scope the queries to (as accepted by `configuration.runWithTenant`).
1108
- * @returns {{find: (recordId: ?) => Promise<InstanceType<MC> | null>, findBy: (conditions: {[key: string]: string | number}) => Promise<InstanceType<MC> | null>, findByOrFail: (conditions: {[key: string]: string | number}) => Promise<InstanceType<MC>>}} - Eager finders scoped to the given tenant.
3291
+ * @param {object} tenant - Ordinary or null-prototype JSON-compatible tenant descriptor to scope the model to.
3292
+ * @returns {TenantModelScope<MC>} - Model scope bound to the captured tenant database.
1109
3293
  */
1110
- static usingTenant<MC extends typeof VelociousDatabaseRecord>(this: MC, tenant: unknown): {
1111
- find: (recordId: unknown) => Promise<InstanceType<MC> | null>;
1112
- findBy: (conditions: {
1113
- [key: string]: string | number;
1114
- }) => Promise<InstanceType<MC> | null>;
1115
- findByOrFail: (conditions: {
1116
- [key: string]: string | number;
1117
- }) => Promise<InstanceType<MC>>;
1118
- };
1119
- /**
1120
- * Runs `callback` with the tenant switched to `tenant` and that tenant's
1121
- * connections ensured. Backs `usingTenant`.
1122
- * @template T
1123
- * @param {?} tenant - Tenant descriptor.
1124
- * @param {() => Promise<T>} callback - Query to run under the tenant.
1125
- * @returns {Promise<T>} - Resolves with the callback's result.
1126
- */
1127
- static _runUsingTenant<T>(tenant: unknown, callback: () => Promise<T>): Promise<T>;
3294
+ static usingTenant<MC extends typeof VelociousDatabaseRecord>(this: MC, tenant: object): TenantModelScope<MC>;
1128
3295
  /**
1129
3296
  * Runs find or create by.
1130
3297
  * @template {typeof VelociousDatabaseRecord} MC
1131
3298
  * @this {MC}
1132
3299
  * @param {{[key: string]: string | number}} conditions - Conditions hash keyed by attribute name.
1133
- * @param {function() : void} [callback] - Callback function.
3300
+ * @param {() => void} [callback] - Callback function.
1134
3301
  * @returns {Promise<InstanceType<MC>>} - Resolves with the or create by.
1135
3302
  */
1136
3303
  static findOrCreateBy<MC extends typeof VelociousDatabaseRecord>(this: MC, conditions: {
@@ -1141,10 +3308,10 @@ declare class VelociousDatabaseRecord<WriteAttributes extends Record<string, unk
1141
3308
  * @template {typeof VelociousDatabaseRecord} MC
1142
3309
  * @this {MC}
1143
3310
  * @param {Record<string, string | number>} conditions - Conditions.
1144
- * @param {function(InstanceType<MC>) : void} [callback] - Callback function.
3311
+ * @param {(arg: InstanceType<MC>) => void} [callback] - Callback function.
1145
3312
  * @returns {Promise<InstanceType<MC>>} - Resolves with the or initialize by.
1146
3313
  */
1147
- static findOrInitializeBy<MC extends typeof VelociousDatabaseRecord>(this: MC, conditions: Record<string, string | number>, callback?: (arg0: InstanceType<MC>) => void): Promise<InstanceType<MC>>;
3314
+ static findOrInitializeBy<MC extends typeof VelociousDatabaseRecord>(this: MC, conditions: Record<string, string | number>, callback?: (arg: InstanceType<MC>) => void): Promise<InstanceType<MC>>;
1148
3315
  /**
1149
3316
  * Runs first.
1150
3317
  * @template {typeof VelociousDatabaseRecord} MC
@@ -1233,300 +3400,28 @@ declare class VelociousDatabaseRecord<WriteAttributes extends Record<string, unk
1233
3400
  * Runs ransack.
1234
3401
  * @template {typeof VelociousDatabaseRecord} MC
1235
3402
  * @this {MC}
1236
- * @param {Record<string, ?>} params - Ransack-style params hash.
3403
+ * @param {Record<string, ReturnType<typeof JSON.parse>>} params - Ransack-style params hash.
1237
3404
  * @returns {ModelClassQuery<MC>} - Query with Ransack filters applied.
1238
3405
  */
1239
- static ransack<MC extends typeof VelociousDatabaseRecord>(this: MC, params: Record<string, unknown>): ModelClassQuery<MC>;
3406
+ static ransack<MC extends typeof VelociousDatabaseRecord>(this: MC, params: Record<string, ReturnType<typeof JSON.parse>>): ModelClassQuery<MC>;
1240
3407
  /**
1241
3408
  * Runs constructor.
1242
3409
  * @param {WriteAttributes} changes - Changes.
1243
3410
  */
1244
3411
  constructor(changes?: WriteAttributes);
1245
- /**
1246
- * Attributes.
1247
- * @type {Record<string, ?>} */
1248
- _attributes: Record<string, unknown>;
1249
- /**
1250
- * Changes.
1251
- * @type {Record<string, ?>} */
1252
- _changes: Record<string, unknown>;
1253
- /**
1254
- * Changes captured before a create audit is written.
1255
- * @type {import("./auditing.js").AuditChanges | undefined} */
1256
- _pendingCreateAuditChanges: import("./auditing.js").AuditChanges | undefined;
1257
- /**
1258
- * Changes captured before an update audit is written.
1259
- * @type {import("./auditing.js").AuditChanges | undefined} */
1260
- _pendingUpdateAuditChanges: import("./auditing.js").AuditChanges | undefined;
1261
- /**
1262
- * Attribute names explicitly assigned in the current update call.
1263
- * @type {Set<string> | undefined}
1264
- */
1265
- _assignedAttributeNames: Set<string> | undefined;
1266
- /**
1267
- * Columns as hash.
1268
- * @type {Record<string, import("../drivers/base-column.js").default>} */
1269
- _columnsAsHash: Record<string, import("../drivers/base-column.js").default>;
1270
- /**
1271
- * Connection.
1272
- * @type {import("../drivers/base.js").default | undefined} */
1273
- __connection: import("../drivers/base.js").default | undefined;
1274
- /**
1275
- * Explicit operation owning this record's database work.
1276
- * @type {import("../operation.js").default | undefined} */
1277
- _databaseOperation: import("../operation.js").default | undefined;
1278
- /**
1279
- * Instance relationships.
1280
- * @type {Record<string, import("./instance-relationships/base.js").default>} */
1281
- _instanceRelationships: Record<string, import("./instance-relationships/base.js").default>;
1282
- /**
1283
- * Attachments.
1284
- * @type {Record<string, RecordAttachmentHandle>} */
1285
- _attachments: Record<string, RecordAttachmentHandle>;
1286
- /**
1287
- * Load cohort.
1288
- * @type {Array<VelociousDatabaseRecord> | undefined} - Shared reference to sibling records loaded in the same batch. Used by auto-preload.
1289
- */
1290
- _loadCohort: Array<VelociousDatabaseRecord> | undefined;
1291
- /**
1292
- * Table name.
1293
- * @type {string | undefined} */
1294
- __tableName: string | undefined;
1295
- /**
1296
- * Validation errors.
1297
- * @type {Record<string, ValidationErrorObjectType[]>} */
1298
- _validationErrors: Record<string, ValidationErrorObjectType[]>;
1299
- /**
1300
- * Runs get relationship by name.
1301
- * @param {string} relationshipName - Relationship name.
1302
- * @returns {import("./instance-relationships/base.js").default} - The relationship by name.
1303
- */
1304
- getRelationshipByName(relationshipName: string): import("./instance-relationships/base.js").default;
1305
- /**
1306
- * Preloads relationship(s) onto this already-loaded record. Accepts either a
1307
- * query built via `Model.preload(...).select(...)` or a raw preload spec
1308
- * (string / array / nested object). A relationship that is already preloaded
1309
- * with all the required columns present is left untouched unless `force` is
1310
- * set. Preloading onto the relationship cache lets later accessors reuse the
1311
- * loaded data instead of issuing identical queries.
1312
- * @param {import("../query/model-class-query.js").default | import("../query/index.js").NestedPreloadRecord | string | Array<string | import("../query/index.js").NestedPreloadRecord>} queryOrSpec - Preload source.
1313
- * @param {{force?: boolean}} [options] - Options.
1314
- * @returns {Promise<void>} - Resolves when preloading completes.
1315
- */
1316
- preload(queryOrSpec: import("../query/model-class-query.js").default | import("../query/index.js").NestedPreloadRecord | string | Array<string | import("../query/index.js").NestedPreloadRecord>, options?: {
1317
- force?: boolean;
1318
- }): Promise<void>;
1319
- /**
1320
- * Runs load relationship.
1321
- * @param {string} relationshipName - Relationship name.
1322
- * @returns {Promise<?>} - Loaded relationship value.
1323
- */
1324
- loadRelationship(relationshipName: string): Promise<unknown>;
1325
- /**
1326
- * Runs relationship or load.
1327
- * @param {string} relationshipName - Relationship name.
1328
- * @param {{preloadTranslations?: boolean}} [options] - Load options.
1329
- * @returns {Promise<?>} - Loaded relationship value.
1330
- */
1331
- relationshipOrLoad(relationshipName: string, options?: {
1332
- preloadTranslations?: boolean;
1333
- }): Promise<unknown>;
1334
- /**
1335
- * Preloads translations on a loaded relationship target when explicitly requested.
1336
- * @param {?} loaded - Loaded relationship value.
1337
- * @returns {Promise<?>} - Relationship value after translation preload.
1338
- */
1339
- _preloadLoadedRelationshipTranslations(loaded: unknown): Promise<unknown>;
1340
- /**
1341
- * Runs get attachment by name.
1342
- * @param {string} attachmentName - Attachment name.
1343
- * @returns {RecordAttachmentHandle} - Attachment handle.
1344
- */
1345
- getAttachmentByName(attachmentName: string): RecordAttachmentHandle;
1346
- /**
1347
- * Runs get configuration.
1348
- * @returns {import("../../configuration.js").default} - The configuration.
1349
- */
1350
- _getConfiguration(): import("../../configuration.js").default;
1351
- /**
1352
- * Runs has attribute.
1353
- * @param {?} value - Value to use.
1354
- * @returns {boolean} - Whether attribute.
1355
- */
1356
- _hasAttribute(value: unknown): boolean;
1357
- /**
1358
- * Runs get attribute.
1359
- * @param {string} name - Name.
1360
- * @returns {?} - The attribute.
1361
- */
1362
- getAttribute(name: string): unknown;
1363
- /**
1364
- * Runs get model class.
1365
- * @abstract
1366
- * @returns {typeof VelociousDatabaseRecord} - The model class.
1367
- */
1368
- getModelClass(): typeof VelociousDatabaseRecord;
1369
- /**
1370
- * Runs set attribute.
1371
- * @param {string} name - Name.
1372
- * @param {?} newValue - New value.
1373
- * @returns {void} - No return value.
1374
- */
1375
- setAttribute(name: string, newValue: unknown): void;
1376
- /**
1377
- * Runs set column attribute.
1378
- * @param {string} name - Name.
1379
- * @param {?} newValue - New value.
1380
- */
1381
- _setColumnAttribute(name: string, newValue: unknown): void;
1382
- /**
1383
- * Clears loaded belongs-to caches when callers assign the foreign key directly.
1384
- * @param {string} columnName - Changed database column name.
1385
- * @param {?} normalizedValue - New normalized column value.
1386
- * @returns {void} - No return value.
1387
- */
1388
- _clearBelongsToRelationshipForChangedForeignKey(columnName: string, normalizedValue: unknown): void;
1389
- /**
1390
- * Runs belongs to relationships for foreign key.
1391
- * @param {string} columnName - Changed database column name.
1392
- * @returns {Array<?>} - Loaded relationship instances that use the changed foreign key.
1393
- */
1394
- _belongsToRelationshipsForForeignKey(columnName: string): Array<unknown>;
1395
- /**
1396
- * Runs belongs to relationship uses foreign key.
1397
- * @param {object} args - Relationship match arguments.
1398
- * @param {string} args.columnName - Changed database column name.
1399
- * @param {?} args.relationship - Relationship instance.
1400
- * @returns {boolean} - Whether the relationship is a belongs-to using the changed foreign key.
1401
- */
1402
- _belongsToRelationshipUsesForeignKey({ columnName, relationship }: {
1403
- columnName: string;
1404
- relationship: unknown;
1405
- }): boolean;
1406
- /**
1407
- * Runs belongs to relationship matches foreign key value.
1408
- * @param {object} args - Relationship cache arguments.
1409
- * @param {?} args.normalizedValue - New normalized column value.
1410
- * @param {?} args.relationship - Relationship instance.
1411
- * @returns {boolean} - Whether the loaded related record still matches the changed foreign key.
1412
- */
1413
- _belongsToRelationshipMatchesForeignKeyValue({ normalizedValue, relationship }: {
1414
- normalizedValue: unknown;
1415
- relationship: unknown;
1416
- }): boolean;
1417
- /**
1418
- * Returns the foreign key value for a belongs-to relationship assignment.
1419
- * @param {object} args - Relationship assignment arguments.
1420
- * @param {VelociousDatabaseRecord | null | undefined} args.model - Assigned model.
1421
- * @param {import("./instance-relationships/base.js").default} args.relationship - Belongs-to relationship instance.
1422
- * @returns {string | number | null | undefined} - Foreign key value for the assignment.
1423
- */
1424
- _belongsToForeignKeyValue({ model, relationship }: {
1425
- model: VelociousDatabaseRecord | null | undefined;
1426
- relationship: import("./instance-relationships/base.js").default;
1427
- }): string | number | null | undefined;
1428
- /**
1429
- * Runs clear loaded belongs to relationship.
1430
- * @param {?} relationship - Relationship instance.
1431
- * @returns {void} - No return value.
1432
- */
1433
- _clearLoadedBelongsToRelationship(relationship: unknown): void;
1434
- /**
1435
- * Runs normalize date value.
1436
- * @param {?} value - Value to use.
1437
- * @returns {?} - The date value.
1438
- */
1439
- _normalizeDateValue(value: unknown): unknown;
1440
- /**
1441
- * Runs normalize sqlite boolean value.
1442
- * @param {object} args - Options object.
1443
- * @param {string | undefined} args.columnType - Column type.
1444
- * @param {?} args.value - Value to normalize.
1445
- * @returns {?} - Normalized value.
1446
- */
1447
- _normalizeSqliteBooleanValue({ columnType, value }: {
1448
- columnType: string | undefined;
1449
- value: unknown;
1450
- }): unknown;
1451
- /**
1452
- * Normalizes a boolean value before storing. A declared `"boolean"` attribute cast stores
1453
- * booleans as 1/0 only for integer-backed columns (e.g. an MSSQL `bit`). Columns whose
1454
- * underlying type is already a native boolean (e.g. Postgres `boolean`) keep `true`/`false`
1455
- * so the driver can emit the proper boolean literal; otherwise the sqlite-only normalizer applies.
1456
- * @param {object} args - Options object.
1457
- * @param {string} args.attributeName - Attribute name being written.
1458
- * @param {string | undefined} args.columnType - Column type.
1459
- * @param {?} args.value - Value to normalize.
1460
- * @returns {?} - Normalized value.
1461
- */
1462
- _normalizeBooleanValueForWrite({ attributeName, columnType, value }: {
1463
- attributeName: string;
1464
- columnType: string | undefined;
1465
- value: unknown;
1466
- }): unknown;
1467
- /**
1468
- * Runs save.
1469
- * @returns {Promise<void>} - Resolves when complete.
1470
- */
1471
- save(): Promise<void>;
1472
- _autoSaveBelongsToRelationships(): Promise<{
1473
- savedCount: number;
1474
- }>;
1475
- _autoSaveHasManyAndHasOneRelationshipsToSave(): import("./instance-relationships/base.js").default<typeof VelociousDatabaseRecord, typeof VelociousDatabaseRecord>[];
1476
- /**
1477
- * Resolves a relationship foreign-key column to this model's public attribute name.
1478
- * @param {import("./instance-relationships/base.js").default<typeof VelociousDatabaseRecord, typeof VelociousDatabaseRecord>} instanceRelationship - Relationship instance.
1479
- * @returns {string} Attribute name accepted by setAttribute/assign.
1480
- */
1481
- _relationshipForeignKeyAttribute(instanceRelationship: import("./instance-relationships/base.js").default<typeof VelociousDatabaseRecord, typeof VelociousDatabaseRecord>): string;
1482
- /**
1483
- * Runs auto save has many and has one relationships.
1484
- * @param {object} args - Options object.
1485
- * @param {boolean} args.isNewRecord - Whether is new record.
1486
- */
1487
- _autoSaveHasManyAndHasOneRelationships({ isNewRecord }: {
1488
- isNewRecord: boolean;
1489
- }): Promise<void>;
1490
- /**
1491
- * Runs auto save attachments.
1492
- * @returns {Promise<void>} - Resolves when pending attachments have been saved.
1493
- */
1494
- _autoSaveAttachments(): Promise<void>;
1495
- /**
1496
- * Runs translations loaded.
1497
- * @abstract
1498
- * @returns {TranslationBase[]} - The translations loaded.
1499
- */
1500
- translationsLoaded(): TranslationBase[];
1501
- /**
1502
- * Runs get translated attribute.
1503
- * @param {string} name - Name.
1504
- * @param {string} locale - Locale.
1505
- * @returns {string | undefined} - The translated attribute, if found.
1506
- */
1507
- _getTranslatedAttribute(name: string, locale: string): string | undefined;
1508
- /**
1509
- * Runs get translated attribute with fallback.
1510
- * @param {string} name - Name.
1511
- * @param {string} locale - Locale.
1512
- * @returns {string | undefined} - The translated attribute with fallback, if found.
1513
- */
1514
- _getTranslatedAttributeWithFallback(name: string, locale: string): string | undefined;
1515
- /**
1516
- * Runs set translated attribute.
1517
- * @param {string} name - Name.
1518
- * @param {string} locale - Locale.
1519
- * @param {?} newValue - New value.
1520
- * @returns {void} - No return value.
1521
- */
1522
- _setTranslatedAttribute(name: string, locale: string, newValue: unknown): void;
1523
- _isNewRecord: boolean;
1524
3412
  /**
1525
3413
  * Binds future query, lifecycle, relationship, and persistence work to an operation.
1526
3414
  * @param {import("../operation.js").default} operation - Owning operation.
1527
3415
  * @returns {this} - Bound record.
1528
3416
  */
1529
3417
  bindDatabaseOperation(operation: import("../operation.js").default): this;
3418
+ /**
3419
+ * Releases this record from a completed eager-helper operation while
3420
+ * preserving the legacy ambient follow-up behavior of `usingTenant` finders.
3421
+ * @param {import("../operation.js").default} operation - Releasing operation.
3422
+ * @returns {this} - Record.
3423
+ */
3424
+ releaseDatabaseOperation(operation: import("../operation.js").default): this;
1530
3425
  /**
1531
3426
  * Returns the explicit operation owning this record, if any.
1532
3427
  * @returns {import("../operation.js").default | undefined} - Owning operation.
@@ -1546,6 +3441,14 @@ declare class VelociousDatabaseRecord<WriteAttributes extends Record<string, unk
1546
3441
  * @returns {ModelClassQuery<MC>} - Target query.
1547
3442
  */
1548
3443
  queryForModel<MC extends typeof VelociousDatabaseRecord>(ModelClass: MC): ModelClassQuery<MC>;
3444
+ /**
3445
+ * Initializes a relationship/preload target without dropping this record's
3446
+ * explicit operation connection.
3447
+ * @param {typeof VelociousDatabaseRecord} ModelClass - Target model class.
3448
+ * @param {import("../../configuration.js").default} configuration - Owning configuration.
3449
+ * @returns {Promise<void>} - Resolves when initialized.
3450
+ */
3451
+ ensureModelClassInitialized(ModelClass: typeof VelociousDatabaseRecord, configuration: import("../../configuration.js").default): Promise<void>;
1549
3452
  /**
1550
3453
  * Runs load existing record.
1551
3454
  * @param {object} attributes - Attributes.
@@ -1554,20 +3457,20 @@ declare class VelociousDatabaseRecord<WriteAttributes extends Record<string, unk
1554
3457
  loadExistingRecord(attributes: object): void;
1555
3458
  /**
1556
3459
  * Assigns the given attributes to the record.
1557
- * @param {Record<string, ?>} attributesToAssign - Attributes to assign.
3460
+ * @param {Record<string, ReturnType<typeof JSON.parse>>} attributesToAssign - Attributes to assign.
1558
3461
  * @returns {void} - No return value.
1559
3462
  */
1560
- assign(attributesToAssign: Record<string, unknown>): void;
3463
+ assign(attributesToAssign: Record<string, ReturnType<typeof JSON.parse>>): void;
1561
3464
  /**
1562
3465
  * Returns a the current attributes of the record (original attributes from database plus changes)
1563
- * @returns {Record<string, ?>} - The attributes.
3466
+ * @returns {Record<string, ReturnType<typeof JSON.parse>>} - The attributes.
1564
3467
  */
1565
- attributes(): Record<string, unknown>;
3468
+ attributes(): Record<string, ReturnType<typeof JSON.parse>>;
1566
3469
  /**
1567
3470
  * Returns column-name keyed data (original attributes from database plus changes)
1568
- * @returns {Record<string, ?>} - The raw attributes.
3471
+ * @returns {Record<string, ReturnType<typeof JSON.parse>>} - The raw attributes.
1569
3472
  */
1570
- rawAttributes(): Record<string, unknown>;
3473
+ rawAttributes(): Record<string, ReturnType<typeof JSON.parse>>;
1571
3474
  /**
1572
3475
  * Runs connection.
1573
3476
  * @returns {import("../drivers/base.js").default} - The connection.
@@ -1606,9 +3509,9 @@ declare class VelociousDatabaseRecord<WriteAttributes extends Record<string, unk
1606
3509
  * @param {typeof VelociousDatabaseRecord} TargetModelClass - Related model class.
1607
3510
  * @param {string} identifier - Tenant database identifier.
1608
3511
  * @param {TenantDatabaseProviderType} provider - Tenant database provider.
1609
- * @returns {Promise<Array<?>>} - Listed tenant objects.
3512
+ * @returns {Promise<Array<ReturnType<typeof JSON.parse>>>} - Listed tenant objects.
1610
3513
  */
1611
- _dependentRestrictProviderTenants(instanceRelationship: RestrictInstanceRelationship, TargetModelClass: typeof VelociousDatabaseRecord, identifier: string, provider: TenantDatabaseProviderType): Promise<Array<unknown>>;
3514
+ _dependentRestrictProviderTenants(instanceRelationship: RestrictInstanceRelationship, TargetModelClass: typeof VelociousDatabaseRecord, identifier: string, provider: TenantDatabaseProviderType): Promise<Array<ReturnType<typeof JSON.parse>>>;
1612
3515
  /**
1613
3516
  * Destroys the record in the database and all of its dependent records.
1614
3517
  * @returns {Promise<void>} - Resolves when complete.
@@ -1674,9 +3577,9 @@ declare class VelociousDatabaseRecord<WriteAttributes extends Record<string, unk
1674
3577
  isChanged(): boolean;
1675
3578
  /**
1676
3579
  * Returns the changes that have been made to this record since it was loaded from the database.
1677
- * @returns {Record<string, Array<?>>} - The changes.
3580
+ * @returns {Record<string, Array<ReturnType<typeof JSON.parse>>>} - The changes.
1678
3581
  */
1679
- changes(): Record<string, Array<unknown>>;
3582
+ changes(): Record<string, Array<ReturnType<typeof JSON.parse>>>;
1680
3583
  /**
1681
3584
  * Runs table name.
1682
3585
  * @returns {string} - The table name.
@@ -1723,25 +3626,25 @@ declare class VelociousDatabaseRecord<WriteAttributes extends Record<string, unk
1723
3626
  * registered fn for this record (e.g. no child rows matched the
1724
3627
  * aggregate).
1725
3628
  * @param {string} name - queryData attribute name (matches a SELECT alias from the registered fn).
1726
- * @returns {?} - Attached query-data value.
3629
+ * @returns {ReturnType<typeof JSON.parse>} - Attached query-data value.
1727
3630
  */
1728
- queryData(name: string): unknown;
3631
+ queryData(name: string): ReturnType<typeof JSON.parse>;
1729
3632
  /**
1730
3633
  * Attach a queryData value to this record. Internal helper used by
1731
3634
  * the `queryData` runner and by frontend-model hydration; outside
1732
3635
  * code should not call this directly.
1733
3636
  * @param {string} name - queryData attribute name.
1734
- * @param {?} value - Value to attach.
3637
+ * @param {ReturnType<typeof JSON.parse>} value - Value to attach.
1735
3638
  * @returns {void}
1736
3639
  */
1737
- _setQueryData(name: string, value: unknown): void;
3640
+ _setQueryData(name: string, value: ReturnType<typeof JSON.parse>): void;
1738
3641
  /**
1739
3642
  * All attached queryData values as a plain object. Used by the
1740
3643
  * frontend-model serializer to ship queryData alongside the record
1741
3644
  * attributes on the wire.
1742
- * @returns {Record<string, ?>} - Query-data values keyed by name.
3645
+ * @returns {Record<string, ReturnType<typeof JSON.parse>>} - Query-data values keyed by name.
1743
3646
  */
1744
- queryDataValues(): Record<string, unknown>;
3647
+ queryDataValues(): Record<string, ReturnType<typeof JSON.parse>>;
1745
3648
  /**
1746
3649
  * Read a per-record ability result attached by `.abilities(...)`. The
1747
3650
  * backend evaluates each requested action against the current ability
@@ -1773,9 +3676,9 @@ declare class VelociousDatabaseRecord<WriteAttributes extends Record<string, unk
1773
3676
  /**
1774
3677
  * Reads a column value from the record.
1775
3678
  * @param {string} attributeName The name of the column to read. This is the column name, not the attribute name.
1776
- * @returns {?} - The column.
3679
+ * @returns {ReturnType<typeof JSON.parse>} - The column.
1777
3680
  */
1778
- readColumn(attributeName: string): unknown;
3681
+ readColumn(attributeName: string): ReturnType<typeof JSON.parse>;
1779
3682
  /**
1780
3683
  * Resolves any declared per-attribute cast for a database column name.
1781
3684
  * @param {string} columnName - Database column name.
@@ -1785,10 +3688,10 @@ declare class VelociousDatabaseRecord<WriteAttributes extends Record<string, unk
1785
3688
  /**
1786
3689
  * Converts a stored value to a real boolean for a declared `"boolean"` cast.
1787
3690
  * Leaves null/undefined untouched; treats 1/true/"1" as true and 0/false/"0" as false.
1788
- * @param {?} value - Stored database value.
1789
- * @returns {?} - Converted boolean, or the original value when not recognized.
3691
+ * @param {ReturnType<typeof JSON.parse>} value - Stored database value.
3692
+ * @returns {ReturnType<typeof JSON.parse>} - Converted boolean, or the original value when not recognized.
1790
3693
  */
1791
- _castDeclaredBooleanForRead(value: unknown): unknown;
3694
+ _castDeclaredBooleanForRead(value: ReturnType<typeof JSON.parse>): ReturnType<typeof JSON.parse>;
1792
3695
  /**
1793
3696
  * Whether a column value is currently loaded on this record (either as a
1794
3697
  * persisted attribute or a pending change). Used to decide whether a preload
@@ -1804,20 +3707,20 @@ declare class VelociousDatabaseRecord<WriteAttributes extends Record<string, unk
1804
3707
  * @param {object} args - Options object.
1805
3708
  * @param {string} args.columnName - Database column name being read.
1806
3709
  * @param {string | undefined} args.columnType - Column type.
1807
- * @param {?} args.value - Value to normalize.
1808
- * @returns {?} - Normalized value.
3710
+ * @param {ReturnType<typeof JSON.parse>} args.value - Value to normalize.
3711
+ * @returns {ReturnType<typeof JSON.parse>} - Normalized value.
1809
3712
  */
1810
3713
  _normalizeBooleanValueForRead({ columnName, columnType, value }: {
1811
3714
  columnName: string;
1812
3715
  columnType: string | undefined;
1813
- value: unknown;
1814
- }): unknown;
3716
+ value: ReturnType<typeof JSON.parse>;
3717
+ }): ReturnType<typeof JSON.parse>;
1815
3718
  /**
1816
3719
  * Runs normalize date value for read.
1817
- * @param {?} value - Value from database.
1818
- * @returns {?} - Normalized value.
3720
+ * @param {ReturnType<typeof JSON.parse>} value - Value from database.
3721
+ * @returns {ReturnType<typeof JSON.parse>} - Normalized value.
1819
3722
  */
1820
- _normalizeDateValueForRead(value: unknown): unknown;
3723
+ _normalizeDateValueForRead(value: ReturnType<typeof JSON.parse>): ReturnType<typeof JSON.parse>;
1821
3724
  _belongsToChanges(): Record<string, any>;
1822
3725
  /**
1823
3726
  * Runs create new record.
@@ -1842,16 +3745,16 @@ declare class VelociousDatabaseRecord<WriteAttributes extends Record<string, unk
1842
3745
  }): Promise<void>;
1843
3746
  /**
1844
3747
  * Sets timestamp defaults for a new record insert.
1845
- * @param {Record<string, ?>} data - Column-keyed data.
3748
+ * @param {Record<string, ReturnType<typeof JSON.parse>>} data - Column-keyed data.
1846
3749
  * @returns {void} - No return value.
1847
3750
  */
1848
- _setDefaultTimestampValues(data: Record<string, unknown>): void;
3751
+ _setDefaultTimestampValues(data: Record<string, ReturnType<typeof JSON.parse>>): void;
1849
3752
  /**
1850
3753
  * Runs normalize date values for write.
1851
- * @param {Record<string, ?>} data - Column-keyed data.
3754
+ * @param {Record<string, ReturnType<typeof JSON.parse>>} data - Column-keyed data.
1852
3755
  * @returns {void} - No return value.
1853
3756
  */
1854
- _normalizeDateValuesForWrite(data: Record<string, unknown>): void;
3757
+ _normalizeDateValuesForWrite(data: Record<string, ReturnType<typeof JSON.parse>>): void;
1855
3758
  /**
1856
3759
  * Runs update record with changes.
1857
3760
  * @returns {Promise<void>} - Resolves when complete.
@@ -1902,7 +3805,6 @@ declare class VelociousDatabaseRecord<WriteAttributes extends Record<string, unk
1902
3805
  */
1903
3806
  update(attributesToAssign: WriteAttributes): Promise<void>;
1904
3807
  }
1905
- import ModelClassQuery from "../query/model-class-query.js";
1906
- import RecordAttachmentHandle from "./attachments/handle.js";
1907
- export { AdvisoryLockBusyError, AdvisoryLockHoldTimeoutError, AdvisoryLockTimeoutError };
3808
+ export { AdvisoryLockBusyError, AdvisoryLockHoldTimeoutError, AdvisoryLockTimeoutError, TenantDatabaseScopeError, ValidationError };
3809
+ export default VelociousDatabaseRecord;
1908
3810
  //# sourceMappingURL=index.d.ts.map