@checkstack/healthcheck-common 0.9.0 → 0.10.1

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,49 @@
1
1
  # @checkstack/healthcheck-common
2
2
 
3
+ ## 0.10.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 3c34b07: Complete SLO Reliability Engine frontend and backend
8
+
9
+ **Frontend** — 7 new visualization components:
10
+
11
+ - `StreakCounter`: Fire-themed compliance streak counter with color-coded flame and best-streak trophy
12
+ - `AchievementBadge`: Emoji-labeled badges for 9 achievement types with hover tooltip
13
+ - `AttributionChart`: Horizontal stacked bar showing error budget split (self/upstream/remaining)
14
+ - `DowntimeTimeline`: Dot-and-line timeline with attribution badges and timestamps
15
+ - `SloTrendChart`: Pure SVG availability trend line chart from daily snapshots
16
+ - `MilestoneFeed`: Organization-wide milestone feed on the SLO overview sidebar
17
+ - `DependencyExclusionConfig`: Interactive upstream dependency picker for SLO editor
18
+
19
+ **Backend** — Weekly digest scheduled integration event:
20
+
21
+ - `weekly-digest.ts`: Cron job (Monday 09:00 UTC) emitting SLO performance summary
22
+ - Top/worst performers, breach counts, and streak data delivered via configured notification channels
23
+ - New `sloWeeklyDigest` hook registered as integration event
24
+
25
+ - Updated dependencies [d1a2796]
26
+ - @checkstack/common@0.6.5
27
+ - @checkstack/signal-common@0.1.9
28
+
29
+ ## 0.10.0
30
+
31
+ ### Minor Changes
32
+
33
+ - 54a5f80: ### Health Check Editor Redesign — IDE-Style Experience
34
+
35
+ Replaces the modal-based health check editor with a full-page, IDE-style experience:
36
+
37
+ - **Strategy Picker Page**: New `/config/create` page with categorized strategy discovery, search filtering, and grouped card grid layout
38
+ - **IDE Editor Page**: New `/config/:configId/edit` page with a split-view layout — explorer tree on the left, editor panel on the right
39
+ - **Strategy Categories**: Introduces `StrategyCategory` enum with 16 categories (Networking, Database, Infrastructure, etc.) — all 13 strategy plugins now declare their category
40
+ - **New RPC Endpoint**: Added `getConfiguration` (singular by ID) for efficient single-resource fetching on the edit page
41
+ - **Explorer Tree**: Left-hand navigation with General, Check Items (collectors), and Access Control sections, with real-time validation indicators
42
+ - **Validation Status Bar**: Bottom bar showing aggregated validation issues with clickable navigation
43
+ - **Unsaved Changes Guard**: Browser `beforeunload` protection when the form is dirty
44
+ - **Responsive Design**: Split-view on desktop, stacked layout on mobile
45
+ - **Deleted**: Legacy `HealthCheckEditor.tsx` modal component
46
+
3
47
  ## 0.9.0
4
48
 
5
49
  ### Minor Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@checkstack/healthcheck-common",
3
- "version": "0.9.0",
3
+ "version": "0.10.1",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -14,7 +14,7 @@
14
14
  },
15
15
  "devDependencies": {
16
16
  "typescript": "^5.7.2",
17
- "@checkstack/tsconfig": "0.0.4",
17
+ "@checkstack/tsconfig": "0.0.5",
18
18
  "@checkstack/scripts": "0.1.2"
19
19
  },
20
20
  "scripts": {
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
  }
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",
@@ -363,26 +371,6 @@ export const healthCheckContract = {
363
371
  ),
364
372
  }),
365
373
  ),
366
-
367
- getAvailabilityStats: proc({
368
- operationType: "query",
369
- userType: "public",
370
- access: [healthCheckAccess.status],
371
- })
372
- .input(
373
- z.object({
374
- systemId: z.string(),
375
- configurationId: z.string(),
376
- }),
377
- )
378
- .output(
379
- z.object({
380
- availability31Days: z.number().nullable(),
381
- availability365Days: z.number().nullable(),
382
- totalRuns31Days: z.number(),
383
- totalRuns365Days: z.number(),
384
- }),
385
- ),
386
374
  };
387
375
  // Export contract type
388
376
  export type HealthCheckContract = typeof healthCheckContract;
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
+ };