image library changes, bit flags changes

This commit is contained in:
2025-09-16 18:01:55 -04:00
parent 5934f1a91c
commit c4f32b1940
16 changed files with 119 additions and 284 deletions

View File

@@ -4,6 +4,9 @@ import { z } from "zod";
import type { HonoEnv } from "./types.ts";
import { ZodSchema } from "zod/v4";
import { HTTPStatus } from "@oneday/http-status";
import Logging from "@proxnet/undead-logging";
const log = new Logging("Validation");
// thanks claude, this hurt my brain!
@@ -17,7 +20,10 @@ export const typedZValidator = <
recNetError?: string
) => {
return zValidator(target, schema, (result, c) => {
if (!result.success) {
log.w(`Validation failed: ${JSON.stringify(result.error)}`);
if (recNetError) return c.json({ success: false, error: recNetError }, httpOk == true ? HTTPStatus.OK : HTTPStatus.BadRequest);
else return c.json({ success: false, error: "Request validation failed" }, httpOk == true ? HTTPStatus.OK : HTTPStatus.BadRequest);
}