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
@@ -4,7 +4,7 @@
4
4
  * Runs query.
5
5
  * @param {import("sql.js").Database} connection - Connection.
6
6
  * @param {string} sql - SQL string.
7
- * @returns {Promise<Record<string, ?>[]>} - Resolves with string value.
7
+ * @returns {Promise<Record<string, ReturnType<typeof JSON.parse>>[]>} - Resolves with string value.
8
8
  */
9
9
  export default async function query(connection, sql) {
10
10
  const rows = []
@@ -34,7 +34,7 @@ export default async function query(connection, sql) {
34
34
  for (const rowValues of result[0].values) {
35
35
  /**
36
36
  * Row.
37
- * @type {Record<string, ?>} */
37
+ * @type {Record<string, ReturnType<typeof JSON.parse>>} */
38
38
  const row = {}
39
39
 
40
40
  for (const columnIndex in columns) {
@@ -59,7 +59,7 @@ export default class VelociousDatabaseDriversSqliteTableRebuilder {
59
59
  // copy: index names are database-global and survive the rename, and a violation (e.g. a new
60
60
  // unique index over rows that all receive the same default) fails during INSERT...SELECT,
61
61
  // while the original table still exists - never after the swap.
62
- /** @type {Array<{column: import("../../table-data/table-column.js").default, index: ?, indexArgs: ?}>} */
62
+ /** @type {Array<{column: import("../../table-data/table-column.js").default, index: ReturnType<typeof JSON.parse>, indexArgs: ReturnType<typeof JSON.parse>}>} */
63
63
  const strippedColumnIndexes = []
64
64
 
65
65
  for (const column of targetTableData.getColumns()) {
@@ -3,7 +3,7 @@
3
3
  /**
4
4
  * AddColumnArgsType type.
5
5
  * @typedef {object} AddColumnArgsType
6
- * @property {?} [default] - Default value for the column.
6
+ * @property {ReturnType<typeof JSON.parse>} [default] - Default value for the column.
7
7
  * @property {object} [foreignKey] - Foreign key definition for the column.
8
8
  * @property {boolean | {unique: boolean}} [index] - Whether to add an index (optionally unique).
9
9
  * @property {number} [limit] - Alias for maxLength (varchar length limit) on string-like columns.
@@ -15,7 +15,7 @@
15
15
  /**
16
16
  * CreateTableIdArgsType type.
17
17
  * @typedef {object} CreateTableIdArgsType
18
- * @property {?} [default] - Default value for the ID column.
18
+ * @property {ReturnType<typeof JSON.parse>} [default] - Default value for the ID column.
19
19
  * @property {string} [type] - Column type for the ID column.
20
20
  */
21
21
  /**
@@ -9,11 +9,11 @@
9
9
  */
10
10
 
11
11
  /**
12
- * @typedef {function() : typeof import("../migration/index.js").default} ImportCallbackType
12
+ * @typedef {() => typeof import("../migration/index.js").default} ImportCallbackType
13
13
  */
14
14
 
15
15
  /**
16
- * @typedef {function(string) : Promise<typeof import("../migration/index.js").default>} ImportFullpathCallbackType
16
+ * @typedef {(arg: string) => Promise<typeof import("../migration/index.js").default>} ImportFullpathCallbackType
17
17
  */
18
18
 
19
19
  /**
@@ -11,16 +11,23 @@ export default class VelociousDatabaseOperation {
11
11
  * Runs constructor.
12
12
  * @param {object} args - Operation ownership.
13
13
  * @param {import("../configuration.js").default} args.configuration - Owning configuration.
14
+ * @param {boolean} [args.enforceCurrentTenantReuseKey] - Whether ambient tenant changes invalidate this legacy operation.
15
+ * @param {import("../configuration-types.js").DatabaseConfigurationType} [args.databaseConfiguration] - Captured resolved physical database configuration.
14
16
  * @param {string} args.configurationReuseKey - Physical database configuration key captured at checkout.
15
17
  * @param {import("./drivers/base.js").default} args.connection - Pinned physical connection.
16
18
  * @param {string} args.databaseIdentifier - Singular database identifier.
17
19
  * @param {symbol} args.owner - Opaque pool lease owner.
20
+ * @param {object | undefined} args.tenant - Tenant descriptor captured by the owning handle.
18
21
  */
19
- constructor({configuration, configurationReuseKey, connection, databaseIdentifier, owner}) {
22
+ constructor({configuration, databaseConfiguration, configurationReuseKey, connection, databaseIdentifier, enforceCurrentTenantReuseKey = true, owner, tenant}) {
20
23
  this._active = true
21
24
  this._configuration = configuration
25
+ this._databaseConfiguration = databaseConfiguration || configuration.resolveDatabaseConfiguration(databaseIdentifier, tenant)
22
26
  this._configurationReuseKey = configurationReuseKey
23
27
  this._databaseIdentifier = databaseIdentifier
28
+ this._enforceCurrentTenantReuseKey = enforceCurrentTenantReuseKey
29
+ this._physicalConnection = connection
30
+ this._tenant = tenant
24
31
  this._connection = new OperationConnection({
25
32
  connection,
26
33
  operation: this,
@@ -54,7 +61,7 @@ export default class VelociousDatabaseOperation {
54
61
  throw new Error(`${ModelClass.getModelName()} belongs to another Velocious configuration`)
55
62
  }
56
63
 
57
- const modelDatabaseIdentifier = ModelClass.getDatabaseIdentifier()
64
+ const modelDatabaseIdentifier = ModelClass.getDatabaseIdentifier({tenant: this._tenant})
58
65
 
59
66
  if (modelDatabaseIdentifier !== this._databaseIdentifier) {
60
67
  throw new Error(`${ModelClass.getModelName()} uses database ${JSON.stringify(modelDatabaseIdentifier)}, not operation database ${JSON.stringify(this._databaseIdentifier)}`)
@@ -118,11 +125,52 @@ export default class VelociousDatabaseOperation {
118
125
  * Narrows the Proxy facade to the complete driver surface that it forwards.
119
126
  * @type {import("./drivers/base.js").default}
120
127
  */
121
- const connectionFacade = /** @type {?} */ (this._connection)
128
+ const connectionFacade = /** @type {ReturnType<typeof JSON.parse>} */ (this._connection)
122
129
 
123
130
  return connectionFacade
124
131
  }
125
132
 
133
+ /**
134
+ * Returns the tenant descriptor captured by the immutable handle.
135
+ * @returns {Record<string, unknown> | undefined} - Captured tenant descriptor.
136
+ */
137
+ tenant() {
138
+ return /** @type {Record<string, unknown> | undefined} */ (this._tenant)
139
+ }
140
+
141
+ /**
142
+ * Returns the logical database identifier owned by this operation.
143
+ * @returns {string} - Database identifier.
144
+ */
145
+ databaseIdentifier() {
146
+ return this._databaseIdentifier
147
+ }
148
+
149
+ /**
150
+ * Returns a stable physical-database identity suitable for operation-aware caches.
151
+ * @returns {string} - Physical database identity.
152
+ */
153
+ databaseIdentity() {
154
+ return `${this._databaseIdentifier}:${this._configurationReuseKey}`
155
+ }
156
+
157
+ /**
158
+ * Initializes a model through this operation's captured connection.
159
+ * @param {typeof import("./record/index.js").default} ModelClass - Model class.
160
+ * @returns {Promise<void>} - Resolves when initialized.
161
+ */
162
+ async ensureModelInitialized(ModelClass) {
163
+ this.assertActive()
164
+
165
+ if (ModelClass.isInitialized()) this.assertModel(ModelClass)
166
+
167
+ await ModelClass.ensureInitialized({
168
+ configuration: this._configuration,
169
+ connection: this.connection()
170
+ })
171
+ this.assertModel(ModelClass)
172
+ }
173
+
126
174
  /**
127
175
  * Raises when an operation handle has left its callback.
128
176
  * @returns {void}
@@ -130,12 +178,17 @@ export default class VelociousDatabaseOperation {
130
178
  assertActive() {
131
179
  if (!this._active) throw new Error("Database operation has completed")
132
180
 
133
- const currentReuseKey = this
181
+ const pool = this
134
182
  ._configuration
135
183
  .getDatabasePool(this._databaseIdentifier)
136
- .getConfigurationReuseKey()
184
+ const capturedReuseKey = pool.getConfigurationReuseKey(this._databaseConfiguration)
185
+ const connectionReuseKey = pool.getConnectionConfigurationReuseKey(this._physicalConnection)
186
+
187
+ if (capturedReuseKey !== this._configurationReuseKey || connectionReuseKey !== this._configurationReuseKey) {
188
+ throw new Error(`Database operation for ${JSON.stringify(this._databaseIdentifier)} belongs to a different physical database than its captured tenant handle`)
189
+ }
137
190
 
138
- if (currentReuseKey !== this._configurationReuseKey) {
191
+ if (this._enforceCurrentTenantReuseKey && pool.getConfigurationReuseKey() !== this._configurationReuseKey) {
139
192
  throw new Error(`Database operation for ${JSON.stringify(this._databaseIdentifier)} belongs to a different physical database than the current tenant context`)
140
193
  }
141
194
  }
@@ -113,7 +113,7 @@ export default class VelociousDatabasePoolAsyncTrackedMultiConnection extends Ba
113
113
  super({configuration, identifier})
114
114
  /**
115
115
  * Runs a callback without the inherited current connection context.
116
- * @type {(callback: () => ?) => ?}
116
+ * @type {(callback: () => ReturnType<typeof JSON.parse>) => ReturnType<typeof JSON.parse>}
117
117
  */
118
118
  const withoutCurrentConnectionContext = (callback) => this.asyncLocalStorage.run(SUPPRESSED_CONNECTION_CONTEXT, callback)
119
119
  this._withoutCurrentConnectionContext = withoutCurrentConnectionContext
@@ -155,7 +155,7 @@ export default class VelociousDatabasePoolAsyncTrackedMultiConnection extends Ba
155
155
  * Runs close checked out connection after checkin failure.
156
156
  * @param {import("../drivers/base.js").default} connection - Connection that failed check-in cleanup.
157
157
  * @param {number | undefined} id - Connection checkout id.
158
- * @param {?} originalError - Error that caused check-in cleanup to fail.
158
+ * @param {ReturnType<typeof JSON.parse>} originalError - Error that caused check-in cleanup to fail.
159
159
  * @returns {Promise<void>} - Resolves when cleanup has been attempted.
160
160
  */
161
161
  async closeCheckedOutConnectionAfterCheckinFailure(connection, id, originalError) {
@@ -232,6 +232,33 @@ export default class VelociousDatabasePoolAsyncTrackedMultiConnection extends Ba
232
232
  return await this.waitForCheckout(databaseConfig, reuseKey, options)
233
233
  }
234
234
 
235
+ /**
236
+ * Checks out a connection for an already-resolved physical configuration
237
+ * without consulting ambient tenant state.
238
+ * @param {import("../../configuration-types.js").DatabaseConfigurationType} databaseConfig - Captured database configuration.
239
+ * @param {import("./base.js").ConnectionCheckoutOptions} [options] - Checkout options.
240
+ * @returns {Promise<import("../drivers/base.js").default>} - Activated pooled connection.
241
+ */
242
+ async checkoutForConfiguration(databaseConfig, options = {}) {
243
+ const reuseKey = this.getConfigurationReuseKey(databaseConfig)
244
+ let connection = this.takeIdleConnectionForReuseKey(reuseKey)
245
+
246
+ if (connection) return await this.activateConnection(connection, options)
247
+
248
+ await this.reapIdleConnections()
249
+ connection = this.takeIdleConnectionForReuseKey(reuseKey)
250
+
251
+ if (connection) return await this.activateConnection(connection, options)
252
+
253
+ if (this.canSpawnConnection(databaseConfig)) {
254
+ connection = await this.spawnConnectionForCheckout(databaseConfig, reuseKey)
255
+
256
+ return await this.activateConnection(connection, options)
257
+ }
258
+
259
+ return await this.waitForCheckout(databaseConfig, reuseKey, options)
260
+ }
261
+
235
262
  /**
236
263
  * Runs take idle connection for reuse key.
237
264
  * @param {string} reuseKey - Database configuration reuse key.
@@ -295,10 +322,11 @@ export default class VelociousDatabasePoolAsyncTrackedMultiConnection extends Ba
295
322
 
296
323
  /**
297
324
  * Runs max connections.
325
+ * @param {import("../../configuration-types.js").DatabaseConfigurationType} [databaseConfig] - Configuration whose pool maximum applies.
298
326
  * @returns {number | null} - Configured max live connections.
299
327
  */
300
- maxConnections() {
301
- const value = this.getConfiguration().pool?.max
328
+ maxConnections(databaseConfig = this.getConfiguration()) {
329
+ const value = databaseConfig.pool?.max
302
330
 
303
331
  if (value === null) return null
304
332
  if (this.validMaxConnections(value)) return value
@@ -308,10 +336,11 @@ export default class VelociousDatabasePoolAsyncTrackedMultiConnection extends Ba
308
336
 
309
337
  /**
310
338
  * Runs checkout timeout millis.
339
+ * @param {import("../../configuration-types.js").DatabaseConfigurationType} [databaseConfig] - Configuration whose timeout applies.
311
340
  * @returns {number | null} - Pending checkout timeout in milliseconds, or null when disabled.
312
341
  */
313
- checkoutTimeoutMillis() {
314
- const value = this.getConfiguration().pool?.checkoutTimeoutMillis
342
+ checkoutTimeoutMillis(databaseConfig = this.getConfiguration()) {
343
+ const value = databaseConfig.pool?.checkoutTimeoutMillis
315
344
 
316
345
  if (value === null) return null
317
346
  if (this.validCheckoutTimeoutMillis(value)) return value
@@ -321,7 +350,7 @@ export default class VelociousDatabasePoolAsyncTrackedMultiConnection extends Ba
321
350
 
322
351
  /**
323
352
  * Runs valid checkout timeout millis.
324
- * @param {?} value - Candidate checkout timeout.
353
+ * @param {ReturnType<typeof JSON.parse>} value - Candidate checkout timeout.
325
354
  * @returns {value is number} - Whether the value is a valid timeout.
326
355
  */
327
356
  validCheckoutTimeoutMillis(value) {
@@ -330,7 +359,7 @@ export default class VelociousDatabasePoolAsyncTrackedMultiConnection extends Ba
330
359
 
331
360
  /**
332
361
  * Runs valid max connections.
333
- * @param {?} value - Candidate max connection count.
362
+ * @param {ReturnType<typeof JSON.parse>} value - Candidate max connection count.
334
363
  * @returns {value is number} - Whether the value is a valid max connection count.
335
364
  */
336
365
  validMaxConnections(value) {
@@ -353,10 +382,11 @@ export default class VelociousDatabasePoolAsyncTrackedMultiConnection extends Ba
353
382
 
354
383
  /**
355
384
  * Runs can spawn connection.
385
+ * @param {import("../../configuration-types.js").DatabaseConfigurationType} [databaseConfig] - Configuration whose pool maximum applies.
356
386
  * @returns {boolean} - Whether a new connection can be spawned.
357
387
  */
358
- canSpawnConnection() {
359
- const maxConnections = this.maxConnections()
388
+ canSpawnConnection(databaseConfig = this.getConfiguration()) {
389
+ const maxConnections = this.maxConnections(databaseConfig)
360
390
 
361
391
  return maxConnections === null || this.liveConnectionCount() < maxConnections
362
392
  }
@@ -396,7 +426,7 @@ export default class VelociousDatabasePoolAsyncTrackedMultiConnection extends Ba
396
426
  async waitForCheckout(databaseConfig, reuseKey, options = {}) {
397
427
  return await new Promise((resolve, reject) => {
398
428
  const enqueuedAt = Date.now()
399
- const timeoutMillis = this.checkoutTimeoutMillis()
429
+ const timeoutMillis = this.checkoutTimeoutMillis(databaseConfig)
400
430
  /** @type {PendingCheckout} */
401
431
  const checkout = {
402
432
  databaseConfig,
@@ -451,7 +481,7 @@ export default class VelociousDatabasePoolAsyncTrackedMultiConnection extends Ba
451
481
 
452
482
  if (await this.closeIdleConnectionForPendingCheckoutCapacity(checkout)) continue
453
483
  if (!this.pendingCheckouts.includes(checkout)) continue
454
- if (this.canSpawnConnection()) {
484
+ if (this.canSpawnConnection(checkout.databaseConfig)) {
455
485
  this.removePendingCheckoutAt(0)
456
486
  await this.spawnAndResolvePendingCheckout(checkout)
457
487
  continue
@@ -561,7 +591,7 @@ export default class VelociousDatabasePoolAsyncTrackedMultiConnection extends Ba
561
591
 
562
592
  /**
563
593
  * Builds a sanitized connection summary for checkout timeout diagnostics.
564
- * @param {Record<string, ?>} connection - Connection debug snapshot.
594
+ * @param {Record<string, ReturnType<typeof JSON.parse>>} connection - Connection debug snapshot.
565
595
  * @returns {string} - Sanitized connection state.
566
596
  */
567
597
  pendingCheckoutTimeoutConnectionSummary(connection) {
@@ -575,7 +605,7 @@ export default class VelociousDatabasePoolAsyncTrackedMultiConnection extends Ba
575
605
  const activeQuery = connection.activeQuery
576
606
 
577
607
  if (activeQuery && typeof activeQuery === "object" && !Array.isArray(activeQuery)) {
578
- const runningMs = (/** @type {Record<string, ?>} */ (activeQuery)).runningMs
608
+ const runningMs = (/** @type {Record<string, ReturnType<typeof JSON.parse>>} */ (activeQuery)).runningMs
579
609
 
580
610
  if (typeof runningMs === "number") parts.push(`activeQueryMs=${runningMs}`)
581
611
  }
@@ -623,7 +653,7 @@ export default class VelociousDatabasePoolAsyncTrackedMultiConnection extends Ba
623
653
 
624
654
  if (this.findIdleConnectionForReuseKey(checkout.reuseKey)) return false
625
655
 
626
- return this.canSpawnConnection() ? false : await this.closeOneIdleConnectionForCapacity()
656
+ return this.canSpawnConnection(checkout.databaseConfig) ? false : await this.closeOneIdleConnectionForCapacity()
627
657
  }
628
658
 
629
659
  /**
@@ -703,8 +733,8 @@ export default class VelociousDatabasePoolAsyncTrackedMultiConnection extends Ba
703
733
  /**
704
734
  * Runs with connection.
705
735
  * @template T
706
- * @param {import("./base.js").ConnectionCheckoutOptions | function(import("../drivers/base.js").default) : Promise<T>} optionsOrCallback - Checkout options or callback to invoke with the connection.
707
- * @param {function(import("../drivers/base.js").default) : Promise<T>} [callback] - Callback to invoke with the connection.
736
+ * @param {import("./base.js").ConnectionCheckoutOptions | ((arg: import("../drivers/base.js").default) => Promise<T>)} optionsOrCallback - Checkout options or callback to invoke with the connection.
737
+ * @param {(arg: import("../drivers/base.js").default) => Promise<T>} [callback] - Callback to invoke with the connection.
708
738
  * @returns {Promise<T>} - Resolves with the callback result.
709
739
  */
710
740
  async withConnection(optionsOrCallback, callback) {
@@ -725,6 +755,27 @@ export default class VelociousDatabasePoolAsyncTrackedMultiConnection extends Ba
725
755
  })
726
756
  }
727
757
 
758
+ /**
759
+ * Runs a captured operation through the normal bounded pool lifecycle.
760
+ * @template T
761
+ * @param {import("./base.js").CapturedConnectionOptions} options - Captured checkout options.
762
+ * @param {(connection: import("../drivers/base.js").default, owner: symbol) => Promise<T>} callback - Operation callback.
763
+ * @returns {Promise<T>} - Callback result.
764
+ */
765
+ async withCapturedOperationConnection({databaseConfiguration, name}, callback) {
766
+ const connection = await this.checkoutForConfiguration(databaseConfiguration, {name})
767
+ const id = connection.getIdSeq()
768
+ const owner = Symbol("captured-database-operation-owner")
769
+
770
+ return await this.asyncLocalStorage.run(id, async () => {
771
+ try {
772
+ return await callback(connection, owner)
773
+ } finally {
774
+ await this.checkin(connection)
775
+ }
776
+ })
777
+ }
778
+
728
779
  /**
729
780
  * Runs get current connection.
730
781
  * @returns {import("../drivers/base.js").default} - The current connection.
@@ -923,12 +974,12 @@ export default class VelociousDatabasePoolAsyncTrackedMultiConnection extends Ba
923
974
  /**
924
975
  * Runs debug connection snapshots.
925
976
  * @param {number} now - Current timestamp.
926
- * @returns {{connections: Array<Record<string, ?>>, seenConnections: Set<import("../drivers/base.js").default>}} - Connection snapshots and seen set.
977
+ * @returns {{connections: Array<Record<string, ReturnType<typeof JSON.parse>>>, seenConnections: Set<import("../drivers/base.js").default>}} - Connection snapshots and seen set.
927
978
  */
928
979
  debugConnectionSnapshots(now) {
929
980
  /**
930
981
  * Connections.
931
- * @type {Array<Record<string, ?>>} */
982
+ * @type {Array<Record<string, ReturnType<typeof JSON.parse>>>} */
932
983
  const connections = []
933
984
  const seenConnections = new Set()
934
985
 
@@ -941,7 +992,7 @@ export default class VelociousDatabasePoolAsyncTrackedMultiConnection extends Ba
941
992
 
942
993
  /**
943
994
  * Runs add in use debug connection snapshots.
944
- * @param {{connections: Array<Record<string, ?>>, now: number, seenConnections: Set<import("../drivers/base.js").default>}} args - Snapshot collection state.
995
+ * @param {{connections: Array<Record<string, ReturnType<typeof JSON.parse>>>, now: number, seenConnections: Set<import("../drivers/base.js").default>}} args - Snapshot collection state.
945
996
  * @returns {void}
946
997
  */
947
998
  addInUseDebugConnectionSnapshots({connections, now, seenConnections}) {
@@ -957,7 +1008,7 @@ export default class VelociousDatabasePoolAsyncTrackedMultiConnection extends Ba
957
1008
 
958
1009
  /**
959
1010
  * Runs add idle debug connection snapshots.
960
- * @param {{connections: Array<Record<string, ?>>, now: number, seenConnections: Set<import("../drivers/base.js").default>}} args - Snapshot collection state.
1011
+ * @param {{connections: Array<Record<string, ReturnType<typeof JSON.parse>>>, now: number, seenConnections: Set<import("../drivers/base.js").default>}} args - Snapshot collection state.
961
1012
  * @returns {void}
962
1013
  */
963
1014
  addIdleDebugConnectionSnapshots({connections, now, seenConnections}) {
@@ -976,7 +1027,7 @@ export default class VelociousDatabasePoolAsyncTrackedMultiConnection extends Ba
976
1027
 
977
1028
  /**
978
1029
  * Runs add fallback debug connection snapshots.
979
- * @param {{connections: Array<Record<string, ?>>, seenConnections: Set<import("../drivers/base.js").default>}} args - Snapshot collection state.
1030
+ * @param {{connections: Array<Record<string, ReturnType<typeof JSON.parse>>>, seenConnections: Set<import("../drivers/base.js").default>}} args - Snapshot collection state.
980
1031
  * @returns {void}
981
1032
  */
982
1033
  addFallbackDebugConnectionSnapshots({connections, seenConnections}) {
@@ -986,7 +1037,7 @@ export default class VelociousDatabasePoolAsyncTrackedMultiConnection extends Ba
986
1037
 
987
1038
  /**
988
1039
  * Runs add debug connection snapshot if unseen.
989
- * @param {{connection: import("../drivers/base.js").default | undefined, connections: Array<Record<string, ?>>, reapable?: boolean, seenConnections: Set<import("../drivers/base.js").default>, state: string}} args - Snapshot collection state.
1040
+ * @param {{connection: import("../drivers/base.js").default | undefined, connections: Array<Record<string, ReturnType<typeof JSON.parse>>>, reapable?: boolean, seenConnections: Set<import("../drivers/base.js").default>, state: string}} args - Snapshot collection state.
990
1041
  * @returns {void}
991
1042
  */
992
1043
  addDebugConnectionSnapshotIfUnseen({connection, connections, reapable, seenConnections, state}) {
@@ -1083,7 +1134,7 @@ export default class VelociousDatabasePoolAsyncTrackedMultiConnection extends Ba
1083
1134
 
1084
1135
  /**
1085
1136
  * Runs valid idle timeout millis.
1086
- * @param {?} value - Candidate idle timeout value.
1137
+ * @param {ReturnType<typeof JSON.parse>} value - Candidate idle timeout value.
1087
1138
  * @returns {value is number} - Whether the value is a valid idle timeout.
1088
1139
  */
1089
1140
  validIdleTimeoutMillis(value) {
@@ -29,12 +29,12 @@ export default function baseMethodsForward(PoolBase) {
29
29
  "updateSql"
30
30
  ]
31
31
 
32
- const prototype = /** @type {Record<string, (...args: Array<?>) => ?>} */ (/** @type {?} */ (PoolBase.prototype))
32
+ const prototype = /** @type {Record<string, (...args: Array<ReturnType<typeof JSON.parse>>) => ReturnType<typeof JSON.parse>>} */ (/** @type {ReturnType<typeof JSON.parse>} */ (PoolBase.prototype))
33
33
 
34
34
  for (const forwardMethod of forwardMethods) {
35
35
  prototype[forwardMethod] = function(...args) {
36
36
  const connection = this.getCurrentConnection()
37
- const connectionRecord = /** @type {Record<string, (...args: Array<?>) => ?>} */ (/** @type {?} */ (connection))
37
+ const connectionRecord = /** @type {Record<string, (...args: Array<ReturnType<typeof JSON.parse>>) => ReturnType<typeof JSON.parse>>} */ (/** @type {ReturnType<typeof JSON.parse>} */ (connection))
38
38
  const connectionMethod = connectionRecord[forwardMethod]
39
39
 
40
40
  if (!connectionMethod) throw new Error(`${forwardMethod} isn't defined on driver`)
@@ -14,6 +14,12 @@ import baseMethodsForward from "./base-methods-forward.js"
14
14
  * @typedef {object} ConnectionCheckoutOptions
15
15
  * @property {string} [name] - Human-readable name for the checked-out connection.
16
16
  */
17
+ /**
18
+ * CapturedConnectionOptions type.
19
+ * @typedef {object} CapturedConnectionOptions
20
+ * @property {import("../../configuration-types.js").DatabaseConfigurationType} databaseConfiguration - Resolved physical database configuration captured by the caller.
21
+ * @property {string} [name] - Human-readable name for the checked-out connection.
22
+ */
17
23
  /**
18
24
  * DatabasePoolPendingCheckoutDebugSnapshot type.
19
25
  * @typedef {object} DatabasePoolPendingCheckoutDebugSnapshot
@@ -29,8 +35,8 @@ import baseMethodsForward from "./base-methods-forward.js"
29
35
  /**
30
36
  * DatabasePoolDebugSnapshot type.
31
37
  * @typedef {object} DatabasePoolDebugSnapshot
32
- * @property {Record<string, ?>} configuration - Sanitized resolved database configuration.
33
- * @property {Array<Record<string, ?>>} connections - Live connection snapshots.
38
+ * @property {Record<string, ReturnType<typeof JSON.parse>>} configuration - Sanitized resolved database configuration.
39
+ * @property {Array<Record<string, ReturnType<typeof JSON.parse>>>} connections - Live connection snapshots.
34
40
  * @property {number} connectionsBeingSpawned - Number of in-progress connection spawns.
35
41
  * @property {number} idleCount - Number of idle connections.
36
42
  * @property {string} identifier - Database identifier.
@@ -50,7 +56,7 @@ const shared = {
50
56
 
51
57
  /**
52
58
  * Runs stable stringify.
53
- * @param {?} value - Value to stringify.
59
+ * @param {ReturnType<typeof JSON.parse>} value - Value to stringify.
54
60
  * @returns {string} - Stable JSON string.
55
61
  */
56
62
  function stableStringify(value) {
@@ -60,9 +66,9 @@ function stableStringify(value) {
60
66
 
61
67
  if (value && typeof value === "object") {
62
68
  const entries = Object
63
- .keys(/** @type {Record<string, ?>} */ (value))
69
+ .keys(/** @type {Record<string, ReturnType<typeof JSON.parse>>} */ (value))
64
70
  .sort()
65
- .map((key) => `${JSON.stringify(key)}:${stableStringify(/** @type {Record<string, ?>} */ (value)[key])}`)
71
+ .map((key) => `${JSON.stringify(key)}:${stableStringify(/** @type {Record<string, ReturnType<typeof JSON.parse>>} */ (value)[key])}`)
66
72
 
67
73
  return `{${entries.join(",")}}`
68
74
  }
@@ -73,7 +79,7 @@ function stableStringify(value) {
73
79
  class VelociousDatabasePoolBase {
74
80
  /**
75
81
  * Without current connection context.
76
- * @type {undefined | ((callback: () => ?) => ?)} */
82
+ * @type {undefined | ((callback: () => ReturnType<typeof JSON.parse>) => ReturnType<typeof JSON.parse>)} */
77
83
  _withoutCurrentConnectionContext = undefined
78
84
 
79
85
  /**
@@ -216,11 +222,10 @@ class VelociousDatabasePoolBase {
216
222
 
217
223
  /**
218
224
  * Runs get configuration reuse key.
225
+ * @param {import("../../configuration-types.js").DatabaseConfigurationType} [databaseConfiguration] - Resolved configuration to identify.
219
226
  * @returns {string} - Reuse key for the currently resolved database configuration.
220
227
  */
221
- getConfigurationReuseKey() {
222
- const databaseConfiguration = this.getConfiguration()
223
-
228
+ getConfigurationReuseKey(databaseConfiguration = this.getConfiguration()) {
224
229
  return stableStringify({
225
230
  database: databaseConfiguration.database,
226
231
  host: databaseConfiguration.host,
@@ -310,13 +315,24 @@ class VelociousDatabasePoolBase {
310
315
 
311
316
  this.logger.debug("spawnConnection", {identifier: this.identifier, databaseConfig})
312
317
 
313
- const connection = await this.spawnConnectionWithConfiguration(databaseConfig)
318
+ return await this.spawnConnectionForConfiguration(databaseConfig)
319
+ }
314
320
 
321
+ /**
322
+ * Spawns a connection for an already-resolved physical database configuration.
323
+ * The reuse identity is derived only from that captured configuration.
324
+ * @param {import("../../configuration-types.js").DatabaseConfigurationType} databaseConfiguration - Captured resolved configuration.
325
+ * @returns {Promise<import("../drivers/base.js").default>} - Connected and identity-stamped driver.
326
+ */
327
+ async spawnConnectionForConfiguration(databaseConfiguration) {
328
+ const reuseKey = this.getConfigurationReuseKey(databaseConfiguration)
329
+ const connection = await this.spawnConnectionWithConfiguration(databaseConfiguration)
315
330
  const connectionWithPoolKey = /** @type {import("../drivers/base.js").default & {[POOL_CONFIGURATION_KEY]?: string}} */ (connection)
316
- connectionWithPoolKey[POOL_CONFIGURATION_KEY] = this.getConfigurationReuseKey()
331
+
332
+ connectionWithPoolKey[POOL_CONFIGURATION_KEY] = reuseKey
317
333
  connection.setSchemaCacheInvalidator(() => {
318
334
  this.clearSchemaCache()
319
- this.configuration.clearSchemaCachesForReuseKey(this.getConfigurationReuseKey())
335
+ this.configuration.clearSchemaCachesForReuseKey(reuseKey)
320
336
  })
321
337
 
322
338
  return connection
@@ -361,8 +377,8 @@ class VelociousDatabasePoolBase {
361
377
  * Runs with connection.
362
378
  * @template T
363
379
  * @abstract
364
- * @param {ConnectionCheckoutOptions | function(import("../drivers/base.js").default) : Promise<T>} _optionsOrCallback - Checkout options or callback function.
365
- * @param {function(import("../drivers/base.js").default) : Promise<T>} [_callback] - Callback function.
380
+ * @param {ConnectionCheckoutOptions | ((arg: import("../drivers/base.js").default) => Promise<T>)} _optionsOrCallback - Checkout options or callback function.
381
+ * @param {(arg: import("../drivers/base.js").default) => Promise<T>} [_callback] - Callback function.
366
382
  * @returns {Promise<T>} - Resolves with the callback result.
367
383
  */
368
384
  withConnection(_optionsOrCallback, _callback) {
@@ -382,6 +398,21 @@ class VelociousDatabasePoolBase {
382
398
  return await this.withConnection(options, async (connection) => await callback(connection, owner))
383
399
  }
384
400
 
401
+ /**
402
+ * Runs work through a pool-owned checkout for an immutable, already-resolved
403
+ * physical configuration. Concrete pools must preserve their capacity,
404
+ * timeout, queue, debug, and closeAll ownership on this path.
405
+ * @template T
406
+ * @param {CapturedConnectionOptions} options - Captured checkout options.
407
+ * @param {(connection: import("../drivers/base.js").default, owner: symbol) => Promise<T>} callback - Operation callback.
408
+ * @returns {Promise<T>} - Callback result.
409
+ */
410
+ async withCapturedOperationConnection(options, callback) {
411
+ void options
412
+ void callback
413
+ throw new Error("'withCapturedOperationConnection' not implemented")
414
+ }
415
+
385
416
  /**
386
417
  * Ensures a reusable connection exists for contexts where AsyncLocalStorage isn't set.
387
418
  * Default implementation just checks out a connection.
@@ -410,7 +441,7 @@ class VelociousDatabasePoolBase {
410
441
 
411
442
  /**
412
443
  * Runs debug configuration snapshot.
413
- * @returns {Record<string, ?>} - Sanitized resolved database configuration.
444
+ * @returns {Record<string, ReturnType<typeof JSON.parse>>} - Sanitized resolved database configuration.
414
445
  */
415
446
  debugConfigurationSnapshot() {
416
447
  const databaseConfig = this.getConfiguration()
@@ -434,8 +465,8 @@ class VelociousDatabasePoolBase {
434
465
  /**
435
466
  * Runs debug connection snapshot.
436
467
  * @param {import("../drivers/base.js").default} connection - Database connection.
437
- * @param {Record<string, ?>} details - Extra diagnostic fields.
438
- * @returns {Record<string, ?>} - Connection diagnostic snapshot.
468
+ * @param {Record<string, ReturnType<typeof JSON.parse>>} details - Extra diagnostic fields.
469
+ * @returns {Record<string, ReturnType<typeof JSON.parse>>} - Connection diagnostic snapshot.
439
470
  */
440
471
  debugConnectionSnapshot(connection, details = {}) {
441
472
  const connectionWithPoolKey = /** @type {import("../drivers/base.js").default & {[POOL_CONFIGURATION_KEY]?: string}} */ (connection)