update blueprints

This commit is contained in:
Pallavi Kumari
2025-09-30 23:20:42 +05:30
parent 574cd2a754
commit 664aa6ed2a
2 changed files with 10 additions and 4 deletions

View File

@@ -107,7 +107,9 @@ export async function updateProxyResources(
enabled: targetData.enabled,
internalPort: internalPortToCreate,
path: targetData.path,
pathMatchType: targetData["path-match"]
pathMatchType: targetData["path-match"],
rewritePath: targetData.rewritePath,
rewritePathType: targetData["rewrite-match"]
})
.returning();
@@ -327,7 +329,9 @@ export async function updateProxyResources(
port: targetData.port,
enabled: targetData.enabled,
path: targetData.path,
pathMatchType: targetData["path-match"]
pathMatchType: targetData["path-match"],
rewritePath: targetData.rewritePath,
rewritePathType: targetData["rewrite-match"]
})
.where(eq(targets.targetId, existingTarget.targetId))
.returning();

View File

@@ -14,7 +14,9 @@ export const TargetSchema = z.object({
enabled: z.boolean().optional().default(true),
"internal-port": z.number().int().min(1).max(65535).optional(),
path: z.string().optional(),
"path-match": z.enum(["exact", "prefix", "regex"]).optional().nullable()
"path-match": z.enum(["exact", "prefix", "regex"]).optional().nullable(),
rewritePath: z.string().optional(),
"rewrite-match": z.enum(["exact", "prefix", "regex", "stripPrefix"]).optional().nullable()
});
export type TargetData = z.infer<typeof TargetSchema>;
@@ -183,7 +185,7 @@ export const ClientResourceSchema = z.object({
"proxy-port": z.number().min(1).max(65535),
"hostname": z.string().min(1).max(255),
"internal-port": z.number().min(1).max(65535),
enabled: z.boolean().optional().default(true)
enabled: z.boolean().optional().default(true)
});
// Schema for the entire configuration object