agent updates

This commit is contained in:
znetsixe
2026-02-12 10:14:56 +01:00
parent 105a3082ab
commit 1cfb36f604
22 changed files with 649 additions and 23 deletions

View File

@@ -36,8 +36,8 @@ const Logger = require("./logger");
class ValidationUtils {
constructor(IloggerEnabled, IloggerLevel) {
const loggerEnabled = IloggerEnabled || true;
const loggerLevel = IloggerLevel || "warn";
const loggerEnabled = IloggerEnabled ?? true;
const loggerLevel = IloggerLevel ?? "warn";
this.logger = new Logger(loggerEnabled, loggerLevel, 'ValidationUtils');
}
@@ -191,7 +191,7 @@ class ValidationUtils {
continue;
}
if("default" in v){
if(v && typeof v === "object" && "default" in v){
//put the default value in the object
newObj[k] = v.default;
continue;
@@ -496,6 +496,11 @@ class ValidationUtils {
return fieldSchema.default;
}
if (typeof configValue !== "string") {
this.logger.warn(`${name}.${key} is not a valid enum string. Using default value.`);
return fieldSchema.default;
}
const validValues = rules.values.map(e => e.value.toLowerCase());
//remove caps