Files
kai 2c40721490
release / which version (push) Successful in 1s
release / olares chart · sanity (push) Successful in 5s
release / app (push) Successful in 1m9s
release / tag and release (push) Successful in 2s
Teen role with own passkey, pictures for older children (26.11.19) (#20)
2026-11-07 06:50:03 +00:00

25 lines
700 B
TypeScript

import { z } from "zod";
const name = z.string().trim().min(1).max(60);
export const setupOptionsBody = z.object({
code: z.string().min(1).max(64),
name,
household: z.string().trim().min(1).max(80),
});
export const challengeBody = z.object({
challengeId: z.string().uuid(),
response: z.object({ id: z.string().min(1).max(1024) }).passthrough(),
});
export const inviteOptionsBody = z.object({
token: z.string().min(20).max(100),
name: name.optional(),
});
export const createInvitationBody = z.discriminatedUnion("kind", [
z.object({ kind: z.literal("person"), name, role: z.enum(["member", "admin", "teen"]).default("member") }),
z.object({ kind: z.literal("device") }),
]);