Added first
This commit is contained in:
@@ -1,5 +1,13 @@
|
||||
import z from "zod"
|
||||
import { bedwarsStatsSchema, buildBattleStatsSchema, duelsStatsSchema, murderMysteryStatsSchema, skywarsStatsSchema, uhcSchema } from "./stats"
|
||||
import {
|
||||
bedwarsStatsSchema,
|
||||
buildBattleStatsSchema,
|
||||
duelsStatsSchema,
|
||||
murderMysteryStatsSchema,
|
||||
pitStats,
|
||||
skywarsStatsSchema,
|
||||
uhcSchema
|
||||
} from "./stats"
|
||||
|
||||
export const playerSchema = z.looseObject({
|
||||
player: z.looseObject({
|
||||
@@ -19,7 +27,8 @@ export const playerSchema = z.looseObject({
|
||||
Duels: duelsStatsSchema.optional(),
|
||||
MurderMystery: murderMysteryStatsSchema.optional(),
|
||||
BuildBattle: buildBattleStatsSchema.optional(),
|
||||
UHC: uhcSchema.optional()
|
||||
UHC: uhcSchema.optional(),
|
||||
Pit: pitStats.optional()
|
||||
}).optional(),
|
||||
quests: z.record(
|
||||
z.string(),
|
||||
|
||||
@@ -445,3 +445,22 @@ export const uhcSchema = z.looseObject({
|
||||
ultimates_crafted_solo: z.number().default(0),
|
||||
...uhcModesStats()
|
||||
})
|
||||
|
||||
export const pitStats = z.looseObject({
|
||||
pit_stats_ptl: z.looseObject({
|
||||
kills: z.number().default(0),
|
||||
deaths: z.number().default(0)
|
||||
}),
|
||||
profile: z.looseObject({
|
||||
prestiges: z.array(z.looseObject({
|
||||
index: z.number(),
|
||||
xp_on_prestige: z.number(),
|
||||
timestamp: z.number()
|
||||
})),
|
||||
xp: z.number().default(0)
|
||||
})
|
||||
}).transform(({ profile, pit_stats_ptl, ...rest }) => ({
|
||||
profile,
|
||||
...pit_stats_ptl,
|
||||
...rest
|
||||
}))
|
||||
|
||||
Reference in New Issue
Block a user