2026-10-07 08:16:39 +00:00
|
|
|
import { z } from "zod/v4";
|
2026-10-10 10:01:58 +00:00
|
|
|
|
2026-10-07 08:16:39 +00:00
|
|
|
export const SupportValuesSchema = z
|
|
|
|
|
.strictObject({
|
|
|
|
|
toolId: z.uuid(),
|
|
|
|
|
destination: z.string().trim().max(300),
|
|
|
|
|
requiresVpn: z.boolean(),
|
|
|
|
|
preferred: z.boolean(),
|
|
|
|
|
state: z.enum(["pending", "available", "retired"]),
|
|
|
|
|
notes: z.string().trim().max(2000),
|
|
|
|
|
})
|
|
|
|
|
.refine((value) => !value.preferred || value.state === "available");
|
2026-10-10 10:01:58 +00:00
|
|
|
|
2026-10-07 08:16:39 +00:00
|
|
|
export type SupportInput = z.infer<typeof SupportValuesSchema>;
|
2026-10-10 10:01:58 +00:00
|
|
|
|
2026-10-07 08:16:39 +00:00
|
|
|
export const SupportToolInputSchema = z.strictObject({
|
|
|
|
|
name: z.string().trim().min(1).max(100),
|
|
|
|
|
active: z.boolean(),
|
|
|
|
|
});
|
2026-10-10 10:01:58 +00:00
|
|
|
|
2026-10-07 08:16:39 +00:00
|
|
|
export type SupportToolInput = z.infer<typeof SupportToolInputSchema>;
|
2026-10-10 10:01:58 +00:00
|
|
|
|
2026-10-07 08:16:39 +00:00
|
|
|
export class SupportError extends Error {
|
|
|
|
|
constructor(public readonly code: string) {
|
|
|
|
|
super(code);
|
|
|
|
|
}
|
|
|
|
|
}
|