mirror of
https://github.com/Dokploy/dokploy
synced 2025-06-26 18:27:59 +00:00
35 lines
934 B
TypeScript
35 lines
934 B
TypeScript
import { z } from "zod";
|
|
|
|
export const deployJobSchema = z.discriminatedUnion("applicationType", [
|
|
z.object({
|
|
applicationId: z.string(),
|
|
titleLog: z.string(),
|
|
descriptionLog: z.string(),
|
|
server: z.boolean().optional(),
|
|
type: z.enum(["deploy", "redeploy"]),
|
|
applicationType: z.literal("application"),
|
|
serverId: z.string().min(1),
|
|
}),
|
|
z.object({
|
|
composeId: z.string(),
|
|
titleLog: z.string(),
|
|
descriptionLog: z.string(),
|
|
server: z.boolean().optional(),
|
|
type: z.enum(["deploy", "redeploy"]),
|
|
applicationType: z.literal("compose"),
|
|
serverId: z.string().min(1),
|
|
}),
|
|
z.object({
|
|
applicationId: z.string(),
|
|
previewDeploymentId: z.string(),
|
|
titleLog: z.string(),
|
|
descriptionLog: z.string(),
|
|
server: z.boolean().optional(),
|
|
type: z.enum(["deploy"]),
|
|
applicationType: z.literal("application-preview"),
|
|
serverId: z.string().min(1),
|
|
}),
|
|
]);
|
|
|
|
export type DeployJob = z.infer<typeof deployJobSchema>;
|