Add permission-scoped MCP, readiness checks, and management UI improvements
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
import { z } from "zod";
|
||||
|
||||
export const createAssistantTokenInputSchema = z.object({
|
||||
name: z.string().trim().min(1).max(80),
|
||||
permissions: z.array(z.string().min(1).max(80)).min(1).max(64),
|
||||
readOnly: z.boolean().default(true),
|
||||
days: z.number().int().min(1).max(365).default(30),
|
||||
});
|
||||
@@ -201,6 +201,7 @@ export const moderatePhotoInputSchema = z.object({
|
||||
});
|
||||
|
||||
export const moderateSubmissionInputSchema = z.object({
|
||||
eventId: z.string().uuid(),
|
||||
submissionId: z.string().uuid(),
|
||||
visibility: photoVisibilitySchema,
|
||||
});
|
||||
@@ -273,3 +274,4 @@ export type EventCreatePolicy = z.infer<typeof eventCreatePolicySchema>;
|
||||
export type PhotoProcessingStatus = z.infer<typeof photoProcessingStatusSchema>;
|
||||
export type PhotoVisibility = z.infer<typeof photoVisibilitySchema>;
|
||||
export type AllowedImageType = z.infer<typeof allowedImageTypeSchema>;
|
||||
export { createAssistantTokenInputSchema } from "./assistant";
|
||||
|
||||
@@ -2,9 +2,9 @@ import { expect, test } from "bun:test";
|
||||
import { savedSignSchema } from "./sign";
|
||||
|
||||
test("dragged headline positions persist and reject invalid coordinates", () => {
|
||||
const base = { title: "Wedding", headline: "Share", message: "Welcome", paper: "card6x4", ink: "black" };
|
||||
const base = { title: "Wedding", headline: "Share", message: "Welcome", paper: "card6x4", ink: "black" } as const;
|
||||
expect(savedSignSchema.parse(base).headlinePosition).toBeUndefined();
|
||||
const moved = { ...base, headlinePosition: { x: 12.5, y: 14, width: 42, height: 28 }, headlineAlign: "center", headlineVerticalAlign: "middle" };
|
||||
const moved = { ...base, headlinePosition: { x: 12.5, y: 14, width: 42, height: 28 }, headlineAlign: "center", headlineVerticalAlign: "middle" } as const;
|
||||
expect(savedSignSchema.parse(JSON.parse(JSON.stringify(moved)))).toEqual(moved);
|
||||
for (const headlinePosition of [{ x: -1, y: 0 }, { x: 0, y: 101 }, { x: NaN, y: 2 }, { x: 1, y: Infinity }, { x: "5", y: 0 }, { x: 0, y: 0, z: 2 }]) {
|
||||
expect(savedSignSchema.safeParse({ ...base, headlinePosition }).success).toBe(false);
|
||||
@@ -15,7 +15,7 @@ test("dragged headline positions persist and reject invalid coordinates", () =>
|
||||
});
|
||||
|
||||
test("text sizing survives saved design round trips and rejects invalid scales", () => {
|
||||
const base = { title: "Event", headline: "Share", message: "Welcome", paper: "letter", ink: "indigo" };
|
||||
const base = { title: "Event", headline: "Share", message: "Welcome", paper: "letter", ink: "indigo" } as const;
|
||||
expect(savedSignSchema.parse(base).headlineScale).toBeUndefined();
|
||||
const sized = { ...base, headlineScale: 150, messageScale: 125, titleScale: 75, showUrl: false };
|
||||
expect(savedSignSchema.parse(JSON.parse(JSON.stringify(sized)))).toEqual(sized);
|
||||
|
||||
Reference in New Issue
Block a user