Coordinator and worker come from bots.kind; bot_types now only holds workspace_admin (was admin), each row naming its workspace, with no scope field. Rows from v0.2.8 and earlier are fixed at boot by migrateBotTypes. Co-Authored-By: Claude Opus 5.5 <[email protected]>
15 lines
484 B
TypeScript
15 lines
484 B
TypeScript
import { z } from "zod";
|
|
|
|
/**
|
|
* Giving a bot a workspace type, or taking it away: today, making it the
|
|
* workspace's admin.
|
|
*/
|
|
export const SetBotTypeRequestSchema = z.object({
|
|
bot_id: z.coerce.number().int().positive("Pick a bot"),
|
|
workspace_id: z.coerce.number().int().positive("Pick a workspace"),
|
|
bot_type: z.enum(["workspace_admin"]).default("workspace_admin"),
|
|
given: z.boolean(),
|
|
});
|
|
|
|
export type SetBotTypeRequest = z.infer<typeof SetBotTypeRequestSchema>;
|