feat(mcp): подготовить сервер и доступ к приёмке
This commit is contained in:
commit
bf3d50e1ff
3835 files changed
+537122
No files matched your search
@@ -0,0 +1,21 @@
|
||||
import { z } from "zod"
|
||||
|
||||
export const vxlanResponseSchema = z.object({
|
||||
tunnels: z.array(z.object({
|
||||
id: z.string().min(1), name: z.string().min(1), serverId: z.string().min(1),
|
||||
vni: z.number().int().min(0).max(16777215),
|
||||
port: z.number().int().min(0).max(65535), dstPort: z.number().int().min(1).max(65535),
|
||||
vtepIp: z.string(), remoteVteps: z.array(z.string()), l2mtu: z.number().int().nonnegative().nullable(),
|
||||
mtu: z.number().int().min(1).max(65535).optional(),
|
||||
arpProxy: z.boolean(), arpMode: z.enum(["disabled", "enabled", "local-proxy-arp", "proxy-arp", "reply-only"]).optional(), macLearning: z.boolean(), comment: z.string(), enabled: z.boolean(),
|
||||
status: z.enum(["up", "down"]),
|
||||
})).refine(rows => new Set(rows.map(row => JSON.stringify([row.serverId, row.id]))).size === rows.length && rows.every(row => row.arpMode === undefined || row.arpProxy === (row.arpMode === "proxy-arp" || row.arpMode === "local-proxy-arp"))),
|
||||
failures: z.array(z.object({ serverId: z.string().trim().min(1), serverName: z.string().optional(), error: z.string() })).default([]),
|
||||
}).refine(data => new Set(data.failures.map(f => f.serverId)).size === data.failures.length && !data.tunnels.some(t => data.failures.some(f => f.serverId === t.serverId)))
|
||||
|
||||
export const vxlanServersSchema = z.array(z.object({
|
||||
id: z.number().int().positive(), name: z.string(), host: z.string(), country: z.string(), enabled: z.boolean(),
|
||||
type: z.enum(["jump-host", "exit-node", "home-router"]).optional(), site: z.string().optional(),
|
||||
asn: z.string().optional(), status: z.enum(["online", "offline", "degraded"]).nullable().optional(),
|
||||
latency: z.number().finite().nullable().optional(),
|
||||
})).refine(rows => new Set(rows.map(row => row.id)).size === rows.length)
|
||||
Reference in new issue
Block a user