validation refactoring

This commit is contained in:
Alex Holliday committed 2026-03-01 17:35:00 +00:00
1 parent 0bff26fe47
commit c3a41272a3
23 files changed
+662 -852

No files matched your search

@@ -0,0 +1,34 @@
import joi from "joi";
//****************************************
// Settings Validations
//****************************************
export const updateAppSettingsBodyValidation = joi.object({
checkTTL: joi.number().allow(""),
pagespeedApiKey: joi.string().allow(""),
language: joi.string().allow(""),
timezone: joi.string().allow(""),
showURL: joi.bool().optional(),
systemEmailHost: joi.string().allow(""),
systemEmailPort: joi.number().allow(""),
systemEmailAddress: joi.string().allow(""),
systemEmailPassword: joi.string().allow(""),
systemEmailUser: joi.string().allow(""),
systemEmailConnectionHost: joi.string().allow(""),
systemEmailTLSServername: joi.string().allow(""),
systemEmailSecure: joi.boolean(),
systemEmailPool: joi.boolean(),
systemEmailIgnoreTLS: joi.boolean(),
systemEmailRequireTLS: joi.boolean(),
systemEmailRejectUnauthorized: joi.boolean(),
globalThresholds: joi
.object({
cpu: joi.number().min(1).max(100).allow(""),
memory: joi.number().min(1).max(100).allow(""),
disk: joi.number().min(1).max(100).allow(""),
temperature: joi.number().min(1).max(150).allow(""),
})
.optional(),
});