feat(integrations): add mock integration (#3505)

This commit is contained in:
Meier Lukas
2025-07-04 09:49:18 +02:00
committed by GitHub
parent 350a531d32
commit 58d5b14c51
73 changed files with 1049 additions and 156 deletions

View File

@@ -9,7 +9,8 @@ import { Integration } from "../base/integration";
import type { SessionStore } from "../base/session-store";
import { createSessionStore } from "../base/session-store";
import type { TestingResult } from "../base/test-connection/test-connection-service";
import type { HealthMonitoring } from "../types";
import type { ISystemHealthMonitoringIntegration } from "../interfaces/health-monitoring/health-monitoring-integration";
import type { SystemHealthMonitoring } from "../types";
import { cpuTempSchema, fileSystemSchema, smartSchema, systemInformationSchema } from "./openmediavault-types";
const localLogger = logger.child({ module: "OpenMediaVaultIntegration" });
@@ -18,7 +19,7 @@ type SessionStoreValue =
| { type: "header"; sessionId: string }
| { type: "cookie"; loginToken: string; sessionId: string };
export class OpenMediaVaultIntegration extends Integration {
export class OpenMediaVaultIntegration extends Integration implements ISystemHealthMonitoringIntegration {
private readonly sessionStore: SessionStore<SessionStoreValue>;
constructor(integration: IntegrationInput) {
@@ -26,7 +27,7 @@ export class OpenMediaVaultIntegration extends Integration {
this.sessionStore = createSessionStore(integration);
}
public async getSystemInfoAsync(): Promise<HealthMonitoring> {
public async getSystemInfoAsync(): Promise<SystemHealthMonitoring> {
const systemResponses = await this.makeAuthenticatedRpcCallAsync("system", "getInformation");
const fileSystemResponse = await this.makeAuthenticatedRpcCallAsync(
"filesystemmgmt",