···11-// Shitty file to help with automatically generating endpoint bindings so that we can dump them to the
11+// Mediocre file to help with automatically generating endpoint bindings so that we can dump them to the
22// Cloudflare WAF to protect/log against abuse
33import { Context, Hono } from "hono";
44import { describeRoute, resolver, validator } from "hono-openapi";
55import { ContextVariables } from "../auth";
66import { Bindings } from "../types";
77-import { AccountDeleteSchema, AccountForgotSchema, CheckCallbackParam, PasswordResetPart } from "../validation/accountForgotDeleteSchema";
88-import { AccountResetSchema } from "../validation/accountResetSchema";
77+import { AccountDeleteSchema, AccountForgotSchema } from "../validation/accountForgotDeleteSchema";
88+import {
99+ AccountResetSchema, PasswordResetCheckCallbackParam,
1010+ PasswordResetTokenParam
1111+} from "../validation/accountResetSchema";
912import { AccountUpdateSchema } from "../validation/accountUpdateSchema";
1013import { LoginSchema } from "../validation/loginSchema";
1114import { FileDeleteSchema } from "../validation/mediaSchema";
1215import { EditSchema, PostSchema } from "../validation/postSchema";
1316import { RepostSchema } from "../validation/repostSchema";
1414-import { CheckGUIDSchema, CreateResponseSchema, FileOperationResponseSchema, GenericResponseSchema } from "../validation/responseSchema";
1717+import {
1818+ CheckFileSchema, CheckGUIDSchema, CreateResponseSchema,
1919+ FileOperationResponseSchema, GenericResponseSchema
2020+} from "../validation/responseSchema";
1521import { SignupSchema } from "../validation/signupSchema";
16221723export const openapiRoutes = new Hono<{ Bindings: Bindings, Variables: ContextVariables }>();
···408414409415openapiRoutes.get("/preview/file/:id", describeRoute({
410416 description: "preview a file",
411411-}), validator("param", CheckGUIDSchema));
417417+}), validator("param", CheckFileSchema));
412418413419openapiRoutes.get("/api/auth/reset-password/:id", describeRoute({
414420 description: "resets a password"
415415-}), validator("param", PasswordResetPart), validator("query", CheckCallbackParam));421421+}), validator("param", PasswordResetTokenParam), validator("query", PasswordResetCheckCallbackParam));
···11+// Everything in this file is used for OpenAPI route generation.
22+//
33+// This can be the generally expected results for most endpoints
44+// but not all.
15import * as z from "zod/v4";
26import { fileKeyRegex } from "./regexCases";
37