Merge pull request #3898 from Dokploy/3850-zod-validation-on-undefined-default-values

feat: add enableSubmodules and update watchPaths in application schema
This commit is contained in:
Mauricio Siu
2026-03-05 10:49:47 -06:00
committed by GitHub
+12 -13
View File
@@ -365,12 +365,13 @@ const createSchema = createInsertSchema(applications, {
previewPath: z.string().optional(), previewPath: z.string().optional(),
previewCertificateType: z.enum(["letsencrypt", "none", "custom"]).optional(), previewCertificateType: z.enum(["letsencrypt", "none", "custom"]).optional(),
previewRequireCollaboratorPermissions: z.boolean().optional(), previewRequireCollaboratorPermissions: z.boolean().optional(),
watchPaths: z.array(z.string()).optional(), watchPaths: z.array(z.string()).optional().optional(),
previewLabels: z.array(z.string()).optional(), previewLabels: z.array(z.string()).optional(),
cleanCache: z.boolean().optional(), cleanCache: z.boolean().optional(),
stopGracePeriodSwarm: z.bigint().nullable(), stopGracePeriodSwarm: z.bigint().nullable(),
endpointSpecSwarm: EndpointSpecSwarmSchema.nullable(), endpointSpecSwarm: EndpointSpecSwarmSchema.nullable(),
ulimitsSwarm: UlimitsSwarmSchema.nullable(), ulimitsSwarm: UlimitsSwarmSchema.nullable(),
enableSubmodules: z.boolean().optional(),
}); });
export const apiCreateApplication = createSchema.pick({ export const apiCreateApplication = createSchema.pick({
@@ -433,13 +434,13 @@ export const apiSaveGithubProvider = createSchema
owner: true, owner: true,
buildPath: true, buildPath: true,
githubId: true, githubId: true,
watchPaths: true,
enableSubmodules: true,
}) })
.required() .required()
.extend({ .extend({
triggerType: z.enum(["push", "tag"]).default("push"), triggerType: z.enum(["push", "tag"]).default("push"),
}); })
.required()
.merge(createSchema.pick({ enableSubmodules: true, watchPaths: true }));
export const apiSaveGitlabProvider = createSchema export const apiSaveGitlabProvider = createSchema
.pick({ .pick({
@@ -451,10 +452,9 @@ export const apiSaveGitlabProvider = createSchema
gitlabId: true, gitlabId: true,
gitlabProjectId: true, gitlabProjectId: true,
gitlabPathNamespace: true, gitlabPathNamespace: true,
watchPaths: true,
enableSubmodules: true,
}) })
.required(); .required()
.merge(createSchema.pick({ enableSubmodules: true, watchPaths: true }));
export const apiSaveBitbucketProvider = createSchema export const apiSaveBitbucketProvider = createSchema
.pick({ .pick({
@@ -465,10 +465,9 @@ export const apiSaveBitbucketProvider = createSchema
bitbucketRepositorySlug: true, bitbucketRepositorySlug: true,
bitbucketId: true, bitbucketId: true,
applicationId: true, applicationId: true,
watchPaths: true,
enableSubmodules: true,
}) })
.required(); .required()
.merge(createSchema.pick({ enableSubmodules: true, watchPaths: true }));
export const apiSaveGiteaProvider = createSchema export const apiSaveGiteaProvider = createSchema
.pick({ .pick({
@@ -478,10 +477,9 @@ export const apiSaveGiteaProvider = createSchema
giteaOwner: true, giteaOwner: true,
giteaRepository: true, giteaRepository: true,
giteaId: true, giteaId: true,
watchPaths: true,
enableSubmodules: true,
}) })
.required(); .required()
.merge(createSchema.pick({ enableSubmodules: true, watchPaths: true }));
export const apiSaveDockerProvider = createSchema export const apiSaveDockerProvider = createSchema
.pick({ .pick({
@@ -506,6 +504,7 @@ export const apiSaveGitProvider = createSchema
.merge( .merge(
createSchema.pick({ createSchema.pick({
customGitSSHKeyId: true, customGitSSHKeyId: true,
enableSubmodules: true,
}), }),
); );