perf upgrade

This commit is contained in:
yohlo
2026-07-12 21:26:16 -07:00
parent ec334bbed4
commit 778f0f7994
74 changed files with 1522 additions and 1014 deletions
+16 -16
View File
@@ -17,14 +17,14 @@ export const listTournaments = createServerFn()
);
export const createTournament = createServerFn()
.inputValidator(tournamentInputSchema)
.validator(tournamentInputSchema)
.middleware([superTokensAdminFunctionMiddleware, serverFnLoggingMiddleware])
.handler(async ({ data }) =>
toServerResult(() => pbAdmin.createTournament(data))
);
export const updateTournament = createServerFn()
.inputValidator(z.object({
.validator(z.object({
id: z.string(),
updates: tournamentInputSchema.partial()
}))
@@ -34,7 +34,7 @@ export const updateTournament = createServerFn()
);
export const getTournament = createServerFn()
.inputValidator(z.string())
.validator(z.string())
.middleware([superTokensFunctionMiddleware])
.handler(async ({ data: tournamentId, context }) => {
const isAdmin = context.roles.includes("Admin");
@@ -47,7 +47,7 @@ export const getCurrentTournament = createServerFn()
);
export const enrollTeam = createServerFn()
.inputValidator(z.object({
.validator(z.object({
tournamentId: z.string(),
teamId: z.string()
}))
@@ -81,7 +81,7 @@ export const enrollTeam = createServerFn()
);
export const unenrollTeam = createServerFn()
.inputValidator(z.object({
.validator(z.object({
tournamentId: z.string(),
teamId: z.string()
}))
@@ -91,21 +91,21 @@ export const unenrollTeam = createServerFn()
);
export const getUnenrolledTeams = createServerFn()
.inputValidator(z.string())
.validator(z.string())
.middleware([superTokensAdminFunctionMiddleware])
.handler(async ({ data: tournamentId }) =>
toServerResult(() => pbAdmin.getUnenrolledTeams(tournamentId))
);
export const getFreeAgents = createServerFn()
.inputValidator(z.string())
.validator(z.string())
.middleware([superTokensFunctionMiddleware])
.handler(async ({ data: tournamentId }) =>
toServerResult(() => pbAdmin.getFreeAgents(tournamentId))
);
export const enrollFreeAgent = createServerFn()
.inputValidator(z.object({ phone: z.string(), tournamentId: z.string() }))
.validator(z.object({ phone: z.string(), tournamentId: z.string() }))
.middleware([superTokensFunctionMiddleware, serverFnLoggingMiddleware])
.handler(async ({ context, data }) =>
toServerResult(async () => {
@@ -119,7 +119,7 @@ export const enrollFreeAgent = createServerFn()
);
export const unenrollFreeAgent = createServerFn()
.inputValidator(z.object({ tournamentId: z.string() }))
.validator(z.object({ tournamentId: z.string() }))
.middleware([superTokensFunctionMiddleware, serverFnLoggingMiddleware])
.handler(async ({ context, data }) =>
toServerResult(async () => {
@@ -133,7 +133,7 @@ export const unenrollFreeAgent = createServerFn()
);
export const generateRandomTeams = createServerFn()
.inputValidator(z.object({
.validator(z.object({
tournamentId: z.string(),
seed: z.number().optional()
}))
@@ -313,7 +313,7 @@ export const generateRandomTeams = createServerFn()
);
export const confirmTeamAssignments = createServerFn()
.inputValidator(z.object({
.validator(z.object({
tournamentId: z.string(),
assignments: z.array(z.object({
player1Id: z.string(),
@@ -503,14 +503,14 @@ async function calculateGroupStandings(groupId: string): Promise<GroupStanding[]
}
export const getGroupStandings = createServerFn()
.inputValidator(z.string())
.validator(z.string())
.middleware([superTokensFunctionMiddleware])
.handler(async ({ data: groupId }) =>
toServerResult(() => calculateGroupStandings(groupId))
);
export const generateKnockoutBracket = createServerFn()
.inputValidator(z.object({
.validator(z.object({
tournamentId: z.string(),
}))
.middleware([superTokensAdminFunctionMiddleware, serverFnLoggingMiddleware])
@@ -711,7 +711,7 @@ export const generateKnockoutBracket = createServerFn()
);
export const adminEnrollPlayer = createServerFn()
.inputValidator(z.object({
.validator(z.object({
playerId: z.string(),
tournamentId: z.string()
}))
@@ -724,7 +724,7 @@ export const adminEnrollPlayer = createServerFn()
);
export const adminUnenrollPlayer = createServerFn()
.inputValidator(z.object({
.validator(z.object({
playerId: z.string(),
tournamentId: z.string()
}))
@@ -737,7 +737,7 @@ export const adminUnenrollPlayer = createServerFn()
);
export const generateGroupStage = createServerFn()
.inputValidator(z.object({
.validator(z.object({
tournamentId: z.string(),
groupConfig: z.object({
num_groups: z.number(),