mirror of
https://github.com/versia-pub/server.git
synced 2026-04-28 05:09:16 +02:00
refactor(api): ♻️ Move all client schema code to new package
This commit is contained in:
parent
52602c3da7
commit
3fe07a79b8
128 changed files with 3904 additions and 169 deletions
11
packages/client/schemas/common.ts
Normal file
11
packages/client/schemas/common.ts
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
import { z } from "@hono/zod-openapi";
|
||||
import ISO6391 from "iso-639-1";
|
||||
|
||||
export const Id = z.string().uuid();
|
||||
|
||||
export const iso631 = z.enum(ISO6391.getAllCodes() as [string, ...string[]]);
|
||||
|
||||
export const zBoolean = z
|
||||
.string()
|
||||
.transform((v) => ["true", "1", "on"].includes(v.toLowerCase()))
|
||||
.or(z.boolean());
|
||||
Loading…
Add table
Add a link
Reference in a new issue