cursedbelt-server 4.12.0 → 4.13.0

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 (469) hide show
  1. package/dist/server/_bunOnly.d.ts +1 -0
  2. package/dist/server/_bunOnly.js +12 -0
  3. package/dist/server/activity/index.d.ts +4 -4
  4. package/dist/server/activity/index.js +3 -3
  5. package/dist/server/activity/migrations.d.ts +1 -1
  6. package/dist/server/activity/shareSource.d.ts +1 -1
  7. package/dist/server/activity/shareSource.js +1 -1
  8. package/dist/server/activity/store.js +2 -2
  9. package/dist/server/analytics/index.d.ts +2 -2
  10. package/dist/server/analytics/index.js +2 -2
  11. package/dist/server/app.d.ts +4 -4
  12. package/dist/server/app.js +6 -6
  13. package/dist/server/audit/index.d.ts +2 -2
  14. package/dist/server/audit/index.js +2 -2
  15. package/dist/server/audit/migrations.d.ts +1 -1
  16. package/dist/server/audit/sqliteSink.js +2 -2
  17. package/dist/server/audit/sqliteSink.test.js +1 -1
  18. package/dist/server/auth/csrf.js +1 -1
  19. package/dist/server/auth/fileTokenSigner.d.ts +1 -1
  20. package/dist/server/auth/getOnly.d.ts +1 -1
  21. package/dist/server/auth/getOnly.js +1 -1
  22. package/dist/server/auth/index.d.ts +12 -12
  23. package/dist/server/auth/index.js +11 -11
  24. package/dist/server/auth/jwt.d.ts +1 -1
  25. package/dist/server/auth/middleware.d.ts +1 -1
  26. package/dist/server/auth/middleware.js +3 -3
  27. package/dist/server/auth/sessionStore.d.ts +2 -2
  28. package/dist/server/auth/types.d.ts +1 -1
  29. package/dist/server/bench/assert.d.ts +1 -1
  30. package/dist/server/bench/assert.js +1 -1
  31. package/dist/server/bench/cpuBudget.d.ts +4 -4
  32. package/dist/server/bench/cpuBudget.js +3 -3
  33. package/dist/server/bench/index.d.ts +6 -6
  34. package/dist/server/bench/index.js +6 -6
  35. package/dist/server/bench/recorder.d.ts +2 -2
  36. package/dist/server/bench/recorder.js +1 -1
  37. package/dist/server/bench/runBench.d.ts +2 -2
  38. package/dist/server/ctgr.d.ts +1 -1
  39. package/dist/server/ctgr.js +1 -1
  40. package/dist/server/d1/fakeD1.d.ts +1 -1
  41. package/dist/server/d1/fakeD1.js +1 -1
  42. package/dist/server/d1/index.d.ts +8 -8
  43. package/dist/server/d1/index.js +8 -8
  44. package/dist/server/d1/invocation.d.ts +1 -1
  45. package/dist/server/d1/invocation.js +2 -2
  46. package/dist/server/d1/kysely.d.ts +2 -2
  47. package/dist/server/d1/kysely.js +2 -2
  48. package/dist/server/d1/limits.d.ts +1 -1
  49. package/dist/server/d1/limits.js +1 -1
  50. package/dist/server/d1/local.d.ts +1 -1
  51. package/dist/server/d1/local.js +3 -3
  52. package/dist/server/d1/localBackup.d.ts +1 -1
  53. package/dist/server/d1/localBackup.js +2 -2
  54. package/dist/server/d1/remote.d.ts +1 -1
  55. package/dist/server/d1/remote.js +3 -3
  56. package/dist/server/d1/scheduling.d.ts +1 -1
  57. package/dist/server/d1/values.d.ts +1 -1
  58. package/dist/server/d1/values.js +1 -1
  59. package/dist/server/db/kysely.d.ts +1 -1
  60. package/dist/server/dropzone/index.d.ts +2 -2
  61. package/dist/server/dropzone/index.js +2 -2
  62. package/dist/server/guard/argon2Binding.js +1 -1
  63. package/dist/server/guard/index.d.ts +5 -5
  64. package/dist/server/guard/index.js +5 -5
  65. package/dist/server/guard/kdfWorker.d.ts +1 -1
  66. package/dist/server/guard/kdfWorker.js +3 -3
  67. package/dist/server/guard/kdfWorkerEntry.js +1 -1
  68. package/dist/server/guard/passwordVerifier.js +1 -1
  69. package/dist/server/guard/sessionSigner.d.ts +2 -2
  70. package/dist/server/guard/sessionSigner.js +1 -1
  71. package/dist/server/incidents/checks.d.ts +2 -2
  72. package/dist/server/incidents/index.d.ts +8 -8
  73. package/dist/server/incidents/index.js +8 -8
  74. package/dist/server/incidents/migrations.d.ts +1 -1
  75. package/dist/server/incidents/notifier.d.ts +3 -3
  76. package/dist/server/incidents/reporter.d.ts +1 -1
  77. package/dist/server/incidents/routes.d.ts +4 -4
  78. package/dist/server/incidents/routes.js +1 -1
  79. package/dist/server/incidents/store.d.ts +1 -1
  80. package/dist/server/incidents/store.js +3 -3
  81. package/dist/server/index.d.ts +26 -26
  82. package/dist/server/index.js +23 -23
  83. package/dist/server/jobs/fireQueue.d.ts +1 -1
  84. package/dist/server/jobs/fireQueue.js +3 -3
  85. package/dist/server/jobs/index.d.ts +7 -7
  86. package/dist/server/jobs/index.js +7 -7
  87. package/dist/server/jobs/logger.d.ts +1 -1
  88. package/dist/server/jobs/polling.d.ts +1 -1
  89. package/dist/server/jobs/polling.js +1 -1
  90. package/dist/server/jobs/runner.d.ts +1 -1
  91. package/dist/server/jobs/runner.js +5 -5
  92. package/dist/server/master-lock/accountsPage.d.ts +1 -1
  93. package/dist/server/master-lock/accountsPage.js +1 -1
  94. package/dist/server/master-lock/guard.d.ts +2 -2
  95. package/dist/server/master-lock/guard.js +2 -2
  96. package/dist/server/master-lock/index.d.ts +7 -7
  97. package/dist/server/master-lock/index.js +7 -7
  98. package/dist/server/master-lock/masterLock.js +1 -11
  99. package/dist/server/master-lock/principals.d.ts +1 -1
  100. package/dist/server/master-lock/principals.js +1 -1
  101. package/dist/server/master-lock/seed.d.ts +1 -1
  102. package/dist/server/master-lock/seed.js +1 -1
  103. package/dist/server/master-lock/store.d.ts +1 -1
  104. package/dist/server/media-bun/index.d.ts +3 -3
  105. package/dist/server/media-bun/index.js +3 -3
  106. package/dist/server/media-bun/video.d.ts +1 -1
  107. package/dist/server/media-bun/video.js +1 -1
  108. package/dist/server/metrics/telemetrySink.d.ts +1 -1
  109. package/dist/server/metrics/telemetrySink.js +1 -1
  110. package/dist/server/middleware/correlationId.d.ts +1 -1
  111. package/dist/server/middleware/errorEnvelope.d.ts +1 -1
  112. package/dist/server/middleware/errorEnvelope.js +1 -1
  113. package/dist/server/middleware/index.d.ts +10 -10
  114. package/dist/server/middleware/index.js +10 -10
  115. package/dist/server/middleware/rateLimit.js +1 -1
  116. package/dist/server/middleware/requestLogger.d.ts +3 -3
  117. package/dist/server/middleware/requestLogger.js +3 -3
  118. package/dist/server/middleware/zValidator.d.ts +1 -1
  119. package/dist/server/middleware/zValidator.js +1 -1
  120. package/dist/server/migration/runner.d.ts +1 -1
  121. package/dist/server/net/outboundGuard.js +1 -1
  122. package/dist/server/notifications/index.d.ts +7 -7
  123. package/dist/server/notifications/index.js +4 -4
  124. package/dist/server/notifications/migrations.d.ts +1 -1
  125. package/dist/server/notifications/routes.d.ts +1 -1
  126. package/dist/server/notifications/service.d.ts +1 -1
  127. package/dist/server/notifications/service.js +2 -2
  128. package/dist/server/resume/index.d.ts +2 -2
  129. package/dist/server/resume/index.js +2 -2
  130. package/dist/server/resume/routes.d.ts +1 -1
  131. package/dist/server/resume/routes.js +1 -1
  132. package/dist/server/retention/archive.js +1 -1
  133. package/dist/server/retention/fleet.d.ts +2 -2
  134. package/dist/server/retention/fleet.js +2 -2
  135. package/dist/server/retention/index.d.ts +6 -6
  136. package/dist/server/retention/index.js +6 -6
  137. package/dist/server/retention/store.d.ts +1 -1
  138. package/dist/server/retention/store.js +2 -2
  139. package/dist/server/retention/sweeper.d.ts +3 -3
  140. package/dist/server/retention/sweeper.js +2 -2
  141. package/dist/server/retention/target.d.ts +3 -3
  142. package/dist/server/retention/target.js +2 -2
  143. package/dist/server/search/index.d.ts +2 -2
  144. package/dist/server/search/index.js +2 -2
  145. package/dist/server/search/pgSearchProvider.js +2 -2
  146. package/dist/server/search/pgSearchProvider.pg.test.js +2 -2
  147. package/dist/server/sharing/index.d.ts +8 -8
  148. package/dist/server/sharing/index.js +5 -5
  149. package/dist/server/sharing/migrations.d.ts +1 -1
  150. package/dist/server/sharing/router.d.ts +1 -1
  151. package/dist/server/sharing/sql.js +1 -1
  152. package/dist/server/sharing/store.js +3 -3
  153. package/dist/server/sqlite/browse.js +1 -1
  154. package/dist/server/sqlite/export.js +1 -1
  155. package/dist/server/sqlite/import.js +1 -1
  156. package/dist/server/sqlite/index.d.ts +9 -9
  157. package/dist/server/sqlite/index.js +9 -9
  158. package/dist/server/sqlite/stats.js +1 -1
  159. package/dist/server/sqlite/viewer.js +2 -2
  160. package/dist/server/storage/binaryServerProcessing.d.ts +1 -1
  161. package/dist/server/storage/binaryServerProcessing.js +2 -2
  162. package/dist/server/storage/binaryServerStore.d.ts +2 -2
  163. package/dist/server/storage/binaryStore.d.ts +1 -1
  164. package/dist/server/storage/binaryStoreFake.d.ts +1 -1
  165. package/dist/server/storage/diskStore.d.ts +1 -1
  166. package/dist/server/storage/files/adapter.d.ts +4 -4
  167. package/dist/server/storage/files/adapter.js +1 -1
  168. package/dist/server/storage/files/catalogue.d.ts +3 -3
  169. package/dist/server/storage/files/catalogue.js +6 -6
  170. package/dist/server/storage/files/chunkedUpload.d.ts +3 -3
  171. package/dist/server/storage/files/chunkedUpload.js +1 -1
  172. package/dist/server/storage/files/fileRoutes.d.ts +4 -4
  173. package/dist/server/storage/files/fileRoutes.js +3 -3
  174. package/dist/server/storage/files/index.d.ts +9 -9
  175. package/dist/server/storage/files/index.js +8 -8
  176. package/dist/server/storage/files/migrations.d.ts +1 -1
  177. package/dist/server/storage/files/stack.d.ts +7 -7
  178. package/dist/server/storage/files/stack.js +10 -10
  179. package/dist/server/storage/files/storageOps.d.ts +1 -1
  180. package/dist/server/storage/files/types.d.ts +1 -1
  181. package/dist/server/storage/imageThumbnail.js +1 -1
  182. package/dist/server/storage/index.d.ts +15 -15
  183. package/dist/server/storage/index.js +14 -14
  184. package/dist/server/storage/mountMediaRoutes.d.ts +3 -3
  185. package/dist/server/storage/mountMediaRoutes.js +2 -2
  186. package/dist/server/storage/objectStoreMediaStore.d.ts +1 -1
  187. package/dist/server/storage/s3ObjectStore.js +1 -1
  188. package/dist/server/storage/sources.d.ts +2 -2
  189. package/dist/server/storage/sources.js +2 -2
  190. package/dist/server/storage/streamRange.d.ts +1 -1
  191. package/dist/server/storage/streamToken.js +1 -1
  192. package/dist/server/storage/videoProcessor.d.ts +1 -1
  193. package/dist/server/storage/videoProcessor.js +2 -2
  194. package/dist/server/sync/engine.d.ts +2 -2
  195. package/dist/server/sync/engine.js +1 -1
  196. package/dist/server/sync/http.d.ts +4 -4
  197. package/dist/server/sync/http.js +3 -3
  198. package/dist/server/sync/index.d.ts +11 -11
  199. package/dist/server/sync/index.js +11 -11
  200. package/dist/server/sync/opLog.d.ts +1 -1
  201. package/dist/server/sync/signal.d.ts +1 -1
  202. package/dist/server/sync/timer.d.ts +3 -3
  203. package/dist/server/sync/timer.js +1 -1
  204. package/dist/server/ws/eventBus.d.ts +1 -1
  205. package/dist/server/ws/hub.d.ts +1 -1
  206. package/dist/server/ws/hub.js +3 -3
  207. package/dist/server/ws/index.d.ts +5 -5
  208. package/dist/server/ws/index.js +4 -4
  209. package/dist/server/ws/presence.d.ts +1 -1
  210. package/dist/server/ws/room.d.ts +1 -1
  211. package/dist/server/ws/types.d.ts +1 -1
  212. package/package.json +9 -9
  213. package/src/publicSurface.spec.ts +1 -1
  214. package/src/server/_bunOnly.ts +15 -0
  215. package/src/server/activity/index.ts +4 -4
  216. package/src/server/activity/migrations.ts +1 -1
  217. package/src/server/activity/shareSource.ts +2 -2
  218. package/src/server/activity/store.spec.ts +3 -3
  219. package/src/server/activity/store.ts +2 -2
  220. package/src/server/analytics/index.ts +2 -2
  221. package/src/server/analytics/injectedScripts.spec.ts +3 -3
  222. package/src/server/analytics/webAnalytics.spec.ts +1 -1
  223. package/src/server/app.spec.ts +9 -9
  224. package/src/server/app.ts +7 -7
  225. package/src/server/audit/index.ts +2 -2
  226. package/src/server/audit/migrations.ts +1 -1
  227. package/src/server/audit/sqliteSink.test.ts +1 -1
  228. package/src/server/audit/sqliteSink.ts +2 -2
  229. package/src/server/auth/cookie.spec.ts +1 -1
  230. package/src/server/auth/csrf.spec.ts +1 -1
  231. package/src/server/auth/csrf.ts +1 -1
  232. package/src/server/auth/fileTokenSigner.ts +1 -1
  233. package/src/server/auth/getOnly.spec.ts +2 -2
  234. package/src/server/auth/getOnly.ts +2 -2
  235. package/src/server/auth/index.ts +12 -12
  236. package/src/server/auth/jwt.spec.ts +2 -2
  237. package/src/server/auth/jwt.ts +1 -1
  238. package/src/server/auth/loginThrottle.spec.ts +1 -1
  239. package/src/server/auth/middleware.spec.ts +7 -7
  240. package/src/server/auth/middleware.ts +4 -4
  241. package/src/server/auth/password.spec.ts +1 -1
  242. package/src/server/auth/sessionStore.spec.ts +3 -3
  243. package/src/server/auth/sessionStore.ts +3 -3
  244. package/src/server/auth/totp.spec.ts +1 -1
  245. package/src/server/auth/types.ts +1 -1
  246. package/src/server/auth/vault.spec.ts +1 -1
  247. package/src/server/bench/assert.ts +2 -2
  248. package/src/server/bench/budget.spec.ts +2 -2
  249. package/src/server/bench/cpuBudget.spec.ts +6 -6
  250. package/src/server/bench/cpuBudget.ts +5 -5
  251. package/src/server/bench/cpuClock.spec.ts +2 -2
  252. package/src/server/bench/index.ts +6 -6
  253. package/src/server/bench/recorder.ts +2 -2
  254. package/src/server/bench/runBench.ts +2 -2
  255. package/src/server/ctgr.spec.ts +2 -2
  256. package/src/server/ctgr.ts +2 -2
  257. package/src/server/d1/backup.spec.ts +2 -2
  258. package/src/server/d1/fakeD1.ts +2 -2
  259. package/src/server/d1/index.ts +8 -8
  260. package/src/server/d1/invocation.spec.ts +6 -6
  261. package/src/server/d1/invocation.ts +2 -2
  262. package/src/server/d1/kysely.spec.ts +5 -5
  263. package/src/server/d1/kysely.ts +3 -3
  264. package/src/server/d1/limits.spec.ts +3 -3
  265. package/src/server/d1/limits.ts +1 -1
  266. package/src/server/d1/local.ts +3 -3
  267. package/src/server/d1/localBackup.ts +3 -3
  268. package/src/server/d1/remote.ts +3 -3
  269. package/src/server/d1/sameShape.spec.ts +4 -4
  270. package/src/server/d1/scheduling.spec.ts +1 -1
  271. package/src/server/d1/scheduling.ts +1 -1
  272. package/src/server/d1/values.ts +1 -1
  273. package/src/server/db/kysely.spec.ts +1 -1
  274. package/src/server/db/kysely.ts +1 -1
  275. package/src/server/dropzone/index.ts +2 -2
  276. package/src/server/dropzone/scan.spec.ts +1 -1
  277. package/src/server/errors.spec.ts +1 -1
  278. package/src/server/guard/argon2Binding.spec.ts +1 -1
  279. package/src/server/guard/argon2Binding.ts +1 -1
  280. package/src/server/guard/argon2Kat.spec.ts +1 -1
  281. package/src/server/guard/guard.spec.ts +3 -3
  282. package/src/server/guard/index.ts +5 -5
  283. package/src/server/guard/kdfWorker.spec.ts +3 -3
  284. package/src/server/guard/kdfWorker.ts +3 -3
  285. package/src/server/guard/kdfWorkerEntry.ts +1 -1
  286. package/src/server/guard/passwordVerifier.spec.ts +1 -1
  287. package/src/server/guard/passwordVerifier.ts +1 -1
  288. package/src/server/guard/revocationStore.spec.ts +2 -2
  289. package/src/server/guard/sessionSigner.ts +3 -3
  290. package/src/server/incidents/checks.ts +2 -2
  291. package/src/server/incidents/incidents.spec.ts +7 -7
  292. package/src/server/incidents/index.ts +8 -8
  293. package/src/server/incidents/migrations.ts +1 -1
  294. package/src/server/incidents/notifier.ts +3 -3
  295. package/src/server/incidents/reporter.ts +1 -1
  296. package/src/server/incidents/routes.ts +5 -5
  297. package/src/server/incidents/store.ts +3 -3
  298. package/src/server/index.ts +26 -26
  299. package/src/server/jobs/fireQueue.spec.ts +1 -1
  300. package/src/server/jobs/fireQueue.ts +3 -3
  301. package/src/server/jobs/index.ts +7 -7
  302. package/src/server/jobs/logger.ts +1 -1
  303. package/src/server/jobs/plainjobAdapter.spec.ts +1 -1
  304. package/src/server/jobs/polling.spec.ts +1 -1
  305. package/src/server/jobs/polling.ts +2 -2
  306. package/src/server/jobs/runner.spec.ts +3 -3
  307. package/src/server/jobs/runner.ts +5 -5
  308. package/src/server/jobs/timeout.spec.ts +1 -1
  309. package/src/server/master-lock/accounts.spec.ts +2 -2
  310. package/src/server/master-lock/accountsPage.spec.ts +4 -4
  311. package/src/server/master-lock/accountsPage.ts +1 -1
  312. package/src/server/master-lock/beaconNeverReachesTheWall.spec.ts +4 -4
  313. package/src/server/master-lock/guard.spec.ts +3 -3
  314. package/src/server/master-lock/guard.ts +3 -3
  315. package/src/server/master-lock/index.ts +7 -7
  316. package/src/server/master-lock/lockPage.spec.ts +2 -2
  317. package/src/server/master-lock/masterLock.spec.ts +2 -2
  318. package/src/server/master-lock/masterLock.ts +1 -10
  319. package/src/server/master-lock/principals.spec.ts +4 -4
  320. package/src/server/master-lock/principals.ts +1 -1
  321. package/src/server/master-lock/seed.spec.ts +3 -3
  322. package/src/server/master-lock/seed.ts +1 -1
  323. package/src/server/master-lock/store.ts +1 -1
  324. package/src/server/media-bun/image.spec.ts +1 -1
  325. package/src/server/media-bun/index.ts +3 -3
  326. package/src/server/media-bun/streaming.spec.ts +1 -1
  327. package/src/server/media-bun/video.spec.ts +1 -1
  328. package/src/server/media-bun/video.ts +1 -1
  329. package/src/server/metrics/normalizeRoute.spec.ts +1 -1
  330. package/src/server/metrics/telemetrySink.spec.ts +3 -3
  331. package/src/server/metrics/telemetrySink.ts +1 -1
  332. package/src/server/middleware/bodyLimit.spec.ts +1 -1
  333. package/src/server/middleware/correlationId.ts +1 -1
  334. package/src/server/middleware/corsAllowlist.spec.ts +2 -2
  335. package/src/server/middleware/errorEnvelope.ts +2 -2
  336. package/src/server/middleware/index.ts +10 -10
  337. package/src/server/middleware/localOrigin.spec.ts +1 -1
  338. package/src/server/middleware/rateLimit.spec.ts +1 -1
  339. package/src/server/middleware/rateLimit.ts +1 -1
  340. package/src/server/middleware/requestLogger.ts +5 -5
  341. package/src/server/middleware/zValidator.spec.ts +4 -4
  342. package/src/server/middleware/zValidator.ts +2 -2
  343. package/src/server/migration/runner.spec.ts +2 -2
  344. package/src/server/migration/runner.ts +1 -1
  345. package/src/server/net/outboundGuard.spec.ts +1 -1
  346. package/src/server/net/outboundGuard.ts +1 -1
  347. package/src/server/notifications/index.ts +7 -7
  348. package/src/server/notifications/migrations.ts +1 -1
  349. package/src/server/notifications/routes.ts +1 -1
  350. package/src/server/notifications/service.spec.ts +3 -3
  351. package/src/server/notifications/service.ts +2 -2
  352. package/src/server/paths/appDataHome.spec.ts +1 -1
  353. package/src/server/resume/index.ts +2 -2
  354. package/src/server/resume/resume.spec.ts +2 -2
  355. package/src/server/resume/routes.ts +1 -1
  356. package/src/server/retention/archive.spec.ts +2 -2
  357. package/src/server/retention/archive.ts +1 -1
  358. package/src/server/retention/fleet.ts +4 -4
  359. package/src/server/retention/index.ts +6 -6
  360. package/src/server/retention/policy.spec.ts +1 -1
  361. package/src/server/retention/store.spec.ts +3 -3
  362. package/src/server/retention/store.ts +3 -3
  363. package/src/server/retention/sweeper.spec.ts +5 -5
  364. package/src/server/retention/sweeper.ts +5 -5
  365. package/src/server/retention/target.spec.ts +3 -3
  366. package/src/server/retention/target.ts +5 -5
  367. package/src/server/search/index.ts +2 -2
  368. package/src/server/search/pgSearchProvider.pg.test.ts +2 -2
  369. package/src/server/search/pgSearchProvider.ts +2 -2
  370. package/src/server/sharing/index.ts +8 -8
  371. package/src/server/sharing/migrations.ts +1 -1
  372. package/src/server/sharing/router.spec.ts +2 -2
  373. package/src/server/sharing/router.ts +1 -1
  374. package/src/server/sharing/sql.ts +1 -1
  375. package/src/server/sharing/store.spec.ts +2 -2
  376. package/src/server/sharing/store.ts +3 -3
  377. package/src/server/sqlite/backup.spec.ts +1 -1
  378. package/src/server/sqlite/browse.spec.ts +1 -1
  379. package/src/server/sqlite/browse.ts +1 -1
  380. package/src/server/sqlite/export.spec.ts +2 -2
  381. package/src/server/sqlite/export.ts +1 -1
  382. package/src/server/sqlite/fts5.spec.ts +1 -1
  383. package/src/server/sqlite/health.spec.ts +1 -1
  384. package/src/server/sqlite/import.spec.ts +3 -3
  385. package/src/server/sqlite/import.ts +1 -1
  386. package/src/server/sqlite/index.ts +9 -9
  387. package/src/server/sqlite/readonlySql.spec.ts +1 -1
  388. package/src/server/sqlite/stats.spec.ts +1 -1
  389. package/src/server/sqlite/stats.ts +1 -1
  390. package/src/server/sqlite/viewer.spec.ts +1 -1
  391. package/src/server/sqlite/viewer.ts +2 -2
  392. package/src/server/storage/binaryServerProcessing.integration.spec.ts +2 -2
  393. package/src/server/storage/binaryServerProcessing.spec.ts +2 -2
  394. package/src/server/storage/binaryServerProcessing.ts +3 -3
  395. package/src/server/storage/binaryServerStore.ts +3 -3
  396. package/src/server/storage/binaryStore.spec.ts +2 -2
  397. package/src/server/storage/binaryStore.ts +1 -1
  398. package/src/server/storage/binaryStoreFake.ts +1 -1
  399. package/src/server/storage/chunked.integration.spec.ts +4 -4
  400. package/src/server/storage/diskStore.ts +1 -1
  401. package/src/server/storage/fileUploadClient-chunked.integration.spec.ts +6 -6
  402. package/src/server/storage/fileUploadClient.integration.spec.ts +7 -7
  403. package/src/server/storage/files/adapter.photo.display.spec.ts +10 -10
  404. package/src/server/storage/files/adapter.photo.spec.ts +9 -9
  405. package/src/server/storage/files/adapter.spec.ts +8 -8
  406. package/src/server/storage/files/adapter.ts +5 -5
  407. package/src/server/storage/files/catalogue.media-host.spec.ts +6 -6
  408. package/src/server/storage/files/catalogue.orderings.spec.ts +6 -6
  409. package/src/server/storage/files/catalogue.recover.spec.ts +5 -5
  410. package/src/server/storage/files/catalogue.sort.spec.ts +6 -6
  411. package/src/server/storage/files/catalogue.spec.ts +7 -7
  412. package/src/server/storage/files/catalogue.trash-import.spec.ts +6 -6
  413. package/src/server/storage/files/catalogue.ts +6 -6
  414. package/src/server/storage/files/chunkedUpload.spec.ts +7 -7
  415. package/src/server/storage/files/chunkedUpload.ts +4 -4
  416. package/src/server/storage/files/collections.spec.ts +6 -6
  417. package/src/server/storage/files/fileRoutes.replace.spec.ts +8 -8
  418. package/src/server/storage/files/fileRoutes.spec.ts +8 -8
  419. package/src/server/storage/files/fileRoutes.ts +6 -6
  420. package/src/server/storage/files/index.ts +9 -9
  421. package/src/server/storage/files/migrations.ts +1 -1
  422. package/src/server/storage/files/stack.spec.ts +5 -5
  423. package/src/server/storage/files/stack.ts +12 -12
  424. package/src/server/storage/files/storageOps.spec.ts +4 -4
  425. package/src/server/storage/files/storageOps.ts +1 -1
  426. package/src/server/storage/files/types.ts +1 -1
  427. package/src/server/storage/imageThumbnail.spec.ts +2 -2
  428. package/src/server/storage/imageThumbnail.ts +1 -1
  429. package/src/server/storage/index.ts +15 -15
  430. package/src/server/storage/mountMediaRoutes.ts +4 -4
  431. package/src/server/storage/objectStore.spec.ts +1 -1
  432. package/src/server/storage/objectStoreMediaStore.ts +1 -1
  433. package/src/server/storage/s3ObjectStore.ts +1 -1
  434. package/src/server/storage/sources.ts +3 -3
  435. package/src/server/storage/storage.spec.ts +6 -6
  436. package/src/server/storage/streamRange.ts +1 -1
  437. package/src/server/storage/streamToken.ts +1 -1
  438. package/src/server/storage/transcodeJobs.spec.ts +1 -1
  439. package/src/server/storage/videoDerivativeKeys.spec.ts +1 -1
  440. package/src/server/storage/videoProcessor.posterOnly.spec.ts +4 -4
  441. package/src/server/storage/videoProcessor.ts +2 -2
  442. package/src/server/sync/alarm.spec.ts +1 -1
  443. package/src/server/sync/commands.spec.ts +1 -1
  444. package/src/server/sync/engine.spec.ts +4 -4
  445. package/src/server/sync/engine.ts +2 -2
  446. package/src/server/sync/http.ts +5 -5
  447. package/src/server/sync/httpRemote.spec.ts +1 -1
  448. package/src/server/sync/index.ts +11 -11
  449. package/src/server/sync/opLog.spec.ts +1 -1
  450. package/src/server/sync/opLog.ts +1 -1
  451. package/src/server/sync/planner.spec.ts +1 -1
  452. package/src/server/sync/signal.spec.ts +1 -1
  453. package/src/server/sync/signal.ts +1 -1
  454. package/src/server/sync/status.spec.ts +1 -1
  455. package/src/server/sync/timer.spec.ts +3 -3
  456. package/src/server/sync/timer.ts +3 -3
  457. package/src/server/sync/tokens.spec.ts +1 -1
  458. package/src/server/ws/eventBus.spec.ts +2 -2
  459. package/src/server/ws/eventBus.ts +1 -1
  460. package/src/server/ws/hub.integration.spec.ts +5 -5
  461. package/src/server/ws/hub.spec.ts +3 -3
  462. package/src/server/ws/hub.ts +4 -4
  463. package/src/server/ws/index.ts +5 -5
  464. package/src/server/ws/presence.spec.ts +3 -3
  465. package/src/server/ws/presence.ts +1 -1
  466. package/src/server/ws/room.spec.ts +2 -2
  467. package/src/server/ws/room.ts +1 -1
  468. package/src/server/ws/types.ts +1 -1
  469. package/src/testTmpRoot.spec.ts +1 -1
@@ -1,6 +1,6 @@
1
1
  import { describe, expect, test } from 'bun:test';
2
2
  import { Hono } from 'hono';
3
- import { CSRF_COOKIE_NAME, CSRF_HEADER_NAME, createCsrfMiddleware } from './csrf';
3
+ import { CSRF_COOKIE_NAME, CSRF_HEADER_NAME, createCsrfMiddleware } from './csrf.js';
4
4
 
5
5
  const REQ = (path: string, init?: RequestInit) => new Request(`http://localhost${path}`, init);
6
6
 
@@ -1,6 +1,6 @@
1
1
  import type { MiddlewareHandler } from 'hono';
2
2
  import { getCookie, setCookie } from 'hono/cookie';
3
- import { ApiError, toErrorEnvelope } from '../errors';
3
+ import { ApiError, toErrorEnvelope } from '../errors.js';
4
4
 
5
5
  /**
6
6
  * Double-submit CSRF guard for the cookie-auth + ctgr GET-tunnel model.
@@ -1,5 +1,5 @@
1
1
  import { importPKCS8, SignJWT } from 'jose';
2
- import type { FileTokenClaims, FileTokenSigner } from '../storage/binaryServerStore';
2
+ import type { FileTokenClaims, FileTokenSigner } from '../storage/binaryServerStore.js';
3
3
 
4
4
  // RS256 file-token signer for binary-server tenants. binary-server holds only the tenant's
5
5
  // PUBLIC key (resolved by the token's `iss` claim) and can verify but never mint; the app holds
@@ -1,7 +1,7 @@
1
1
  import { describe, expect, test } from 'bun:test';
2
2
  import { Hono } from 'hono';
3
- import { getOnlyEnforcement, isGetOnlyViolation } from './getOnly';
4
- import type { AuthEnv, AuthUser } from './types';
3
+ import { getOnlyEnforcement, isGetOnlyViolation } from './getOnly.js';
4
+ import type { AuthEnv, AuthUser } from './types.js';
5
5
 
6
6
  const REQ = (path: string, init?: RequestInit) => new Request(`http://localhost${path}`, init);
7
7
 
@@ -1,6 +1,6 @@
1
1
  import type { MiddlewareHandler } from 'hono';
2
- import { ApiError, toErrorEnvelope } from '../errors';
3
- import type { AuthEnv } from './types';
2
+ import { ApiError, toErrorEnvelope } from '../errors.js';
3
+ import type { AuthEnv } from './types.js';
4
4
 
5
5
  /**
6
6
  * `getOnly` enforcement — the server-side half of the `/f` GET-only session
@@ -8,14 +8,14 @@ export {
8
8
  clearAuthCookie,
9
9
  readAuthCookie,
10
10
  writeAuthCookie,
11
- } from './cookie';
12
- export { CSRF_COOKIE_NAME, CSRF_HEADER_NAME, type CsrfOptions, createCsrfMiddleware } from './csrf';
11
+ } from './cookie.js';
12
+ export { CSRF_COOKIE_NAME, CSRF_HEADER_NAME, type CsrfOptions, createCsrfMiddleware } from './csrf.js';
13
13
  export {
14
14
  createRs256FileTokenSigner,
15
15
  type Rs256FileTokenSignerOptions,
16
- } from './fileTokenSigner';
17
- export { getOnlyEnforcement, isGetOnlyViolation } from './getOnly';
18
- export { signToken, verifyPurposeToken, verifyToken } from './jwt';
16
+ } from './fileTokenSigner.js';
17
+ export { getOnlyEnforcement, isGetOnlyViolation } from './getOnly.js';
18
+ export { signToken, verifyPurposeToken, verifyToken } from './jwt.js';
19
19
  export {
20
20
  clientKeyOf,
21
21
  clientKeyOfContext,
@@ -23,13 +23,13 @@ export {
23
23
  type LoginThrottle,
24
24
  type LoginThrottleOptions,
25
25
  type ThrottleVerdict,
26
- } from './loginThrottle';
27
- export { createAuthMiddleware } from './middleware';
28
- export { hashPassword, needsRehash, verifyPassword } from './password';
26
+ } from './loginThrottle.js';
27
+ export { createAuthMiddleware } from './middleware.js';
28
+ export { hashPassword, needsRehash, verifyPassword } from './password.js';
29
29
  export {
30
30
  createSessionStore,
31
31
  type SessionStoreOptions,
32
- } from './sessionStore';
32
+ } from './sessionStore.js';
33
33
  export {
34
34
  DEFAULT_TOTP_ISSUER,
35
35
  generateRecoveryCodes,
@@ -37,7 +37,7 @@ export {
37
37
  getTotpUri,
38
38
  verifyRecoveryCode,
39
39
  verifyTotpCode,
40
- } from './totp';
40
+ } from './totp.js';
41
41
  export type {
42
42
  AppJwtPayload,
43
43
  AuthEnv,
@@ -47,5 +47,5 @@ export type {
47
47
  Session,
48
48
  SessionStore,
49
49
  TokenPurpose,
50
- } from './types';
51
- export { decryptVaultItem, deriveVaultKey, encryptVaultItem } from './vault';
50
+ } from './types.js';
51
+ export { decryptVaultItem, deriveVaultKey, encryptVaultItem } from './vault.js';
@@ -1,7 +1,7 @@
1
1
  import { describe, expect, test } from 'bun:test';
2
2
  import { SignJWT } from 'jose';
3
- import { signToken, verifyPurposeToken, verifyToken } from './jwt';
4
- import type { AppJwtPayload } from './types';
3
+ import { signToken, verifyPurposeToken, verifyToken } from './jwt.js';
4
+ import type { AppJwtPayload } from './types.js';
5
5
 
6
6
  const SECRET = 'a-test-secret-at-least-32-chars-long!!';
7
7
 
@@ -1,5 +1,5 @@
1
1
  import { type JWTPayload, jwtVerify, SignJWT } from 'jose';
2
- import type { AppJwtPayload } from './types';
2
+ import type { AppJwtPayload } from './types.js';
3
3
 
4
4
  /**
5
5
  * JWT sign/verify on `jose` (Web Crypto HMAC — native on Bun + Node, no native
@@ -1,5 +1,5 @@
1
1
  import { describe, expect, it } from 'bun:test';
2
- import { clientKeyOf, createLoginThrottle } from './loginThrottle';
2
+ import { clientKeyOf, createLoginThrottle } from './loginThrottle.js';
3
3
 
4
4
  const clock = (start = 1_000_000) => {
5
5
  let t = start;
@@ -1,13 +1,13 @@
1
1
  import { Database } from 'bun:sqlite';
2
2
  import { afterEach, beforeEach, describe, expect, test } from 'bun:test';
3
3
  import { Hono } from 'hono';
4
- import { createKysely } from '../db/kysely';
5
- import { AUTH_COOKIE_NAME } from './cookie';
6
- import { getOnlyEnforcement } from './getOnly';
7
- import { signToken } from './jwt';
8
- import { createAuthMiddleware } from './middleware';
9
- import { createSessionStore } from './sessionStore';
10
- import type { AuthEnv, SessionStore } from './types';
4
+ import { createKysely } from '../db/kysely.js';
5
+ import { AUTH_COOKIE_NAME } from './cookie.js';
6
+ import { getOnlyEnforcement } from './getOnly.js';
7
+ import { signToken } from './jwt.js';
8
+ import { createAuthMiddleware } from './middleware.js';
9
+ import { createSessionStore } from './sessionStore.js';
10
+ import type { AuthEnv, SessionStore } from './types.js';
11
11
 
12
12
  const SECRET = 'integration-test-secret-32-chars-min!';
13
13
  const REQ = (path: string, init?: RequestInit) => new Request(`http://localhost${path}`, init);
@@ -1,8 +1,8 @@
1
1
  import type { MiddlewareHandler } from 'hono';
2
- import { ApiError, toErrorEnvelope } from '../errors';
3
- import { readAuthCookie } from './cookie';
4
- import { verifyToken } from './jwt';
5
- import type { AppJwtPayload, AuthEnv, AuthUser, SessionStore } from './types';
2
+ import { ApiError, toErrorEnvelope } from '../errors.js';
3
+ import { readAuthCookie } from './cookie.js';
4
+ import { verifyToken } from './jwt.js';
5
+ import type { AppJwtPayload, AuthEnv, AuthUser, SessionStore } from './types.js';
6
6
 
7
7
  /**
8
8
  * The composed auth middleware. Reads the httpOnly `access_token` cookie, verifies
@@ -1,6 +1,6 @@
1
1
  import { describe, expect, test } from 'bun:test';
2
2
  import { pbkdf2Sync, randomBytes } from 'node:crypto';
3
- import { hashPassword, needsRehash, verifyPassword } from './password';
3
+ import { hashPassword, needsRehash, verifyPassword } from './password.js';
4
4
 
5
5
  // Reproduce the OLD app's legacy hash shape: PBKDF2-SHA512 @ 1000 iterations, the
6
6
  // salt + derived hex joined as "<salt>:<hex>" (what the ETL stores in the password
@@ -1,8 +1,8 @@
1
1
  import { Database } from 'bun:sqlite';
2
2
  import { afterEach, beforeEach, describe, expect, test } from 'bun:test';
3
- import { createKysely, type PlumbingDb } from '../db/kysely';
4
- import { createSessionStore } from './sessionStore';
5
- import type { SessionStore } from './types';
3
+ import { createKysely, type PlumbingDb } from '../db/kysely.js';
4
+ import { createSessionStore } from './sessionStore.js';
5
+ import type { SessionStore } from './types.js';
6
6
 
7
7
  const DDL = `CREATE TABLE auth_sessions (
8
8
  session_id TEXT PRIMARY KEY,
@@ -1,6 +1,6 @@
1
- import type { PlumbingDb } from '../db/kysely';
2
- import type { AuthSessionRow } from '../db/plumbingTypes';
3
- import type { CreateSessionInput, Session, SessionStore } from './types';
1
+ import type { PlumbingDb } from '../db/kysely.js';
2
+ import type { AuthSessionRow } from '../db/plumbingTypes.js';
3
+ import type { CreateSessionInput, Session, SessionStore } from './types.js';
4
4
 
5
5
  /**
6
6
  * Kysely-backed, revocable, restart-surviving session store (task 26).
@@ -6,7 +6,7 @@ import {
6
6
  getTotpUri,
7
7
  verifyRecoveryCode,
8
8
  verifyTotpCode,
9
- } from './totp';
9
+ } from './totp.js';
10
10
 
11
11
  describe('TOTP', () => {
12
12
  test('generates a base32 secret', () => {
@@ -1,5 +1,5 @@
1
1
  import type { JWTPayload } from 'jose';
2
- import type { CursedbeltVariables } from '../context';
2
+ import type { CursedbeltVariables } from '../context.js';
3
3
 
4
4
  /**
5
5
  * Shared auth types for the cursedbelt server auth toolkit.
@@ -1,5 +1,5 @@
1
1
  import { describe, expect, test } from 'bun:test';
2
- import { decryptVaultItem, deriveVaultKey, encryptVaultItem } from './vault';
2
+ import { decryptVaultItem, deriveVaultKey, encryptVaultItem } from './vault.js';
3
3
 
4
4
  const SECRET = 'server-secret-used-for-vault-key-derivation';
5
5
 
@@ -6,8 +6,8 @@
6
6
  * a build instead of adding a line to a log nobody opens.
7
7
  */
8
8
 
9
- import { DEFAULT_ROUTE_CPU_BUDGET_MS } from './budget';
10
- import type { CpuBudgetReport, RouteCpuStats } from './recorder';
9
+ import { DEFAULT_ROUTE_CPU_BUDGET_MS } from './budget.js';
10
+ import type { CpuBudgetReport, RouteCpuStats } from './recorder.js';
11
11
 
12
12
  export type CpuViolationKind =
13
13
  /** p99 above the route's declared (or default) budget. */
@@ -9,8 +9,8 @@ import {
9
9
  resolveBudget,
10
10
  validateCpuBudgetConfig,
11
11
  WORKERS_PAID_INCLUDED_CPU_MS,
12
- } from './budget';
13
- import { percentile } from './recorder';
12
+ } from './budget.js';
13
+ import { percentile } from './recorder.js';
14
14
 
15
15
  describe('the derivation', () => {
16
16
  it('derives 9.9 CPU-ms from the Workers Paid allowance and the projected traffic', () => {
@@ -1,16 +1,16 @@
1
1
  import { describe, expect, it } from 'bun:test';
2
2
  import { Hono } from 'hono';
3
- import { assertCpuBudgets, checkCpuBudgets, formatCpuBudgetReport } from './assert';
4
- import { type CpuBudgetConfig, DEFAULT_ROUTE_CPU_BUDGET_MS } from './budget';
5
- import { cpuBudget } from './cpuBudget';
3
+ import { assertCpuBudgets, checkCpuBudgets, formatCpuBudgetReport } from './assert.js';
4
+ import { type CpuBudgetConfig, DEFAULT_ROUTE_CPU_BUDGET_MS } from './budget.js';
5
+ import { cpuBudget } from './cpuBudget.js';
6
6
  import {
7
7
  fixedCpuClock,
8
8
  processCpuClock,
9
9
  unavailableCpuClock,
10
10
  workerCpuClock,
11
- } from './cpuClock';
12
- import { createCpuRecorder } from './recorder';
13
- import { BENCH_ORIGIN, runCpuBench } from './runBench';
11
+ } from './cpuClock.js';
12
+ import { createCpuRecorder } from './recorder.js';
13
+ import { BENCH_ORIGIN, runCpuBench } from './runBench.js';
14
14
 
15
15
  /**
16
16
  * 🔴 **The assertion must fire in BOTH directions or it is decoration.** A gate that can
@@ -1,9 +1,9 @@
1
1
  import type { MiddlewareHandler } from 'hono';
2
- import type { CursedbeltEnv } from '../context';
3
- import { normalizeRoute } from '../metrics/normalizeRoute';
4
- import type { CpuBudgetConfig } from './budget';
5
- import { type CpuClock, processCpuClock } from './cpuClock';
6
- import { type CpuRecorder, createCpuRecorder } from './recorder';
2
+ import type { CursedbeltEnv } from '../context.js';
3
+ import { normalizeRoute } from '../metrics/normalizeRoute.js';
4
+ import type { CpuBudgetConfig } from './budget.js';
5
+ import { type CpuClock, processCpuClock } from './cpuClock.js';
6
+ import { type CpuRecorder, createCpuRecorder } from './recorder.js';
7
7
 
8
8
  /**
9
9
  * Per-route CPU attribution, mounted like any other cursedbelt middleware.
@@ -1,7 +1,7 @@
1
1
  import { afterEach, describe, expect, it } from 'bun:test';
2
2
  import { Hono } from 'hono';
3
- import { cpuBudget } from './cpuBudget';
4
- import { processCpuClock } from './cpuClock';
3
+ import { cpuBudget } from './cpuBudget.js';
4
+ import { processCpuClock } from './cpuClock.js';
5
5
 
6
6
  /**
7
7
  * 🔴 **The runtime this file exists for is the one `bun test` is not.**
@@ -40,7 +40,7 @@ export {
40
40
  type CpuViolation,
41
41
  type CpuViolationKind,
42
42
  formatCpuBudgetReport,
43
- } from './assert';
43
+ } from './assert.js';
44
44
  export {
45
45
  type CpuBudgetConfig,
46
46
  type CpuBudgetExemption,
@@ -60,8 +60,8 @@ export {
60
60
  WORKERS_PAID_INCLUDED_REQUESTS,
61
61
  WORKERS_PAID_USD_PER_MILLION_CPU_MS,
62
62
  WORKERS_PAID_USD_PER_MILLION_REQUESTS,
63
- } from './budget';
64
- export { type CpuBudgetOpts, cpuBudget } from './cpuBudget';
63
+ } from './budget.js';
64
+ export { type CpuBudgetOpts, cpuBudget } from './cpuBudget.js';
65
65
  export {
66
66
  type CpuClock,
67
67
  type CpuSpan,
@@ -70,7 +70,7 @@ export {
70
70
  resolveCpuClock,
71
71
  unavailableCpuClock,
72
72
  workerCpuClock,
73
- } from './cpuClock';
73
+ } from './cpuClock.js';
74
74
  export {
75
75
  type CpuBudgetReport,
76
76
  type CpuRecorder,
@@ -78,5 +78,5 @@ export {
78
78
  createCpuRecorder,
79
79
  percentile,
80
80
  type RouteCpuStats,
81
- } from './recorder';
82
- export { BENCH_ORIGIN, type BenchCase, runCpuBench, type RunCpuBenchOpts } from './runBench';
81
+ } from './recorder.js';
82
+ export { BENCH_ORIGIN, type BenchCase, runCpuBench, type RunCpuBenchOpts } from './runBench.js';
@@ -11,8 +11,8 @@ import {
11
11
  type ResolvedBudget,
12
12
  resolveBudget,
13
13
  validateCpuBudgetConfig,
14
- } from './budget';
15
- import type { CpuClock } from './cpuClock';
14
+ } from './budget.js';
15
+ import type { CpuClock } from './cpuClock.js';
16
16
 
17
17
  /**
18
18
  * Nearest-rank percentile over an ASCENDING-sorted array: the smallest value at or below
@@ -1,5 +1,5 @@
1
- import type { CpuRecorder } from './recorder';
2
- import type { CpuBudgetReport } from './recorder';
1
+ import type { CpuRecorder } from './recorder.js';
2
+ import type { CpuBudgetReport } from './recorder.js';
3
3
 
4
4
  /**
5
5
  * Drive a Hono app's routes and measure what each costs in CPU.
@@ -3,8 +3,8 @@ import { Hono } from 'hono';
3
3
  import { toBase64 } from 'cursedbelt-core/ctgr';
4
4
  import { ChunkStore } from 'cursedbelt-core/ctgr/chunk-store';
5
5
  import { encodeRequest } from 'cursedbelt-core/ctgr';
6
- import type { CursedbeltEnv } from './context';
7
- import { buildRoutes, CTGR_ROUTE_PATTERN, getCtgrDecoded, unGETify } from './ctgr';
6
+ import type { CursedbeltEnv } from './context.js';
7
+ import { buildRoutes, CTGR_ROUTE_PATTERN, getCtgrDecoded, unGETify } from './ctgr.js';
8
8
 
9
9
  const ORIGIN = 'http://localhost';
10
10
  const fetchChunk = (app: Hono<CursedbeltEnv>, url: string, init?: RequestInit) =>
@@ -19,8 +19,8 @@ import {
19
19
  METHOD_TO_ABBREV,
20
20
  } from 'cursedbelt-core/ctgr/types';
21
21
  import { V0ChunkStore } from 'cursedbelt-core/ctgr/v0compat';
22
- import type { CursedbeltEnv } from './context';
23
- import { ApiError, toErrorEnvelope } from './errors';
22
+ import type { CursedbeltEnv } from './context.js';
23
+ import { ApiError, toErrorEnvelope } from './errors.js';
24
24
 
25
25
  /**
26
26
  * The path pattern that matches EVERY ctgr GET twin (`/ctgr<XX>...`) and nothing
@@ -3,10 +3,10 @@ import { afterEach, describe, expect, test } from 'bun:test';
3
3
  import { existsSync, mkdtempSync, rmSync, statSync } from 'node:fs';
4
4
  import { tmpdir } from 'node:os';
5
5
  import { join } from 'node:path';
6
- import { createTimeTravelBackup } from './backup';
6
+ import { createTimeTravelBackup } from './backup.js';
7
7
  // The local half is a separate module on purpose — it reaches `bun:sqlite`, so it may not
8
8
  // sit in the `./d1` barrel a Worker imports. See `./localBackup.ts`'s header.
9
- import { backupFor, checkpointWal, createLocalBackup } from './localBackup';
9
+ import { backupFor, checkpointWal, createLocalBackup } from './localBackup.js';
10
10
 
11
11
  const dirs: string[] = [];
12
12
  const scratch = (): string => {
@@ -35,8 +35,8 @@
35
35
  */
36
36
 
37
37
  import type { Database } from 'bun:sqlite';
38
- import type { D1BindingLike, D1BindingResult, D1BindingStatement } from './remote';
39
- import { isPureReadSql } from './values';
38
+ import type { D1BindingLike, D1BindingResult, D1BindingStatement } from './remote.js';
39
+ import { isPureReadSql } from './values.js';
40
40
 
41
41
  /** The bind types a real D1 binding accepts. Everything else throws. */
42
42
  function assertD1Bindable(value: unknown, index: number): void {
@@ -20,7 +20,7 @@ export {
20
20
  createTimeTravelBackup,
21
21
  type DatabaseBackup,
22
22
  type TimeTravelOpts,
23
- } from './backup';
23
+ } from './backup.js';
24
24
  // 🔴 `./localBackup` is deliberately NOT re-exported here — import `checkpointWal`,
25
25
  // `createLocalBackup`, `LocalBackupOpts` and `backupFor` from
26
26
  // `cursedbelt-server/d1/backup-local`. It reaches `bun:sqlite` for real (via
@@ -39,16 +39,16 @@ export {
39
39
  // that does not use the query builder — which per `../db/kysely.ts`'s own header is most
40
40
  // of them, since business tables stay on raw statements. Measured 2026-09-18 against the
41
41
  // published 4.3.0 tarball. `barrelsReachNoOptionalPeer.spec.ts` is what keeps it out.
42
- export { createPendingWrites, type InvocationD1, type PendingWrites, perInvocation, type WriteCollector } from './invocation';
43
- export { assertBatchSize, assertWithinLimits, chunkForBind, LIMITS } from './limits';
44
- export { createLocalD1, refuseInteractiveTransaction } from './local';
42
+ export { createPendingWrites, type InvocationD1, type PendingWrites, perInvocation, type WriteCollector } from './invocation.js';
43
+ export { assertBatchSize, assertWithinLimits, chunkForBind, LIMITS } from './limits.js';
44
+ export { createLocalD1, refuseInteractiveTransaction } from './local.js';
45
45
  export {
46
46
  createRemoteD1,
47
47
  type D1BindingLike,
48
48
  type D1BindingMeta,
49
49
  type D1BindingResult,
50
50
  type D1BindingStatement,
51
- } from './remote';
51
+ } from './remote.js';
52
52
  export {
53
53
  classifySchedule,
54
54
  cronFieldCount,
@@ -60,7 +60,7 @@ export {
60
60
  toFiveField,
61
61
  type TriggerShape,
62
62
  type WorkersPrimitive,
63
- } from './scheduling';
63
+ } from './scheduling.js';
64
64
  export {
65
65
  D1BindError,
66
66
  type D1LikeBindable,
@@ -72,5 +72,5 @@ export {
72
72
  type D1LikeValue,
73
73
  D1LimitError,
74
74
  D1UnsupportedError,
75
- } from './types';
76
- export { makeMeta, normalizeBind, normalizeBinds, normalizeRow, normalizeRows, normalizeValue } from './values';
75
+ } from './types.js';
76
+ export { makeMeta, normalizeBind, normalizeBinds, normalizeRow, normalizeRows, normalizeValue } from './values.js';
@@ -1,11 +1,11 @@
1
1
  import { Database } from 'bun:sqlite';
2
2
  import { beforeEach, describe, expect, test } from 'bun:test';
3
- import { createFakeD1Binding } from './fakeD1';
4
- import { createPendingWrites, perInvocation } from './invocation';
5
- import { LIMITS } from './limits';
6
- import { createLocalD1 } from './local';
7
- import { createRemoteD1 } from './remote';
8
- import { D1LimitError, type D1LikeDatabase } from './types';
3
+ import { createFakeD1Binding } from './fakeD1.js';
4
+ import { createPendingWrites, perInvocation } from './invocation.js';
5
+ import { LIMITS } from './limits.js';
6
+ import { createLocalD1 } from './local.js';
7
+ import { createRemoteD1 } from './remote.js';
8
+ import { D1LimitError, type D1LikeDatabase } from './types.js';
9
9
 
10
10
  /**
11
11
  * 🔴 Every test here would have passed against the seam as published in 4.2.0, because
@@ -49,8 +49,8 @@
49
49
  * here on 2026-09-19.
50
50
  */
51
51
 
52
- import { LIMITS } from './limits';
53
- import { D1LimitError, type D1LikeBindable, type D1LikeDatabase, type D1LikeResult, type D1LikeRow, type D1LikeStatement, type D1LikeValue } from './types';
52
+ import { LIMITS } from './limits.js';
53
+ import { D1LimitError, type D1LikeBindable, type D1LikeDatabase, type D1LikeResult, type D1LikeRow, type D1LikeStatement, type D1LikeValue } from './types.js';
54
54
 
55
55
  /**
56
56
  * A database handle that knows how much of its invocation budget it has spent.
@@ -7,11 +7,11 @@
7
7
  import { Database } from 'bun:sqlite';
8
8
  import { describe, expect, test } from 'bun:test';
9
9
  import type { Kysely } from 'kysely';
10
- import { createFakeD1Binding } from './fakeD1';
11
- import { createD1Kysely } from './kysely';
12
- import { createLocalD1 } from './local';
13
- import { createRemoteD1 } from './remote';
14
- import { D1UnsupportedError, type D1LikeDatabase } from './types';
10
+ import { createFakeD1Binding } from './fakeD1.js';
11
+ import { createD1Kysely } from './kysely.js';
12
+ import { createLocalD1 } from './local.js';
13
+ import { createRemoteD1 } from './remote.js';
14
+ import { D1UnsupportedError, type D1LikeDatabase } from './types.js';
15
15
 
16
16
  const DDL = `CREATE TABLE app_config (
17
17
  key TEXT PRIMARY KEY, value TEXT NOT NULL, updated_at TEXT NOT NULL, updated_by TEXT
@@ -41,9 +41,9 @@ import {
41
41
  SqliteIntrospector,
42
42
  SqliteQueryCompiler,
43
43
  } from 'kysely';
44
- import type { PlumbingSchema } from '../db/plumbingTypes';
45
- import { refuseInteractiveTransaction } from './local';
46
- import { type D1LikeBindable, type D1LikeDatabase, D1UnsupportedError } from './types';
44
+ import type { PlumbingSchema } from '../db/plumbingTypes.js';
45
+ import { refuseInteractiveTransaction } from './local.js';
46
+ import { type D1LikeBindable, type D1LikeDatabase, D1UnsupportedError } from './types.js';
47
47
 
48
48
  /**
49
49
  * Kysely compiles to a parameter list that may contain values our seam refuses
@@ -1,8 +1,8 @@
1
1
  import { Database } from 'bun:sqlite';
2
2
  import { describe, expect, test } from 'bun:test';
3
- import { assertBatchSize, assertWithinLimits, chunkForBind, LIMITS } from './limits';
4
- import { createLocalD1 } from './local';
5
- import { D1LimitError } from './types';
3
+ import { assertBatchSize, assertWithinLimits, chunkForBind, LIMITS } from './limits.js';
4
+ import { createLocalD1 } from './local.js';
5
+ import { D1LimitError } from './types.js';
6
6
 
7
7
  describe('D1 limits are enforced on the LOCAL driver too', () => {
8
8
  // 🔴 The point of every test here: `bun:sqlite` has none of these caps, so without
@@ -18,7 +18,7 @@
18
18
  * Values are the Workers **Paid** tier, which is what the owner already pays for.
19
19
  */
20
20
 
21
- import { D1LimitError, type D1LikeBindable } from './types';
21
+ import { D1LimitError, type D1LikeBindable } from './types.js';
22
22
 
23
23
  export const LIMITS = {
24
24
  /** Bound parameters in a single statement. */
@@ -15,7 +15,7 @@
15
15
  */
16
16
 
17
17
  import type { Database } from 'bun:sqlite';
18
- import { assertBatchSize, assertWithinLimits } from './limits';
18
+ import { assertBatchSize, assertWithinLimits } from './limits.js';
19
19
  import {
20
20
  type D1LikeBindable,
21
21
  type D1LikeDatabase,
@@ -24,8 +24,8 @@ import {
24
24
  type D1LikeStatement,
25
25
  type D1LikeValue,
26
26
  D1UnsupportedError,
27
- } from './types';
28
- import { isPureReadSql, makeMeta, normalizeBinds, normalizeRows, normalizeValue } from './values';
27
+ } from './types.js';
28
+ import { isPureReadSql, makeMeta, normalizeBinds, normalizeRows, normalizeValue } from './values.js';
29
29
 
30
30
  /** Shared clock, so `meta.duration` means the same thing on both sides of the seam. */
31
31
  const now = (): number => performance.now();
@@ -35,9 +35,9 @@
35
35
  import type { Database } from 'bun:sqlite';
36
36
  import { existsSync, mkdirSync } from 'node:fs';
37
37
  import { join } from 'node:path';
38
- import { snapshotSqlite } from '../sqlite/backup';
39
- import type { BackupPoint, DatabaseBackup, TimeTravelOpts } from './backup';
40
- import { createTimeTravelBackup } from './backup';
38
+ import { snapshotSqlite } from '../sqlite/backup.js';
39
+ import type { BackupPoint, DatabaseBackup, TimeTravelOpts } from './backup.js';
40
+ import { createTimeTravelBackup } from './backup.js';
41
41
 
42
42
  export interface LocalBackupOpts {
43
43
  /** The live handle — checkpointed before the snapshot is taken. */
@@ -15,7 +15,7 @@
15
15
  * fake that has no `workerd` in sight.
16
16
  */
17
17
 
18
- import { assertBatchSize, assertWithinLimits } from './limits';
18
+ import { assertBatchSize, assertWithinLimits } from './limits.js';
19
19
  import {
20
20
  type D1LikeBindable,
21
21
  type D1LikeDatabase,
@@ -24,8 +24,8 @@ import {
24
24
  type D1LikeStatement,
25
25
  type D1LikeValue,
26
26
  D1UnsupportedError,
27
- } from './types';
28
- import { makeMeta, normalizeBinds, normalizeRows, normalizeValue } from './values';
27
+ } from './types.js';
28
+ import { makeMeta, normalizeBinds, normalizeRows, normalizeValue } from './values.js';
29
29
 
30
30
  /** What D1 reports back about a statement. Its `meta` is richer than the local driver's. */
31
31
  export interface D1BindingMeta {
@@ -16,10 +16,10 @@
16
16
 
17
17
  import { Database } from 'bun:sqlite';
18
18
  import { beforeEach, describe, expect, test } from 'bun:test';
19
- import { createFakeD1Binding } from './fakeD1';
20
- import { createLocalD1 } from './local';
21
- import { createRemoteD1 } from './remote';
22
- import { D1BindError, type D1LikeBindable, type D1LikeDatabase } from './types';
19
+ import { createFakeD1Binding } from './fakeD1.js';
20
+ import { createLocalD1 } from './local.js';
21
+ import { createRemoteD1 } from './remote.js';
22
+ import { D1BindError, type D1LikeBindable, type D1LikeDatabase } from './types.js';
23
23
 
24
24
  const DDL = `CREATE TABLE t (
25
25
  id INTEGER PRIMARY KEY,
@@ -6,7 +6,7 @@ import {
6
6
  type PortableJob,
7
7
  toCronTriggers,
8
8
  toFiveField,
9
- } from './scheduling';
9
+ } from './scheduling.js';
10
10
 
11
11
  const job = (name: string, shape: PortableJob['shape']): PortableJob => ({
12
12
  name,