mirror of
https://github.com/fosrl/pangolin.git
synced 2026-03-02 16:56:39 +00:00
use strict zod objects and hide proto on targets
This commit is contained in:
@@ -15,13 +15,15 @@ const createSiteParamsSchema = z.object({
|
||||
orgId: z.string(),
|
||||
});
|
||||
|
||||
const createSiteSchema = z.object({
|
||||
name: z.string().min(1).max(255),
|
||||
exitNodeId: z.number().int().positive(),
|
||||
subdomain: z.string().min(1).max(255).optional(),
|
||||
pubKey: z.string(),
|
||||
subnet: z.string(),
|
||||
});
|
||||
const createSiteSchema = z
|
||||
.object({
|
||||
name: z.string().min(1).max(255),
|
||||
exitNodeId: z.number().int().positive(),
|
||||
subdomain: z.string().min(1).max(255).optional(),
|
||||
pubKey: z.string(),
|
||||
subnet: z.string(),
|
||||
})
|
||||
.strict();
|
||||
|
||||
export type CreateSiteResponse = {
|
||||
name: string;
|
||||
|
||||
@@ -23,6 +23,7 @@ const updateSiteBodySchema = z
|
||||
megabytesIn: z.number().int().nonnegative().optional(),
|
||||
megabytesOut: z.number().int().nonnegative().optional(),
|
||||
})
|
||||
.strict()
|
||||
.refine((data) => Object.keys(data).length > 0, {
|
||||
message: "At least one field must be provided for update",
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user