feat(core): Centralize timeouts/constants, add CLI prompt helpers, and introduce webhook/script actions with safety and SNMP refactors

This commit is contained in:
2026-01-29 17:04:12 +00:00
parent d0e3a4ae74
commit 07648b4880
24 changed files with 1019 additions and 590 deletions

View File

@@ -9,12 +9,13 @@ import { ServiceHandler } from './cli/service-handler.ts';
import { ActionHandler } from './cli/action-handler.ts';
import { FeatureHandler } from './cli/feature-handler.ts';
import * as https from 'node:https';
import type { INupstAccessor, IUpdateStatus } from './interfaces/index.ts';
/**
* Main Nupst class that coordinates all components
* Acts as a facade to access SNMP, Daemon, and Systemd functionality
*/
export class Nupst {
export class Nupst implements INupstAccessor {
private readonly snmp: NupstSnmp;
private readonly daemon: NupstDaemon;
private readonly systemd: NupstSystemd;
@@ -134,11 +135,7 @@ export class Nupst {
* Get update status information
* @returns Object with update status information
*/
public getUpdateStatus(): {
currentVersion: string;
latestVersion: string;
updateAvailable: boolean;
} {
public getUpdateStatus(): IUpdateStatus {
return {
currentVersion: this.getVersion(),
latestVersion: this.latestVersion || this.getVersion(),