feat(integrations): add mock integration (#3505)
This commit is contained in:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user