2026-02-21 04:30:36 +00:00
|
|
|
import { z } from 'zod';
|
|
|
|
|
|
|
|
|
|
export const CreateProjectSchema = z.object({
|
|
|
|
|
name: z.string().min(1).max(100).regex(/^[a-z0-9-]+$/, 'Name must be lowercase alphanumeric with hyphens'),
|
|
|
|
|
description: z.string().max(1000).default(''),
|
feat: granular RBAC with resource/operation bindings, users, groups
- Replace admin role with granular roles: view, create, delete, edit, run
- Two binding types: resource bindings (role+resource+optional name) and
operation bindings (role:run + action like backup, logs, impersonate)
- Name-scoped resource bindings for per-instance access control
- Remove role from project members (all permissions via RBAC)
- Add users, groups, RBAC CRUD endpoints and CLI commands
- describe user/group shows all RBAC access (direct + inherited)
- create rbac supports --subject, --binding, --operation flags
- Backup/restore handles users, groups, RBAC definitions
- mcplocal project-based MCP endpoint discovery
- Full test coverage for all new functionality
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 11:05:19 +00:00
|
|
|
proxyMode: z.enum(['direct', 'filtered']).default('direct'),
|
|
|
|
|
llmProvider: z.string().max(100).optional(),
|
|
|
|
|
llmModel: z.string().max(100).optional(),
|
|
|
|
|
servers: z.array(z.string().min(1)).default([]),
|
|
|
|
|
}).refine(
|
|
|
|
|
(d) => d.proxyMode !== 'filtered' || d.llmProvider,
|
|
|
|
|
{ message: 'llmProvider is required when proxyMode is "filtered"' },
|
|
|
|
|
);
|
2026-02-21 04:30:36 +00:00
|
|
|
|
|
|
|
|
export const UpdateProjectSchema = z.object({
|
|
|
|
|
description: z.string().max(1000).optional(),
|
feat: granular RBAC with resource/operation bindings, users, groups
- Replace admin role with granular roles: view, create, delete, edit, run
- Two binding types: resource bindings (role+resource+optional name) and
operation bindings (role:run + action like backup, logs, impersonate)
- Name-scoped resource bindings for per-instance access control
- Remove role from project members (all permissions via RBAC)
- Add users, groups, RBAC CRUD endpoints and CLI commands
- describe user/group shows all RBAC access (direct + inherited)
- create rbac supports --subject, --binding, --operation flags
- Backup/restore handles users, groups, RBAC definitions
- mcplocal project-based MCP endpoint discovery
- Full test coverage for all new functionality
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 11:05:19 +00:00
|
|
|
proxyMode: z.enum(['direct', 'filtered']).optional(),
|
|
|
|
|
llmProvider: z.string().max(100).nullable().optional(),
|
|
|
|
|
llmModel: z.string().max(100).nullable().optional(),
|
|
|
|
|
servers: z.array(z.string().min(1)).optional(),
|
2026-02-21 04:30:36 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
export type CreateProjectInput = z.infer<typeof CreateProjectSchema>;
|
|
|
|
|
export type UpdateProjectInput = z.infer<typeof UpdateProjectSchema>;
|