refactor: update database imports to use centralized db module for improved consistency across API routes and schemas

This commit is contained in:
Mauricio Siu
2026-02-24 19:00:30 -06:00
parent b027d21589
commit b2218efce6
39 changed files with 225 additions and 220 deletions
+76 -50
View File
@@ -126,62 +126,88 @@ const schema = createInsertSchema(deployments, {
previewDeploymentId: z.string(),
buildServerId: z.string(),
});
export const apiCreateDeployment = z.object({
title: z.string().min(1),
status: z.string().default("running"),
logPath: z.string().min(1),
applicationId: z.string().min(1),
description: z.string().optional(),
previewDeploymentId: z.string().optional(),
});
export const apiCreateDeployment = schema
.pick({
title: true,
status: true,
logPath: true,
applicationId: true,
description: true,
previewDeploymentId: true,
})
.extend({
applicationId: z.string().min(1),
});
export const apiCreateDeploymentPreview = z.object({
title: z.string().min(1),
status: z.string().default("running"),
logPath: z.string().min(1),
description: z.string().optional(),
previewDeploymentId: z.string().min(1),
});
export const apiCreateDeploymentPreview = schema
.pick({
title: true,
status: true,
logPath: true,
description: true,
previewDeploymentId: true,
})
.extend({
previewDeploymentId: z.string().min(1),
});
export const apiCreateDeploymentCompose = z.object({
title: z.string().min(1),
status: z.string().default("running"),
logPath: z.string().min(1),
composeId: z.string().min(1),
description: z.string().optional(),
});
export const apiCreateDeploymentCompose = schema
.pick({
title: true,
status: true,
logPath: true,
composeId: true,
description: true,
})
.extend({
composeId: z.string().min(1),
});
export const apiCreateDeploymentBackup = z.object({
title: z.string().min(1),
status: z.string().default("running"),
logPath: z.string().min(1),
backupId: z.string().min(1),
description: z.string().optional(),
});
export const apiCreateDeploymentBackup = schema
.pick({
title: true,
status: true,
logPath: true,
backupId: true,
description: true,
})
.extend({
backupId: z.string().min(1),
});
export const apiCreateDeploymentServer = z.object({
title: z.string().min(1),
status: z.string().default("running"),
logPath: z.string().min(1),
serverId: z.string().min(1),
description: z.string().optional(),
});
export const apiCreateDeploymentServer = schema
.pick({
title: true,
status: true,
logPath: true,
serverId: true,
description: true,
})
.extend({
serverId: z.string().min(1),
});
export const apiCreateDeploymentSchedule = z.object({
title: z.string().min(1),
status: z.string().default("running"),
logPath: z.string().min(1),
description: z.string().optional(),
scheduleId: z.string().min(1),
});
export const apiCreateDeploymentSchedule = schema
.pick({
title: true,
status: true,
logPath: true,
description: true,
})
.extend({
scheduleId: z.string().min(1),
});
export const apiCreateDeploymentVolumeBackup = z.object({
title: z.string().min(1),
status: z.string().default("running"),
logPath: z.string().min(1),
description: z.string().optional(),
volumeBackupId: z.string().min(1),
});
export const apiCreateDeploymentVolumeBackup = schema
.pick({
title: true,
status: true,
logPath: true,
description: true,
})
.extend({
volumeBackupId: z.string().min(1),
});
export const apiFindAllByApplication = z.object({
applicationId: z.string().min(1),