cursedbelt-server 4.11.1 → 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 (471) 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.d.ts +26 -49
  99. package/dist/server/master-lock/masterLock.js +48 -15
  100. package/dist/server/master-lock/principals.d.ts +1 -1
  101. package/dist/server/master-lock/principals.js +1 -1
  102. package/dist/server/master-lock/seed.d.ts +1 -1
  103. package/dist/server/master-lock/seed.js +1 -1
  104. package/dist/server/master-lock/store.d.ts +6 -1
  105. package/dist/server/master-lock/store.js +5 -0
  106. package/dist/server/media-bun/index.d.ts +3 -3
  107. package/dist/server/media-bun/index.js +3 -3
  108. package/dist/server/media-bun/video.d.ts +1 -1
  109. package/dist/server/media-bun/video.js +1 -1
  110. package/dist/server/metrics/telemetrySink.d.ts +1 -1
  111. package/dist/server/metrics/telemetrySink.js +1 -1
  112. package/dist/server/middleware/correlationId.d.ts +1 -1
  113. package/dist/server/middleware/errorEnvelope.d.ts +1 -1
  114. package/dist/server/middleware/errorEnvelope.js +1 -1
  115. package/dist/server/middleware/index.d.ts +10 -10
  116. package/dist/server/middleware/index.js +10 -10
  117. package/dist/server/middleware/rateLimit.js +1 -1
  118. package/dist/server/middleware/requestLogger.d.ts +3 -3
  119. package/dist/server/middleware/requestLogger.js +3 -3
  120. package/dist/server/middleware/zValidator.d.ts +1 -1
  121. package/dist/server/middleware/zValidator.js +1 -1
  122. package/dist/server/migration/runner.d.ts +1 -1
  123. package/dist/server/net/outboundGuard.js +1 -1
  124. package/dist/server/notifications/index.d.ts +7 -7
  125. package/dist/server/notifications/index.js +4 -4
  126. package/dist/server/notifications/migrations.d.ts +1 -1
  127. package/dist/server/notifications/routes.d.ts +1 -1
  128. package/dist/server/notifications/service.d.ts +1 -1
  129. package/dist/server/notifications/service.js +2 -2
  130. package/dist/server/resume/index.d.ts +2 -2
  131. package/dist/server/resume/index.js +2 -2
  132. package/dist/server/resume/routes.d.ts +1 -1
  133. package/dist/server/resume/routes.js +1 -1
  134. package/dist/server/retention/archive.js +1 -1
  135. package/dist/server/retention/fleet.d.ts +2 -2
  136. package/dist/server/retention/fleet.js +2 -2
  137. package/dist/server/retention/index.d.ts +6 -6
  138. package/dist/server/retention/index.js +6 -6
  139. package/dist/server/retention/store.d.ts +1 -1
  140. package/dist/server/retention/store.js +2 -2
  141. package/dist/server/retention/sweeper.d.ts +3 -3
  142. package/dist/server/retention/sweeper.js +2 -2
  143. package/dist/server/retention/target.d.ts +3 -3
  144. package/dist/server/retention/target.js +2 -2
  145. package/dist/server/search/index.d.ts +2 -2
  146. package/dist/server/search/index.js +2 -2
  147. package/dist/server/search/pgSearchProvider.js +2 -2
  148. package/dist/server/search/pgSearchProvider.pg.test.js +2 -2
  149. package/dist/server/sharing/index.d.ts +8 -8
  150. package/dist/server/sharing/index.js +5 -5
  151. package/dist/server/sharing/migrations.d.ts +1 -1
  152. package/dist/server/sharing/router.d.ts +1 -1
  153. package/dist/server/sharing/sql.js +1 -1
  154. package/dist/server/sharing/store.js +3 -3
  155. package/dist/server/sqlite/browse.js +1 -1
  156. package/dist/server/sqlite/export.js +1 -1
  157. package/dist/server/sqlite/import.js +1 -1
  158. package/dist/server/sqlite/index.d.ts +9 -9
  159. package/dist/server/sqlite/index.js +9 -9
  160. package/dist/server/sqlite/stats.js +1 -1
  161. package/dist/server/sqlite/viewer.js +2 -2
  162. package/dist/server/storage/binaryServerProcessing.d.ts +1 -1
  163. package/dist/server/storage/binaryServerProcessing.js +2 -2
  164. package/dist/server/storage/binaryServerStore.d.ts +2 -2
  165. package/dist/server/storage/binaryStore.d.ts +1 -1
  166. package/dist/server/storage/binaryStoreFake.d.ts +1 -1
  167. package/dist/server/storage/diskStore.d.ts +1 -1
  168. package/dist/server/storage/files/adapter.d.ts +4 -4
  169. package/dist/server/storage/files/adapter.js +1 -1
  170. package/dist/server/storage/files/catalogue.d.ts +3 -3
  171. package/dist/server/storage/files/catalogue.js +6 -6
  172. package/dist/server/storage/files/chunkedUpload.d.ts +3 -3
  173. package/dist/server/storage/files/chunkedUpload.js +1 -1
  174. package/dist/server/storage/files/fileRoutes.d.ts +4 -4
  175. package/dist/server/storage/files/fileRoutes.js +3 -3
  176. package/dist/server/storage/files/index.d.ts +9 -9
  177. package/dist/server/storage/files/index.js +8 -8
  178. package/dist/server/storage/files/migrations.d.ts +1 -1
  179. package/dist/server/storage/files/stack.d.ts +7 -7
  180. package/dist/server/storage/files/stack.js +10 -10
  181. package/dist/server/storage/files/storageOps.d.ts +1 -1
  182. package/dist/server/storage/files/types.d.ts +1 -1
  183. package/dist/server/storage/imageThumbnail.js +1 -1
  184. package/dist/server/storage/index.d.ts +15 -15
  185. package/dist/server/storage/index.js +14 -14
  186. package/dist/server/storage/mountMediaRoutes.d.ts +3 -3
  187. package/dist/server/storage/mountMediaRoutes.js +2 -2
  188. package/dist/server/storage/objectStoreMediaStore.d.ts +1 -1
  189. package/dist/server/storage/s3ObjectStore.js +1 -1
  190. package/dist/server/storage/sources.d.ts +2 -2
  191. package/dist/server/storage/sources.js +2 -2
  192. package/dist/server/storage/streamRange.d.ts +1 -1
  193. package/dist/server/storage/streamToken.js +1 -1
  194. package/dist/server/storage/videoProcessor.d.ts +1 -1
  195. package/dist/server/storage/videoProcessor.js +2 -2
  196. package/dist/server/sync/engine.d.ts +2 -2
  197. package/dist/server/sync/engine.js +1 -1
  198. package/dist/server/sync/http.d.ts +4 -4
  199. package/dist/server/sync/http.js +3 -3
  200. package/dist/server/sync/index.d.ts +11 -11
  201. package/dist/server/sync/index.js +11 -11
  202. package/dist/server/sync/opLog.d.ts +1 -1
  203. package/dist/server/sync/signal.d.ts +1 -1
  204. package/dist/server/sync/timer.d.ts +3 -3
  205. package/dist/server/sync/timer.js +1 -1
  206. package/dist/server/ws/eventBus.d.ts +1 -1
  207. package/dist/server/ws/hub.d.ts +1 -1
  208. package/dist/server/ws/hub.js +3 -3
  209. package/dist/server/ws/index.d.ts +5 -5
  210. package/dist/server/ws/index.js +4 -4
  211. package/dist/server/ws/presence.d.ts +1 -1
  212. package/dist/server/ws/room.d.ts +1 -1
  213. package/dist/server/ws/types.d.ts +1 -1
  214. package/package.json +9 -9
  215. package/src/publicSurface.spec.ts +1 -1
  216. package/src/server/_bunOnly.ts +15 -0
  217. package/src/server/activity/index.ts +4 -4
  218. package/src/server/activity/migrations.ts +1 -1
  219. package/src/server/activity/shareSource.ts +2 -2
  220. package/src/server/activity/store.spec.ts +3 -3
  221. package/src/server/activity/store.ts +2 -2
  222. package/src/server/analytics/index.ts +2 -2
  223. package/src/server/analytics/injectedScripts.spec.ts +3 -3
  224. package/src/server/analytics/webAnalytics.spec.ts +1 -1
  225. package/src/server/app.spec.ts +9 -9
  226. package/src/server/app.ts +7 -7
  227. package/src/server/audit/index.ts +2 -2
  228. package/src/server/audit/migrations.ts +1 -1
  229. package/src/server/audit/sqliteSink.test.ts +1 -1
  230. package/src/server/audit/sqliteSink.ts +2 -2
  231. package/src/server/auth/cookie.spec.ts +1 -1
  232. package/src/server/auth/csrf.spec.ts +1 -1
  233. package/src/server/auth/csrf.ts +1 -1
  234. package/src/server/auth/fileTokenSigner.ts +1 -1
  235. package/src/server/auth/getOnly.spec.ts +2 -2
  236. package/src/server/auth/getOnly.ts +2 -2
  237. package/src/server/auth/index.ts +12 -12
  238. package/src/server/auth/jwt.spec.ts +2 -2
  239. package/src/server/auth/jwt.ts +1 -1
  240. package/src/server/auth/loginThrottle.spec.ts +1 -1
  241. package/src/server/auth/middleware.spec.ts +7 -7
  242. package/src/server/auth/middleware.ts +4 -4
  243. package/src/server/auth/password.spec.ts +1 -1
  244. package/src/server/auth/sessionStore.spec.ts +3 -3
  245. package/src/server/auth/sessionStore.ts +3 -3
  246. package/src/server/auth/totp.spec.ts +1 -1
  247. package/src/server/auth/types.ts +1 -1
  248. package/src/server/auth/vault.spec.ts +1 -1
  249. package/src/server/bench/assert.ts +2 -2
  250. package/src/server/bench/budget.spec.ts +2 -2
  251. package/src/server/bench/cpuBudget.spec.ts +6 -6
  252. package/src/server/bench/cpuBudget.ts +5 -5
  253. package/src/server/bench/cpuClock.spec.ts +2 -2
  254. package/src/server/bench/index.ts +6 -6
  255. package/src/server/bench/recorder.ts +2 -2
  256. package/src/server/bench/runBench.ts +2 -2
  257. package/src/server/ctgr.spec.ts +2 -2
  258. package/src/server/ctgr.ts +2 -2
  259. package/src/server/d1/backup.spec.ts +2 -2
  260. package/src/server/d1/fakeD1.ts +2 -2
  261. package/src/server/d1/index.ts +8 -8
  262. package/src/server/d1/invocation.spec.ts +6 -6
  263. package/src/server/d1/invocation.ts +2 -2
  264. package/src/server/d1/kysely.spec.ts +5 -5
  265. package/src/server/d1/kysely.ts +3 -3
  266. package/src/server/d1/limits.spec.ts +3 -3
  267. package/src/server/d1/limits.ts +1 -1
  268. package/src/server/d1/local.ts +3 -3
  269. package/src/server/d1/localBackup.ts +3 -3
  270. package/src/server/d1/remote.ts +3 -3
  271. package/src/server/d1/sameShape.spec.ts +4 -4
  272. package/src/server/d1/scheduling.spec.ts +1 -1
  273. package/src/server/d1/scheduling.ts +1 -1
  274. package/src/server/d1/values.ts +1 -1
  275. package/src/server/db/kysely.spec.ts +1 -1
  276. package/src/server/db/kysely.ts +1 -1
  277. package/src/server/dropzone/index.ts +2 -2
  278. package/src/server/dropzone/scan.spec.ts +1 -1
  279. package/src/server/errors.spec.ts +1 -1
  280. package/src/server/guard/argon2Binding.spec.ts +1 -1
  281. package/src/server/guard/argon2Binding.ts +1 -1
  282. package/src/server/guard/argon2Kat.spec.ts +1 -1
  283. package/src/server/guard/guard.spec.ts +3 -3
  284. package/src/server/guard/index.ts +5 -5
  285. package/src/server/guard/kdfWorker.spec.ts +3 -3
  286. package/src/server/guard/kdfWorker.ts +3 -3
  287. package/src/server/guard/kdfWorkerEntry.ts +1 -1
  288. package/src/server/guard/passwordVerifier.spec.ts +1 -1
  289. package/src/server/guard/passwordVerifier.ts +1 -1
  290. package/src/server/guard/revocationStore.spec.ts +2 -2
  291. package/src/server/guard/sessionSigner.ts +3 -3
  292. package/src/server/incidents/checks.ts +2 -2
  293. package/src/server/incidents/incidents.spec.ts +7 -7
  294. package/src/server/incidents/index.ts +8 -8
  295. package/src/server/incidents/migrations.ts +1 -1
  296. package/src/server/incidents/notifier.ts +3 -3
  297. package/src/server/incidents/reporter.ts +1 -1
  298. package/src/server/incidents/routes.ts +5 -5
  299. package/src/server/incidents/store.ts +3 -3
  300. package/src/server/index.ts +26 -26
  301. package/src/server/jobs/fireQueue.spec.ts +1 -1
  302. package/src/server/jobs/fireQueue.ts +3 -3
  303. package/src/server/jobs/index.ts +7 -7
  304. package/src/server/jobs/logger.ts +1 -1
  305. package/src/server/jobs/plainjobAdapter.spec.ts +1 -1
  306. package/src/server/jobs/polling.spec.ts +1 -1
  307. package/src/server/jobs/polling.ts +2 -2
  308. package/src/server/jobs/runner.spec.ts +3 -3
  309. package/src/server/jobs/runner.ts +5 -5
  310. package/src/server/jobs/timeout.spec.ts +1 -1
  311. package/src/server/master-lock/accounts.spec.ts +2 -2
  312. package/src/server/master-lock/accountsPage.spec.ts +4 -4
  313. package/src/server/master-lock/accountsPage.ts +1 -1
  314. package/src/server/master-lock/beaconNeverReachesTheWall.spec.ts +4 -4
  315. package/src/server/master-lock/guard.spec.ts +3 -3
  316. package/src/server/master-lock/guard.ts +3 -3
  317. package/src/server/master-lock/index.ts +8 -7
  318. package/src/server/master-lock/lockPage.spec.ts +2 -2
  319. package/src/server/master-lock/masterLock.spec.ts +59 -2
  320. package/src/server/master-lock/masterLock.ts +76 -14
  321. package/src/server/master-lock/principals.spec.ts +4 -4
  322. package/src/server/master-lock/principals.ts +1 -1
  323. package/src/server/master-lock/seed.spec.ts +3 -3
  324. package/src/server/master-lock/seed.ts +1 -1
  325. package/src/server/master-lock/store.ts +7 -1
  326. package/src/server/media-bun/image.spec.ts +1 -1
  327. package/src/server/media-bun/index.ts +3 -3
  328. package/src/server/media-bun/streaming.spec.ts +1 -1
  329. package/src/server/media-bun/video.spec.ts +1 -1
  330. package/src/server/media-bun/video.ts +1 -1
  331. package/src/server/metrics/normalizeRoute.spec.ts +1 -1
  332. package/src/server/metrics/telemetrySink.spec.ts +3 -3
  333. package/src/server/metrics/telemetrySink.ts +1 -1
  334. package/src/server/middleware/bodyLimit.spec.ts +1 -1
  335. package/src/server/middleware/correlationId.ts +1 -1
  336. package/src/server/middleware/corsAllowlist.spec.ts +2 -2
  337. package/src/server/middleware/errorEnvelope.ts +2 -2
  338. package/src/server/middleware/index.ts +10 -10
  339. package/src/server/middleware/localOrigin.spec.ts +1 -1
  340. package/src/server/middleware/rateLimit.spec.ts +1 -1
  341. package/src/server/middleware/rateLimit.ts +1 -1
  342. package/src/server/middleware/requestLogger.ts +5 -5
  343. package/src/server/middleware/zValidator.spec.ts +4 -4
  344. package/src/server/middleware/zValidator.ts +2 -2
  345. package/src/server/migration/runner.spec.ts +2 -2
  346. package/src/server/migration/runner.ts +1 -1
  347. package/src/server/net/outboundGuard.spec.ts +1 -1
  348. package/src/server/net/outboundGuard.ts +1 -1
  349. package/src/server/notifications/index.ts +7 -7
  350. package/src/server/notifications/migrations.ts +1 -1
  351. package/src/server/notifications/routes.ts +1 -1
  352. package/src/server/notifications/service.spec.ts +3 -3
  353. package/src/server/notifications/service.ts +2 -2
  354. package/src/server/paths/appDataHome.spec.ts +1 -1
  355. package/src/server/resume/index.ts +2 -2
  356. package/src/server/resume/resume.spec.ts +2 -2
  357. package/src/server/resume/routes.ts +1 -1
  358. package/src/server/retention/archive.spec.ts +2 -2
  359. package/src/server/retention/archive.ts +1 -1
  360. package/src/server/retention/fleet.ts +4 -4
  361. package/src/server/retention/index.ts +6 -6
  362. package/src/server/retention/policy.spec.ts +1 -1
  363. package/src/server/retention/store.spec.ts +3 -3
  364. package/src/server/retention/store.ts +3 -3
  365. package/src/server/retention/sweeper.spec.ts +5 -5
  366. package/src/server/retention/sweeper.ts +5 -5
  367. package/src/server/retention/target.spec.ts +3 -3
  368. package/src/server/retention/target.ts +5 -5
  369. package/src/server/search/index.ts +2 -2
  370. package/src/server/search/pgSearchProvider.pg.test.ts +2 -2
  371. package/src/server/search/pgSearchProvider.ts +2 -2
  372. package/src/server/sharing/index.ts +8 -8
  373. package/src/server/sharing/migrations.ts +1 -1
  374. package/src/server/sharing/router.spec.ts +2 -2
  375. package/src/server/sharing/router.ts +1 -1
  376. package/src/server/sharing/sql.ts +1 -1
  377. package/src/server/sharing/store.spec.ts +2 -2
  378. package/src/server/sharing/store.ts +3 -3
  379. package/src/server/sqlite/backup.spec.ts +1 -1
  380. package/src/server/sqlite/browse.spec.ts +1 -1
  381. package/src/server/sqlite/browse.ts +1 -1
  382. package/src/server/sqlite/export.spec.ts +2 -2
  383. package/src/server/sqlite/export.ts +1 -1
  384. package/src/server/sqlite/fts5.spec.ts +1 -1
  385. package/src/server/sqlite/health.spec.ts +1 -1
  386. package/src/server/sqlite/import.spec.ts +3 -3
  387. package/src/server/sqlite/import.ts +1 -1
  388. package/src/server/sqlite/index.ts +9 -9
  389. package/src/server/sqlite/readonlySql.spec.ts +1 -1
  390. package/src/server/sqlite/stats.spec.ts +1 -1
  391. package/src/server/sqlite/stats.ts +1 -1
  392. package/src/server/sqlite/viewer.spec.ts +1 -1
  393. package/src/server/sqlite/viewer.ts +2 -2
  394. package/src/server/storage/binaryServerProcessing.integration.spec.ts +2 -2
  395. package/src/server/storage/binaryServerProcessing.spec.ts +2 -2
  396. package/src/server/storage/binaryServerProcessing.ts +3 -3
  397. package/src/server/storage/binaryServerStore.ts +3 -3
  398. package/src/server/storage/binaryStore.spec.ts +2 -2
  399. package/src/server/storage/binaryStore.ts +1 -1
  400. package/src/server/storage/binaryStoreFake.ts +1 -1
  401. package/src/server/storage/chunked.integration.spec.ts +4 -4
  402. package/src/server/storage/diskStore.ts +1 -1
  403. package/src/server/storage/fileUploadClient-chunked.integration.spec.ts +6 -6
  404. package/src/server/storage/fileUploadClient.integration.spec.ts +7 -7
  405. package/src/server/storage/files/adapter.photo.display.spec.ts +10 -10
  406. package/src/server/storage/files/adapter.photo.spec.ts +9 -9
  407. package/src/server/storage/files/adapter.spec.ts +8 -8
  408. package/src/server/storage/files/adapter.ts +5 -5
  409. package/src/server/storage/files/catalogue.media-host.spec.ts +6 -6
  410. package/src/server/storage/files/catalogue.orderings.spec.ts +6 -6
  411. package/src/server/storage/files/catalogue.recover.spec.ts +5 -5
  412. package/src/server/storage/files/catalogue.sort.spec.ts +6 -6
  413. package/src/server/storage/files/catalogue.spec.ts +7 -7
  414. package/src/server/storage/files/catalogue.trash-import.spec.ts +6 -6
  415. package/src/server/storage/files/catalogue.ts +6 -6
  416. package/src/server/storage/files/chunkedUpload.spec.ts +7 -7
  417. package/src/server/storage/files/chunkedUpload.ts +4 -4
  418. package/src/server/storage/files/collections.spec.ts +6 -6
  419. package/src/server/storage/files/fileRoutes.replace.spec.ts +8 -8
  420. package/src/server/storage/files/fileRoutes.spec.ts +8 -8
  421. package/src/server/storage/files/fileRoutes.ts +6 -6
  422. package/src/server/storage/files/index.ts +9 -9
  423. package/src/server/storage/files/migrations.ts +1 -1
  424. package/src/server/storage/files/stack.spec.ts +5 -5
  425. package/src/server/storage/files/stack.ts +12 -12
  426. package/src/server/storage/files/storageOps.spec.ts +4 -4
  427. package/src/server/storage/files/storageOps.ts +1 -1
  428. package/src/server/storage/files/types.ts +1 -1
  429. package/src/server/storage/imageThumbnail.spec.ts +2 -2
  430. package/src/server/storage/imageThumbnail.ts +1 -1
  431. package/src/server/storage/index.ts +15 -15
  432. package/src/server/storage/mountMediaRoutes.ts +4 -4
  433. package/src/server/storage/objectStore.spec.ts +1 -1
  434. package/src/server/storage/objectStoreMediaStore.ts +1 -1
  435. package/src/server/storage/s3ObjectStore.ts +1 -1
  436. package/src/server/storage/sources.ts +3 -3
  437. package/src/server/storage/storage.spec.ts +6 -6
  438. package/src/server/storage/streamRange.ts +1 -1
  439. package/src/server/storage/streamToken.ts +1 -1
  440. package/src/server/storage/transcodeJobs.spec.ts +1 -1
  441. package/src/server/storage/videoDerivativeKeys.spec.ts +1 -1
  442. package/src/server/storage/videoProcessor.posterOnly.spec.ts +4 -4
  443. package/src/server/storage/videoProcessor.ts +2 -2
  444. package/src/server/sync/alarm.spec.ts +1 -1
  445. package/src/server/sync/commands.spec.ts +1 -1
  446. package/src/server/sync/engine.spec.ts +4 -4
  447. package/src/server/sync/engine.ts +2 -2
  448. package/src/server/sync/http.ts +5 -5
  449. package/src/server/sync/httpRemote.spec.ts +1 -1
  450. package/src/server/sync/index.ts +11 -11
  451. package/src/server/sync/opLog.spec.ts +1 -1
  452. package/src/server/sync/opLog.ts +1 -1
  453. package/src/server/sync/planner.spec.ts +1 -1
  454. package/src/server/sync/signal.spec.ts +1 -1
  455. package/src/server/sync/signal.ts +1 -1
  456. package/src/server/sync/status.spec.ts +1 -1
  457. package/src/server/sync/timer.spec.ts +3 -3
  458. package/src/server/sync/timer.ts +3 -3
  459. package/src/server/sync/tokens.spec.ts +1 -1
  460. package/src/server/ws/eventBus.spec.ts +2 -2
  461. package/src/server/ws/eventBus.ts +1 -1
  462. package/src/server/ws/hub.integration.spec.ts +5 -5
  463. package/src/server/ws/hub.spec.ts +3 -3
  464. package/src/server/ws/hub.ts +4 -4
  465. package/src/server/ws/index.ts +5 -5
  466. package/src/server/ws/presence.spec.ts +3 -3
  467. package/src/server/ws/presence.ts +1 -1
  468. package/src/server/ws/room.spec.ts +2 -2
  469. package/src/server/ws/room.ts +1 -1
  470. package/src/server/ws/types.ts +1 -1
  471. package/src/testTmpRoot.spec.ts +1 -1
@@ -36,10 +36,10 @@
36
36
  * route that notifies somebody else; producing is server-side code calling
37
37
  * `center.notify*`.
38
38
  */
39
- export { createNotificationHub } from "./hub";
40
- export { NOTIFICATION_MIGRATIONS, NOTIFICATIONS_TABLE } from "./migrations";
41
- export { mountNotificationRoutes } from "./routes";
42
- export { createNotificationService } from "./service";
39
+ export { createNotificationHub } from "./hub.js";
40
+ export { NOTIFICATION_MIGRATIONS, NOTIFICATIONS_TABLE } from "./migrations.js";
41
+ export { mountNotificationRoutes } from "./routes.js";
42
+ export { createNotificationService } from "./service.js";
43
43
  // Re-exported so a server consumer needs ONE import for the whole contract —
44
44
  // the same courtesy `server/sharing` extends over `cursedbelt-core/sharing`. The
45
45
  // engine remains cwip's; this is a door, not a copy.
@@ -1,4 +1,4 @@
1
- import type { Migration } from "../migration/types";
1
+ import type { Migration } from "../migration/types.js";
2
2
  export declare const NOTIFICATIONS_TABLE = "notifications";
3
3
  /**
4
4
  * Ordered migrations for the notification table.
@@ -35,7 +35,7 @@
35
35
  */
36
36
  import type { Context, Hono } from "hono";
37
37
  import type { NotificationCenter } from "cwip/notifications";
38
- import type { NotificationHub } from "./hub";
38
+ import type { NotificationHub } from "./hub.js";
39
39
  /** The slice of the center these routes use — `createNotificationCenter(...)`
40
40
  * satisfies it, and so does any app-specific facade over one. */
41
41
  export type NotificationRouteCenter = Pick<NotificationCenter, "list" | "get" | "unreadCount" | "markRead" | "markAllRead" | "setDone" | "doneAll" | "remove">;
@@ -15,7 +15,7 @@
15
15
  import type { Database } from "bun:sqlite";
16
16
  import { type NotificationCenter, type NotificationStore } from "cwip/notifications";
17
17
  import type { Context, Hono } from "hono";
18
- import { type NotificationHub } from "./hub";
18
+ import { type NotificationHub } from "./hub.js";
19
19
  export interface CreateNotificationServiceOptions {
20
20
  /** The app's own database — the table lands beside its rows. */
21
21
  db: Database;
@@ -1,6 +1,6 @@
1
1
  import { createNotificationCenter, createSqliteNotificationStore, } from "cwip/notifications";
2
- import { createNotificationHub } from "./hub";
3
- import { mountNotificationRoutes } from "./routes";
2
+ import { createNotificationHub } from "./hub.js";
3
+ import { mountNotificationRoutes } from "./routes.js";
4
4
  export function createNotificationService(options) {
5
5
  const onError = options.onError ??
6
6
  ((error, context) => console.error(`[notifications] ${context}:`, error instanceof Error ? error.message : error));
@@ -1,2 +1,2 @@
1
- export { createSqliteResumeStore, MAX_LOCATION_LENGTH, type ResumeRecord, type ResumeStore, type ResumeStoreOptions, } from './store';
2
- export { mountResumeRoutes, RESUME_KEY_PATTERN, type ResumeRoutesOptions } from './routes';
1
+ export { createSqliteResumeStore, MAX_LOCATION_LENGTH, type ResumeRecord, type ResumeStore, type ResumeStoreOptions, } from './store.js';
2
+ export { mountResumeRoutes, RESUME_KEY_PATTERN, type ResumeRoutesOptions } from './routes.js';
@@ -1,2 +1,2 @@
1
- export { createSqliteResumeStore, MAX_LOCATION_LENGTH, } from './store';
2
- export { mountResumeRoutes, RESUME_KEY_PATTERN } from './routes';
1
+ export { createSqliteResumeStore, MAX_LOCATION_LENGTH, } from './store.js';
2
+ export { mountResumeRoutes, RESUME_KEY_PATTERN } from './routes.js';
@@ -17,7 +17,7 @@
17
17
  * screen it names.
18
18
  */
19
19
  import type { Context, Hono } from 'hono';
20
- import { type ResumeStore } from './store';
20
+ import { type ResumeStore } from './store.js';
21
21
  export interface ResumeRoutesOptions {
22
22
  store: ResumeStore;
23
23
  /** Resolve the caller to a user id, or null to refuse. */
@@ -1,4 +1,4 @@
1
- import { MAX_LOCATION_LENGTH } from './store';
1
+ import { MAX_LOCATION_LENGTH } from './store.js';
2
2
  const NO_STORE = { 'cache-control': 'no-store, private' };
3
3
  /**
4
4
  * What a `?key=` may look like. 🔴 EXPORTED because a client that builds a key
@@ -44,7 +44,7 @@
44
44
  import { createHash } from "node:crypto";
45
45
  import { appendFileSync, closeSync, existsSync, fsyncSync, mkdirSync, openSync, readdirSync, readFileSync, renameSync, rmSync, statSync, writeFileSync, writeSync, } from "node:fs";
46
46
  import { join } from "node:path";
47
- import { APP_DATA_HOME_ENV, resolveAppDataHome } from "../paths/appDataHome";
47
+ import { APP_DATA_HOME_ENV, resolveAppDataHome } from "../paths/appDataHome.js";
48
48
  /** The default budget of uncollected archive on a staged (deployed-box) home.
49
49
  * Generous next to the tables it governs — notes' whole `ops` log is ~15 MB —
50
50
  * and small next to a 6.7 GB root. Reached only if the collector has stopped. */
@@ -9,8 +9,8 @@
9
9
  * up as data that vanished earlier than the screen said it would — which is the
10
10
  * one failure mode that would make the owner stop trusting the control.
11
11
  */
12
- import type { EffectiveRetentionPolicy, RetentionOverride } from "./policy";
13
- import type { PublishedResource } from "./store";
12
+ import type { EffectiveRetentionPolicy, RetentionOverride } from "./policy.js";
13
+ import type { PublishedResource } from "./store.js";
14
14
  export interface RetentionFleetRow extends PublishedResource {
15
15
  key: string;
16
16
  app: string;
@@ -1,5 +1,5 @@
1
- import { RETENTION_CATEGORIES, resolveRetentionPolicy } from "./policy";
2
- import { readRetentionOverrides, readRetentionRegistry, resolveRetentionHome } from "./store";
1
+ import { RETENTION_CATEGORIES, resolveRetentionPolicy } from "./policy.js";
2
+ import { readRetentionOverrides, readRetentionRegistry, resolveRetentionHome } from "./store.js";
3
3
  export function buildRetentionFleetView(options = {}) {
4
4
  const home = options.home ?? resolveRetentionHome();
5
5
  const publications = readRetentionRegistry(home);
@@ -30,9 +30,9 @@
30
30
  * the owner would miss (which is exactly why billing evidence is NOT a category
31
31
  * and lives in `retentionPolicy.ts` instead).
32
32
  */
33
- export { archiveStamp, createJsonlArchive, DEFAULT_PENDING_ARCHIVE_BUDGET_BYTES, resolveArchiveHome, verifyArchive, type ArchiveHome, type ArchiveSegment, type ArchiveSink, type JsonlArchiveOptions, } from "./archive";
34
- export { ARCHIVING_RETENTION_CATEGORIES, assertRetentionDeclaration, categoryArchivesBeforeDelete, cutoffFor, DAY_MS, FLEET_DEFAULT_RETENTION_DAYS, RETENTION_CATEGORIES, RETENTION_CATEGORY_KEYS, RETENTION_MAX_DAYS, RETENTION_MIN_DAYS, resolveRetentionPolicy, retentionKey, type EffectiveRetentionPolicy, type RetentionPolicy, type RetentionCategory, type RetentionDeclaration, type RetentionFieldSource, type RetentionOverride, type RetentionUnit, } from "./policy";
35
- export { publishRetention, readRetentionOverrides, readRetentionRegistry, resolveRetentionHome, setRetentionHomeForTests, writeRetentionOverride, type PublishedResource, type RetentionMeasurement, type RetentionOverridesFile, type RetentionPublication, type RetentionSweepReport, } from "./store";
36
- export { createArchivingSqliteTableTarget, createFileDirTarget, createSqliteTableTarget, type ArchivingSqliteTableTargetOptions, type FileDirTargetOptions, type RetentionPreview, type RetentionTarget, type SqliteTableTargetOptions, } from "./target";
37
- export { createRetentionSweeper, DEFAULT_SWEEP_INTERVAL_MS, OVERRIDES_PULSE_MS, type CreateRetentionSweeperOptions, type ResourceOutcome, type RetentionRunReport, type RetentionSweeper, } from "./sweeper";
38
- export { buildRetentionFleetView, type RetentionFleetRow, type RetentionFleetView } from "./fleet";
33
+ export { archiveStamp, createJsonlArchive, DEFAULT_PENDING_ARCHIVE_BUDGET_BYTES, resolveArchiveHome, verifyArchive, type ArchiveHome, type ArchiveSegment, type ArchiveSink, type JsonlArchiveOptions, } from "./archive.js";
34
+ export { ARCHIVING_RETENTION_CATEGORIES, assertRetentionDeclaration, categoryArchivesBeforeDelete, cutoffFor, DAY_MS, FLEET_DEFAULT_RETENTION_DAYS, RETENTION_CATEGORIES, RETENTION_CATEGORY_KEYS, RETENTION_MAX_DAYS, RETENTION_MIN_DAYS, resolveRetentionPolicy, retentionKey, type EffectiveRetentionPolicy, type RetentionPolicy, type RetentionCategory, type RetentionDeclaration, type RetentionFieldSource, type RetentionOverride, type RetentionUnit, } from "./policy.js";
35
+ export { publishRetention, readRetentionOverrides, readRetentionRegistry, resolveRetentionHome, setRetentionHomeForTests, writeRetentionOverride, type PublishedResource, type RetentionMeasurement, type RetentionOverridesFile, type RetentionPublication, type RetentionSweepReport, } from "./store.js";
36
+ export { createArchivingSqliteTableTarget, createFileDirTarget, createSqliteTableTarget, type ArchivingSqliteTableTargetOptions, type FileDirTargetOptions, type RetentionPreview, type RetentionTarget, type SqliteTableTargetOptions, } from "./target.js";
37
+ export { createRetentionSweeper, DEFAULT_SWEEP_INTERVAL_MS, OVERRIDES_PULSE_MS, type CreateRetentionSweeperOptions, type ResourceOutcome, type RetentionRunReport, type RetentionSweeper, } from "./sweeper.js";
38
+ export { buildRetentionFleetView, type RetentionFleetRow, type RetentionFleetView } from "./fleet.js";
@@ -30,9 +30,9 @@
30
30
  * the owner would miss (which is exactly why billing evidence is NOT a category
31
31
  * and lives in `retentionPolicy.ts` instead).
32
32
  */
33
- export { archiveStamp, createJsonlArchive, DEFAULT_PENDING_ARCHIVE_BUDGET_BYTES, resolveArchiveHome, verifyArchive, } from "./archive";
34
- export { ARCHIVING_RETENTION_CATEGORIES, assertRetentionDeclaration, categoryArchivesBeforeDelete, cutoffFor, DAY_MS, FLEET_DEFAULT_RETENTION_DAYS, RETENTION_CATEGORIES, RETENTION_CATEGORY_KEYS, RETENTION_MAX_DAYS, RETENTION_MIN_DAYS, resolveRetentionPolicy, retentionKey, } from "./policy";
35
- export { publishRetention, readRetentionOverrides, readRetentionRegistry, resolveRetentionHome, setRetentionHomeForTests, writeRetentionOverride, } from "./store";
36
- export { createArchivingSqliteTableTarget, createFileDirTarget, createSqliteTableTarget, } from "./target";
37
- export { createRetentionSweeper, DEFAULT_SWEEP_INTERVAL_MS, OVERRIDES_PULSE_MS, } from "./sweeper";
38
- export { buildRetentionFleetView } from "./fleet";
33
+ export { archiveStamp, createJsonlArchive, DEFAULT_PENDING_ARCHIVE_BUDGET_BYTES, resolveArchiveHome, verifyArchive, } from "./archive.js";
34
+ export { ARCHIVING_RETENTION_CATEGORIES, assertRetentionDeclaration, categoryArchivesBeforeDelete, cutoffFor, DAY_MS, FLEET_DEFAULT_RETENTION_DAYS, RETENTION_CATEGORIES, RETENTION_CATEGORY_KEYS, RETENTION_MAX_DAYS, RETENTION_MIN_DAYS, resolveRetentionPolicy, retentionKey, } from "./policy.js";
35
+ export { publishRetention, readRetentionOverrides, readRetentionRegistry, resolveRetentionHome, setRetentionHomeForTests, writeRetentionOverride, } from "./store.js";
36
+ export { createArchivingSqliteTableTarget, createFileDirTarget, createSqliteTableTarget, } from "./target.js";
37
+ export { createRetentionSweeper, DEFAULT_SWEEP_INTERVAL_MS, OVERRIDES_PULSE_MS, } from "./sweeper.js";
38
+ export { buildRetentionFleetView } from "./fleet.js";
@@ -1,4 +1,4 @@
1
- import type { RetentionDeclaration, RetentionOverride } from "./policy";
1
+ import type { RetentionDeclaration, RetentionOverride } from "./policy.js";
2
2
  /** What one sweep of one resource did. Published so the UI can show it. */
3
3
  export interface RetentionSweepReport {
4
4
  at: number;
@@ -46,8 +46,8 @@
46
46
  */
47
47
  import { existsSync, mkdirSync, readdirSync, readFileSync, renameSync, rmSync, writeFileSync, } from "node:fs";
48
48
  import { join } from "node:path";
49
- import { APP_DATA_HOME_ENV, resolveAppDataHome } from "../paths/appDataHome";
50
- import { retentionKey } from "./policy";
49
+ import { APP_DATA_HOME_ENV, resolveAppDataHome } from "../paths/appDataHome.js";
50
+ import { retentionKey } from "./policy.js";
51
51
  /**
52
52
  * A FUNCTION, not a shared constant. `writeRetentionOverride` mutates what
53
53
  * `readRetentionOverrides` hands it, so a module-level empty object would be
@@ -1,6 +1,6 @@
1
- import type { EffectiveRetentionPolicy } from "./policy";
2
- import type { RetentionSweepReport } from "./store";
3
- import type { RetentionTarget } from "./target";
1
+ import type { EffectiveRetentionPolicy } from "./policy.js";
2
+ import type { RetentionSweepReport } from "./store.js";
3
+ import type { RetentionTarget } from "./target.js";
4
4
  /** Default cadence. Diagnostic data is not urgent; four sweeps a day is plenty. */
5
5
  export declare const DEFAULT_SWEEP_INTERVAL_MS: number;
6
6
  /** How often to notice an overrides edit. */
@@ -19,8 +19,8 @@
19
19
  */
20
20
  import { statSync } from "node:fs";
21
21
  import { join } from "node:path";
22
- import { assertRetentionDeclaration, resolveRetentionPolicy, retentionKey } from "./policy";
23
- import { publishRetention, readRetentionOverrides, resolveRetentionHome } from "./store";
22
+ import { assertRetentionDeclaration, resolveRetentionPolicy, retentionKey } from "./policy.js";
23
+ import { publishRetention, readRetentionOverrides, resolveRetentionHome } from "./store.js";
24
24
  /** Default cadence. Diagnostic data is not urgent; four sweeps a day is plenty. */
25
25
  export const DEFAULT_SWEEP_INTERVAL_MS = 6 * 60 * 60 * 1000;
26
26
  /** How often to notice an overrides edit. */
@@ -15,9 +15,9 @@
15
15
  * were correct on the day they were written.
16
16
  */
17
17
  import type { Database } from "bun:sqlite";
18
- import type { ArchiveSink } from "./archive";
19
- import type { EffectiveRetentionPolicy, RetentionDeclaration } from "./policy";
20
- import type { RetentionMeasurement, RetentionSweepReport } from "./store";
18
+ import type { ArchiveSink } from "./archive.js";
19
+ import type { EffectiveRetentionPolicy, RetentionDeclaration } from "./policy.js";
20
+ import type { RetentionMeasurement, RetentionSweepReport } from "./store.js";
21
21
  export interface RetentionPreview {
22
22
  /** Items the age rule would remove. */
23
23
  aged: number;
@@ -1,7 +1,7 @@
1
1
  import { readdirSync, rmSync, statSync } from "node:fs";
2
2
  import { join } from "node:path";
3
- import { DEFAULT_PENDING_ARCHIVE_BUDGET_BYTES } from "./archive";
4
- import { categoryArchivesBeforeDelete, cutoffFor, retentionKey } from "./policy";
3
+ import { DEFAULT_PENDING_ARCHIVE_BUDGET_BYTES } from "./archive.js";
4
+ import { categoryArchivesBeforeDelete, cutoffFor, retentionKey } from "./policy.js";
5
5
  /**
6
6
  * Table and column names cannot be bound as parameters, so they are
7
7
  * interpolated — and therefore must be proven safe rather than trusted. Every
@@ -1,2 +1,2 @@
1
- export { createPgSearchProvider, type PgSearchProviderOptions } from './pgSearchProvider';
2
- export { ensureSaasSearchSchema, PG_RANK_WEIGHTS, PG_SEARCH_CHUNKS_DDL, PG_SEARCH_DDL, PG_SEARCH_DOCS_DDL, } from './pgSearchSchema';
1
+ export { createPgSearchProvider, type PgSearchProviderOptions } from './pgSearchProvider.js';
2
+ export { ensureSaasSearchSchema, PG_RANK_WEIGHTS, PG_SEARCH_CHUNKS_DDL, PG_SEARCH_DDL, PG_SEARCH_DOCS_DDL, } from './pgSearchSchema.js';
@@ -2,5 +2,5 @@
2
2
  // Postgres. `createSaasHostServices` is the near side a deployment actually
3
3
  // calls; these are exported for a host that wires the tier by hand and for the
4
4
  // migration step that creates the schema.
5
- export { createPgSearchProvider } from './pgSearchProvider';
6
- export { ensureSaasSearchSchema, PG_RANK_WEIGHTS, PG_SEARCH_CHUNKS_DDL, PG_SEARCH_DDL, PG_SEARCH_DOCS_DDL, } from './pgSearchSchema';
5
+ export { createPgSearchProvider } from './pgSearchProvider.js';
6
+ export { ensureSaasSearchSchema, PG_RANK_WEIGHTS, PG_SEARCH_CHUNKS_DDL, PG_SEARCH_DDL, PG_SEARCH_DOCS_DDL, } from './pgSearchSchema.js';
@@ -63,8 +63,8 @@
63
63
  */
64
64
  import { assertNonEmpty, clampLimit, clampPositive, countChunks, docKey, fuseSearchTiers, rankChunksByVector, UNKNOWN_EMBED_MODEL, writeDocChunks, } from 'cwip/search-provider';
65
65
  import { createPostgresControlExecutor, saasSetTenantSql, } from 'cwip/storage';
66
- import { AppError } from '../errors';
67
- import { PG_RANK_WEIGHTS } from './pgSearchSchema';
66
+ import { AppError } from '../errors.js';
67
+ import { PG_RANK_WEIGHTS } from './pgSearchSchema.js';
68
68
  const DEFAULT_LIMIT = 20;
69
69
  const MAX_LIMIT = 200;
70
70
  /** Mirrors the SQLite provider's fusion depth — see its `FUSION_DEPTH`. */
@@ -23,8 +23,8 @@
23
23
  */
24
24
  import { SQL } from 'bun';
25
25
  import { afterAll, beforeAll, beforeEach, describe, expect, it } from 'bun:test';
26
- import { createPgSearchProvider } from './pgSearchProvider';
27
- import { ensureSaasSearchSchema } from './pgSearchSchema';
26
+ import { createPgSearchProvider } from './pgSearchProvider.js';
27
+ import { ensureSaasSearchSchema } from './pgSearchSchema.js';
28
28
  const ADMIN_URL = process.env.CC_PG_URL;
29
29
  /**
30
30
  * A dedicated NON-SUPERUSER owner, and the reason is the finding this suite
@@ -6,13 +6,13 @@
6
6
  * `./store.ts`'s header for the five properties it guarantees and `./sql.ts` for
7
7
  * why the row filter is a SQL fragment rather than a list of ids.
8
8
  */
9
- export { SHARE_MIGRATIONS } from "./migrations";
10
- export { SHARE_EVENTS_TABLE, SHARE_GRANTS_TABLE, SHARE_GROUPS_TABLE, SHARE_GROUP_MEMBERS_TABLE, } from "./migrations";
11
- export { GROUP_SUBJECT_PREFIX, mountShareRoutes, parseSubjectParam, subjectParam, } from "./router";
12
- export type { ShareRouterOptions, ShareRouterViewer, ShareRoutesPayload } from "./router";
13
- export { sharedResourceSql, sqlColumn, sqlLiteral } from "./sql";
14
- export type { SharedResourceSqlOptions } from "./sql";
15
- export { createShareStore, group, user } from "./store";
16
- export type { GrantInput, RevokeInput, ShareEventQuery, ShareStore, ShareStoreOptions, ShareTarget, } from "./store";
9
+ export { SHARE_MIGRATIONS } from "./migrations.js";
10
+ export { SHARE_EVENTS_TABLE, SHARE_GRANTS_TABLE, SHARE_GROUPS_TABLE, SHARE_GROUP_MEMBERS_TABLE, } from "./migrations.js";
11
+ export { GROUP_SUBJECT_PREFIX, mountShareRoutes, parseSubjectParam, subjectParam, } from "./router.js";
12
+ export type { ShareRouterOptions, ShareRouterViewer, ShareRoutesPayload } from "./router.js";
13
+ export { sharedResourceSql, sqlColumn, sqlLiteral } from "./sql.js";
14
+ export type { SharedResourceSqlOptions } from "./sql.js";
15
+ export { createShareStore, group, user } from "./store.js";
16
+ export type { GrantInput, RevokeInput, ShareEventQuery, ShareStore, ShareStoreOptions, ShareTarget, } from "./store.js";
17
17
  export { accessMeets, describeAccess, describeShareEvent, isShareAccess, isShareLevel, isShareSubjectType, levelsMeeting, normalizeSubject, normalizeSubjectId, resolveAccess, resourceKey, sameResource, sameSubject, SHARE_ACTIONS, strongerAccess, } from "cursedbelt-core/sharing/model";
18
18
  export type { ShareAccess, ShareAction, ShareEvent, ShareGrant, ShareGroup, ShareGroupMember, ShareLevel, ShareResource, ShareSubject, ShareSubjectType, ShareViewer, } from "cursedbelt-core/sharing/model";
@@ -6,11 +6,11 @@
6
6
  * `./store.ts`'s header for the five properties it guarantees and `./sql.ts` for
7
7
  * why the row filter is a SQL fragment rather than a list of ids.
8
8
  */
9
- export { SHARE_MIGRATIONS } from "./migrations";
10
- export { SHARE_EVENTS_TABLE, SHARE_GRANTS_TABLE, SHARE_GROUPS_TABLE, SHARE_GROUP_MEMBERS_TABLE, } from "./migrations";
11
- export { GROUP_SUBJECT_PREFIX, mountShareRoutes, parseSubjectParam, subjectParam, } from "./router";
12
- export { sharedResourceSql, sqlColumn, sqlLiteral } from "./sql";
13
- export { createShareStore, group, user } from "./store";
9
+ export { SHARE_MIGRATIONS } from "./migrations.js";
10
+ export { SHARE_EVENTS_TABLE, SHARE_GRANTS_TABLE, SHARE_GROUPS_TABLE, SHARE_GROUP_MEMBERS_TABLE, } from "./migrations.js";
11
+ export { GROUP_SUBJECT_PREFIX, mountShareRoutes, parseSubjectParam, subjectParam, } from "./router.js";
12
+ export { sharedResourceSql, sqlColumn, sqlLiteral } from "./sql.js";
13
+ export { createShareStore, group, user } from "./store.js";
14
14
  // Re-exported so a server consumer needs ONE import for the whole contract; the
15
15
  // pure entry (`cursedbelt-core/sharing`) stays available for a browser or a test.
16
16
  export { accessMeets, describeAccess, describeShareEvent, isShareAccess, isShareLevel, isShareSubjectType, levelsMeeting, normalizeSubject, normalizeSubjectId, resolveAccess, resourceKey, sameResource, sameSubject, SHARE_ACTIONS, strongerAccess, } from "cursedbelt-core/sharing/model";
@@ -1,4 +1,4 @@
1
- import type { Migration } from "../migration/types";
1
+ import type { Migration } from "../migration/types.js";
2
2
  export declare const SHARE_GRANTS_TABLE = "share_grants";
3
3
  export declare const SHARE_GROUPS_TABLE = "share_groups";
4
4
  export declare const SHARE_GROUP_MEMBERS_TABLE = "share_group_members";
@@ -44,7 +44,7 @@
44
44
  */
45
45
  import type { Context, Hono } from 'hono';
46
46
  import type { ShareEvent, ShareGrant } from 'cursedbelt-core/sharing/model';
47
- import type { ShareStore } from './store';
47
+ import type { ShareStore } from './store.js';
48
48
  /** The `group:` prefix that lets a group subject travel in a path segment. Exported so a
49
49
  * client and a route cannot disagree about it. */
50
50
  export declare const GROUP_SUBJECT_PREFIX = "group:";
@@ -26,7 +26,7 @@
26
26
  * tested with hostile input; a consumer never quotes anything itself.
27
27
  */
28
28
  import { levelsMeeting, normalizeSubjectId } from "cursedbelt-core/sharing/model";
29
- import { SHARE_GRANTS_TABLE, SHARE_GROUP_MEMBERS_TABLE } from "./migrations";
29
+ import { SHARE_GRANTS_TABLE, SHARE_GROUP_MEMBERS_TABLE } from "./migrations.js";
30
30
  /**
31
31
  * Quote a string as a SQL literal.
32
32
  *
@@ -1,7 +1,7 @@
1
1
  import { levelsMeeting, normalizeSubjectId, strongerAccess, } from "cursedbelt-core/sharing/model";
2
- import { runMigrations } from "../migration/runner";
3
- import { SHARE_EVENTS_TABLE, SHARE_GRANTS_TABLE, SHARE_GROUPS_TABLE, SHARE_GROUP_MEMBERS_TABLE, SHARE_MIGRATIONS, } from "./migrations";
4
- import { sharedResourceSql } from "./sql";
2
+ import { runMigrations } from "../migration/runner.js";
3
+ import { SHARE_EVENTS_TABLE, SHARE_GRANTS_TABLE, SHARE_GROUPS_TABLE, SHARE_GROUP_MEMBERS_TABLE, SHARE_MIGRATIONS, } from "./migrations.js";
4
+ import { sharedResourceSql } from "./sql.js";
5
5
  /** Shorthand for the common subject. `group(id)` is its sibling. */
6
6
  export const user = (id) => ({ type: "user", id });
7
7
  export const group = (id) => ({ type: "group", id });
@@ -1,5 +1,5 @@
1
1
  import { clampPageLimit } from 'cwip/math';
2
- import { isReadOnlySql } from './readonlySql';
2
+ import { isReadOnlySql } from './readonlySql.js';
3
3
  /**
4
4
  * Hono-free read-only SQLite browse primitives — the shared core beneath
5
5
  * `createSqliteViewerMiddleware` (viewer.ts) AND any consumer that can't mount a
@@ -2,7 +2,7 @@ import { readFileSync, rmSync } from 'node:fs';
2
2
  import { tmpdir } from 'node:os';
3
3
  import { join } from 'node:path';
4
4
  import { toCsv } from 'cwip/csv';
5
- import { isKnownTable, quoteIdent, UnknownTableError } from './browse';
5
+ import { isKnownTable, quoteIdent, UnknownTableError } from './browse.js';
6
6
  /** All rows of one table serialized to CSV or JSON. Throws {@link UnknownTableError}. */
7
7
  export function exportSqliteTable(db, table, format) {
8
8
  if (!isKnownTable(db, table))
@@ -3,7 +3,7 @@ import { withForeignKeysOff } from 'cwip/sqlite';
3
3
  import { rmSync, writeFileSync } from 'node:fs';
4
4
  import { tmpdir } from 'node:os';
5
5
  import { join } from 'node:path';
6
- import { isKnownTable, quoteIdent, UnknownTableError } from './browse';
6
+ import { isKnownTable, quoteIdent, UnknownTableError } from './browse.js';
7
7
  /** Real column names of a table, in declared order. */
8
8
  function tableColumns(db, table) {
9
9
  return db
@@ -1,9 +1,9 @@
1
- export { type BackupInfo, createSqliteBackupService, snapshotSqlite, type SqliteBackupOpts, type SqliteBackupS3Opts, type SqliteBackupService, } from './backup';
2
- export { clampLimit, clampOffset, isKnownTable, listSqliteTables, NotReadOnlyError, quoteIdent, readSqliteTable, runReadonlySqlite, type SqliteTableInfo, type SqliteTablePage, UnknownTableError, } from './browse';
3
- export { exportSqliteSnapshot, exportSqliteTable, type SnapshotExport, type TableExport, type TableExportFormat, } from './export';
4
- export { applyFtsSchema, buildFtsSchema, createFts5Search, type Fts5Search, type FtsHighlightOpts, type FtsResult, type FtsSearchOpts, type FtsSnippetOpts, type FtsTableSpec, sanitizeFtsQuery, } from './fts5';
5
- export { createSqliteHealthChecks, type SqliteHealthCheck, type SqliteHealthOpts, type SqliteHealthResult, type SqliteHealthStatus, } from './health';
6
- export { type ImportMode, type ImportResult, importRowsIntoSqliteTable, type RestoreResult, restoreSqliteSnapshot, } from './import';
7
- export { isReadOnlySql } from './readonlySql';
8
- export { collectSqliteStats, type DbStats, type TableStat } from './stats';
9
- export { createSqliteViewerMiddleware } from './viewer';
1
+ export { type BackupInfo, createSqliteBackupService, snapshotSqlite, type SqliteBackupOpts, type SqliteBackupS3Opts, type SqliteBackupService, } from './backup.js';
2
+ export { clampLimit, clampOffset, isKnownTable, listSqliteTables, NotReadOnlyError, quoteIdent, readSqliteTable, runReadonlySqlite, type SqliteTableInfo, type SqliteTablePage, UnknownTableError, } from './browse.js';
3
+ export { exportSqliteSnapshot, exportSqliteTable, type SnapshotExport, type TableExport, type TableExportFormat, } from './export.js';
4
+ export { applyFtsSchema, buildFtsSchema, createFts5Search, type Fts5Search, type FtsHighlightOpts, type FtsResult, type FtsSearchOpts, type FtsSnippetOpts, type FtsTableSpec, sanitizeFtsQuery, } from './fts5.js';
5
+ export { createSqliteHealthChecks, type SqliteHealthCheck, type SqliteHealthOpts, type SqliteHealthResult, type SqliteHealthStatus, } from './health.js';
6
+ export { type ImportMode, type ImportResult, importRowsIntoSqliteTable, type RestoreResult, restoreSqliteSnapshot, } from './import.js';
7
+ export { isReadOnlySql } from './readonlySql.js';
8
+ export { collectSqliteStats, type DbStats, type TableStat } from './stats.js';
9
+ export { createSqliteViewerMiddleware } from './viewer.js';
@@ -4,12 +4,12 @@
4
4
  // export / import / stats primitives that back both the viewer middleware and any
5
5
  // bespoke-transport consumer (a cursedshell plugin, the encrypted-GET "f" app). All
6
6
  // app-agnostic; the apps supply table names, paths, and thresholds.
7
- export { createSqliteBackupService, snapshotSqlite, } from './backup';
8
- export { clampLimit, clampOffset, isKnownTable, listSqliteTables, NotReadOnlyError, quoteIdent, readSqliteTable, runReadonlySqlite, UnknownTableError, } from './browse';
9
- export { exportSqliteSnapshot, exportSqliteTable, } from './export';
10
- export { applyFtsSchema, buildFtsSchema, createFts5Search, sanitizeFtsQuery, } from './fts5';
11
- export { createSqliteHealthChecks, } from './health';
12
- export { importRowsIntoSqliteTable, restoreSqliteSnapshot, } from './import';
13
- export { isReadOnlySql } from './readonlySql';
14
- export { collectSqliteStats } from './stats';
15
- export { createSqliteViewerMiddleware } from './viewer';
7
+ export { createSqliteBackupService, snapshotSqlite, } from './backup.js';
8
+ export { clampLimit, clampOffset, isKnownTable, listSqliteTables, NotReadOnlyError, quoteIdent, readSqliteTable, runReadonlySqlite, UnknownTableError, } from './browse.js';
9
+ export { exportSqliteSnapshot, exportSqliteTable, } from './export.js';
10
+ export { applyFtsSchema, buildFtsSchema, createFts5Search, sanitizeFtsQuery, } from './fts5.js';
11
+ export { createSqliteHealthChecks, } from './health.js';
12
+ export { importRowsIntoSqliteTable, restoreSqliteSnapshot, } from './import.js';
13
+ export { isReadOnlySql } from './readonlySql.js';
14
+ export { collectSqliteStats } from './stats.js';
15
+ export { createSqliteViewerMiddleware } from './viewer.js';
@@ -1,4 +1,4 @@
1
- import { listSqliteTables } from './browse';
1
+ import { listSqliteTables } from './browse.js';
2
2
  /** Whole-database size from the page pragmas (works without `dbstat`). */
3
3
  function fileBytes(db) {
4
4
  const pageCount = db.query('PRAGMA page_count').get()?.page_count ?? 0;
@@ -1,6 +1,6 @@
1
1
  import { Hono } from 'hono';
2
- import { ApiError, toErrorEnvelope } from '../errors';
3
- import { listSqliteTables, NotReadOnlyError, readSqliteTable, runReadonlySqlite, UnknownTableError, } from './browse';
2
+ import { ApiError, toErrorEnvelope } from '../errors.js';
3
+ import { listSqliteTables, NotReadOnlyError, readSqliteTable, runReadonlySqlite, UnknownTableError, } from './browse.js';
4
4
  /**
5
5
  * A read-only SQLite browser as a Hono sub-app — a thin HTTP wrapper over the
6
6
  * Hono-free primitives in `browse.ts` (the same primitives a cursedshell plugin or
@@ -1,4 +1,4 @@
1
- import type { ImageDerivatives, VideoProcessor } from './files/catalogue';
1
+ import type { ImageDerivatives, VideoProcessor } from './files/catalogue.js';
2
2
  export type BinaryServerProcessingConfig = {
3
3
  /** e.g. 'https://binary-server.cursedalchemy.com' — same value as the byte store's baseUrl. */
4
4
  baseUrl: string;
@@ -1,5 +1,5 @@
1
- import { createTranscodeJobClient } from './transcodeJobs';
2
- import { fsHlsPrefix, fsMp4Key, fsPosterKey, fsSpriteKey, fsVttKey } from './types';
1
+ import { createTranscodeJobClient } from './transcodeJobs.js';
2
+ import { fsHlsPrefix, fsMp4Key, fsPosterKey, fsSpriteKey, fsVttKey } from './types.js';
3
3
  export function createBinaryServerProcessing(cfg) {
4
4
  const jobs = createTranscodeJobClient(cfg);
5
5
  const { appKey, submit, poll } = jobs;
@@ -1,3 +1,3 @@
1
- import type { BinaryServerConfig, MediaStore } from './types';
2
- export type { BinaryServerConfig, FileTokenClaims, FileTokenSigner } from './types';
1
+ import type { BinaryServerConfig, MediaStore } from './types.js';
2
+ export type { BinaryServerConfig, FileTokenClaims, FileTokenSigner } from './types.js';
3
3
  export declare function createBinaryServerStore(cfg: BinaryServerConfig): MediaStore;
@@ -1,4 +1,4 @@
1
- import type { FileTokenClaims } from './types';
1
+ import type { FileTokenClaims } from './types.js';
2
2
  /**
3
3
  * The claims binary-server verifies, re-exported from `./types` (the fleet's single
4
4
  * source of truth — `cursedbelt-server/storage/types`). See there for the per-field
@@ -44,7 +44,7 @@
44
44
  * async meta(key) { … what this suite is actually about … },
45
45
  * };
46
46
  */
47
- import type { BinaryStore } from './binaryStore';
47
+ import type { BinaryStore } from './binaryStore.js';
48
48
  /**
49
49
  * Every member of {@link BinaryStore}, inert.
50
50
  *
@@ -1,2 +1,2 @@
1
- import type { MediaStore } from './types';
1
+ import type { MediaStore } from './types.js';
2
2
  export declare function createDiskStore(root: string): MediaStore;
@@ -1,7 +1,7 @@
1
- import type { MediaUrls } from '../sources';
2
- import type { MediaGallerySource, MediaSource, PhotoSource } from '../types';
3
- import type { FileUrls } from './fileRoutes';
4
- import type { FileCatalogue, FileToPlayable } from './types';
1
+ import type { MediaUrls } from '../sources.js';
2
+ import type { MediaGallerySource, MediaSource, PhotoSource } from '../types.js';
3
+ import type { FileUrls } from './fileRoutes.js';
4
+ import type { FileCatalogue, FileToPlayable } from './types.js';
5
5
  /** Resolve a video FileRecord to a PlayableVideo with tokenised URLs. Non-video ⇒ null. */
6
6
  export declare function createFileToPlayable(urls: MediaUrls, sourceId: string): FileToPlayable;
7
7
  /** Expose a FileCatalogue as a video-only `MediaSource` — the gallery is a view, not a store. */
@@ -1,4 +1,4 @@
1
- import { isBrowserRenderableImage } from '../imageThumbnail';
1
+ import { isBrowserRenderableImage } from '../imageThumbnail.js';
2
2
  /** Build the image→GalleryPhoto mapper shared by the photo source and the mixed media source.
3
3
  * The primary image is served by the file byte route (fileUrls); the grid thumbnail + HEIC
4
4
  * display derivative by the type-agnostic poster route (mediaUrls) when ingest produced one. */
@@ -1,7 +1,7 @@
1
1
  import type { Database } from 'bun:sqlite';
2
- import { type MediaCtx, type MediaStore } from '../types';
3
- import { type ProcessOptions, type ProcessResult } from '../videoProcessor';
4
- import { type FileCatalogue } from './types';
2
+ import { type MediaCtx, type MediaStore } from '../types.js';
3
+ import { type ProcessOptions, type ProcessResult } from '../videoProcessor.js';
4
+ import { type FileCatalogue } from './types.js';
5
5
  /** Swappable video ingest→derivatives implementation. The default runs ffmpeg
6
6
  * locally ({@link processVideo}); a remote backend (binary-server) delegates
7
7
  * the heavy work to the storage host instead — see binaryServerProcessing. */
@@ -1,11 +1,11 @@
1
1
  import { readdir, stat as fsStat } from 'node:fs/promises';
2
2
  import path from 'node:path';
3
- import { renderImage } from '../../media-bun/image';
4
- import { ffmpegImageThumbnail, isBrowserRenderableImage } from '../imageThumbnail';
5
- import { fsDisplayKey, fsHlsPrefix, fsMp4Key, fsPosterKey, fsSourceKey, fsSpriteKey, fsVttKey, } from '../types';
6
- import { processVideo } from '../videoProcessor';
7
- import { mimeByExt } from './mimeByExt';
8
- import { classifyFileType, } from './types';
3
+ import { renderImage } from '../../media-bun/image.js';
4
+ import { ffmpegImageThumbnail, isBrowserRenderableImage } from '../imageThumbnail.js';
5
+ import { fsDisplayKey, fsHlsPrefix, fsMp4Key, fsPosterKey, fsSourceKey, fsSpriteKey, fsVttKey, } from '../types.js';
6
+ import { processVideo } from '../videoProcessor.js';
7
+ import { mimeByExt } from './mimeByExt.js';
8
+ import { classifyFileType, } from './types.js';
9
9
  // The general primary binary for a NON-video file (images/docs/…) lives here; video files store a
10
10
  // raw source (fsSourceKey) + derived mp4/HLS/poster/sprite via the shared video keyspace.
11
11
  export const fileBinaryKey = (owner, id) => `fs/${owner}/${id}`;
@@ -1,6 +1,6 @@
1
- import type { MediaCtx } from '../types';
2
- import type { StorageOpsLedger } from './storageOps';
3
- import type { FileCatalogue, FileRecord } from './types';
1
+ import type { MediaCtx } from '../types.js';
2
+ import type { StorageOpsLedger } from './storageOps.js';
3
+ import type { FileCatalogue, FileRecord } from './types.js';
4
4
  export type ChunkedInit = {
5
5
  fileId: string;
6
6
  /** Chunk session id — also the ledger op id; echoed to the backend as sid so its assemble event
@@ -1,5 +1,5 @@
1
1
  import { DEFAULT_UPLOAD_CHUNK_SIZE } from 'cursedbelt-core/media/upload-limits';
2
- import { catalogueUploadKey } from './catalogue';
2
+ import { catalogueUploadKey } from './catalogue.js';
3
3
  // ── Chunked upload (large files, direct-to-backend) ──────────────────────────────
4
4
  // For multi-GB uploads we don't proxy bytes through the app origin. Instead: the client asks the
5
5
  // app to START an upload (init) → the app mints per-chunk PUT URLs that go DIRECT to the byte
@@ -1,8 +1,8 @@
1
1
  import type { Context, Hono } from 'hono';
2
- import type { StreamTokenService } from '../streamToken';
3
- import type { MediaCtx, MediaStore } from '../types';
4
- import type { ChunkedUploadService } from './chunkedUpload';
5
- import { type FileCatalogue } from './types';
2
+ import type { StreamTokenService } from '../streamToken.js';
3
+ import type { MediaCtx, MediaStore } from '../types.js';
4
+ import type { ChunkedUploadService } from './chunkedUpload.js';
5
+ import { type FileCatalogue } from './types.js';
6
6
  /** The 413 message a single-PUT over the cap returns — the client treats it as a hard error. */
7
7
  export declare const SINGLE_UPLOAD_TOO_LARGE = "file too large for a single request \u2014 use chunked upload";
8
8
  export interface FileUrls {
@@ -1,7 +1,7 @@
1
1
  import { MAX_SINGLE_UPLOAD_BYTES } from 'cursedbelt-core/media/upload-limits';
2
- import { serveRange } from '../streamRange';
3
- import { fileBinaryKey } from './catalogue';
4
- import { FILE_SORTS } from './types';
2
+ import { serveRange } from '../streamRange.js';
3
+ import { fileBinaryKey } from './catalogue.js';
4
+ import { FILE_SORTS } from './types.js';
5
5
  // ── File binary + upload routes ─────────────────────────────────────────────────
6
6
  // The FileCatalogue's byte edge for GENERAL files (images/docs/audio/any) — the piece
7
7
  // mountMediaRoutes (video-only: mp4/hls/poster/sprite) doesn't cover. A file's primary binary