fix(core): tidy formatting and minor fixes across CLI, SNMP, HTTP server, migrations and packaging
This commit is contained in:
@@ -197,7 +197,11 @@ export class NupstSnmp {
|
||||
const levelName = Object.keys(snmp.SecurityLevel).find((key) =>
|
||||
snmp.SecurityLevel[key] === user.level
|
||||
);
|
||||
logger.dim(`SNMPv3 user configuration: name=${user.name}, level=${levelName}, authProtocol=${user.authProtocol ? 'Set' : 'Not Set'}, privProtocol=${user.privProtocol ? 'Set' : 'Not Set'}`);
|
||||
logger.dim(
|
||||
`SNMPv3 user configuration: name=${user.name}, level=${levelName}, authProtocol=${
|
||||
user.authProtocol ? 'Set' : 'Not Set'
|
||||
}, privProtocol=${user.privProtocol ? 'Set' : 'Not Set'}`,
|
||||
);
|
||||
}
|
||||
|
||||
session = snmp.createV3Session(config.host, user, options);
|
||||
@@ -259,7 +263,9 @@ export class NupstSnmp {
|
||||
}
|
||||
|
||||
if (this.debug) {
|
||||
logger.dim(`SNMP response: oid=${varbinds[0].oid}, type=${varbinds[0].type}, value=${value}`);
|
||||
logger.dim(
|
||||
`SNMP response: oid=${varbinds[0].oid}, type=${varbinds[0].type}, value=${value}`,
|
||||
);
|
||||
}
|
||||
|
||||
resolve(value);
|
||||
@@ -496,7 +502,9 @@ export class NupstSnmp {
|
||||
} catch (retryError) {
|
||||
if (this.debug) {
|
||||
logger.error(
|
||||
`Retry failed for ${description}: ${retryError instanceof Error ? retryError.message : String(retryError)}`,
|
||||
`Retry failed for ${description}: ${
|
||||
retryError instanceof Error ? retryError.message : String(retryError)
|
||||
}`,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -517,7 +525,9 @@ export class NupstSnmp {
|
||||
} catch (retryError) {
|
||||
if (this.debug) {
|
||||
logger.error(
|
||||
`Retry failed for ${description}: ${retryError instanceof Error ? retryError.message : String(retryError)}`,
|
||||
`Retry failed for ${description}: ${
|
||||
retryError instanceof Error ? retryError.message : String(retryError)
|
||||
}`,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -556,7 +566,9 @@ export class NupstSnmp {
|
||||
} catch (stdError) {
|
||||
if (this.debug) {
|
||||
logger.error(
|
||||
`Standard OID retry failed for ${description}: ${stdError instanceof Error ? stdError.message : String(stdError)}`,
|
||||
`Standard OID retry failed for ${description}: ${
|
||||
stdError instanceof Error ? stdError.message : String(stdError)
|
||||
}`,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ export interface IUpsStatus {
|
||||
/** Output current in amps */
|
||||
outputCurrent: number;
|
||||
/** Raw values from SNMP responses */
|
||||
raw: Record<string, any>;
|
||||
raw: Record<string, unknown>;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user