moved to use regular object
This commit is contained in:
@@ -56,7 +56,7 @@ function bedwarsModeStats() {
|
||||
}
|
||||
}
|
||||
|
||||
export const bedwarsStatsSchema = z.looseObject({
|
||||
export const bedwarsStatsSchema = z.object({
|
||||
Experience: z.number().default(0),
|
||||
coins: z.number().default(0),
|
||||
winstreak: z.number().optional(),
|
||||
@@ -74,7 +74,7 @@ export const bedwarsStatsSchema = z.looseObject({
|
||||
diamond_resources_collected_bedwars: z.number().default(0),
|
||||
emerald_resources_collected_bedwars: z.number().default(0),
|
||||
_items_purchased_bedwars: z.number().default(0),
|
||||
slumber: z.looseObject({
|
||||
slumber: z.object({
|
||||
tickets: z.number().default(0),
|
||||
bag_type: z.string().optional(),
|
||||
total_tickets_earned: z.number().default(0),
|
||||
@@ -114,7 +114,7 @@ function skywarsModeStats() {
|
||||
return Object.fromEntries(entries) as Record<`${typeof stats[number]}_${typeof ids[number]}`, z.ZodDefault<z.ZodNumber>>
|
||||
}
|
||||
|
||||
export const skywarsStatsSchema = z.looseObject({
|
||||
export const skywarsStatsSchema = z.object({
|
||||
skywars_experience: z.number().default(0),
|
||||
selected_prestige_icon: z.string().optional(),
|
||||
kills: z.number().default(0),
|
||||
@@ -158,7 +158,7 @@ export const skywarsStatsSchema = z.looseObject({
|
||||
heads_heavenly: z.number().default(0),
|
||||
heads_ethereal: z.number().default(0),
|
||||
heads_indescribable: z.number().default(0),
|
||||
head_collection: z.looseObject({
|
||||
head_collection: z.object({
|
||||
prestigious: z.array(z.object({
|
||||
username: z.string().nullable().default(null),
|
||||
timestamp: z.number(),
|
||||
@@ -314,7 +314,7 @@ function devisionTitles() {
|
||||
return Object.fromEntries(entries) as Record<`${typeof devisions[number]}_${typeof titles[number]}_title_prestige`, z.ZodDefault<z.ZodNumber>>
|
||||
}
|
||||
|
||||
export const duelsStatsSchema = z.looseObject({
|
||||
export const duelsStatsSchema = z.object({
|
||||
wins: z.number().default(0),
|
||||
losses: z.number().default(0),
|
||||
coins: z.number().default(0),
|
||||
@@ -363,7 +363,7 @@ function murderMysteryModeStats() {
|
||||
return Object.fromEntries(entries) as Record<`${typeof stats[number]}_${typeof ids[number]}`, z.ZodDefault<z.ZodNumber>>
|
||||
}
|
||||
|
||||
export const murderMysteryStatsSchema = z.looseObject({
|
||||
export const murderMysteryStatsSchema = z.object({
|
||||
kills: z.number().default(0),
|
||||
deaths: z.number().default(0),
|
||||
wins: z.number().default(0),
|
||||
@@ -388,7 +388,7 @@ export const murderMysteryStatsSchema = z.looseObject({
|
||||
...murderMysteryModeStats()
|
||||
})
|
||||
|
||||
export const buildBattleStatsSchema = z.looseObject({
|
||||
export const buildBattleStatsSchema = z.object({
|
||||
wins: z.number().default(0),
|
||||
score: z.number().default(0),
|
||||
coins: z.number().default(0),
|
||||
@@ -436,7 +436,7 @@ function uhcModesStats() {
|
||||
return Object.fromEntries(entries) as Record<`${typeof stats[number]}_${typeof ids[number]}`, z.ZodDefault<z.ZodNumber>>
|
||||
}
|
||||
|
||||
export const uhcSchema = z.looseObject({
|
||||
export const uhcSchema = z.object({
|
||||
kills: z.number().default(0),
|
||||
deaths: z.number().default(0),
|
||||
wins: z.number().default(0),
|
||||
@@ -448,8 +448,8 @@ export const uhcSchema = z.looseObject({
|
||||
...uhcModesStats()
|
||||
})
|
||||
|
||||
export const pitStats = z.looseObject({
|
||||
pit_stats_ptl: z.looseObject({
|
||||
export const pitStats = z.object({
|
||||
pit_stats_ptl: z.object({
|
||||
kills: z.number().default(0),
|
||||
deaths: z.number().default(0),
|
||||
cash_earned: z.number().default(0),
|
||||
@@ -488,8 +488,8 @@ export const pitStats = z.looseObject({
|
||||
king_quest_completion: z.number().default(0),
|
||||
sewer_treasures_found: z.number().default(0)
|
||||
}),
|
||||
profile: z.looseObject({
|
||||
prestiges: z.array(z.looseObject({
|
||||
profile: z.object({
|
||||
prestiges: z.array(z.object({
|
||||
index: z.number(),
|
||||
xp_on_prestige: z.number(),
|
||||
timestamp: z.number()
|
||||
@@ -536,7 +536,7 @@ function tntGamesModeStats() {
|
||||
return Object.fromEntries(entries) as Record<`new_${typeof ids[number]}wizard_${typeof stats[number]}`, z.ZodDefault<z.ZodNumber>>
|
||||
}
|
||||
|
||||
export const tntGamesStatsSchema = z.looseObject({
|
||||
export const tntGamesStatsSchema = z.object({
|
||||
wins: z.number().default(0),
|
||||
coins: z.number().default(0),
|
||||
kills_tntag: z.number().default(0),
|
||||
@@ -597,21 +597,21 @@ function megawallsClassStats() {
|
||||
const entries = new Map<string, z.ZodDefault<z.ZodNumber>>()
|
||||
const classes = new Map<
|
||||
string,
|
||||
z.ZodOptional<z.ZodObject<{ prestige: z.ZodDefault<z.ZodNumber>, enderchest_rows: z.ZodDefault<z.ZodNumber> }, z.core.$loose>>
|
||||
z.ZodOptional<z.ZodObject<{ prestige: z.ZodDefault<z.ZodNumber>, enderchest_rows: z.ZodDefault<z.ZodNumber> }>>
|
||||
>()
|
||||
|
||||
for (const id of ids) {
|
||||
for (const stat of stats) {
|
||||
entries.set(`${id}_${stat}`, z.number().default(0))
|
||||
}
|
||||
classes.set(id, z.looseObject({ prestige: z.number().default(0), enderchest_rows: z.number().default(0) }).optional())
|
||||
classes.set(id, z.object({ prestige: z.number().default(0), enderchest_rows: z.number().default(0) }).optional())
|
||||
}
|
||||
|
||||
return {
|
||||
classStats: Object.fromEntries(entries) as Record<`${typeof ids[number]}_${typeof stats[number]}`, z.ZodDefault<z.ZodNumber>>,
|
||||
classOther: Object.fromEntries(classes) as Record<
|
||||
`${typeof ids[number]}`,
|
||||
z.ZodOptional<z.ZodObject<{ prestige: z.ZodDefault<z.ZodNumber>, enderchest_rows: z.ZodDefault<z.ZodNumber> }, z.core.$loose>>
|
||||
z.ZodOptional<z.ZodObject<{ prestige: z.ZodDefault<z.ZodNumber>, enderchest_rows: z.ZodDefault<z.ZodNumber> }>>
|
||||
>
|
||||
}
|
||||
}
|
||||
@@ -641,7 +641,7 @@ function megawallsModeStats() {
|
||||
return Object.fromEntries(entries) as Record<`${typeof stats[number]}_${typeof ids[number]}`, z.ZodDefault<z.ZodNumber>>
|
||||
}
|
||||
|
||||
export const megawallsStats = z.looseObject({
|
||||
export const megawallsStats = z.object({
|
||||
kills: z.number().default(0),
|
||||
assists: z.number().default(0),
|
||||
deaths: z.number().default(0),
|
||||
@@ -655,7 +655,7 @@ export const megawallsStats = z.looseObject({
|
||||
coins: z.number().default(0),
|
||||
wither_damage: z.number().default(0),
|
||||
witherDamage: z.number().default(0),
|
||||
classes: z.looseObject(megawallsClassStats().classOther).optional(),
|
||||
classes: z.object(megawallsClassStats().classOther).optional(),
|
||||
...megawallsClassStats().classStats,
|
||||
...megawallsModeStats()
|
||||
})
|
||||
@@ -694,7 +694,7 @@ function copsAndCrimsGunUpgrades() {
|
||||
return Object.fromEntries(entries) as Record<`${typeof ids[number]}_${typeof upgrades[number]}`, z.ZodDefault<z.ZodNumber>>
|
||||
}
|
||||
|
||||
export const copsAndCrimsStatsSchema = z.looseObject({
|
||||
export const copsAndCrimsStatsSchema = z.object({
|
||||
kills: z.number().default(0),
|
||||
assists: z.number().default(0),
|
||||
deaths: z.number().default(0),
|
||||
@@ -724,7 +724,7 @@ export const copsAndCrimsStatsSchema = z.looseObject({
|
||||
...copsAndCrimsGunUpgrades()
|
||||
})
|
||||
|
||||
const woolGamesClassStats = z.looseObject({
|
||||
const woolGamesClassStats = z.object({
|
||||
kills: z.number().default(0),
|
||||
assists: z.number().default(0),
|
||||
deaths: z.number().default(0),
|
||||
@@ -733,16 +733,16 @@ const woolGamesClassStats = z.looseObject({
|
||||
powerups_gotten: z.number().default(0)
|
||||
})
|
||||
|
||||
export const woolGamesStatsSchema = z.looseObject({
|
||||
export const woolGamesStatsSchema = z.object({
|
||||
wool_wars_prestige_icon: z.string().optional(),
|
||||
playtime: z.number().default(0),
|
||||
coins: z.number().default(0),
|
||||
progression: z.looseObject({
|
||||
progression: z.object({
|
||||
experience: z.number().default(0),
|
||||
available_layers: z.number().default(0)
|
||||
}).optional(),
|
||||
capture_the_wool: z.looseObject({
|
||||
stats: z.looseObject({
|
||||
capture_the_wool: z.object({
|
||||
stats: z.object({
|
||||
kills: z.number().default(0),
|
||||
assits: z.number().default(0),
|
||||
deaths: z.number().default(0),
|
||||
@@ -757,8 +757,8 @@ export const woolGamesStatsSchema = z.looseObject({
|
||||
gold_spent: z.number().default(0)
|
||||
}).optional()
|
||||
}).optional(),
|
||||
sheep_wars: z.looseObject({
|
||||
stats: z.looseObject({
|
||||
sheep_wars: z.object({
|
||||
stats: z.object({
|
||||
kills: z.number().default(0),
|
||||
deaths: z.number().default(0),
|
||||
wins: z.number().default(0),
|
||||
@@ -767,9 +767,9 @@ export const woolGamesStatsSchema = z.looseObject({
|
||||
damage_dealt: z.number().default(0)
|
||||
}).optional()
|
||||
}).optional(),
|
||||
wool_wars: z.looseObject({
|
||||
wool_wars: z.object({
|
||||
selected_class: z.string().optional(),
|
||||
stats: z.looseObject({
|
||||
stats: z.object({
|
||||
kills: z.number().default(0),
|
||||
assits: z.number().default(0),
|
||||
deaths: z.number().default(0),
|
||||
@@ -778,7 +778,7 @@ export const woolGamesStatsSchema = z.looseObject({
|
||||
wool_placed: z.number().default(0),
|
||||
blocks_broken: z.number().default(0),
|
||||
powerups_gotten: z.number().default(0),
|
||||
classes: z.looseObject({
|
||||
classes: z.object({
|
||||
tank: woolGamesClassStats.optional(),
|
||||
archer: woolGamesClassStats.optional(),
|
||||
swordsman: woolGamesClassStats.optional(),
|
||||
|
||||
Reference in New Issue
Block a user