Svelte 컴포넌트를 제외한 파일, 폴더 및 라우팅 경로의 이름을 kebab-case로 통일하고 import 경로에 실제 파일 확장자를 사용하도록 변경

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
staticandClaude Opus 5.5 committed 2026-10-12 07:41:28 +09:00
1 parent 225ad3515f
commit 306fcb2420
201 files changed
+550 -545

No files matched your search

+4 -4
View File
@@ -1,7 +1,7 @@
import { ClientRepo, SessionRepo, IntegrityError } from "#lib/server/db/index.js";
import env from "#lib/server/config.js";
import { verifySessionId } from "#lib/server/crypto.js";
import { AppError } from "#lib/server/errors.js";
import { ClientRepo, SessionRepo, IntegrityError } from "#lib/server/db/index.ts";
import env from "#lib/server/config.ts";
import { verifySessionId } from "#lib/server/crypto.ts";
import { AppError } from "#lib/server/errors.ts";
export interface Session {
sessionId: string;
+1 -1
View File
@@ -1,4 +1,4 @@
import { AppError, type ErrorCode } from "#lib/server/errors.js";
import { AppError, type ErrorCode } from "#lib/server/errors.ts";
const errorCodes = {
// Category
+13 -13
View File
@@ -1,14 +1,14 @@
export * as CategoryRepo from "./repositories/category";
export * as ClientRepo from "./repositories/client";
export * as DirectoryRepo from "./repositories/directory";
export * as FileRepo from "./repositories/file";
export * as FileDeletionRepo from "./repositories/fileDeletion";
export * as HskRepo from "./repositories/hsk";
export * as MediaRepo from "./repositories/media";
export * as MekRepo from "./repositories/mek";
export * as SessionRepo from "./repositories/session";
export * as UploadRepo from "./repositories/upload";
export * as UserRepo from "./repositories/user";
export * as CategoryRepo from "./repositories/category.ts";
export * as ClientRepo from "./repositories/client.ts";
export * as DirectoryRepo from "./repositories/directory.ts";
export * as FileRepo from "./repositories/file.ts";
export * as FileDeletionRepo from "./repositories/file-deletion.ts";
export * as HskRepo from "./repositories/hsk.ts";
export * as MediaRepo from "./repositories/media.ts";
export * as MekRepo from "./repositories/mek.ts";
export * as SessionRepo from "./repositories/session.ts";
export * as UploadRepo from "./repositories/upload.ts";
export * as UserRepo from "./repositories/user.ts";
export * from "./error";
export { default as db } from "./kysely";
export * from "./error.ts";
export { default as db } from "./kysely.ts";
+4 -4
View File
@@ -1,9 +1,9 @@
import { Kysely } from "kysely";
import { Migrator } from "kysely/migration";
import env from "#lib/server/config.js";
import { createDialect } from "./dialect";
import migrations from "./migrations";
import type { Database } from "./schema";
import env from "#lib/server/config.ts";
import { createDialect } from "./dialect.ts";
import migrations from "./migrations/index.ts";
import type { Database } from "./schema/index.ts";
const db = new Kysely<Database>({ dialect: createDialect(env.database) });
+6 -6
View File
@@ -1,9 +1,9 @@
import * as Initial1737357000 from "./1737357000-Initial";
import * as AddFileCategory1737422340 from "./1737422340-AddFileCategory";
import * as AddThumbnail1738409340 from "./1738409340-AddThumbnail";
import * as AddChunkedUpload1768062380 from "./1768062380-AddChunkedUpload";
import * as AddFavorites1768643000 from "./1768643000-AddFavorites";
import * as AddFileDeletionQueue1791730000 from "./1791730000-AddFileDeletionQueue";
import * as Initial1737357000 from "./1737357000-Initial.ts";
import * as AddFileCategory1737422340 from "./1737422340-AddFileCategory.ts";
import * as AddThumbnail1738409340 from "./1738409340-AddThumbnail.ts";
import * as AddChunkedUpload1768062380 from "./1768062380-AddChunkedUpload.ts";
import * as AddFavorites1768643000 from "./1768643000-AddFavorites.ts";
import * as AddFileDeletionQueue1791730000 from "./1791730000-AddFileDeletionQueue.ts";
export default {
"1737357000-Initial": Initial1737357000,
+4 -4
View File
@@ -1,8 +1,8 @@
import type { Selectable } from "kysely";
import { IntegrityError } from "../error";
import db from "../kysely";
import type { CategoryTable, Ciphertext } from "../schema";
import { lockActiveMekVersion } from "./mek";
import { IntegrityError } from "../error.ts";
import db from "../kysely.ts";
import type { CategoryTable, Ciphertext } from "../schema/index.ts";
import { lockActiveMekVersion } from "./mek.ts";
export interface Category {
id: number;
+3 -3
View File
@@ -1,7 +1,7 @@
import pg from "pg";
import { IntegrityError } from "../error";
import db from "../kysely";
import type { UserClientState } from "../schema";
import { IntegrityError } from "../error.ts";
import db from "../kysely.ts";
import type { UserClientState } from "../schema/index.ts";
interface Client {
id: number;
+5 -5
View File
@@ -1,9 +1,9 @@
import type { Selectable } from "kysely";
import { IntegrityError } from "../error";
import db from "../kysely";
import type { Ciphertext, DirectoryTable } from "../schema";
import { enqueueFileDeletions } from "./fileDeletion";
import { lockActiveMekVersion } from "./mek";
import { IntegrityError } from "../error.ts";
import db from "../kysely.ts";
import type { Ciphertext, DirectoryTable } from "../schema/index.ts";
import { enqueueFileDeletions } from "./file-deletion.ts";
import { lockActiveMekVersion } from "./mek.ts";
export interface Directory {
id: number;
@@ -1,4 +1,4 @@
import db from "../kysely";
import db from "../kysely.ts";
export const enqueueFileDeletions = async (
trx: typeof db,
+5 -5
View File
@@ -1,11 +1,11 @@
import { sql, type Selectable } from "kysely";
import { jsonArrayFrom } from "kysely/helpers/postgres";
import pg from "pg";
import { IntegrityError } from "../error";
import db from "../kysely";
import type { Ciphertext, FileTable } from "../schema";
import { toCategory } from "./category";
import { enqueueFileDeletions } from "./fileDeletion";
import { IntegrityError } from "../error.ts";
import db from "../kysely.ts";
import type { Ciphertext, FileTable } from "../schema/index.ts";
import { toCategory } from "./category.ts";
import { enqueueFileDeletions } from "./file-deletion.ts";
export interface File {
id: number;
+3 -3
View File
@@ -1,7 +1,7 @@
import pg from "pg";
import { IntegrityError } from "../error";
import db from "../kysely";
import type { HskState } from "../schema";
import { IntegrityError } from "../error.ts";
import db from "../kysely.ts";
import type { HskState } from "../schema/index.ts";
interface Hsk {
userId: number;
+3 -3
View File
@@ -1,7 +1,7 @@
import type { NotNull } from "kysely";
import { IntegrityError } from "../error";
import db from "../kysely";
import { enqueueFileDeletions } from "./fileDeletion";
import { IntegrityError } from "../error.ts";
import db from "../kysely.ts";
import { enqueueFileDeletions } from "./file-deletion.ts";
interface Thumbnail {
id: number;
+3 -3
View File
@@ -1,7 +1,7 @@
import pg from "pg";
import { IntegrityError } from "../error";
import db from "../kysely";
import type { MekState } from "../schema";
import { IntegrityError } from "../error.ts";
import db from "../kysely.ts";
import type { MekState } from "../schema/index.ts";
interface Mek {
userId: number;
+3 -3
View File
@@ -1,7 +1,7 @@
import pg from "pg";
import env from "#lib/server/config.js";
import { IntegrityError } from "../error";
import db from "../kysely";
import env from "#lib/server/config.ts";
import { IntegrityError } from "../error.ts";
import db from "../kysely.ts";
export const createSession = async (
userId: number,
+7 -7
View File
@@ -1,11 +1,11 @@
import { sql, type Selectable } from "kysely";
import { IntegrityError } from "../error";
import db from "../kysely";
import type { Ciphertext, UploadSessionTable } from "../schema";
import { ensureDirectoryExists } from "./directory";
import { enqueueFileDeletions } from "./fileDeletion";
import { lockActiveHskVersion } from "./hsk";
import { lockActiveMekVersion } from "./mek";
import { IntegrityError } from "../error.ts";
import db from "../kysely.ts";
import type { Ciphertext, UploadSessionTable } from "../schema/index.ts";
import { ensureDirectoryExists } from "./directory.ts";
import { enqueueFileDeletions } from "./file-deletion.ts";
import { lockActiveHskVersion } from "./hsk.ts";
import { lockActiveMekVersion } from "./mek.ts";
interface BaseUploadSession {
id: string;
+1 -1
View File
@@ -1,4 +1,4 @@
import db from "../kysely";
import db from "../kysely.ts";
interface User {
id: number;
+1 -1
View File
@@ -1,5 +1,5 @@
import type { Generated } from "kysely";
import type { Ciphertext } from "./utils";
import type { Ciphertext } from "./utils.ts";
export interface CategoryTable {
id: Generated<number>;
+1 -1
View File
@@ -1,5 +1,5 @@
import type { ColumnType, Generated } from "kysely";
import type { Ciphertext } from "./utils";
import type { Ciphertext } from "./utils.ts";
export interface DirectoryTable {
id: Generated<number>;
+1 -1
View File
@@ -1,5 +1,5 @@
import type { ColumnType, Generated } from "kysely";
import type { Ciphertext } from "./utils";
import type { Ciphertext } from "./utils.ts";
export interface FileTable {
id: Generated<number>;
+12 -12
View File
@@ -1,15 +1,15 @@
export * from "./category";
export * from "./client";
export * from "./directory";
export * from "./file";
export * from "./fileDeletion";
export * from "./hsk";
export * from "./media";
export * from "./mek";
export * from "./session";
export * from "./upload";
export * from "./user";
export * from "./utils";
export * from "./category.ts";
export * from "./client.ts";
export * from "./directory.ts";
export * from "./file.ts";
export * from "./file-deletion.ts";
export * from "./hsk.ts";
export * from "./media.ts";
export * from "./mek.ts";
export * from "./session.ts";
export * from "./upload.ts";
export * from "./user.ts";
export * from "./utils.ts";
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
export interface Database {}
+1 -1
View File
@@ -1,5 +1,5 @@
import type { Generated } from "kysely";
import type { Ciphertext } from "./utils";
import type { Ciphertext } from "./utils.ts";
export interface UploadSessionTable {
id: string;
+1 -1
View File
@@ -1,5 +1,5 @@
import { error, type RequestEvent } from "@sveltejs/kit";
import { AppError } from "#lib/server/errors.js";
import { AppError } from "#lib/server/errors.ts";
// Converts `AppError`s thrown by services into HTTP errors
export const handleAppErrors = <Event extends RequestEvent>(
+1 -1
View File
@@ -1,6 +1,6 @@
import { error, redirect } from "@sveltejs/kit";
import type { Handle } from "@sveltejs/kit/hooks";
import { cookieOptions, authenticate, AuthenticationError } from "#lib/server/auth.js";
import { cookieOptions, authenticate, AuthenticationError } from "#lib/server/auth.ts";
export const authenticateMiddleware: Handle = async ({ event, resolve }) => {
try {
+2 -2
View File
@@ -1,2 +1,2 @@
export { default as authenticate } from "./authenticate";
export { default as setAgentInfo } from "./setAgentInfo";
export { default as authenticate } from "./authenticate.ts";
export { default as setAgentInfo } from "./set-agent-info.ts";
+5 -5
View File
@@ -1,9 +1,9 @@
import argon2 from "argon2";
import { ClientRepo, IntegrityError, SessionRepo, UserRepo } from "#lib/server/db/index.js";
import env from "#lib/server/config.js";
import { issueSessionId } from "#lib/server/crypto.js";
import { AppError } from "#lib/server/errors.js";
import { createChallenge, verifyChallengeAnswer } from "./client";
import { ClientRepo, IntegrityError, SessionRepo, UserRepo } from "#lib/server/db/index.ts";
import env from "#lib/server/config.ts";
import { issueSessionId } from "#lib/server/crypto.ts";
import { AppError } from "#lib/server/errors.ts";
import { createChallenge, verifyChallengeAnswer } from "./client.ts";
const MIN_PASSWORD_LENGTH = 8;
+4 -4
View File
@@ -1,7 +1,7 @@
import { CategoryRepo, FileRepo } from "#lib/server/db/index.js";
import type { Ciphertext } from "#lib/server/db/schema/index.js";
import { AppError } from "#lib/server/errors.js";
import { ensureFreshDekVersion } from "./common";
import { CategoryRepo, FileRepo } from "#lib/server/db/index.ts";
import type { Ciphertext } from "#lib/server/db/schema/index.ts";
import { AppError } from "#lib/server/errors.ts";
import { ensureFreshDekVersion } from "./common.ts";
export const getCategory = async (userId: number, categoryId: CategoryId, recurse: boolean) => {
const category =
+4 -4
View File
@@ -1,7 +1,7 @@
import { ClientRepo } from "#lib/server/db/index.js";
import env from "#lib/server/config.js";
import { generateChallenge, verifyPubKey, verifySignature } from "#lib/server/crypto.js";
import { AppError } from "#lib/server/errors.js";
import { ClientRepo } from "#lib/server/db/index.ts";
import env from "#lib/server/config.ts";
import { generateChallenge, verifyPubKey, verifySignature } from "#lib/server/crypto.ts";
import { AppError } from "#lib/server/errors.ts";
const CHALLENGE_LENGTH = 32;
+1 -1
View File
@@ -1,4 +1,4 @@
import { AppError } from "#lib/server/errors.js";
import { AppError } from "#lib/server/errors.ts";
const DEK_VERSION_TOLERANCE = 60 * 1000; // 1 minute
+5 -5
View File
@@ -1,8 +1,8 @@
import { DirectoryRepo, FileRepo } from "#lib/server/db/index.js";
import type { Ciphertext } from "#lib/server/db/schema/index.js";
import { AppError } from "#lib/server/errors.js";
import { ensureFreshDekVersion } from "./common";
import { schedulePendingFileDeletions } from "./fileDeletion";
import { DirectoryRepo, FileRepo } from "#lib/server/db/index.ts";
import type { Ciphertext } from "#lib/server/db/schema/index.ts";
import { AppError } from "#lib/server/errors.ts";
import { ensureFreshDekVersion } from "./common.ts";
import { schedulePendingFileDeletions } from "./file-deletion.ts";
export const getDirectory = async (userId: number, directoryId: DirectoryId) => {
const directory =
@@ -1,5 +1,5 @@
import { FileDeletionRepo } from "#lib/server/db/index.js";
import { deleteFile } from "#lib/server/storage/index.js";
import { FileDeletionRepo } from "#lib/server/db/index.ts";
import { deleteFile } from "#lib/server/storage/index.ts";
const BATCH_SIZE = 100;
+6 -6
View File
@@ -1,9 +1,9 @@
import { FileRepo, MediaRepo } from "#lib/server/db/index.js";
import type { Ciphertext } from "#lib/server/db/schema/index.js";
import { AppError } from "#lib/server/errors.js";
import { createEncContentStream } from "#lib/server/storage/index.js";
import type { RangeRequest } from "#lib/shared/http.js";
import { schedulePendingFileDeletions } from "./fileDeletion";
import { FileRepo, MediaRepo } from "#lib/server/db/index.ts";
import type { Ciphertext } from "#lib/server/db/schema/index.ts";
import { AppError } from "#lib/server/errors.ts";
import { createEncContentStream } from "#lib/server/storage/index.ts";
import type { RangeRequest } from "#lib/shared/http.ts";
import { schedulePendingFileDeletions } from "./file-deletion.ts";
export const getFile = async (userId: number, fileId: number) => {
const file = await FileRepo.getFile(userId, fileId);
+10 -10
View File
@@ -1,10 +1,10 @@
export * as AuthService from "./auth";
export * as CategoryService from "./category";
export * as ClientService from "./client";
export * as DirectoryService from "./directory";
export * as FileService from "./file";
export * as FileDeletionService from "./fileDeletion";
export * as KeyService from "./key";
export * as SearchService from "./search";
export * as UploadService from "./upload";
export * as UserService from "./user";
export * as AuthService from "./auth.ts";
export * as CategoryService from "./category.ts";
export * as ClientService from "./client.ts";
export * as DirectoryService from "./directory.ts";
export * as FileService from "./file.ts";
export * as FileDeletionService from "./file-deletion.ts";
export * as KeyService from "./key.ts";
export * as SearchService from "./search.ts";
export * as UploadService from "./upload.ts";
export * as UserService from "./user.ts";
+3 -3
View File
@@ -1,6 +1,6 @@
import { ClientRepo, HskRepo, MekRepo } from "#lib/server/db/index.js";
import { verifySignature } from "#lib/server/crypto.js";
import { AppError } from "#lib/server/errors.js";
import { ClientRepo, HskRepo, MekRepo } from "#lib/server/db/index.ts";
import { verifySignature } from "#lib/server/crypto.ts";
import { AppError } from "#lib/server/errors.ts";
export const getClientMeks = async (userId: number, clientId: number) => {
return await MekRepo.getAllValidClientMeks(userId, clientId);
+1 -1
View File
@@ -1,4 +1,4 @@
import { DirectoryRepo, FileRepo } from "#lib/server/db/index.js";
import { DirectoryRepo, FileRepo } from "#lib/server/db/index.ts";
export const search = async (
userId: number,
+6 -6
View File
@@ -1,15 +1,15 @@
import type { Readable } from "stream";
import { db, FileRepo, MediaRepo, UploadRepo } from "#lib/server/db/index.js";
import type { Ciphertext } from "#lib/server/db/schema/index.js";
import { AppError } from "#lib/server/errors.js";
import { db, FileRepo, MediaRepo, UploadRepo } from "#lib/server/db/index.ts";
import type { Ciphertext } from "#lib/server/db/schema/index.ts";
import { AppError } from "#lib/server/errors.ts";
import {
deleteFile,
hashFile,
reserveFile,
writeChunkAtOffset,
} from "#lib/server/storage/index.js";
import { ensureFreshDekVersion } from "./common";
import { schedulePendingFileDeletions } from "./fileDeletion";
} from "#lib/server/storage/index.ts";
import { ensureFreshDekVersion } from "./common.ts";
import { schedulePendingFileDeletions } from "./file-deletion.ts";
const UPLOAD_EXPIRES = 24 * 3600 * 1000; // 24 hours
const THUMBNAIL_CHUNKS = 1; // Up to 4 MiB
+2 -2
View File
@@ -1,5 +1,5 @@
import { UserRepo } from "#lib/server/db/index.js";
import { AppError } from "#lib/server/errors.js";
import { UserRepo } from "#lib/server/db/index.ts";
import { AppError } from "#lib/server/errors.ts";
export const getUser = async (userId: number) => {
const user = await UserRepo.getUser(userId);
+2 -2
View File
@@ -1,7 +1,7 @@
import { open } from "fs/promises";
import type { Readable } from "stream";
import { AppError } from "#lib/server/errors.js";
import { ENCRYPTION_OVERHEAD, ENCRYPTED_CHUNK_SIZE } from "#lib/shared/format/index.js";
import { AppError } from "#lib/server/errors.ts";
import { ENCRYPTION_OVERHEAD, ENCRYPTED_CHUNK_SIZE } from "#lib/shared/format/index.ts";
const invalidChunkSize = () => new AppError("BAD_REQUEST", "Invalid chunk size");
+1 -1
View File
@@ -2,7 +2,7 @@ import { createHash, randomUUID } from "crypto";
import { createReadStream } from "fs";
import { mkdir, open, unlink } from "fs/promises";
import { dirname } from "path";
import env from "#lib/server/config.js";
import env from "#lib/server/config.ts";
const roots = {
library: () => env.libraryPath,
+3 -3
View File
@@ -1,3 +1,3 @@
export * from "./chunks";
export * from "./files";
export * from "./streams";
export * from "./chunks.ts";
export * from "./files.ts";
export * from "./streams.ts";
+2 -2
View File
@@ -1,8 +1,8 @@
import { createReadStream } from "fs";
import { stat } from "fs/promises";
import { Readable } from "stream";
import { AppError } from "#lib/server/errors.js";
import { resolveRange, type RangeRequest } from "#lib/shared/http.js";
import { AppError } from "#lib/server/errors.ts";
import { resolveRange, type RangeRequest } from "#lib/shared/http.ts";
export const createEncContentStream = async (
path: string,