@checkstack/healthcheck-common 0.8.4 → 0.10.0

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,53 @@
1
1
  # @checkstack/healthcheck-common
2
2
 
3
+ ## 0.10.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 54a5f80: ### Health Check Editor Redesign — IDE-Style Experience
8
+
9
+ Replaces the modal-based health check editor with a full-page, IDE-style experience:
10
+
11
+ - **Strategy Picker Page**: New `/config/create` page with categorized strategy discovery, search filtering, and grouped card grid layout
12
+ - **IDE Editor Page**: New `/config/:configId/edit` page with a split-view layout — explorer tree on the left, editor panel on the right
13
+ - **Strategy Categories**: Introduces `StrategyCategory` enum with 16 categories (Networking, Database, Infrastructure, etc.) — all 13 strategy plugins now declare their category
14
+ - **New RPC Endpoint**: Added `getConfiguration` (singular by ID) for efficient single-resource fetching on the edit page
15
+ - **Explorer Tree**: Left-hand navigation with General, Check Items (collectors), and Access Control sections, with real-time validation indicators
16
+ - **Validation Status Bar**: Bottom bar showing aggregated validation issues with clickable navigation
17
+ - **Unsaved Changes Guard**: Browser `beforeunload` protection when the form is dirty
18
+ - **Responsive Design**: Split-view on desktop, stacked layout on mobile
19
+ - **Deleted**: Legacy `HealthCheckEditor.tsx` modal component
20
+
21
+ ## 0.9.0
22
+
23
+ ### Minor Changes
24
+
25
+ - 1f191cf: Add SYSTEM_STATUS_CHANGED signal and dependency-driven notification improvements
26
+
27
+ **healthcheck-common:**
28
+
29
+ - New `SYSTEM_STATUS_CHANGED` signal that fires only on system-level health status transitions (healthy ↔ degraded ↔ unhealthy), providing a low-noise alternative to `HEALTH_CHECK_RUN_COMPLETED` for coarse-grained reactivity
30
+
31
+ **healthcheck-backend:**
32
+
33
+ - Broadcast `SYSTEM_STATUS_CHANGED` signal at both status transition code paths in the queue executor
34
+
35
+ **healthcheck-frontend:**
36
+
37
+ - Switch `SystemHealthBadge` from `HEALTH_CHECK_RUN_COMPLETED` to `SYSTEM_STATUS_CHANGED` to reduce unnecessary refetch noise
38
+
39
+ **dashboard-frontend:**
40
+
41
+ - Switch `SystemBadgeDataProvider` from `HEALTH_CHECK_RUN_COMPLETED` to `SYSTEM_STATUS_CHANGED` for more efficient badge updates
42
+
43
+ **maintenance-frontend:**
44
+
45
+ - Clarify that notification suppression toggle also applies to downstream dependency-driven notifications
46
+
47
+ **incident-frontend:**
48
+
49
+ - Clarify that notification suppression toggle also applies to downstream dependency-driven notifications
50
+
3
51
  ## 0.8.4
4
52
 
5
53
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@checkstack/healthcheck-common",
3
- "version": "0.8.4",
3
+ "version": "0.10.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -8,14 +8,14 @@
8
8
  }
9
9
  },
10
10
  "dependencies": {
11
- "@checkstack/common": "0.6.3",
12
- "@checkstack/signal-common": "0.1.7",
11
+ "@checkstack/common": "0.6.4",
12
+ "@checkstack/signal-common": "0.1.8",
13
13
  "zod": "^4.2.1"
14
14
  },
15
15
  "devDependencies": {
16
16
  "typescript": "^5.7.2",
17
- "@checkstack/tsconfig": "0.0.3",
18
- "@checkstack/scripts": "0.1.1"
17
+ "@checkstack/tsconfig": "0.0.4",
18
+ "@checkstack/scripts": "0.1.2"
19
19
  },
20
20
  "scripts": {
21
21
  "typecheck": "tsc --noEmit",
package/src/index.ts CHANGED
@@ -1,16 +1,20 @@
1
1
  export * from "./access";
2
2
  export * from "./schemas";
3
3
  export * from "./zod-health-result";
4
+ export * from "./strategy-category";
4
5
 
5
6
  // --- DTOs for API Responses ---
6
7
 
7
8
  /**
8
9
  * Represents a Health Check Strategy available in the system.
9
10
  */
11
+ import type { StrategyCategory } from "./strategy-category";
12
+
10
13
  export interface HealthCheckStrategyDto {
11
14
  id: string;
12
15
  displayName: string;
13
16
  description?: string;
17
+ category: StrategyCategory;
14
18
  // schema is a JSON schema object derived from the Zod schema
15
19
  configSchema: Record<string, unknown>;
16
20
  }
@@ -61,3 +65,18 @@ export const HEALTH_CHECK_RUN_COMPLETED = createSignal(
61
65
  latencyMs: z.number().optional(),
62
66
  }),
63
67
  );
68
+
69
+ /**
70
+ * Broadcast when a system's overall health status transitions.
71
+ * Only fires on actual status changes (e.g. healthy → degraded, unhealthy → healthy),
72
+ * NOT on every individual health check run. Use this for coarse-grained reactivity
73
+ * like dashboard badges and dependency map node statuses.
74
+ */
75
+ export const SYSTEM_STATUS_CHANGED = createSignal(
76
+ "healthcheck.system.status-changed",
77
+ z.object({
78
+ systemId: z.string(),
79
+ previousStatus: z.enum(["healthy", "degraded", "unhealthy"]),
80
+ newStatus: z.enum(["healthy", "degraded", "unhealthy"]),
81
+ }),
82
+ );
package/src/routes.ts CHANGED
@@ -5,6 +5,8 @@ import { createRoutes } from "@checkstack/common";
5
5
  */
6
6
  export const healthcheckRoutes = createRoutes("healthcheck", {
7
7
  config: "/config",
8
+ create: "/config/create",
9
+ edit: "/config/:configId/edit",
8
10
  history: "/history",
9
11
  historyDetail: "/history/:systemId/:configurationId",
10
12
  historyRun: "/history/:systemId/:configurationId/:runId",
@@ -70,6 +70,14 @@ export const healthCheckContract = {
70
70
  z.object({ configurations: z.array(HealthCheckConfigurationSchema) }),
71
71
  ),
72
72
 
73
+ getConfiguration: proc({
74
+ operationType: "query",
75
+ userType: "authenticated",
76
+ access: [healthCheckAccess.configuration.read],
77
+ })
78
+ .input(z.object({ id: z.string() }))
79
+ .output(HealthCheckConfigurationSchema.optional()),
80
+
73
81
  createConfiguration: proc({
74
82
  operationType: "mutation",
75
83
  userType: "authenticated",
package/src/schemas.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { z } from "zod";
2
+ import { StrategyCategorySchema } from "./strategy-category";
2
3
 
3
4
  // --- API Request/Response Schemas (Zod) ---
4
5
 
@@ -6,6 +7,7 @@ export const HealthCheckStrategyDtoSchema = z.object({
6
7
  id: z.string(),
7
8
  displayName: z.string(),
8
9
  description: z.string().optional(),
10
+ category: StrategyCategorySchema,
9
11
  configSchema: z.record(z.string(), z.unknown()),
10
12
  /** JSON Schema for per-run result metadata (with chart annotations) */
11
13
  resultSchema: z.record(z.string(), z.unknown()).optional(),
@@ -0,0 +1,106 @@
1
+ import { z } from "zod";
2
+
3
+ // =============================================================================
4
+ // STRATEGY CATEGORIES
5
+ // =============================================================================
6
+
7
+ /**
8
+ * Predefined categories for health check strategies.
9
+ * Strategy plugins select from this enum at registration time.
10
+ */
11
+ export const StrategyCategory = {
12
+ /** HTTP, DNS, TCP, Ping, UDP, SNMP, TLS */
13
+ NETWORKING: "networking",
14
+ /** Postgres, MySQL, Redis, MongoDB, ClickHouse */
15
+ DATABASE: "database",
16
+ /** SSH, Script, Hardware (CPU/Mem/Disk) */
17
+ INFRASTRUCTURE: "infrastructure",
18
+ /** Docker, Kubernetes, container health */
19
+ CONTAINERIZATION: "containerization",
20
+ /** S3, MinIO, NFS, backup verification */
21
+ STORAGE: "storage",
22
+ /** gRPC, GraphQL, WebSocket, SOAP */
23
+ APPLICATION: "application",
24
+ /** RabbitMQ, Kafka, MQTT, NATS, AMQP */
25
+ MESSAGING: "messaging",
26
+ /** SMTP, IMAP, POP3, deliverability */
27
+ EMAIL: "email",
28
+ /** AWS, Azure, GCP managed services */
29
+ CLOUD: "cloud",
30
+ /** Jenkins, GitLab, Jira, third-party APIs */
31
+ INTEGRATION: "integration",
32
+ /** LLM endpoints, model inference, GPU, API quotas */
33
+ AI: "ai",
34
+ /** TLS certificates, auth endpoints, OCSP, compliance */
35
+ SECURITY: "security",
36
+ /** MQTT devices, sensors, edge gateways */
37
+ IOT: "iot",
38
+ /** RCON, Source Query, game server protocols */
39
+ GAMING: "gaming",
40
+ /** Prometheus, metrics pipelines, log health */
41
+ OBSERVABILITY: "observability",
42
+ /** Catch-all for uncategorized strategies */
43
+ OTHER: "other",
44
+ } as const;
45
+
46
+ export type StrategyCategory =
47
+ (typeof StrategyCategory)[keyof typeof StrategyCategory];
48
+
49
+ /**
50
+ * Zod schema for validating strategy categories.
51
+ */
52
+ export const StrategyCategorySchema = z.enum([
53
+ StrategyCategory.NETWORKING,
54
+ StrategyCategory.DATABASE,
55
+ StrategyCategory.INFRASTRUCTURE,
56
+ StrategyCategory.CONTAINERIZATION,
57
+ StrategyCategory.STORAGE,
58
+ StrategyCategory.APPLICATION,
59
+ StrategyCategory.MESSAGING,
60
+ StrategyCategory.EMAIL,
61
+ StrategyCategory.CLOUD,
62
+ StrategyCategory.INTEGRATION,
63
+ StrategyCategory.AI,
64
+ StrategyCategory.SECURITY,
65
+ StrategyCategory.IOT,
66
+ StrategyCategory.GAMING,
67
+ StrategyCategory.OBSERVABILITY,
68
+ StrategyCategory.OTHER,
69
+ ]);
70
+
71
+ // =============================================================================
72
+ // CATEGORY DISPLAY METADATA
73
+ // =============================================================================
74
+
75
+ interface CategoryMeta {
76
+ /** Human-readable label for UI rendering */
77
+ label: string;
78
+ /** Sort order for UI grouping (lower = first) */
79
+ sortOrder: number;
80
+ }
81
+
82
+ /**
83
+ * Display metadata for each strategy category.
84
+ * Used by the Strategy Picker page for grouping and ordering.
85
+ */
86
+ export const STRATEGY_CATEGORY_META: Record<StrategyCategory, CategoryMeta> = {
87
+ [StrategyCategory.NETWORKING]: { label: "Networking", sortOrder: 0 },
88
+ [StrategyCategory.DATABASE]: { label: "Databases", sortOrder: 1 },
89
+ [StrategyCategory.INFRASTRUCTURE]: { label: "Infrastructure", sortOrder: 2 },
90
+ [StrategyCategory.CONTAINERIZATION]: {
91
+ label: "Containerization",
92
+ sortOrder: 3,
93
+ },
94
+ [StrategyCategory.STORAGE]: { label: "Storage", sortOrder: 4 },
95
+ [StrategyCategory.APPLICATION]: { label: "Application", sortOrder: 5 },
96
+ [StrategyCategory.MESSAGING]: { label: "Messaging", sortOrder: 6 },
97
+ [StrategyCategory.EMAIL]: { label: "Email", sortOrder: 7 },
98
+ [StrategyCategory.CLOUD]: { label: "Cloud", sortOrder: 8 },
99
+ [StrategyCategory.INTEGRATION]: { label: "Integrations", sortOrder: 9 },
100
+ [StrategyCategory.AI]: { label: "AI & Machine Learning", sortOrder: 10 },
101
+ [StrategyCategory.SECURITY]: { label: "Security", sortOrder: 11 },
102
+ [StrategyCategory.IOT]: { label: "IoT", sortOrder: 12 },
103
+ [StrategyCategory.GAMING]: { label: "Gaming", sortOrder: 13 },
104
+ [StrategyCategory.OBSERVABILITY]: { label: "Observability", sortOrder: 14 },
105
+ [StrategyCategory.OTHER]: { label: "Other", sortOrder: 99 },
106
+ };