Remove redundant ID Zod overrides (#26633)

This commit is contained in:
Kit Langton
2026-05-09 23:12:21 -04:00
committed by GitHub
parent b3526f6ce9
commit fb4bab8a66
8 changed files with 34 additions and 61 deletions

View File

@@ -1,4 +1,3 @@
import z from "zod"
import { randomBytes } from "crypto"
const prefixes = {
@@ -7,19 +6,12 @@ const prefixes = {
message: "msg",
permission: "per",
question: "que",
user: "usr",
part: "prt",
pty: "pty",
tool: "tool",
workspace: "wrk",
entry: "ent",
account: "act",
} as const
export function schema(prefix: keyof typeof prefixes) {
return z.string().startsWith(prefixes[prefix])
}
const LENGTH = 26
// State for monotonic ID generation