velocious 1.0.461 → 1.0.463

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 (374) hide show
  1. package/build/application.js +1 -3
  2. package/build/background-jobs/cron-expression.js +1 -3
  3. package/build/background-jobs/forked-runner-child.js +1 -3
  4. package/build/background-jobs/job.js +1 -3
  5. package/build/background-jobs/scheduler.js +2 -6
  6. package/build/background-jobs/store.js +2 -6
  7. package/build/background-jobs/web/controller.js +1 -3
  8. package/build/background-jobs/worker.js +1 -3
  9. package/build/beacon/client.js +2 -6
  10. package/build/cli/tenant-database-command-helper.js +1 -3
  11. package/build/configuration.js +62 -40
  12. package/build/controller.js +4 -14
  13. package/build/database/drivers/mssql/index.js +1 -3
  14. package/build/database/drivers/mysql/index.js +2 -6
  15. package/build/database/drivers/pgsql/index.js +1 -3
  16. package/build/database/drivers/sqlite/base.js +3 -9
  17. package/build/database/drivers/sqlite/index.js +3 -9
  18. package/build/database/drivers/sqlite/table.js +1 -3
  19. package/build/database/migrator.js +1 -3
  20. package/build/database/pool/async-tracked-multi-connection.js +86 -46
  21. package/build/database/pool/base-methods-forward.js +2 -10
  22. package/build/database/pool/base.js +13 -15
  23. package/build/database/query/index.js +4 -12
  24. package/build/database/query/join-object.js +3 -9
  25. package/build/database/query/model-class-query.js +21 -63
  26. package/build/database/query/preloader/belongs-to.js +9 -27
  27. package/build/database/query/preloader/has-many.js +7 -21
  28. package/build/database/query/preloader/has-one.js +3 -9
  29. package/build/database/query/preloader.js +6 -18
  30. package/build/database/query/query-data.js +5 -15
  31. package/build/database/query/where-model-class-hash.js +5 -15
  32. package/build/database/query/with-count.js +5 -15
  33. package/build/database/record/acts-as-list.js +10 -38
  34. package/build/database/record/attachments/normalize-input.js +7 -25
  35. package/build/database/record/attachments/storage-drivers/s3.js +4 -12
  36. package/build/database/record/attachments/store.js +2 -6
  37. package/build/database/record/index.js +55 -171
  38. package/build/database/record/instance-relationships/base.js +6 -20
  39. package/build/database/record/instance-relationships/belongs-to.js +2 -6
  40. package/build/database/record/instance-relationships/has-many.js +4 -12
  41. package/build/database/record/instance-relationships/has-one.js +4 -12
  42. package/build/database/record/relationships/base.js +1 -5
  43. package/build/database/record/validators/presence.js +1 -3
  44. package/build/database/record/validators/uniqueness.js +4 -12
  45. package/build/environment-handlers/browser.js +1 -3
  46. package/build/environment-handlers/node/cli/commands/console.js +2 -6
  47. package/build/environment-handlers/node/cli/commands/db/schema/load.js +1 -3
  48. package/build/environment-handlers/node/cli/commands/generate/frontend-models.js +67 -11
  49. package/build/environment-handlers/node.js +15 -6
  50. package/build/frontend-model-controller.js +34 -110
  51. package/build/frontend-models/base.js +45 -151
  52. package/build/frontend-models/clear-pending-debounced-callback.js +1 -3
  53. package/build/frontend-models/preloader.js +3 -9
  54. package/build/frontend-models/query.js +11 -33
  55. package/build/frontend-models/resource-definition.js +2 -6
  56. package/build/frontend-models/transport-serialization.js +7 -21
  57. package/build/frontend-models/use-destroyed-event.js +2 -6
  58. package/build/frontend-models/use-model-class-event.js +2 -6
  59. package/build/frontend-models/use-updated-event.js +3 -9
  60. package/build/frontend-models/websocket-channel.js +9 -27
  61. package/build/frontend-models/websocket-publishers.js +12 -23
  62. package/build/http-server/client/index.js +7 -19
  63. package/build/http-server/client/params-to-object.js +6 -18
  64. package/build/http-server/client/request-buffer/index.js +1 -3
  65. package/build/http-server/client/request-parser.js +1 -3
  66. package/build/http-server/client/request-runner.js +5 -13
  67. package/build/http-server/client/websocket-session.js +6 -18
  68. package/build/http-server/development-reloader.js +2 -6
  69. package/build/http-server/remote-address.js +1 -5
  70. package/build/http-server/server-client.js +3 -9
  71. package/build/http-server/server-lock.js +2 -6
  72. package/build/http-server/websocket-channel-subscribers.js +2 -6
  73. package/build/http-server/websocket-event-log-store.js +5 -15
  74. package/build/http-server/websocket-events-host.js +1 -3
  75. package/build/http-server/worker-handler/in-process.js +3 -11
  76. package/build/http-server/worker-handler/index.js +3 -2
  77. package/build/http-server/worker-handler/worker-thread.js +1 -3
  78. package/build/logger.js +2 -6
  79. package/build/mailer/backends/smtp.js +1 -5
  80. package/build/mailer/base.js +4 -16
  81. package/build/plugins/sqljs-wasm-route-controller.js +1 -3
  82. package/build/routes/basic-route.js +1 -3
  83. package/build/routes/resolver.js +5 -15
  84. package/build/src/application.d.ts.map +1 -1
  85. package/build/src/application.js +2 -4
  86. package/build/src/background-jobs/cron-expression.d.ts.map +1 -1
  87. package/build/src/background-jobs/cron-expression.js +2 -4
  88. package/build/src/background-jobs/forked-runner-child.js +2 -4
  89. package/build/src/background-jobs/job.d.ts.map +1 -1
  90. package/build/src/background-jobs/job.js +2 -4
  91. package/build/src/background-jobs/scheduler.d.ts.map +1 -1
  92. package/build/src/background-jobs/scheduler.js +3 -7
  93. package/build/src/background-jobs/store.d.ts.map +1 -1
  94. package/build/src/background-jobs/store.js +3 -7
  95. package/build/src/background-jobs/web/controller.d.ts.map +1 -1
  96. package/build/src/background-jobs/web/controller.js +2 -5
  97. package/build/src/background-jobs/worker.d.ts.map +1 -1
  98. package/build/src/background-jobs/worker.js +2 -4
  99. package/build/src/beacon/client.d.ts.map +1 -1
  100. package/build/src/beacon/client.js +3 -7
  101. package/build/src/cli/tenant-database-command-helper.d.ts.map +1 -1
  102. package/build/src/cli/tenant-database-command-helper.js +2 -4
  103. package/build/src/configuration.d.ts +13 -0
  104. package/build/src/configuration.d.ts.map +1 -1
  105. package/build/src/configuration.js +58 -44
  106. package/build/src/controller.d.ts.map +1 -1
  107. package/build/src/controller.js +5 -15
  108. package/build/src/database/drivers/mssql/index.d.ts.map +1 -1
  109. package/build/src/database/drivers/mssql/index.js +2 -4
  110. package/build/src/database/drivers/mysql/index.d.ts.map +1 -1
  111. package/build/src/database/drivers/mysql/index.js +3 -7
  112. package/build/src/database/drivers/pgsql/index.d.ts.map +1 -1
  113. package/build/src/database/drivers/pgsql/index.js +2 -4
  114. package/build/src/database/drivers/sqlite/base.d.ts.map +1 -1
  115. package/build/src/database/drivers/sqlite/base.js +4 -10
  116. package/build/src/database/drivers/sqlite/index.d.ts.map +1 -1
  117. package/build/src/database/drivers/sqlite/index.js +4 -10
  118. package/build/src/database/drivers/sqlite/table.d.ts.map +1 -1
  119. package/build/src/database/drivers/sqlite/table.js +2 -4
  120. package/build/src/database/migrator.d.ts.map +1 -1
  121. package/build/src/database/migrator.js +2 -4
  122. package/build/src/database/pool/async-tracked-multi-connection.d.ts +18 -0
  123. package/build/src/database/pool/async-tracked-multi-connection.d.ts.map +1 -1
  124. package/build/src/database/pool/async-tracked-multi-connection.js +82 -48
  125. package/build/src/database/pool/base-methods-forward.d.ts.map +1 -1
  126. package/build/src/database/pool/base-methods-forward.js +3 -11
  127. package/build/src/database/pool/base.d.ts +5 -0
  128. package/build/src/database/pool/base.d.ts.map +1 -1
  129. package/build/src/database/pool/base.js +13 -16
  130. package/build/src/database/query/index.d.ts.map +1 -1
  131. package/build/src/database/query/index.js +5 -13
  132. package/build/src/database/query/join-object.d.ts.map +1 -1
  133. package/build/src/database/query/join-object.js +4 -10
  134. package/build/src/database/query/model-class-query.d.ts.map +1 -1
  135. package/build/src/database/query/model-class-query.js +22 -64
  136. package/build/src/database/query/preloader/belongs-to.d.ts.map +1 -1
  137. package/build/src/database/query/preloader/belongs-to.js +10 -28
  138. package/build/src/database/query/preloader/has-many.d.ts.map +1 -1
  139. package/build/src/database/query/preloader/has-many.js +8 -22
  140. package/build/src/database/query/preloader/has-one.d.ts.map +1 -1
  141. package/build/src/database/query/preloader/has-one.js +4 -10
  142. package/build/src/database/query/preloader.d.ts.map +1 -1
  143. package/build/src/database/query/preloader.js +7 -20
  144. package/build/src/database/query/query-data.d.ts.map +1 -1
  145. package/build/src/database/query/query-data.js +6 -16
  146. package/build/src/database/query/where-model-class-hash.d.ts.map +1 -1
  147. package/build/src/database/query/where-model-class-hash.js +6 -16
  148. package/build/src/database/query/with-count.d.ts.map +1 -1
  149. package/build/src/database/query/with-count.js +6 -17
  150. package/build/src/database/record/acts-as-list.d.ts.map +1 -1
  151. package/build/src/database/record/acts-as-list.js +11 -47
  152. package/build/src/database/record/attachments/normalize-input.d.ts.map +1 -1
  153. package/build/src/database/record/attachments/normalize-input.js +8 -30
  154. package/build/src/database/record/attachments/storage-drivers/s3.d.ts.map +1 -1
  155. package/build/src/database/record/attachments/storage-drivers/s3.js +5 -13
  156. package/build/src/database/record/attachments/store.d.ts.map +1 -1
  157. package/build/src/database/record/attachments/store.js +3 -7
  158. package/build/src/database/record/index.d.ts +4 -9
  159. package/build/src/database/record/index.d.ts.map +1 -1
  160. package/build/src/database/record/index.js +53 -173
  161. package/build/src/database/record/instance-relationships/base.d.ts.map +1 -1
  162. package/build/src/database/record/instance-relationships/base.js +7 -21
  163. package/build/src/database/record/instance-relationships/belongs-to.d.ts.map +1 -1
  164. package/build/src/database/record/instance-relationships/belongs-to.js +3 -7
  165. package/build/src/database/record/instance-relationships/has-many.d.ts.map +1 -1
  166. package/build/src/database/record/instance-relationships/has-many.js +5 -13
  167. package/build/src/database/record/instance-relationships/has-one.d.ts.map +1 -1
  168. package/build/src/database/record/instance-relationships/has-one.js +5 -13
  169. package/build/src/database/record/relationships/base.d.ts.map +1 -1
  170. package/build/src/database/record/relationships/base.js +2 -6
  171. package/build/src/database/record/validators/presence.d.ts.map +1 -1
  172. package/build/src/database/record/validators/presence.js +2 -4
  173. package/build/src/database/record/validators/uniqueness.d.ts.map +1 -1
  174. package/build/src/database/record/validators/uniqueness.js +5 -14
  175. package/build/src/environment-handlers/browser.d.ts.map +1 -1
  176. package/build/src/environment-handlers/browser.js +2 -4
  177. package/build/src/environment-handlers/node/cli/commands/console.d.ts.map +1 -1
  178. package/build/src/environment-handlers/node/cli/commands/console.js +3 -7
  179. package/build/src/environment-handlers/node/cli/commands/db/schema/load.d.ts.map +1 -1
  180. package/build/src/environment-handlers/node/cli/commands/db/schema/load.js +2 -4
  181. package/build/src/environment-handlers/node/cli/commands/generate/frontend-models.d.ts +38 -0
  182. package/build/src/environment-handlers/node/cli/commands/generate/frontend-models.d.ts.map +1 -1
  183. package/build/src/environment-handlers/node/cli/commands/generate/frontend-models.js +58 -12
  184. package/build/src/environment-handlers/node.d.ts.map +1 -1
  185. package/build/src/environment-handlers/node.js +16 -7
  186. package/build/src/frontend-model-controller.d.ts.map +1 -1
  187. package/build/src/frontend-model-controller.js +35 -114
  188. package/build/src/frontend-models/base.d.ts.map +1 -1
  189. package/build/src/frontend-models/base.js +46 -158
  190. package/build/src/frontend-models/clear-pending-debounced-callback.d.ts.map +1 -1
  191. package/build/src/frontend-models/clear-pending-debounced-callback.js +2 -4
  192. package/build/src/frontend-models/preloader.d.ts.map +1 -1
  193. package/build/src/frontend-models/preloader.js +4 -11
  194. package/build/src/frontend-models/query.d.ts.map +1 -1
  195. package/build/src/frontend-models/query.js +12 -34
  196. package/build/src/frontend-models/resource-definition.d.ts.map +1 -1
  197. package/build/src/frontend-models/resource-definition.js +3 -7
  198. package/build/src/frontend-models/transport-serialization.d.ts.map +1 -1
  199. package/build/src/frontend-models/transport-serialization.js +8 -23
  200. package/build/src/frontend-models/use-destroyed-event.js +3 -7
  201. package/build/src/frontend-models/use-model-class-event.d.ts.map +1 -1
  202. package/build/src/frontend-models/use-model-class-event.js +3 -7
  203. package/build/src/frontend-models/use-updated-event.d.ts.map +1 -1
  204. package/build/src/frontend-models/use-updated-event.js +4 -10
  205. package/build/src/frontend-models/websocket-channel.d.ts.map +1 -1
  206. package/build/src/frontend-models/websocket-channel.js +10 -32
  207. package/build/src/frontend-models/websocket-publishers.d.ts.map +1 -1
  208. package/build/src/frontend-models/websocket-publishers.js +14 -25
  209. package/build/src/http-server/client/index.d.ts.map +1 -1
  210. package/build/src/http-server/client/index.js +8 -22
  211. package/build/src/http-server/client/params-to-object.d.ts.map +1 -1
  212. package/build/src/http-server/client/params-to-object.js +7 -21
  213. package/build/src/http-server/client/request-buffer/index.d.ts.map +1 -1
  214. package/build/src/http-server/client/request-buffer/index.js +2 -4
  215. package/build/src/http-server/client/request-parser.d.ts.map +1 -1
  216. package/build/src/http-server/client/request-parser.js +2 -4
  217. package/build/src/http-server/client/request-runner.d.ts.map +1 -1
  218. package/build/src/http-server/client/request-runner.js +6 -15
  219. package/build/src/http-server/client/websocket-session.d.ts.map +1 -1
  220. package/build/src/http-server/client/websocket-session.js +7 -20
  221. package/build/src/http-server/development-reloader.d.ts.map +1 -1
  222. package/build/src/http-server/development-reloader.js +3 -7
  223. package/build/src/http-server/remote-address.d.ts.map +1 -1
  224. package/build/src/http-server/remote-address.js +2 -6
  225. package/build/src/http-server/server-client.d.ts.map +1 -1
  226. package/build/src/http-server/server-client.js +4 -10
  227. package/build/src/http-server/server-lock.d.ts.map +1 -1
  228. package/build/src/http-server/server-lock.js +3 -7
  229. package/build/src/http-server/websocket-channel-subscribers.d.ts.map +1 -1
  230. package/build/src/http-server/websocket-channel-subscribers.js +3 -7
  231. package/build/src/http-server/websocket-event-log-store.d.ts.map +1 -1
  232. package/build/src/http-server/websocket-event-log-store.js +6 -16
  233. package/build/src/http-server/websocket-events-host.d.ts.map +1 -1
  234. package/build/src/http-server/websocket-events-host.js +2 -5
  235. package/build/src/http-server/worker-handler/in-process.d.ts.map +1 -1
  236. package/build/src/http-server/worker-handler/in-process.js +4 -12
  237. package/build/src/http-server/worker-handler/index.d.ts.map +1 -1
  238. package/build/src/http-server/worker-handler/index.js +4 -3
  239. package/build/src/http-server/worker-handler/worker-thread.d.ts.map +1 -1
  240. package/build/src/http-server/worker-handler/worker-thread.js +2 -4
  241. package/build/src/logger.d.ts.map +1 -1
  242. package/build/src/logger.js +3 -7
  243. package/build/src/mailer/backends/smtp.d.ts.map +1 -1
  244. package/build/src/mailer/backends/smtp.js +2 -6
  245. package/build/src/mailer/base.d.ts.map +1 -1
  246. package/build/src/mailer/base.js +5 -17
  247. package/build/src/plugins/sqljs-wasm-route-controller.d.ts.map +1 -1
  248. package/build/src/plugins/sqljs-wasm-route-controller.js +2 -4
  249. package/build/src/routes/basic-route.d.ts.map +1 -1
  250. package/build/src/routes/basic-route.js +2 -4
  251. package/build/src/routes/resolver.d.ts.map +1 -1
  252. package/build/src/routes/resolver.js +6 -16
  253. package/build/src/testing/expect-utils.d.ts.map +1 -1
  254. package/build/src/testing/expect-utils.js +9 -27
  255. package/build/src/testing/expect.d.ts.map +1 -1
  256. package/build/src/testing/expect.js +5 -15
  257. package/build/src/testing/test-runner.d.ts.map +1 -1
  258. package/build/src/testing/test-runner.js +4 -10
  259. package/build/src/testing/test.d.ts.map +1 -1
  260. package/build/src/testing/test.js +5 -17
  261. package/build/src/utils/model-scope.d.ts.map +1 -1
  262. package/build/src/utils/model-scope.js +2 -5
  263. package/build/src/utils/ransack.d.ts.map +1 -1
  264. package/build/src/utils/ransack.js +15 -42
  265. package/build/src/utils/with-tracked-stack-async-hooks.d.ts.map +1 -1
  266. package/build/src/utils/with-tracked-stack-async-hooks.js +4 -12
  267. package/build/src/utils/with-tracked-stack.d.ts.map +1 -1
  268. package/build/src/utils/with-tracked-stack.js +3 -8
  269. package/build/testing/expect-utils.js +8 -26
  270. package/build/testing/expect.js +4 -14
  271. package/build/testing/test-runner.js +3 -9
  272. package/build/testing/test.js +4 -12
  273. package/build/tsconfig.tsbuildinfo +1 -1
  274. package/build/utils/model-scope.js +1 -3
  275. package/build/utils/ransack.js +15 -41
  276. package/build/utils/with-tracked-stack-async-hooks.js +3 -9
  277. package/build/utils/with-tracked-stack.js +2 -6
  278. package/package.json +5 -3
  279. package/src/application.js +1 -3
  280. package/src/background-jobs/cron-expression.js +1 -3
  281. package/src/background-jobs/forked-runner-child.js +1 -3
  282. package/src/background-jobs/job.js +1 -3
  283. package/src/background-jobs/scheduler.js +2 -6
  284. package/src/background-jobs/store.js +2 -6
  285. package/src/background-jobs/web/controller.js +1 -3
  286. package/src/background-jobs/worker.js +1 -3
  287. package/src/beacon/client.js +2 -6
  288. package/src/cli/tenant-database-command-helper.js +1 -3
  289. package/src/configuration.js +62 -40
  290. package/src/controller.js +4 -14
  291. package/src/database/drivers/mssql/index.js +1 -3
  292. package/src/database/drivers/mysql/index.js +2 -6
  293. package/src/database/drivers/pgsql/index.js +1 -3
  294. package/src/database/drivers/sqlite/base.js +3 -9
  295. package/src/database/drivers/sqlite/index.js +3 -9
  296. package/src/database/drivers/sqlite/table.js +1 -3
  297. package/src/database/migrator.js +1 -3
  298. package/src/database/pool/async-tracked-multi-connection.js +86 -46
  299. package/src/database/pool/base-methods-forward.js +2 -10
  300. package/src/database/pool/base.js +13 -15
  301. package/src/database/query/index.js +4 -12
  302. package/src/database/query/join-object.js +3 -9
  303. package/src/database/query/model-class-query.js +21 -63
  304. package/src/database/query/preloader/belongs-to.js +9 -27
  305. package/src/database/query/preloader/has-many.js +7 -21
  306. package/src/database/query/preloader/has-one.js +3 -9
  307. package/src/database/query/preloader.js +6 -18
  308. package/src/database/query/query-data.js +5 -15
  309. package/src/database/query/where-model-class-hash.js +5 -15
  310. package/src/database/query/with-count.js +5 -15
  311. package/src/database/record/acts-as-list.js +10 -38
  312. package/src/database/record/attachments/normalize-input.js +7 -25
  313. package/src/database/record/attachments/storage-drivers/s3.js +4 -12
  314. package/src/database/record/attachments/store.js +2 -6
  315. package/src/database/record/index.js +55 -171
  316. package/src/database/record/instance-relationships/base.js +6 -20
  317. package/src/database/record/instance-relationships/belongs-to.js +2 -6
  318. package/src/database/record/instance-relationships/has-many.js +4 -12
  319. package/src/database/record/instance-relationships/has-one.js +4 -12
  320. package/src/database/record/relationships/base.js +1 -5
  321. package/src/database/record/validators/presence.js +1 -3
  322. package/src/database/record/validators/uniqueness.js +4 -12
  323. package/src/environment-handlers/browser.js +1 -3
  324. package/src/environment-handlers/node/cli/commands/console.js +2 -6
  325. package/src/environment-handlers/node/cli/commands/db/schema/load.js +1 -3
  326. package/src/environment-handlers/node/cli/commands/generate/frontend-models.js +67 -11
  327. package/src/environment-handlers/node.js +15 -6
  328. package/src/frontend-model-controller.js +34 -110
  329. package/src/frontend-models/base.js +45 -151
  330. package/src/frontend-models/clear-pending-debounced-callback.js +1 -3
  331. package/src/frontend-models/preloader.js +3 -9
  332. package/src/frontend-models/query.js +11 -33
  333. package/src/frontend-models/resource-definition.js +2 -6
  334. package/src/frontend-models/transport-serialization.js +7 -21
  335. package/src/frontend-models/use-destroyed-event.js +2 -6
  336. package/src/frontend-models/use-model-class-event.js +2 -6
  337. package/src/frontend-models/use-updated-event.js +3 -9
  338. package/src/frontend-models/websocket-channel.js +9 -27
  339. package/src/frontend-models/websocket-publishers.js +12 -23
  340. package/src/http-server/client/index.js +7 -19
  341. package/src/http-server/client/params-to-object.js +6 -18
  342. package/src/http-server/client/request-buffer/index.js +1 -3
  343. package/src/http-server/client/request-parser.js +1 -3
  344. package/src/http-server/client/request-runner.js +5 -13
  345. package/src/http-server/client/websocket-session.js +6 -18
  346. package/src/http-server/development-reloader.js +2 -6
  347. package/src/http-server/remote-address.js +1 -5
  348. package/src/http-server/server-client.js +3 -9
  349. package/src/http-server/server-lock.js +2 -6
  350. package/src/http-server/websocket-channel-subscribers.js +2 -6
  351. package/src/http-server/websocket-event-log-store.js +5 -15
  352. package/src/http-server/websocket-events-host.js +1 -3
  353. package/src/http-server/worker-handler/in-process.js +3 -11
  354. package/src/http-server/worker-handler/index.js +3 -2
  355. package/src/http-server/worker-handler/worker-thread.js +1 -3
  356. package/src/logger.js +2 -6
  357. package/src/mailer/backends/smtp.js +1 -5
  358. package/src/mailer/base.js +4 -16
  359. package/src/plugins/sqljs-wasm-route-controller.js +1 -3
  360. package/src/routes/basic-route.js +1 -3
  361. package/src/routes/resolver.js +5 -15
  362. package/src/testing/expect-utils.js +8 -26
  363. package/src/testing/expect.js +4 -14
  364. package/src/testing/test-runner.js +3 -9
  365. package/src/testing/test.js +4 -12
  366. package/src/utils/model-scope.js +1 -3
  367. package/src/utils/ransack.js +15 -41
  368. package/src/utils/with-tracked-stack-async-hooks.js +3 -9
  369. package/src/utils/with-tracked-stack.js +2 -6
  370. package/build/src/utils/ensure-error.d.ts +0 -7
  371. package/build/src/utils/ensure-error.d.ts.map +0 -1
  372. package/build/src/utils/ensure-error.js +0 -15
  373. package/build/utils/ensure-error.js +0 -15
  374. package/src/utils/ensure-error.js +0 -15
@@ -119,9 +119,7 @@ export default class VelociousApplication {
119
119
  async startLockedHttpServer({configuration, host, httpServerConfiguration, port}) {
120
120
  try {
121
121
  if (!configuration.getWebsocketEvents()) {
122
- configuration.setWebsocketEvents(/**
123
- * Types the following value.
124
- * @type {?} */ (websocketEventsHost))
122
+ configuration.setWebsocketEvents(/** @type {?} */ (websocketEventsHost))
125
123
  }
126
124
 
127
125
  await configuration.connectBeacon({peerType: "server"})
@@ -60,9 +60,7 @@ export function parseCronExpression(expression) {
60
60
  }
61
61
 
62
62
  const trimmed = expression.trim().toLowerCase()
63
- const expanded = SHORTCUTS[/**
64
- * Narrows the runtime value to the documented type.
65
- * @type {keyof typeof SHORTCUTS} */ (trimmed)] || trimmed
63
+ const expanded = SHORTCUTS[/** @type {keyof typeof SHORTCUTS} */ (trimmed)] || trimmed
66
64
  const fields = expanded.split(/\s+/)
67
65
 
68
66
  if (fields.length !== 5) {
@@ -12,9 +12,7 @@ let finishing = false
12
12
  function isJobMessage(message) {
13
13
  if (!message || typeof message !== "object") return false
14
14
 
15
- const messageRecord = /**
16
- * Narrows the runtime value to the documented type.
17
- * @type {{type?: ?, payload?: ?}} */ (message)
15
+ const messageRecord = /** @type {{type?: ?, payload?: ?}} */ (message)
18
16
 
19
17
  return messageRecord.type === "job" && Object.hasOwn(messageRecord, "payload")
20
18
  }
@@ -58,9 +58,7 @@ export default class VelociousJob {
58
58
  const isOptionsArg = lastArg && typeof lastArg === "object" && !Array.isArray(lastArg) && "jobOptions" in lastArg
59
59
 
60
60
  if (isOptionsArg) {
61
- const {jobOptions} = /**
62
- * Narrows the runtime value to the documented type.
63
- * @type {{jobOptions: import("./types.js").BackgroundJobOptions}} */ (lastArg)
61
+ const {jobOptions} = /** @type {{jobOptions: import("./types.js").BackgroundJobOptions}} */ (lastArg)
64
62
  return {jobArgs: args.slice(0, -1), jobOptions: jobOptions || {}}
65
63
  }
66
64
 
@@ -52,9 +52,7 @@ export function parseScheduledDuration(value, fieldName) {
52
52
  }
53
53
 
54
54
  const numericValue = Number(match[1])
55
- const multiplier = DURATION_MULTIPLIERS[/**
56
- * Narrows the runtime value to the documented type.
57
- * @type {DurationUnit} */ (match[2])]
55
+ const multiplier = DURATION_MULTIPLIERS[/** @type {DurationUnit} */ (match[2])]
58
56
 
59
57
  if (!multiplier) {
60
58
  throw new Error(`Invalid scheduled background job ${fieldName}: ${value}`)
@@ -168,9 +166,7 @@ export default class BackgroundJobsScheduler {
168
166
  * @returns {void}
169
167
  */
170
168
  scheduleEveryJob({jobConfiguration, jobKey}) {
171
- const everyConfig = /**
172
- * Narrows the runtime value to the documented type.
173
- * @type {NonNullable<typeof jobConfiguration.every>} */ (jobConfiguration.every)
169
+ const everyConfig = /** @type {NonNullable<typeof jobConfiguration.every>} */ (jobConfiguration.every)
174
170
  const {everyValue, firstInValue} = this.normalizeEvery(everyConfig)
175
171
  const intervalMs = parseScheduledDuration(everyValue, `${jobKey}.every`)
176
172
  const firstInMs = firstInValue !== undefined ? parseScheduledDuration(firstInValue, `${jobKey}.first_in`) : intervalMs
@@ -237,9 +237,7 @@ export default class BackgroundJobsStore {
237
237
  const counts = {}
238
238
 
239
239
  for (const row of rows) {
240
- const typedRow = /**
241
- * Narrows the runtime value to the documented type.
242
- * @type {Record<string, ?>} */ (row)
240
+ const typedRow = /** @type {Record<string, ?>} */ (row)
243
241
 
244
242
  counts[String(typedRow.status)] = this._normalizeNumber(typedRow.count) || 0
245
243
  }
@@ -265,9 +263,7 @@ export default class BackgroundJobsStore {
265
263
  if (jobName) query = query.where({job_name: jobName})
266
264
 
267
265
  const rows = await query.results()
268
- const countRow = /**
269
- * Narrows the runtime value to the documented type.
270
- * @type {Record<string, ?>} */ (rows[0] || {})
266
+ const countRow = /** @type {Record<string, ?>} */ (rows[0] || {})
271
267
 
272
268
  return this._normalizeNumber(countRow.count) || 0
273
269
  })
@@ -222,9 +222,7 @@ export default class VelociousBackgroundJobsWebController extends Controller {
222
222
  const redactArgs = Boolean(this._mountOptions().redactArgs)
223
223
 
224
224
  return Object.keys(jobs).map((name) => {
225
- const entry = jobs[name] || /**
226
- * Narrows the runtime value to the documented type.
227
- * @type {?} */ ({})
225
+ const entry = jobs[name] || /** @type {?} */ ({})
228
226
 
229
227
  return {
230
228
  args: redactArgs ? undefined : (entry.args || []),
@@ -276,9 +276,7 @@ export default class BackgroundJobsWorker {
276
276
  /**
277
277
  * Identified payload.
278
278
  * @type {import("./types.js").BackgroundJobPayload & {id: string}} */
279
- const identifiedPayload = /**
280
- * Narrows the runtime value to the documented type.
281
- * @type {?} */ (payload)
279
+ const identifiedPayload = /** @type {?} */ (payload)
282
280
 
283
281
  const executionMode = this._executionModeForPayload(identifiedPayload)
284
282
 
@@ -116,9 +116,7 @@ export default class BeaconClient extends EventEmitter {
116
116
  this.off("connect-error", onError)
117
117
  resolve()
118
118
  }
119
- const onError = (/**
120
- * Narrows the runtime value to the documented type.
121
- * @type {Error} */ error) => {
119
+ const onError = (/** @type {Error} */ error) => {
122
120
  this.off("connect", onConnect)
123
121
  this.off("connect-error", onError)
124
122
  reject(error)
@@ -271,9 +269,7 @@ export default class BeaconClient extends EventEmitter {
271
269
  this.emit("connect")
272
270
  })
273
271
 
274
- jsonSocket.on("message", (/**
275
- * Narrows the runtime value to the documented type.
276
- * @type {import("./types.js").BeaconSocketMessage} */ message) => {
272
+ jsonSocket.on("message", (/** @type {import("./types.js").BeaconSocketMessage} */ message) => {
277
273
  if (message?.type === "hello-ack" && message.peerId === this.peerId) {
278
274
  this._ready = true
279
275
  this.emit("ready")
@@ -184,9 +184,7 @@ export default class TenantDatabaseCommandHelper {
184
184
  */
185
185
  tenantLabel(tenant) {
186
186
  if (tenant && typeof tenant === "object") {
187
- const tenantObject = /**
188
- * Narrows the runtime value to the documented type.
189
- * @type {{id?: ?, name?: ?, slug?: ?}} */ (tenant)
187
+ const tenantObject = /** @type {{id?: ?, name?: ?, slug?: ?}} */ (tenant)
190
188
 
191
189
  if (tenantObject.slug) return String(tenantObject.slug)
192
190
  if (tenantObject.name) return String(tenantObject.name)
@@ -30,15 +30,34 @@ export {CurrentConfigurationNotSetError}
30
30
  * @returns {string | undefined} - Current working directory when the runtime exposes one.
31
31
  */
32
32
  function currentWorkingDirectory() {
33
- const processObject = /**
34
- * Types the following value.
35
- * @type {{cwd?: ?} | undefined} */ (globalThis.process)
33
+ const processObject = /** @type {{cwd?: ?} | undefined} */ (globalThis.process)
36
34
 
37
35
  if (typeof processObject?.cwd !== "function") return undefined
38
36
 
39
37
  return processObject.cwd()
40
38
  }
41
39
 
40
+ /**
41
+ * Resolves the overloaded with/ensure connections arguments.
42
+ * @template T
43
+ * @param {WithConnectionsOptionsType | WithConnectionsCallbackType<T>} optionsOrCallback - Checkout options or callback function.
44
+ * @param {WithConnectionsCallbackType<T> | undefined} callback - Callback function.
45
+ * @param {string} defaultName - Default checkout name.
46
+ * @returns {{name: string, callback: WithConnectionsCallbackType<T> | undefined}} Resolved checkout name and callback.
47
+ */
48
+ function resolveWithConnectionsArgs(optionsOrCallback, callback, defaultName) {
49
+ if (typeof optionsOrCallback == "function") {
50
+ const actualCallback = /** @type {WithConnectionsCallbackType<T>} */ (optionsOrCallback)
51
+
52
+ return {name: defaultName, callback: actualCallback}
53
+ }
54
+
55
+ return {
56
+ name: optionsOrCallback.name || defaultName,
57
+ callback
58
+ }
59
+ }
60
+
42
61
  /**
43
62
  * Runs canonical debug snapshot value.
44
63
  * @param {?} value - Snapshot value to canonicalize.
@@ -49,13 +68,9 @@ function canonicalDebugSnapshotValue(value) {
49
68
  if (Array.isArray(value)) return value.map((entry) => canonicalDebugSnapshotValue(entry))
50
69
 
51
70
  return Object.keys(value).sort().reduce((result, key) => {
52
- result[key] = canonicalDebugSnapshotValue(/**
53
- * Types the following value.
54
- * @type {Record<string, ?>} */ (value)[key])
71
+ result[key] = canonicalDebugSnapshotValue(/** @type {Record<string, ?>} */ (value)[key])
55
72
  return result
56
- }, /**
57
- * Types the following value.
58
- * @type {Record<string, ?>} */ ({}))
73
+ }, /** @type {Record<string, ?>} */ ({}))
59
74
  }
60
75
 
61
76
  /**
@@ -496,9 +511,7 @@ export default class VelociousConfiguration {
496
511
  * @returns {Promise<Record<string, ?>>} - HTTP server worker diagnostics.
497
512
  */
498
513
  async _debugHttpServerSnapshot() {
499
- const httpServer = /**
500
- * Types the following value.
501
- * @type {{getDebugSnapshot?: () => Promise<Record<string, ?>>} | undefined} */ (this._httpServerInstance)
514
+ const httpServer = /** @type {{getDebugSnapshot?: () => Promise<Record<string, ?>>} | undefined} */ (this._httpServerInstance)
502
515
 
503
516
  if (!httpServer?.getDebugSnapshot) {
504
517
  return {configured: Boolean(this.httpServer), active: false}
@@ -597,9 +610,7 @@ export default class VelociousConfiguration {
597
610
  const detailsBuckets = new Map()
598
611
 
599
612
  for (const subscription of channelSubscriptions) {
600
- const details = /**
601
- * Types the following value.
602
- * @type {Record<string, ?>} */ (canonicalDebugSnapshotValue(subscription.debugSnapshot()))
613
+ const details = /** @type {Record<string, ?>} */ (canonicalDebugSnapshotValue(subscription.debugSnapshot()))
603
614
  const key = JSON.stringify(details)
604
615
  const existingBucket = detailsBuckets.get(key)
605
616
 
@@ -624,9 +635,7 @@ export default class VelociousConfiguration {
624
635
  const channelSubscriptionBuckets = new Map()
625
636
 
626
637
  for (const {channelType, subscription} of session._channelSubscriptions.values()) {
627
- const details = /**
628
- * Types the following value.
629
- * @type {Record<string, ?>} */ (subscription.debugSnapshot())
638
+ const details = /** @type {Record<string, ?>} */ (subscription.debugSnapshot())
630
639
  const model = typeof details.model === "string" ? details.model : null
631
640
  const key = JSON.stringify({channelType, model})
632
641
  const existingBucket = channelSubscriptionBuckets.get(key)
@@ -2422,13 +2431,7 @@ export default class VelociousConfiguration {
2422
2431
  * @returns {Promise<T>} - Resolves with the callback result.
2423
2432
  */
2424
2433
  async withConnections(optionsOrCallback, callback) {
2425
- const name = typeof optionsOrCallback == "function" ? "Configuration.withConnections" : (optionsOrCallback.name || "Configuration.withConnections")
2426
- /**
2427
- * Actual with connections callback.
2428
- * @type {WithConnectionsCallbackType<T> | undefined} */
2429
- const actualWithConnectionsCallback = typeof optionsOrCallback == "function" ? /**
2430
- * Types the following value.
2431
- * @type {WithConnectionsCallbackType<T>} */ (optionsOrCallback) : callback
2434
+ const {name, callback: actualWithConnectionsCallback} = resolveWithConnectionsArgs(optionsOrCallback, callback, "Configuration.withConnections")
2432
2435
 
2433
2436
  if (!actualWithConnectionsCallback) throw new Error("withConnections requires a callback")
2434
2437
 
@@ -2437,10 +2440,26 @@ export default class VelociousConfiguration {
2437
2440
  * @type {{[key: string]: import("./database/drivers/base.js").default}} */
2438
2441
  const dbs = {}
2439
2442
 
2443
+ return await this.withDatabaseIdentifierConnections({
2444
+ callback: actualWithConnectionsCallback,
2445
+ dbs,
2446
+ identifiers: this.getDatabaseIdentifiers(),
2447
+ name,
2448
+ stackLabel: "withConnections"
2449
+ })
2450
+ }
2451
+
2452
+ /**
2453
+ * Runs callback with database connections for the requested identifiers.
2454
+ * @template T
2455
+ * @param {{callback: WithConnectionsCallbackType<T>, dbs: Record<string, import("./database/drivers/base.js").default>, identifiers: string[], name: string, stackLabel: string}} args - Connection scope details.
2456
+ * @returns {Promise<T>} - Resolves with the callback result.
2457
+ */
2458
+ async withDatabaseIdentifierConnections({callback, dbs, identifiers, name, stackLabel}) {
2440
2459
  const stack = Error().stack
2441
2460
  const actualCallback = async () => {
2442
- return await withTrackedStack(stack || "withConnections", async () => {
2443
- return await actualWithConnectionsCallback(dbs)
2461
+ return await withTrackedStack(stack || stackLabel, async () => {
2462
+ return await callback(dbs)
2444
2463
  })
2445
2464
  }
2446
2465
 
@@ -2449,7 +2468,7 @@ export default class VelociousConfiguration {
2449
2468
  * @type {() => Promise<T>} */
2450
2469
  let runRequest = actualCallback
2451
2470
 
2452
- for (const identifier of this.getDatabaseIdentifiers()) {
2471
+ for (const identifier of identifiers) {
2453
2472
  let actualRunRequest = runRequest
2454
2473
 
2455
2474
  const nextRunRequest = async () => {
@@ -2537,25 +2556,28 @@ export default class VelociousConfiguration {
2537
2556
  * @returns {Promise<T>} - Resolves with the callback result.
2538
2557
  */
2539
2558
  async ensureConnections(optionsOrCallback, callback) {
2540
- const name = typeof optionsOrCallback == "function" ? "Configuration.ensureConnections" : (optionsOrCallback.name || "Configuration.ensureConnections")
2541
- /**
2542
- * Actual with connections callback.
2543
- * @type {WithConnectionsCallbackType<T> | undefined} */
2544
- const actualWithConnectionsCallback = typeof optionsOrCallback == "function" ? /**
2545
- * Types the following value.
2546
- * @type {WithConnectionsCallbackType<T>} */ (optionsOrCallback) : callback
2559
+ const {name, callback: actualWithConnectionsCallback} = resolveWithConnectionsArgs(optionsOrCallback, callback, "Configuration.ensureConnections")
2547
2560
 
2548
2561
  if (!actualWithConnectionsCallback) throw new Error("ensureConnections requires a callback")
2549
2562
 
2550
2563
  const dbs = this.getCurrentConnections()
2551
- const identifiers = this.getDatabaseIdentifiers()
2552
- const hasAllConnections = identifiers.every((identifier) => dbs[identifier])
2564
+ const missingIdentifiers = this.getDatabaseIdentifiers().filter((identifier) => {
2565
+ if (!dbs[identifier]) return true
2566
+
2567
+ return !this.getDatabasePool(identifier).hasCurrentConnectionContext()
2568
+ })
2553
2569
 
2554
- if (hasAllConnections) {
2570
+ if (missingIdentifiers.length === 0) {
2555
2571
  return await actualWithConnectionsCallback(dbs)
2556
- } else {
2557
- return await this.withConnections({name}, actualWithConnectionsCallback)
2558
2572
  }
2573
+
2574
+ return await this.withDatabaseIdentifierConnections({
2575
+ callback: actualWithConnectionsCallback,
2576
+ dbs,
2577
+ identifiers: missingIdentifiers,
2578
+ name,
2579
+ stackLabel: "ensureConnections"
2580
+ })
2559
2581
  }
2560
2582
 
2561
2583
  /**
@@ -141,9 +141,7 @@ export default class VelociousController {
141
141
  * @returns {typeof VelociousController} - The controller class.
142
142
  */
143
143
  _getControllerClass() {
144
- const controllerClass = /**
145
- * Types the following value.
146
- * @type {typeof VelociousController} */ (this.constructor)
144
+ const controllerClass = /** @type {typeof VelociousController} */ (this.constructor)
147
145
 
148
146
  return controllerClass
149
147
  }
@@ -159,11 +157,7 @@ export default class VelociousController {
159
157
  const beforeActions = currentControllerClass._beforeActions
160
158
 
161
159
  if (beforeActions) {
162
- const controllerPrototype = /**
163
- * Types the following value.
164
- * @type {Record<string, Function | undefined>} */ (/**
165
- * Types the following value.
166
- * @type {?} */ (currentControllerClass.prototype))
160
+ const controllerPrototype = /** @type {Record<string, Function | undefined>} */ (/** @type {?} */ (currentControllerClass.prototype))
167
161
 
168
162
  for (const beforeActionName of beforeActions) {
169
163
  const beforeAction = controllerPrototype[beforeActionName]
@@ -215,9 +209,7 @@ export default class VelociousController {
215
209
 
216
210
  return paramsToObject.toObject()
217
211
  } catch (error) {
218
- const ensuredError = /**
219
- * Types the following value.
220
- * @type {Error & {velociousContext?: Record<string, ?>}} */ (error)
212
+ const ensuredError = /** @type {Error & {velociousContext?: Record<string, ?>}} */ (error)
221
213
 
222
214
  ensuredError.velociousContext = {
223
215
  ...(ensuredError.velociousContext || {}),
@@ -295,9 +287,7 @@ export default class VelociousController {
295
287
 
296
288
  ejs.renderFile(viewPath, actualViewParams, {}, (err, str) => {
297
289
  if (err) {
298
- const renderError = /**
299
- * Types the following value.
300
- * @type {Error & {code?: string}} */ (err)
290
+ const renderError = /** @type {Error & {code?: string}} */ (err)
301
291
 
302
292
  if (renderError.code === "ENOENT") {
303
293
  this.logger.warn(`Missing view file: ${viewPath}`)
@@ -340,9 +340,7 @@ export default class VelociousDatabaseDriversMssql extends Base{
340
340
  const tables = []
341
341
 
342
342
  for (const row of result) {
343
- const table = new Table(this, /**
344
- * Narrows the runtime value to the documented type.
345
- * @type {Record<string, string>} */ (row))
343
+ const table = new Table(this, /** @type {Record<string, string>} */ (row))
346
344
 
347
345
  tables.push(table)
348
346
  }
@@ -223,9 +223,7 @@ export default class VelociousDatabaseDriversMysql extends Base{
223
223
  * @returns {import("../base.js").RetryableDatabaseErrorResult} - Retry info.
224
224
  */
225
225
  retryableDatabaseError(error) {
226
- const errorCode = /**
227
- * Narrows the runtime value to the documented type.
228
- * @type {?} */ (error).code
226
+ const errorCode = /** @type {?} */ (error).code
229
227
  const message = error.message || ""
230
228
  const shouldRetry = (
231
229
  errorCode == "ECONNREFUSED" ||
@@ -337,9 +335,7 @@ export default class VelociousDatabaseDriversMysql extends Base{
337
335
  const tables = []
338
336
 
339
337
  for (const row of result) {
340
- const table = new Table(this, /**
341
- * Narrows the runtime value to the documented type.
342
- * @type {Record<string, string>} */ (row))
338
+ const table = new Table(this, /** @type {Record<string, string>} */ (row))
343
339
 
344
340
  tables.push(table)
345
341
  }
@@ -292,9 +292,7 @@ export default class VelociousDatabaseDriversPgsql extends Base{
292
292
  const tables = []
293
293
 
294
294
  for (const row of result) {
295
- const table = new Table(this, /**
296
- * Narrows the runtime value to the documented type.
297
- * @type {Record<string, string>} */ (row))
295
+ const table = new Table(this, /** @type {Record<string, string>} */ (row))
298
296
 
299
297
  tables.push(table)
300
298
  }
@@ -87,9 +87,7 @@ export default class VelociousDatabaseDriversSqliteBase extends Base {
87
87
  * @returns {Promise<string[]>} - Resolves with SQL statements.
88
88
  */
89
89
  async dropTableSQLs(tableName, args = {}) {
90
- const driver = /**
91
- * Narrows the runtime value to the documented type.
92
- * @type {import("../base.js").default} */ (this)
90
+ const driver = /** @type {import("../base.js").default} */ (this)
93
91
  const dropArgs = Object.assign({tableName, driver}, args)
94
92
  const dropTable = new DropTable(dropArgs)
95
93
 
@@ -126,9 +124,7 @@ export default class VelociousDatabaseDriversSqliteBase extends Base {
126
124
  const tables = []
127
125
 
128
126
  for (const row of result) {
129
- const table = new Table({driver: this, row: /**
130
- * Narrows the runtime value to the documented type.
131
- * @type {Record<string, string | number | null>} */ (row)})
127
+ const table = new Table({driver: this, row: /** @type {Record<string, string | number | null>} */ (row)})
132
128
 
133
129
  tables.push(table)
134
130
  }
@@ -403,9 +399,7 @@ export default class VelociousDatabaseDriversSqliteBase extends Base {
403
399
  if (timeoutHandle) clearTimeout(timeoutHandle)
404
400
 
405
401
  const current = state.waitersByName.get(name) || []
406
- const index = current.indexOf(/**
407
- * Narrows the runtime value to the documented type.
408
- * @type {() => void} */ (removeAndResolve))
402
+ const index = current.indexOf(/** @type {() => void} */ (removeAndResolve))
409
403
 
410
404
  if (index >= 0) current.splice(index, 1)
411
405
  if (current.length === 0) state.waitersByName.delete(name)
@@ -247,9 +247,7 @@ export default class VelociousDatabaseDriversSqliteNode extends Base {
247
247
 
248
248
  return true
249
249
  } catch (error) {
250
- if (/**
251
- * Narrows the runtime value to the documented type.
252
- * @type {NodeJS.ErrnoException} */ (error)?.code !== "EEXIST") throw error
250
+ if (/** @type {NodeJS.ErrnoException} */ (error)?.code !== "EEXIST") throw error
253
251
 
254
252
  if (await this._isAdvisoryLockStale(lockPath)) {
255
253
  await fs.rm(lockPath, {recursive: true, force: true})
@@ -285,9 +283,7 @@ export default class VelociousDatabaseDriversSqliteNode extends Base {
285
283
 
286
284
  return true
287
285
  } catch (error) {
288
- if (/**
289
- * Narrows the runtime value to the documented type.
290
- * @type {NodeJS.ErrnoException} */ (error)?.code !== "EEXIST") throw error
286
+ if (/** @type {NodeJS.ErrnoException} */ (error)?.code !== "EEXIST") throw error
291
287
 
292
288
  if (await this._isAdvisoryLockStale(lockPath)) {
293
289
  await fs.rm(lockPath, {recursive: true, force: true})
@@ -298,9 +294,7 @@ export default class VelociousDatabaseDriversSqliteNode extends Base {
298
294
 
299
295
  return true
300
296
  } catch (retryError) {
301
- if (/**
302
- * Narrows the runtime value to the documented type.
303
- * @type {NodeJS.ErrnoException} */ (retryError)?.code === "EEXIST") return false
297
+ if (/** @type {NodeJS.ErrnoException} */ (retryError)?.code === "EEXIST") return false
304
298
 
305
299
  throw retryError
306
300
  }
@@ -71,9 +71,7 @@ export default class VelociousDatabaseDriversSqliteTable extends BaseTable {
71
71
 
72
72
  if (!sql) throw new Error(`Could not find SQL for index ${columnsIndex.getName()}`)
73
73
 
74
- const indexData = /**
75
- * Narrows the runtime value to the documented type.
76
- * @type {typeof columnsIndex.data & {columnNames?: string[]}} */ (columnsIndex.data)
74
+ const indexData = /** @type {typeof columnsIndex.data & {columnNames?: string[]}} */ (columnsIndex.data)
77
75
 
78
76
  indexData.columnNames = this._parseColumnsFromSQL(String(sql))
79
77
 
@@ -301,9 +301,7 @@ export default class VelociousDatabaseMigrator {
301
301
  const migrationName = match[2]
302
302
  const migrationClassName = inflection.camelize(migrationName)
303
303
 
304
- const migrationObject = /**
305
- * Narrows the runtime value to the documented type.
306
- * @type {import("./migrator/types.js").MigrationObjectType} */ ({
304
+ const migrationObject = /** @type {import("./migrator/types.js").MigrationObjectType} */ ({
307
305
  file,
308
306
  date,
309
307
  migrationClassName