harperdb 4.7.0-beta.1 → 4.7.0-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,7 +5,7 @@
5
5
  * centralized management of component health status.
6
6
  */
7
7
  import { ComponentStatus } from './ComponentStatus.ts';
8
- import { type ComponentStatusLevel, type AggregatedComponentStatus } from './types.ts';
8
+ import { type ComponentStatusLevel, type AggregatedComponentStatus, type ComponentApplicationStatus } from './types.ts';
9
9
  /**
10
10
  * Map of component names to their status information
11
11
  */
@@ -77,4 +77,13 @@ export declare class ComponentStatusRegistry {
77
77
  * Returns a Map with one entry per component showing overall status and thread distribution
78
78
  */
79
79
  static getAggregatedFromAllThreads(registry: ComponentStatusRegistry): Promise<Map<string, AggregatedComponentStatus>>;
80
+ /**
81
+ * Get aggregated status for a specific component and all its sub-components
82
+ * This method handles both exact matches and sub-component aggregation
83
+ *
84
+ * @param componentName - The component name to look up (e.g., "application-template", "http")
85
+ * @param consolidatedStatuses - Pre-fetched consolidated statuses from all threads (optional, will fetch if not provided)
86
+ * @returns Aggregated status information for the component
87
+ */
88
+ getAggregatedStatusFor(componentName: string, consolidatedStatuses?: Map<string, AggregatedComponentStatus>): Promise<ComponentApplicationStatus>;
80
89
  }
@@ -73,3 +73,22 @@ export interface WorkerComponentStatuses {
73
73
  isMainThread: boolean;
74
74
  statuses: Array<[string, ComponentStatusSummary]>;
75
75
  }
76
+ /**
77
+ * Aggregated application-level component status
78
+ * Used for components that may have multiple sub-components (e.g., application-template.rest, application-template.static)
79
+ */
80
+ export interface ComponentApplicationStatus {
81
+ /** Overall aggregated status (error > loading > loaded > healthy) */
82
+ status: ComponentStatusLevel;
83
+ /** Descriptive message with details when not healthy */
84
+ message: string;
85
+ /** Detailed breakdown when issues exist */
86
+ details?: Record<string, {
87
+ status: ComponentStatusLevel;
88
+ message?: string;
89
+ }>;
90
+ /** Last checked time information */
91
+ lastChecked: {
92
+ workers: Record<number, number>;
93
+ };
94
+ }