Code Cleanup™

This commit is contained in:
2024-02-11 11:16:23 +01:00
parent 4b27eb76fe
commit 9fd8ddb9bd
62 changed files with 663 additions and 519 deletions

View File

@@ -41,13 +41,13 @@ export const ServerSchema = z.object({
players: z.object({
online: z.number(),
max: z.number(),
sample: z.array(z.any()).optional()
sample: z.array(z.any()).optional(),
}),
version: z.object({
name: z.string(),
protocol: z.number()
protocol: z.number(),
}),
favicon: z.string().optional()
favicon: z.string().optional(),
});
export type Server = z.infer<typeof ServerSchema>;

View File

@@ -24,7 +24,7 @@ export const ListPageSchema = z.object({
name: z.string(),
sha: z.string(),
downloadUrl: z.string().url(),
id: z.number().positive()
id: z.number().positive(),
});
export type ListPage = z.infer<typeof ListPageSchema>;
@@ -40,12 +40,12 @@ export const PageSchema = z.object({
downloadUrl: z.string().url(),
content: z.string(),
size: z.number().gte(0),
id: z.number().positive()
id: z.number().positive(),
});
export type Page = z.infer<typeof PageSchema>;
export type Pages = {
dirs: {[key: string]: Pages},
files: {[key: string]: ListPage}
dirs: { [key: string]: Pages },
files: { [key: string]: ListPage }
}

View File

@@ -22,7 +22,7 @@ import {z} from "zod";
export const PrefixSchema = z.object({
name: z.string().startsWith("PREFIX_"),
colorCode: z.string().length(2).startsWith("§"),
chatPrefix: z.string()
chatPrefix: z.string(),
});
export type Prefix = z.infer<typeof PrefixSchema>;

View File

@@ -29,7 +29,7 @@ export const SchematicSchema = z.object({
lastUpdate: z.number().positive(),
rank: z.number(),
replaceColor: z.boolean(),
allowReplay: z.boolean()
allowReplay: z.boolean(),
});
export type Schematic = z.infer<typeof SchematicSchema>
@@ -37,10 +37,10 @@ export type Schematic = z.infer<typeof SchematicSchema>
export const SchematicListSchema = z.object({
breadcrumbs: z.array(z.object({
name: z.string(),
id: z.number()
id: z.number(),
})),
schematics: z.array(SchematicSchema),
players: z.record(z.string(), PlayerSchema)
players: z.record(z.string(), PlayerSchema),
});
export type SchematicList = z.infer<typeof SchematicListSchema>
@@ -48,7 +48,7 @@ export type SchematicList = z.infer<typeof SchematicListSchema>
export const SchematicInfoSchema = z.object({
members: z.array(PlayerSchema),
path: z.string(),
schem: SchematicSchema
schem: SchematicSchema,
});
export type SchematicInfo = z.infer<typeof SchematicInfoSchema>
@@ -56,7 +56,7 @@ export type SchematicInfo = z.infer<typeof SchematicInfoSchema>
export const SchematicCodeSchema = z.object({
id: z.number().gte(0),
code: z.string(),
expires: z.number().positive()
expires: z.number().positive(),
});
export type SchematicCode = z.infer<typeof SchematicCodeSchema>

View File

@@ -39,7 +39,7 @@ export const UserStatsSchema = z.object({
eventParticipation: z.number(),
acceptedSchematics: z.number(),
fights: z.number(),
playtime: z.number()
playtime: z.number(),
});
export type UserStats = z.infer<typeof UserStatsSchema>;