UPDATE: next16 and minifyjson
Some checks failed
Gitea Auto Deploy / Deploy-Container (push) Failing after 1m25s

This commit is contained in:
2025-11-18 14:09:00 +07:00
parent 99c8ae82f9
commit afdb92cc2d
64 changed files with 748 additions and 2908848 deletions

View File

@@ -13,6 +13,7 @@ export async function GET(
if (!as) {
return NextResponse.json({ error: 'AS info not found' }, { status: 404 })
}
return NextResponse.json(as)
return new NextResponse(JSON.stringify(as), {
headers: { "Content-Type": "application/json" }
});
}

View File

@@ -13,7 +13,9 @@ export async function POST(request: NextRequest, { params }: { params: Promise<{
const asData = await loadAS(asIds, locale);
return NextResponse.json(asData);
return new NextResponse(JSON.stringify(asData), {
headers: { "Content-Type": "application/json" }
});
} catch {
return NextResponse.json({ error: 'Failed to load as data' }, { status: 500 });
}

View File

@@ -14,5 +14,7 @@ export async function GET(
return NextResponse.json({ error: 'Character not found' }, { status: 404 })
}
return NextResponse.json(char)
return new NextResponse(JSON.stringify(char), {
headers: { "Content-Type": "application/json" }
});
}

View File

@@ -6,14 +6,16 @@ export async function POST(request: NextRequest, { params }: { params: Promise<{
const body = await request.json();
const charIds = body.charIds as string[];
const { locale } = await params;
if (!Array.isArray(charIds) || charIds.some(id => typeof id !== 'string')) {
return NextResponse.json({ error: 'Invalid charIds' }, { status: 400 });
}
const characters = await loadCharacters(charIds, locale);
return NextResponse.json(characters);
return new NextResponse(JSON.stringify(characters), {
headers: { "Content-Type": "application/json" }
});
} catch {
return NextResponse.json({ error: 'Failed to load characters' }, { status: 500 });
}

View File

@@ -14,5 +14,7 @@ export async function GET(
return NextResponse.json({ error: 'Lightcone not found' }, { status: 404 })
}
return NextResponse.json(lightcone)
return new NextResponse(JSON.stringify(lightcone), {
headers: { "Content-Type": "application/json" }
});
}

View File

@@ -6,14 +6,16 @@ export async function POST(request: NextRequest, { params }: { params: Promise<{
const body = await request.json();
const lightconeIds = body.lightconeIds as string[];
const { locale } = await params;
if (!Array.isArray(lightconeIds) || lightconeIds.some(id => typeof id !== 'string')) {
return NextResponse.json({ error: 'Invalid lightconeIds' }, { status: 400 });
}
const lightcones = await loadLightcones(lightconeIds, locale);
return NextResponse.json(lightcones);
return new NextResponse(JSON.stringify(lightcones), {
headers: { "Content-Type": "application/json" }
});
} catch {
return NextResponse.json({ error: 'Failed to load lightcones' }, { status: 500 });
}

View File

@@ -14,5 +14,7 @@ export async function GET(
return NextResponse.json({ error: 'MOC info not found' }, { status: 404 })
}
return NextResponse.json(moc)
return new NextResponse(JSON.stringify(moc), {
headers: { "Content-Type": "application/json" }
});
}

View File

@@ -13,7 +13,9 @@ export async function POST(request: NextRequest, { params }: { params: Promise<{
const mocData = await loadMOC(mocIds, locale);
return NextResponse.json(mocData);
return new NextResponse(JSON.stringify(mocData), {
headers: { "Content-Type": "application/json" }
});
} catch {
return NextResponse.json({ error: 'Failed to load moc data' }, { status: 500 });
}

View File

@@ -13,6 +13,7 @@ export async function GET(
if (!monster) {
return NextResponse.json({ error: 'Monster info not found' }, { status: 404 })
}
return NextResponse.json(monster)
return new NextResponse(JSON.stringify(monster), {
headers: { "Content-Type": "application/json" }
});
}

View File

@@ -6,14 +6,16 @@ export async function POST(request: NextRequest, { params }: { params: Promise<{
const body = await request.json();
const monsterIds = body.monsterIds as string[];
const { locale } = await params;
if (!Array.isArray(monsterIds) || monsterIds.some(id => typeof id !== 'string')) {
return NextResponse.json({ error: 'Invalid monsterIds' }, { status: 400 });
}
const monsterData = await loadMonster(monsterIds, locale);
return NextResponse.json(monsterData);
return new NextResponse(JSON.stringify(monsterData), {
headers: { "Content-Type": "application/json" }
});
} catch {
return NextResponse.json({ error: 'Failed to load monster data' }, { status: 500 });
}

View File

@@ -14,5 +14,7 @@ export async function GET(
return NextResponse.json({ error: 'Peak info not found' }, { status: 404 })
}
return NextResponse.json(peak)
return new NextResponse(JSON.stringify(peak), {
headers: { "Content-Type": "application/json" }
});
}

View File

@@ -13,7 +13,9 @@ export async function POST(request: NextRequest, { params }: { params: Promise<{
const peakData = await loadPeak(peakIds, locale);
return NextResponse.json(peakData);
return new NextResponse(JSON.stringify(peakData), {
headers: { "Content-Type": "application/json" }
});
} catch {
return NextResponse.json({ error: 'Failed to load peak data' }, { status: 500 });
}

View File

@@ -14,5 +14,8 @@ export async function GET(
return NextResponse.json({ error: 'PF info not found' }, { status: 404 })
}
return NextResponse.json(pf)
return new NextResponse(JSON.stringify(pf), {
headers: { "Content-Type": "application/json" }
});
}

View File

@@ -6,14 +6,16 @@ export async function POST(request: NextRequest, { params }: { params: Promise<{
const body = await request.json();
const pfIds = body.pfIds as string[];
const { locale } = await params;
if (!Array.isArray(pfIds) || pfIds.some(id => typeof id !== 'string')) {
return NextResponse.json({ error: 'Invalid pfIds' }, { status: 400 });
}
const pfData = await loadPF(pfIds, locale);
return NextResponse.json(pfData);
return new NextResponse(JSON.stringify(pfData), {
headers: { "Content-Type": "application/json" }
});
} catch {
return NextResponse.json({ error: 'Failed to load pf data' }, { status: 500 });
}

View File

@@ -14,5 +14,7 @@ export async function GET(
return NextResponse.json({ error: 'Relic not found' }, { status: 404 })
}
return NextResponse.json(relic)
return new NextResponse(JSON.stringify(relic), {
headers: { "Content-Type": "application/json" }
});
}

View File

@@ -6,14 +6,16 @@ export async function POST(request: NextRequest, { params }: { params: Promise<{
const body = await request.json();
const relicIds = body.relicIds as string[];
const { locale } = await params;
if (!Array.isArray(relicIds) || relicIds.some(id => typeof id !== 'string')) {
return NextResponse.json({ error: 'Invalid relicIds' }, { status: 400 });
}
const relics = await loadRelics(relicIds, locale);
return NextResponse.json(relics);
return new NextResponse(JSON.stringify(relics), {
headers: { "Content-Type": "application/json" }
});
} catch {
return NextResponse.json({ error: 'Failed to load relics' }, { status: 500 });
}

View File

@@ -4,7 +4,9 @@ import { NextResponse } from "next/server";
export async function GET() {
try {
const configMaze = await loadConfigMaze();
return NextResponse.json(configMaze);
return new NextResponse(JSON.stringify(configMaze), {
headers: { "Content-Type": "application/json" }
});
} catch {
return NextResponse.json({ error: 'Failed to load config maze' }, { status: 500 });
}

View File

@@ -4,7 +4,9 @@ import { NextResponse } from "next/server";
export async function GET() {
try {
const mainAffix = await loadMainAffix();
return NextResponse.json(mainAffix);
return new NextResponse(JSON.stringify(mainAffix), {
headers: { "Content-Type": "application/json" }
});
} catch {
return NextResponse.json({ error: 'Failed to load main affix' }, { status: 500 });
}

View File

@@ -4,7 +4,9 @@ import { NextResponse } from "next/server";
export async function GET() {
try {
const subAffix = await loadSubAffix();
return NextResponse.json(subAffix);
return new NextResponse(JSON.stringify(subAffix), {
headers: { "Content-Type": "application/json" }
});
} catch {
return NextResponse.json({ error: 'Failed to load sub affix' }, { status: 500 });
}

View File

@@ -43,7 +43,8 @@ export async function loadAS(charIds: string[], locale: string): Promise<Record<
fs.mkdirSync(DATA_DIR, { recursive: true });
const filePath = getJsonFilePath(locale);
fs.writeFileSync(filePath, JSON.stringify(result, null, 2), 'utf-8');
fs.writeFileSync(filePath, JSON.stringify(result), 'utf-8');
asFileCache[locale] = result;
asMap = result;

View File

@@ -55,7 +55,7 @@ export async function loadCharacters(charIds: string[], locale: string): Promise
fs.mkdirSync(DATA_DIR, { recursive: true });
const filePath = getJsonFilePath(locale);
fs.writeFileSync(filePath, JSON.stringify(result, null, 2), 'utf-8');
fs.writeFileSync(filePath, JSON.stringify(result), 'utf-8');
characterFileCache[locale] = result;
characterMap = result;

View File

@@ -56,7 +56,7 @@ export async function loadLightcones(charIds: string[], locale: string): Promise
fs.mkdirSync(DATA_DIR, { recursive: true });
const filePath = getJsonFilePath(locale);
fs.writeFileSync(filePath, JSON.stringify(result, null, 2), 'utf-8');
fs.writeFileSync(filePath, JSON.stringify(result), 'utf-8');
lightconeFileCache[locale] = result;
lightconeMap = result;

View File

@@ -43,7 +43,7 @@ export async function loadMOC(charIds: string[], locale: string): Promise<Record
fs.mkdirSync(DATA_DIR, { recursive: true });
const filePath = getJsonFilePath(locale);
fs.writeFileSync(filePath, JSON.stringify(result, null, 2), 'utf-8');
fs.writeFileSync(filePath, JSON.stringify(result), 'utf-8');
mocFileCache[locale] = result;
mocMap = result;

View File

@@ -43,7 +43,7 @@ export async function loadMonster(charIds: string[], locale: string): Promise<Re
fs.mkdirSync(DATA_DIR, { recursive: true });
const filePath = getJsonFilePath(locale);
fs.writeFileSync(filePath, JSON.stringify(result, null, 2), 'utf-8');
fs.writeFileSync(filePath, JSON.stringify(result), 'utf-8');
monsterFileCache[locale] = result;
monsterMap = result;

View File

@@ -43,7 +43,7 @@ export async function loadPeak(charIds: string[], locale: string): Promise<Recor
fs.mkdirSync(DATA_DIR, { recursive: true });
const filePath = getJsonFilePath(locale);
fs.writeFileSync(filePath, JSON.stringify(result, null, 2), 'utf-8');
fs.writeFileSync(filePath, JSON.stringify(result), 'utf-8');
peakFileCache[locale] = result;
peakMap = result;

View File

@@ -43,7 +43,7 @@ export async function loadPF(charIds: string[], locale: string): Promise<Record<
fs.mkdirSync(DATA_DIR, { recursive: true });
const filePath = getJsonFilePath(locale);
fs.writeFileSync(filePath, JSON.stringify(result, null, 2), 'utf-8');
fs.writeFileSync(filePath, JSON.stringify(result), 'utf-8');
pfFileCache[locale] = result;
pfMap = result;

View File

@@ -54,7 +54,7 @@ export async function loadRelics(charIds: string[], locale: string): Promise<Rec
fs.mkdirSync(DATA_DIR, { recursive: true });
const filePath = getJsonFilePath(locale);
fs.writeFileSync(filePath, JSON.stringify(result, null, 2), 'utf-8');
fs.writeFileSync(filePath, JSON.stringify(result), 'utf-8');
relicFileCache[locale] = result;
relicMap = result;