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.
- package/dist/server/_bunOnly.d.ts +1 -0
- package/dist/server/_bunOnly.js +12 -0
- package/dist/server/activity/index.d.ts +4 -4
- package/dist/server/activity/index.js +3 -3
- package/dist/server/activity/migrations.d.ts +1 -1
- package/dist/server/activity/shareSource.d.ts +1 -1
- package/dist/server/activity/shareSource.js +1 -1
- package/dist/server/activity/store.js +2 -2
- package/dist/server/analytics/index.d.ts +2 -2
- package/dist/server/analytics/index.js +2 -2
- package/dist/server/app.d.ts +4 -4
- package/dist/server/app.js +6 -6
- package/dist/server/audit/index.d.ts +2 -2
- package/dist/server/audit/index.js +2 -2
- package/dist/server/audit/migrations.d.ts +1 -1
- package/dist/server/audit/sqliteSink.js +2 -2
- package/dist/server/audit/sqliteSink.test.js +1 -1
- package/dist/server/auth/csrf.js +1 -1
- package/dist/server/auth/fileTokenSigner.d.ts +1 -1
- package/dist/server/auth/getOnly.d.ts +1 -1
- package/dist/server/auth/getOnly.js +1 -1
- package/dist/server/auth/index.d.ts +12 -12
- package/dist/server/auth/index.js +11 -11
- package/dist/server/auth/jwt.d.ts +1 -1
- package/dist/server/auth/middleware.d.ts +1 -1
- package/dist/server/auth/middleware.js +3 -3
- package/dist/server/auth/sessionStore.d.ts +2 -2
- package/dist/server/auth/types.d.ts +1 -1
- package/dist/server/bench/assert.d.ts +1 -1
- package/dist/server/bench/assert.js +1 -1
- package/dist/server/bench/cpuBudget.d.ts +4 -4
- package/dist/server/bench/cpuBudget.js +3 -3
- package/dist/server/bench/index.d.ts +6 -6
- package/dist/server/bench/index.js +6 -6
- package/dist/server/bench/recorder.d.ts +2 -2
- package/dist/server/bench/recorder.js +1 -1
- package/dist/server/bench/runBench.d.ts +2 -2
- package/dist/server/ctgr.d.ts +1 -1
- package/dist/server/ctgr.js +1 -1
- package/dist/server/d1/fakeD1.d.ts +1 -1
- package/dist/server/d1/fakeD1.js +1 -1
- package/dist/server/d1/index.d.ts +8 -8
- package/dist/server/d1/index.js +8 -8
- package/dist/server/d1/invocation.d.ts +1 -1
- package/dist/server/d1/invocation.js +2 -2
- package/dist/server/d1/kysely.d.ts +2 -2
- package/dist/server/d1/kysely.js +2 -2
- package/dist/server/d1/limits.d.ts +1 -1
- package/dist/server/d1/limits.js +1 -1
- package/dist/server/d1/local.d.ts +1 -1
- package/dist/server/d1/local.js +3 -3
- package/dist/server/d1/localBackup.d.ts +1 -1
- package/dist/server/d1/localBackup.js +2 -2
- package/dist/server/d1/remote.d.ts +1 -1
- package/dist/server/d1/remote.js +3 -3
- package/dist/server/d1/scheduling.d.ts +1 -1
- package/dist/server/d1/values.d.ts +1 -1
- package/dist/server/d1/values.js +1 -1
- package/dist/server/db/kysely.d.ts +1 -1
- package/dist/server/dropzone/index.d.ts +2 -2
- package/dist/server/dropzone/index.js +2 -2
- package/dist/server/guard/argon2Binding.js +1 -1
- package/dist/server/guard/index.d.ts +5 -5
- package/dist/server/guard/index.js +5 -5
- package/dist/server/guard/kdfWorker.d.ts +1 -1
- package/dist/server/guard/kdfWorker.js +3 -3
- package/dist/server/guard/kdfWorkerEntry.js +1 -1
- package/dist/server/guard/passwordVerifier.js +1 -1
- package/dist/server/guard/sessionSigner.d.ts +2 -2
- package/dist/server/guard/sessionSigner.js +1 -1
- package/dist/server/incidents/checks.d.ts +2 -2
- package/dist/server/incidents/index.d.ts +8 -8
- package/dist/server/incidents/index.js +8 -8
- package/dist/server/incidents/migrations.d.ts +1 -1
- package/dist/server/incidents/notifier.d.ts +3 -3
- package/dist/server/incidents/reporter.d.ts +1 -1
- package/dist/server/incidents/routes.d.ts +4 -4
- package/dist/server/incidents/routes.js +1 -1
- package/dist/server/incidents/store.d.ts +1 -1
- package/dist/server/incidents/store.js +3 -3
- package/dist/server/index.d.ts +26 -26
- package/dist/server/index.js +23 -23
- package/dist/server/jobs/fireQueue.d.ts +1 -1
- package/dist/server/jobs/fireQueue.js +3 -3
- package/dist/server/jobs/index.d.ts +7 -7
- package/dist/server/jobs/index.js +7 -7
- package/dist/server/jobs/logger.d.ts +1 -1
- package/dist/server/jobs/polling.d.ts +1 -1
- package/dist/server/jobs/polling.js +1 -1
- package/dist/server/jobs/runner.d.ts +1 -1
- package/dist/server/jobs/runner.js +5 -5
- package/dist/server/master-lock/accountsPage.d.ts +1 -1
- package/dist/server/master-lock/accountsPage.js +1 -1
- package/dist/server/master-lock/guard.d.ts +2 -2
- package/dist/server/master-lock/guard.js +2 -2
- package/dist/server/master-lock/index.d.ts +7 -7
- package/dist/server/master-lock/index.js +7 -7
- package/dist/server/master-lock/masterLock.js +1 -11
- package/dist/server/master-lock/principals.d.ts +1 -1
- package/dist/server/master-lock/principals.js +1 -1
- package/dist/server/master-lock/seed.d.ts +1 -1
- package/dist/server/master-lock/seed.js +1 -1
- package/dist/server/master-lock/store.d.ts +1 -1
- package/dist/server/media-bun/index.d.ts +3 -3
- package/dist/server/media-bun/index.js +3 -3
- package/dist/server/media-bun/video.d.ts +1 -1
- package/dist/server/media-bun/video.js +1 -1
- package/dist/server/metrics/telemetrySink.d.ts +1 -1
- package/dist/server/metrics/telemetrySink.js +1 -1
- package/dist/server/middleware/correlationId.d.ts +1 -1
- package/dist/server/middleware/errorEnvelope.d.ts +1 -1
- package/dist/server/middleware/errorEnvelope.js +1 -1
- package/dist/server/middleware/index.d.ts +10 -10
- package/dist/server/middleware/index.js +10 -10
- package/dist/server/middleware/rateLimit.js +1 -1
- package/dist/server/middleware/requestLogger.d.ts +3 -3
- package/dist/server/middleware/requestLogger.js +3 -3
- package/dist/server/middleware/zValidator.d.ts +1 -1
- package/dist/server/middleware/zValidator.js +1 -1
- package/dist/server/migration/runner.d.ts +1 -1
- package/dist/server/net/outboundGuard.js +1 -1
- package/dist/server/notifications/index.d.ts +7 -7
- package/dist/server/notifications/index.js +4 -4
- package/dist/server/notifications/migrations.d.ts +1 -1
- package/dist/server/notifications/routes.d.ts +1 -1
- package/dist/server/notifications/service.d.ts +1 -1
- package/dist/server/notifications/service.js +2 -2
- package/dist/server/resume/index.d.ts +2 -2
- package/dist/server/resume/index.js +2 -2
- package/dist/server/resume/routes.d.ts +1 -1
- package/dist/server/resume/routes.js +1 -1
- package/dist/server/retention/archive.js +1 -1
- package/dist/server/retention/fleet.d.ts +2 -2
- package/dist/server/retention/fleet.js +2 -2
- package/dist/server/retention/index.d.ts +6 -6
- package/dist/server/retention/index.js +6 -6
- package/dist/server/retention/store.d.ts +1 -1
- package/dist/server/retention/store.js +2 -2
- package/dist/server/retention/sweeper.d.ts +3 -3
- package/dist/server/retention/sweeper.js +2 -2
- package/dist/server/retention/target.d.ts +3 -3
- package/dist/server/retention/target.js +2 -2
- package/dist/server/search/index.d.ts +2 -2
- package/dist/server/search/index.js +2 -2
- package/dist/server/search/pgSearchProvider.js +2 -2
- package/dist/server/search/pgSearchProvider.pg.test.js +2 -2
- package/dist/server/sharing/index.d.ts +8 -8
- package/dist/server/sharing/index.js +5 -5
- package/dist/server/sharing/migrations.d.ts +1 -1
- package/dist/server/sharing/router.d.ts +1 -1
- package/dist/server/sharing/sql.js +1 -1
- package/dist/server/sharing/store.js +3 -3
- package/dist/server/sqlite/browse.js +1 -1
- package/dist/server/sqlite/export.js +1 -1
- package/dist/server/sqlite/import.js +1 -1
- package/dist/server/sqlite/index.d.ts +9 -9
- package/dist/server/sqlite/index.js +9 -9
- package/dist/server/sqlite/stats.js +1 -1
- package/dist/server/sqlite/viewer.js +2 -2
- package/dist/server/storage/binaryServerProcessing.d.ts +1 -1
- package/dist/server/storage/binaryServerProcessing.js +2 -2
- package/dist/server/storage/binaryServerStore.d.ts +2 -2
- package/dist/server/storage/binaryStore.d.ts +1 -1
- package/dist/server/storage/binaryStoreFake.d.ts +1 -1
- package/dist/server/storage/diskStore.d.ts +1 -1
- package/dist/server/storage/files/adapter.d.ts +4 -4
- package/dist/server/storage/files/adapter.js +1 -1
- package/dist/server/storage/files/catalogue.d.ts +3 -3
- package/dist/server/storage/files/catalogue.js +6 -6
- package/dist/server/storage/files/chunkedUpload.d.ts +3 -3
- package/dist/server/storage/files/chunkedUpload.js +1 -1
- package/dist/server/storage/files/fileRoutes.d.ts +4 -4
- package/dist/server/storage/files/fileRoutes.js +3 -3
- package/dist/server/storage/files/index.d.ts +9 -9
- package/dist/server/storage/files/index.js +8 -8
- package/dist/server/storage/files/migrations.d.ts +1 -1
- package/dist/server/storage/files/stack.d.ts +7 -7
- package/dist/server/storage/files/stack.js +10 -10
- package/dist/server/storage/files/storageOps.d.ts +1 -1
- package/dist/server/storage/files/types.d.ts +1 -1
- package/dist/server/storage/imageThumbnail.js +1 -1
- package/dist/server/storage/index.d.ts +15 -15
- package/dist/server/storage/index.js +14 -14
- package/dist/server/storage/mountMediaRoutes.d.ts +3 -3
- package/dist/server/storage/mountMediaRoutes.js +2 -2
- package/dist/server/storage/objectStoreMediaStore.d.ts +1 -1
- package/dist/server/storage/s3ObjectStore.js +1 -1
- package/dist/server/storage/sources.d.ts +2 -2
- package/dist/server/storage/sources.js +2 -2
- package/dist/server/storage/streamRange.d.ts +1 -1
- package/dist/server/storage/streamToken.js +1 -1
- package/dist/server/storage/videoProcessor.d.ts +1 -1
- package/dist/server/storage/videoProcessor.js +2 -2
- package/dist/server/sync/engine.d.ts +2 -2
- package/dist/server/sync/engine.js +1 -1
- package/dist/server/sync/http.d.ts +4 -4
- package/dist/server/sync/http.js +3 -3
- package/dist/server/sync/index.d.ts +11 -11
- package/dist/server/sync/index.js +11 -11
- package/dist/server/sync/opLog.d.ts +1 -1
- package/dist/server/sync/signal.d.ts +1 -1
- package/dist/server/sync/timer.d.ts +3 -3
- package/dist/server/sync/timer.js +1 -1
- package/dist/server/ws/eventBus.d.ts +1 -1
- package/dist/server/ws/hub.d.ts +1 -1
- package/dist/server/ws/hub.js +3 -3
- package/dist/server/ws/index.d.ts +5 -5
- package/dist/server/ws/index.js +4 -4
- package/dist/server/ws/presence.d.ts +1 -1
- package/dist/server/ws/room.d.ts +1 -1
- package/dist/server/ws/types.d.ts +1 -1
- package/package.json +9 -9
- package/src/publicSurface.spec.ts +1 -1
- package/src/server/_bunOnly.ts +15 -0
- package/src/server/activity/index.ts +4 -4
- package/src/server/activity/migrations.ts +1 -1
- package/src/server/activity/shareSource.ts +2 -2
- package/src/server/activity/store.spec.ts +3 -3
- package/src/server/activity/store.ts +2 -2
- package/src/server/analytics/index.ts +2 -2
- package/src/server/analytics/injectedScripts.spec.ts +3 -3
- package/src/server/analytics/webAnalytics.spec.ts +1 -1
- package/src/server/app.spec.ts +9 -9
- package/src/server/app.ts +7 -7
- package/src/server/audit/index.ts +2 -2
- package/src/server/audit/migrations.ts +1 -1
- package/src/server/audit/sqliteSink.test.ts +1 -1
- package/src/server/audit/sqliteSink.ts +2 -2
- package/src/server/auth/cookie.spec.ts +1 -1
- package/src/server/auth/csrf.spec.ts +1 -1
- package/src/server/auth/csrf.ts +1 -1
- package/src/server/auth/fileTokenSigner.ts +1 -1
- package/src/server/auth/getOnly.spec.ts +2 -2
- package/src/server/auth/getOnly.ts +2 -2
- package/src/server/auth/index.ts +12 -12
- package/src/server/auth/jwt.spec.ts +2 -2
- package/src/server/auth/jwt.ts +1 -1
- package/src/server/auth/loginThrottle.spec.ts +1 -1
- package/src/server/auth/middleware.spec.ts +7 -7
- package/src/server/auth/middleware.ts +4 -4
- package/src/server/auth/password.spec.ts +1 -1
- package/src/server/auth/sessionStore.spec.ts +3 -3
- package/src/server/auth/sessionStore.ts +3 -3
- package/src/server/auth/totp.spec.ts +1 -1
- package/src/server/auth/types.ts +1 -1
- package/src/server/auth/vault.spec.ts +1 -1
- package/src/server/bench/assert.ts +2 -2
- package/src/server/bench/budget.spec.ts +2 -2
- package/src/server/bench/cpuBudget.spec.ts +6 -6
- package/src/server/bench/cpuBudget.ts +5 -5
- package/src/server/bench/cpuClock.spec.ts +2 -2
- package/src/server/bench/index.ts +6 -6
- package/src/server/bench/recorder.ts +2 -2
- package/src/server/bench/runBench.ts +2 -2
- package/src/server/ctgr.spec.ts +2 -2
- package/src/server/ctgr.ts +2 -2
- package/src/server/d1/backup.spec.ts +2 -2
- package/src/server/d1/fakeD1.ts +2 -2
- package/src/server/d1/index.ts +8 -8
- package/src/server/d1/invocation.spec.ts +6 -6
- package/src/server/d1/invocation.ts +2 -2
- package/src/server/d1/kysely.spec.ts +5 -5
- package/src/server/d1/kysely.ts +3 -3
- package/src/server/d1/limits.spec.ts +3 -3
- package/src/server/d1/limits.ts +1 -1
- package/src/server/d1/local.ts +3 -3
- package/src/server/d1/localBackup.ts +3 -3
- package/src/server/d1/remote.ts +3 -3
- package/src/server/d1/sameShape.spec.ts +4 -4
- package/src/server/d1/scheduling.spec.ts +1 -1
- package/src/server/d1/scheduling.ts +1 -1
- package/src/server/d1/values.ts +1 -1
- package/src/server/db/kysely.spec.ts +1 -1
- package/src/server/db/kysely.ts +1 -1
- package/src/server/dropzone/index.ts +2 -2
- package/src/server/dropzone/scan.spec.ts +1 -1
- package/src/server/errors.spec.ts +1 -1
- package/src/server/guard/argon2Binding.spec.ts +1 -1
- package/src/server/guard/argon2Binding.ts +1 -1
- package/src/server/guard/argon2Kat.spec.ts +1 -1
- package/src/server/guard/guard.spec.ts +3 -3
- package/src/server/guard/index.ts +5 -5
- package/src/server/guard/kdfWorker.spec.ts +3 -3
- package/src/server/guard/kdfWorker.ts +3 -3
- package/src/server/guard/kdfWorkerEntry.ts +1 -1
- package/src/server/guard/passwordVerifier.spec.ts +1 -1
- package/src/server/guard/passwordVerifier.ts +1 -1
- package/src/server/guard/revocationStore.spec.ts +2 -2
- package/src/server/guard/sessionSigner.ts +3 -3
- package/src/server/incidents/checks.ts +2 -2
- package/src/server/incidents/incidents.spec.ts +7 -7
- package/src/server/incidents/index.ts +8 -8
- package/src/server/incidents/migrations.ts +1 -1
- package/src/server/incidents/notifier.ts +3 -3
- package/src/server/incidents/reporter.ts +1 -1
- package/src/server/incidents/routes.ts +5 -5
- package/src/server/incidents/store.ts +3 -3
- package/src/server/index.ts +26 -26
- package/src/server/jobs/fireQueue.spec.ts +1 -1
- package/src/server/jobs/fireQueue.ts +3 -3
- package/src/server/jobs/index.ts +7 -7
- package/src/server/jobs/logger.ts +1 -1
- package/src/server/jobs/plainjobAdapter.spec.ts +1 -1
- package/src/server/jobs/polling.spec.ts +1 -1
- package/src/server/jobs/polling.ts +2 -2
- package/src/server/jobs/runner.spec.ts +3 -3
- package/src/server/jobs/runner.ts +5 -5
- package/src/server/jobs/timeout.spec.ts +1 -1
- package/src/server/master-lock/accounts.spec.ts +2 -2
- package/src/server/master-lock/accountsPage.spec.ts +4 -4
- package/src/server/master-lock/accountsPage.ts +1 -1
- package/src/server/master-lock/beaconNeverReachesTheWall.spec.ts +4 -4
- package/src/server/master-lock/guard.spec.ts +3 -3
- package/src/server/master-lock/guard.ts +3 -3
- package/src/server/master-lock/index.ts +7 -7
- package/src/server/master-lock/lockPage.spec.ts +2 -2
- package/src/server/master-lock/masterLock.spec.ts +2 -2
- package/src/server/master-lock/masterLock.ts +1 -10
- package/src/server/master-lock/principals.spec.ts +4 -4
- package/src/server/master-lock/principals.ts +1 -1
- package/src/server/master-lock/seed.spec.ts +3 -3
- package/src/server/master-lock/seed.ts +1 -1
- package/src/server/master-lock/store.ts +1 -1
- package/src/server/media-bun/image.spec.ts +1 -1
- package/src/server/media-bun/index.ts +3 -3
- package/src/server/media-bun/streaming.spec.ts +1 -1
- package/src/server/media-bun/video.spec.ts +1 -1
- package/src/server/media-bun/video.ts +1 -1
- package/src/server/metrics/normalizeRoute.spec.ts +1 -1
- package/src/server/metrics/telemetrySink.spec.ts +3 -3
- package/src/server/metrics/telemetrySink.ts +1 -1
- package/src/server/middleware/bodyLimit.spec.ts +1 -1
- package/src/server/middleware/correlationId.ts +1 -1
- package/src/server/middleware/corsAllowlist.spec.ts +2 -2
- package/src/server/middleware/errorEnvelope.ts +2 -2
- package/src/server/middleware/index.ts +10 -10
- package/src/server/middleware/localOrigin.spec.ts +1 -1
- package/src/server/middleware/rateLimit.spec.ts +1 -1
- package/src/server/middleware/rateLimit.ts +1 -1
- package/src/server/middleware/requestLogger.ts +5 -5
- package/src/server/middleware/zValidator.spec.ts +4 -4
- package/src/server/middleware/zValidator.ts +2 -2
- package/src/server/migration/runner.spec.ts +2 -2
- package/src/server/migration/runner.ts +1 -1
- package/src/server/net/outboundGuard.spec.ts +1 -1
- package/src/server/net/outboundGuard.ts +1 -1
- package/src/server/notifications/index.ts +7 -7
- package/src/server/notifications/migrations.ts +1 -1
- package/src/server/notifications/routes.ts +1 -1
- package/src/server/notifications/service.spec.ts +3 -3
- package/src/server/notifications/service.ts +2 -2
- package/src/server/paths/appDataHome.spec.ts +1 -1
- package/src/server/resume/index.ts +2 -2
- package/src/server/resume/resume.spec.ts +2 -2
- package/src/server/resume/routes.ts +1 -1
- package/src/server/retention/archive.spec.ts +2 -2
- package/src/server/retention/archive.ts +1 -1
- package/src/server/retention/fleet.ts +4 -4
- package/src/server/retention/index.ts +6 -6
- package/src/server/retention/policy.spec.ts +1 -1
- package/src/server/retention/store.spec.ts +3 -3
- package/src/server/retention/store.ts +3 -3
- package/src/server/retention/sweeper.spec.ts +5 -5
- package/src/server/retention/sweeper.ts +5 -5
- package/src/server/retention/target.spec.ts +3 -3
- package/src/server/retention/target.ts +5 -5
- package/src/server/search/index.ts +2 -2
- package/src/server/search/pgSearchProvider.pg.test.ts +2 -2
- package/src/server/search/pgSearchProvider.ts +2 -2
- package/src/server/sharing/index.ts +8 -8
- package/src/server/sharing/migrations.ts +1 -1
- package/src/server/sharing/router.spec.ts +2 -2
- package/src/server/sharing/router.ts +1 -1
- package/src/server/sharing/sql.ts +1 -1
- package/src/server/sharing/store.spec.ts +2 -2
- package/src/server/sharing/store.ts +3 -3
- package/src/server/sqlite/backup.spec.ts +1 -1
- package/src/server/sqlite/browse.spec.ts +1 -1
- package/src/server/sqlite/browse.ts +1 -1
- package/src/server/sqlite/export.spec.ts +2 -2
- package/src/server/sqlite/export.ts +1 -1
- package/src/server/sqlite/fts5.spec.ts +1 -1
- package/src/server/sqlite/health.spec.ts +1 -1
- package/src/server/sqlite/import.spec.ts +3 -3
- package/src/server/sqlite/import.ts +1 -1
- package/src/server/sqlite/index.ts +9 -9
- package/src/server/sqlite/readonlySql.spec.ts +1 -1
- package/src/server/sqlite/stats.spec.ts +1 -1
- package/src/server/sqlite/stats.ts +1 -1
- package/src/server/sqlite/viewer.spec.ts +1 -1
- package/src/server/sqlite/viewer.ts +2 -2
- package/src/server/storage/binaryServerProcessing.integration.spec.ts +2 -2
- package/src/server/storage/binaryServerProcessing.spec.ts +2 -2
- package/src/server/storage/binaryServerProcessing.ts +3 -3
- package/src/server/storage/binaryServerStore.ts +3 -3
- package/src/server/storage/binaryStore.spec.ts +2 -2
- package/src/server/storage/binaryStore.ts +1 -1
- package/src/server/storage/binaryStoreFake.ts +1 -1
- package/src/server/storage/chunked.integration.spec.ts +4 -4
- package/src/server/storage/diskStore.ts +1 -1
- package/src/server/storage/fileUploadClient-chunked.integration.spec.ts +6 -6
- package/src/server/storage/fileUploadClient.integration.spec.ts +7 -7
- package/src/server/storage/files/adapter.photo.display.spec.ts +10 -10
- package/src/server/storage/files/adapter.photo.spec.ts +9 -9
- package/src/server/storage/files/adapter.spec.ts +8 -8
- package/src/server/storage/files/adapter.ts +5 -5
- package/src/server/storage/files/catalogue.media-host.spec.ts +6 -6
- package/src/server/storage/files/catalogue.orderings.spec.ts +6 -6
- package/src/server/storage/files/catalogue.recover.spec.ts +5 -5
- package/src/server/storage/files/catalogue.sort.spec.ts +6 -6
- package/src/server/storage/files/catalogue.spec.ts +7 -7
- package/src/server/storage/files/catalogue.trash-import.spec.ts +6 -6
- package/src/server/storage/files/catalogue.ts +6 -6
- package/src/server/storage/files/chunkedUpload.spec.ts +7 -7
- package/src/server/storage/files/chunkedUpload.ts +4 -4
- package/src/server/storage/files/collections.spec.ts +6 -6
- package/src/server/storage/files/fileRoutes.replace.spec.ts +8 -8
- package/src/server/storage/files/fileRoutes.spec.ts +8 -8
- package/src/server/storage/files/fileRoutes.ts +6 -6
- package/src/server/storage/files/index.ts +9 -9
- package/src/server/storage/files/migrations.ts +1 -1
- package/src/server/storage/files/stack.spec.ts +5 -5
- package/src/server/storage/files/stack.ts +12 -12
- package/src/server/storage/files/storageOps.spec.ts +4 -4
- package/src/server/storage/files/storageOps.ts +1 -1
- package/src/server/storage/files/types.ts +1 -1
- package/src/server/storage/imageThumbnail.spec.ts +2 -2
- package/src/server/storage/imageThumbnail.ts +1 -1
- package/src/server/storage/index.ts +15 -15
- package/src/server/storage/mountMediaRoutes.ts +4 -4
- package/src/server/storage/objectStore.spec.ts +1 -1
- package/src/server/storage/objectStoreMediaStore.ts +1 -1
- package/src/server/storage/s3ObjectStore.ts +1 -1
- package/src/server/storage/sources.ts +3 -3
- package/src/server/storage/storage.spec.ts +6 -6
- package/src/server/storage/streamRange.ts +1 -1
- package/src/server/storage/streamToken.ts +1 -1
- package/src/server/storage/transcodeJobs.spec.ts +1 -1
- package/src/server/storage/videoDerivativeKeys.spec.ts +1 -1
- package/src/server/storage/videoProcessor.posterOnly.spec.ts +4 -4
- package/src/server/storage/videoProcessor.ts +2 -2
- package/src/server/sync/alarm.spec.ts +1 -1
- package/src/server/sync/commands.spec.ts +1 -1
- package/src/server/sync/engine.spec.ts +4 -4
- package/src/server/sync/engine.ts +2 -2
- package/src/server/sync/http.ts +5 -5
- package/src/server/sync/httpRemote.spec.ts +1 -1
- package/src/server/sync/index.ts +11 -11
- package/src/server/sync/opLog.spec.ts +1 -1
- package/src/server/sync/opLog.ts +1 -1
- package/src/server/sync/planner.spec.ts +1 -1
- package/src/server/sync/signal.spec.ts +1 -1
- package/src/server/sync/signal.ts +1 -1
- package/src/server/sync/status.spec.ts +1 -1
- package/src/server/sync/timer.spec.ts +3 -3
- package/src/server/sync/timer.ts +3 -3
- package/src/server/sync/tokens.spec.ts +1 -1
- package/src/server/ws/eventBus.spec.ts +2 -2
- package/src/server/ws/eventBus.ts +1 -1
- package/src/server/ws/hub.integration.spec.ts +5 -5
- package/src/server/ws/hub.spec.ts +3 -3
- package/src/server/ws/hub.ts +4 -4
- package/src/server/ws/index.ts +5 -5
- package/src/server/ws/presence.spec.ts +3 -3
- package/src/server/ws/presence.ts +1 -1
- package/src/server/ws/room.spec.ts +2 -2
- package/src/server/ws/room.ts +1 -1
- package/src/server/ws/types.ts +1 -1
- 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
|
|
package/src/server/auth/csrf.ts
CHANGED
|
@@ -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
|
package/src/server/auth/index.ts
CHANGED
|
@@ -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
|
|
package/src/server/auth/jwt.ts
CHANGED
|
@@ -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).
|
package/src/server/auth/types.ts
CHANGED
|
@@ -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.
|
package/src/server/ctgr.spec.ts
CHANGED
|
@@ -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) =>
|
package/src/server/ctgr.ts
CHANGED
|
@@ -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 => {
|
package/src/server/d1/fakeD1.ts
CHANGED
|
@@ -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 {
|
package/src/server/d1/index.ts
CHANGED
|
@@ -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
|
package/src/server/d1/kysely.ts
CHANGED
|
@@ -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
|
package/src/server/d1/limits.ts
CHANGED
|
@@ -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. */
|
package/src/server/d1/local.ts
CHANGED
|
@@ -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. */
|
package/src/server/d1/remote.ts
CHANGED
|
@@ -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,
|