import type { InstanceRegistration } from '@n8n/api-types'; import type { Constructable } from '@n8n/di'; export type ClusterStateDiff = { added: readonly InstanceRegistration[]; removed: readonly InstanceRegistration[]; changed: ReadonlyArray<{ previous: InstanceRegistration; current: InstanceRegistration; }>; }; export type ClusterCheckContext = { currentState: ReadonlyMap; previousState: ReadonlyMap; diff: ClusterStateDiff; }; export type ClusterCheckWarning = { code: string; message: string; severity?: 'info' | 'warning' | 'error'; context?: Record; }; export type ClusterCheckAuditEvent = { eventName: string; payload: Record; }; export type ClusterCheckPushNotification = { type: string; data: Record; }; export type ClusterCheckResult = { warnings?: ClusterCheckWarning[]; auditEvents?: ClusterCheckAuditEvent[]; pushNotifications?: ClusterCheckPushNotification[]; }; export type CheckDescription = { name: string; displayName?: string; }; export interface IClusterCheck { checkDescription: CheckDescription; run(context: ClusterCheckContext): Promise; } export type ClusterCheckClass = Constructable;