refactor(lib): organize modules by feature

This commit is contained in:
2026-08-02 16:56:55 +07:00 Unverified
parent 6c3b1cab83
commit d513b47d09
58 changed files with 85 additions and 85 deletions
+1 -1
View File
@@ -4,7 +4,7 @@ import { Readable } from "node:stream";
import { pipeline } from "node:stream/promises";
import { randomUUID } from "node:crypto";
import { NextResponse } from "next/server";
import { requireAdmin } from "@/lib/auth";
import { requireAdmin } from "@/lib/auth/auth";
export const dynamic = "force-dynamic";
+2 -2
View File
@@ -1,6 +1,6 @@
import { NextResponse } from "next/server";
import { requireAdmin } from "@/lib/auth";
import { saveVideoUpload } from "@/lib/video-upload-storage";
import { requireAdmin } from "@/lib/auth/auth";
import { saveVideoUpload } from "@/lib/video/video-upload-storage";
export const dynamic = "force-dynamic";
+1 -1
View File
@@ -1,5 +1,5 @@
import NextAuth from "next-auth";
import { authOptions } from "@/lib/auth-options";
import { authOptions } from "@/lib/auth/auth-options";
const handler = NextAuth(authOptions);
export { handler as GET, handler as POST };
+1 -1
View File
@@ -1,6 +1,6 @@
import { NextRequest, NextResponse } from "next/server";
import { cookies } from "next/headers";
import { requireAdmin } from "@/lib/auth";
import { requireAdmin } from "@/lib/auth/auth";
const TIKTOK_OAUTH_STATE_COOKIE = "tiktok-oauth-state";
+1 -1
View File
@@ -1,7 +1,7 @@
import { NextResponse } from "next/server";
import { randomBytes } from "node:crypto";
import { cookies } from "next/headers";
import { requireAdmin } from "@/lib/auth";
import { requireAdmin } from "@/lib/auth/auth";
const TIKTOK_OAUTH_STATE_COOKIE = "tiktok-oauth-state";
+1 -1
View File
@@ -1,6 +1,6 @@
import { cookies } from "next/headers";
import { NextRequest, NextResponse } from "next/server";
import { requireAdmin } from "@/lib/auth";
import { requireAdmin } from "@/lib/auth/auth";
function escapeHtml(value: unknown) {
return String(value ?? "")
+1 -1
View File
@@ -1,7 +1,7 @@
import { randomBytes } from "node:crypto";
import { cookies } from "next/headers";
import { NextResponse } from "next/server";
import { requireAdmin } from "@/lib/auth";
import { requireAdmin } from "@/lib/auth/auth";
const COOKIE = "youtube-oauth-state";
+1 -1
View File
@@ -1,5 +1,5 @@
import { NextResponse } from "next/server";
import { processDueVideoUploads } from "@/lib/video-platforms";
import { processDueVideoUploads } from "@/lib/video/video-platforms";
export const dynamic = "force-dynamic";
+2 -2
View File
@@ -1,8 +1,8 @@
import { NextResponse } from "next/server";
import { db } from "@/db";
import { cdn } from "@/db/schema";
import { requireDiscordId } from "@/lib/auth";
import { validateImageUploadFile, cdnUrl } from "@/lib/cdn-images";
import { requireDiscordId } from "@/lib/auth/auth";
import { validateImageUploadFile, cdnUrl } from "@/lib/cdn/cdn-images";
export async function POST(req: Request) {
let discordId: string;