feat : update
CI / Verify (push) Successful in 1m14s
CI / Build immutable images and deploy (push) Successful in 3m18s

This commit is contained in:
2026-09-06 15:58:11 +07:00 Unverified
parent de76a27c86
commit 5f6b8c1059
11 changed files with 3934 additions and 21 deletions
+17 -4
View File
@@ -24,6 +24,8 @@ export interface CatalogAscensionGroup {
items: CatalogAscensionMaterial[];
}
export type CatalogLevelingGroup = CatalogAscensionGroup;
export interface CatalogMaterial {
key: string;
name: string;
@@ -50,10 +52,13 @@ const skillSchema = z.object({
icon: z.string(),
});
const attributeSchema = z.record(z.string(), z.union([z.number(), z.string()]));
export const characterDetailSchema = z.object({
info: z.object({
element: z.string().optional(),
weapon: z.string().optional(),
attributes: z.array(attributeSchema).nullish(),
}).nullish(),
constellations: z.record(z.string(), constellationSchema).nullish(),
skills: z.object({
@@ -65,9 +70,8 @@ export const characterDetailSchema = z.object({
z.string(),
z.union([z.number().int(), z.record(z.string(), z.number().int())]),
).nullish(),
attributes: z.array(
z.record(z.string(), z.union([z.number(), z.string()])),
).nullish(),
leveling: z.record(z.string(), z.record(z.string(), z.number().int())).nullish(),
attributes: z.array(attributeSchema).nullish(),
});
export function cleanLunarisText(value: string): string {
@@ -150,10 +154,19 @@ export function ascensionSnapshot(
}));
}
export function levelingSnapshot(
value: z.infer<typeof characterDetailSchema>,
): CatalogLevelingGroup[] {
return Object.entries(value.leveling ?? {}).map(([type, entries]) => ({
type,
items: Object.entries(entries).map(([key, amount]) => ({ key, amount })),
}));
}
export function baseStatsSnapshot(
value: z.infer<typeof characterDetailSchema>,
): CatalogBaseStat[] {
const level90 = value.attributes?.find((entry) => entry.level === 90);
const level90 = (value.info?.attributes ?? value.attributes)?.find((entry) => entry.level === 90);
if (!level90) return [];
return Object.entries(level90)
.filter(([key]) => key !== "level" && key !== "ascension")