From 890444fed65a86af6a8dd65a9a2c5b7aa116e9a9 Mon Sep 17 00:00:00 2001 From: asepharyana Date: Mon, 14 Sep 2026 18:19:22 +0700 Subject: [PATCH] chore(plan): fix stale src/db doc refs + register s3-routing test - 8 repository/port doc comments pointed at long-gone src/db/* layout; now reference the real drizzle repository paths - test:unit and test:s3 now include test/s3-routing.test.ts (was passing but never wired into any script) --- package.json | 4 ++-- src/domain/ports/bucket-repository.ts | 2 +- src/domain/ports/file-part-repository.ts | 2 +- src/domain/ports/file-repository.ts | 2 +- src/domain/ports/multipart-repository.ts | 2 +- .../persistence/repositories/bucket-repository.ts | 2 +- .../persistence/repositories/file-part-repository.ts | 2 +- .../persistence/repositories/file-repository.ts | 4 ++-- .../persistence/repositories/multipart-repository.ts | 2 +- 9 files changed, 11 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index 154a26f..fc86edf 100644 --- a/package.json +++ b/package.json @@ -9,12 +9,12 @@ "start": "NODE_ENV=production bun dist/index.js", "db:migrate": "bun dist/migrate.js", "test": "bun run test:unit", - "test:unit": "bun test --preload ./test/helpers/setup-env.ts test/rateLimit.test.ts && bun test --preload ./test/helpers/setup-env.ts test/file.test.ts && bun test --preload ./test/helpers/setup-env.ts test/files.test.ts && bun test --preload ./test/helpers/setup-env.ts test/health.test.ts && bun test --preload ./test/helpers/setup-env.ts test/db.test.ts && bun test --preload ./test/helpers/setup-env.ts test/bot-pool.test.ts && bun test --preload ./test/helpers/setup-env.ts test/bot.test.ts && bun test --preload ./test/helpers/setup-env.ts test/bootstrap.test.ts && bun test --preload ./test/helpers/setup-env.ts test/swagger.test.ts && bun test --preload ./test/helpers/setup-env.ts test/auth.test.ts && bun test --preload ./test/helpers/setup-env.ts test/auth-routes.test.ts && bun test --preload ./test/helpers/setup-env.ts test/validation.test.ts && bun test --preload ./test/helpers/setup-env.ts test/s3-auth.test.ts && bun test --preload ./test/helpers/setup-env.ts test/s3-auth-edge.test.ts && bun test --preload ./test/helpers/setup-env.ts test/s3-operations.test.ts && bun test --preload ./test/helpers/setup-env.ts test/s3-range.test.ts && bun test --preload ./test/helpers/setup-env.ts test/s3-object-stream.test.ts && bun test --preload ./test/helpers/setup-env.ts test/object-stream-parallel.test.ts && bun test --preload ./test/helpers/setup-env.ts test/s3-helpers-edge.test.ts && bun test --preload ./test/helpers/setup-env.ts test/s3-bucket-config.test.ts && bun test --preload ./test/helpers/setup-env.ts test/chunked-storage.test.ts && bun test --preload ./test/helpers/setup-env.ts test/temp-stream.test.ts && bun test --preload ./test/helpers/setup-env.ts test/zip.test.ts && bun test --preload ./test/helpers/setup-env.ts test/web-api.test.ts && bun test --preload ./test/helpers/setup-env.ts test/env.test.ts && bun test --preload ./test/helpers/setup-env.ts test/home.test.ts && bun test --preload ./test/helpers/setup-env.ts test/deploy-config.test.ts && bun test --preload ./test/helpers/setup-env.ts test/public-readonly-routes.test.ts", + "test:unit": "bun test --preload ./test/helpers/setup-env.ts test/rateLimit.test.ts && bun test --preload ./test/helpers/setup-env.ts test/file.test.ts && bun test --preload ./test/helpers/setup-env.ts test/files.test.ts && bun test --preload ./test/helpers/setup-env.ts test/health.test.ts && bun test --preload ./test/helpers/setup-env.ts test/db.test.ts && bun test --preload ./test/helpers/setup-env.ts test/bot-pool.test.ts && bun test --preload ./test/helpers/setup-env.ts test/bot.test.ts && bun test --preload ./test/helpers/setup-env.ts test/bootstrap.test.ts && bun test --preload ./test/helpers/setup-env.ts test/swagger.test.ts && bun test --preload ./test/helpers/setup-env.ts test/auth.test.ts && bun test --preload ./test/helpers/setup-env.ts test/auth-routes.test.ts && bun test --preload ./test/helpers/setup-env.ts test/validation.test.ts && bun test --preload ./test/helpers/setup-env.ts test/s3-auth.test.ts && bun test --preload ./test/helpers/setup-env.ts test/s3-auth-edge.test.ts && bun test --preload ./test/helpers/setup-env.ts test/s3-operations.test.ts && bun test --preload ./test/helpers/setup-env.ts test/s3-routing.test.ts && bun test --preload ./test/helpers/setup-env.ts test/s3-range.test.ts && bun test --preload ./test/helpers/setup-env.ts test/s3-object-stream.test.ts && bun test --preload ./test/helpers/setup-env.ts test/object-stream-parallel.test.ts && bun test --preload ./test/helpers/setup-env.ts test/s3-helpers-edge.test.ts && bun test --preload ./test/helpers/setup-env.ts test/s3-bucket-config.test.ts && bun test --preload ./test/helpers/setup-env.ts test/chunked-storage.test.ts && bun test --preload ./test/helpers/setup-env.ts test/temp-stream.test.ts && bun test --preload ./test/helpers/setup-env.ts test/zip.test.ts && bun test --preload ./test/helpers/setup-env.ts test/web-api.test.ts && bun test --preload ./test/helpers/setup-env.ts test/env.test.ts && bun test --preload ./test/helpers/setup-env.ts test/home.test.ts && bun test --preload ./test/helpers/setup-env.ts test/deploy-config.test.ts && bun test --preload ./test/helpers/setup-env.ts test/public-readonly-routes.test.ts", "test:quarantine": "bun test --preload ./test/helpers/setup-env.ts test/telegram.test.ts && bun test --preload ./test/helpers/setup-env.ts test/upload.test.ts && bun test --preload ./test/helpers/setup-env.ts test/s3-docker-registry.test.ts && bun test --preload ./test/helpers/setup-env.ts test/s3-sdk.test.ts && bun test --preload ./test/helpers/setup-env.ts test/production-e2e.test.ts", "test:s3-auth": "bun test --preload ./test/helpers/setup-env.ts test/s3-auth.test.ts", "test:s3-ops": "bun test --preload ./test/helpers/setup-env.ts test/s3-operations.test.ts", "test:web-api": "bun test --preload ./test/helpers/setup-env.ts test/web-api.test.ts", - "test:s3": "bun test --preload ./test/helpers/setup-env.ts test/s3-auth.test.ts && bun test --preload ./test/helpers/setup-env.ts test/s3-auth-edge.test.ts && bun test --preload ./test/helpers/setup-env.ts test/s3-operations.test.ts && bun test --preload ./test/helpers/setup-env.ts test/s3-range.test.ts && bun test --preload ./test/helpers/setup-env.ts test/s3-object-stream.test.ts && bun test --preload ./test/helpers/setup-env.ts test/object-stream-parallel.test.ts && bun test --preload ./test/helpers/setup-env.ts test/s3-helpers-edge.test.ts && bun test --preload ./test/helpers/setup-env.ts test/s3-bucket-config.test.ts && bun test --preload ./test/helpers/setup-env.ts test/web-api.test.ts", + "test:s3": "bun test --preload ./test/helpers/setup-env.ts test/s3-auth.test.ts && bun test --preload ./test/helpers/setup-env.ts test/s3-auth-edge.test.ts && bun test --preload ./test/helpers/setup-env.ts test/s3-operations.test.ts && bun test --preload ./test/helpers/setup-env.ts test/s3-routing.test.ts && bun test --preload ./test/helpers/setup-env.ts test/s3-range.test.ts && bun test --preload ./test/helpers/setup-env.ts test/s3-object-stream.test.ts && bun test --preload ./test/helpers/setup-env.ts test/object-stream-parallel.test.ts && bun test --preload ./test/helpers/setup-env.ts test/s3-helpers-edge.test.ts && bun test --preload ./test/helpers/setup-env.ts test/s3-bucket-config.test.ts && bun test --preload ./test/helpers/setup-env.ts test/web-api.test.ts", "lint": "bunx biome check src test", "format": "bunx biome format --write src test", "prepare": "husky" diff --git a/src/domain/ports/bucket-repository.ts b/src/domain/ports/bucket-repository.ts index 6009d13..cd604ec 100644 --- a/src/domain/ports/bucket-repository.ts +++ b/src/domain/ports/bucket-repository.ts @@ -3,7 +3,7 @@ import type { Bucket } from '../entities/bucket'; /** * Repository interface for Bucket entity persistence. * - * Abstracts the bucket CRUD operations currently in `src/db/buckets.ts`. + * Abstracts the bucket CRUD operations currently in `infrastructure/persistence/repositories/bucket-repository.ts`. */ export interface IBucketRepository { /** diff --git a/src/domain/ports/file-part-repository.ts b/src/domain/ports/file-part-repository.ts index 16c9432..5b90f6a 100644 --- a/src/domain/ports/file-part-repository.ts +++ b/src/domain/ports/file-part-repository.ts @@ -3,7 +3,7 @@ import type { FilePart, NewFilePart } from '../entities/file-part'; /** * Repository interface for FilePart entity persistence. * - * Abstracts the file-part operations currently in `src/db/file-parts.ts`. + * Abstracts the file-part operations currently in `infrastructure/persistence/repositories/file-part-repository.ts`. * File parts represent the chunks of a large file stored across multiple * Telegram messages for Telegram-safe storage. */ diff --git a/src/domain/ports/file-repository.ts b/src/domain/ports/file-repository.ts index 5b648af..3ec1bf9 100644 --- a/src/domain/ports/file-repository.ts +++ b/src/domain/ports/file-repository.ts @@ -15,7 +15,7 @@ export interface S3FileRecord extends File { * Repository interface for File entity persistence. * * Abstracts all file CRUD operations currently spread across - * `src/db/files.ts` and `src/db/files-ext.ts`. + * `infrastructure/persistence/repositories/file-repository.ts` and `infrastructure/persistence/repositories/file-repository.ts`. */ export interface IFileRepository { /** diff --git a/src/domain/ports/multipart-repository.ts b/src/domain/ports/multipart-repository.ts index 2e92fad..646263d 100644 --- a/src/domain/ports/multipart-repository.ts +++ b/src/domain/ports/multipart-repository.ts @@ -3,7 +3,7 @@ import type { MultipartPart, MultipartUpload } from '../entities/multipart'; /** * Repository interface for S3 multipart upload persistence. * - * Abstracts the multipart upload operations currently in `src/db/multipart.ts`. + * Abstracts the multipart upload operations currently in `infrastructure/persistence/repositories/multipart-repository.ts`. * Manages both multipart upload sessions and their individual parts. */ export interface IMultipartRepository { diff --git a/src/infrastructure/persistence/repositories/bucket-repository.ts b/src/infrastructure/persistence/repositories/bucket-repository.ts index a79cff7..eb0cbd0 100644 --- a/src/infrastructure/persistence/repositories/bucket-repository.ts +++ b/src/infrastructure/persistence/repositories/bucket-repository.ts @@ -21,7 +21,7 @@ const mapRowToBucket = (row: Record): Bucket => ({ /** * Drizzle-backed implementation of {@link IBucketRepository}. * - * Delegates to the same SQL queries as the original `src/db/buckets.ts` + * Delegates to the same SQL queries as the original `infrastructure/persistence/repositories/bucket-repository.ts` * module, using raw SQL for drizzle tables that are not part of the * typed schema. */ diff --git a/src/infrastructure/persistence/repositories/file-part-repository.ts b/src/infrastructure/persistence/repositories/file-part-repository.ts index 721ba0c..02e729f 100644 --- a/src/infrastructure/persistence/repositories/file-part-repository.ts +++ b/src/infrastructure/persistence/repositories/file-part-repository.ts @@ -31,7 +31,7 @@ const mapRowToFilePart = (row: Record): FilePart => ({ /** * Drizzle-backed implementation of {@link IFilePartRepository}. * - * Delegates to the same SQL queries as the original `src/db/file-parts.ts` + * Delegates to the same SQL queries as the original `infrastructure/persistence/repositories/file-part-repository.ts` * module, using raw SQL for all operations. */ export class DrizzleFilePartRepository implements IFilePartRepository { diff --git a/src/infrastructure/persistence/repositories/file-repository.ts b/src/infrastructure/persistence/repositories/file-repository.ts index 3084ce0..53c2c73 100644 --- a/src/infrastructure/persistence/repositories/file-repository.ts +++ b/src/infrastructure/persistence/repositories/file-repository.ts @@ -51,8 +51,8 @@ const mapDbRowToS3Record = (row: Record): S3FileRecord => ({ /** * Drizzle-backed implementation of {@link IFileRepository}. * - * Delegates to the same SQL queries as the original `src/db/files.ts` and - * `src/db/files-ext.ts` modules while presenting a clean domain interface. + * Delegates to the same SQL queries as the original `infrastructure/persistence/repositories/file-repository.ts` and + * `infrastructure/persistence/repositories/file-repository.ts` modules while presenting a clean domain interface. */ export class DrizzleFileRepository implements IFileRepository { /** diff --git a/src/infrastructure/persistence/repositories/multipart-repository.ts b/src/infrastructure/persistence/repositories/multipart-repository.ts index e48c1d1..5bf1665 100644 --- a/src/infrastructure/persistence/repositories/multipart-repository.ts +++ b/src/infrastructure/persistence/repositories/multipart-repository.ts @@ -19,7 +19,7 @@ const mapRowToMultipartUpload = (r: Record): MultipartUpload => /** * Drizzle-backed implementation of {@link IMultipartRepository}. * - * Delegates to the same SQL queries as the original `src/db/multipart.ts` + * Delegates to the same SQL queries as the original `infrastructure/persistence/repositories/multipart-repository.ts` * module, using raw SQL for all operations on the un-typed * `multipart_uploads` and `multipart_parts` tables. */