@checkstack/incident-common 0.3.4 → 0.4.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,17 @@
1
1
  # @checkstack/incident-common
2
2
 
3
+ ## 0.4.0
4
+
5
+ ### Minor Changes
6
+
7
+ - cce5453: Add notification suppression for incidents
8
+
9
+ - Added `suppressNotifications` field to incidents, allowing active incidents to optionally suppress health check notifications
10
+ - When enabled, health status change notifications will not be sent for affected systems while the incident is active (not resolved)
11
+ - Mirrors the existing maintenance notification suppression pattern
12
+ - Added toggle UI in the IncidentEditor dialog
13
+ - Added `hasActiveIncidentWithSuppression` RPC endpoint for service-to-service queries
14
+
3
15
  ## 0.3.4
4
16
 
5
17
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@checkstack/incident-common",
3
- "version": "0.3.4",
3
+ "version": "0.4.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -108,6 +108,18 @@ export const incidentContract = {
108
108
  })
109
109
  .input(z.object({ id: z.string() }))
110
110
  .output(z.object({ success: z.boolean() })),
111
+
112
+ /**
113
+ * Check if a system has an active incident with notification suppression enabled.
114
+ * Used by the health check system to suppress notifications during acknowledged incidents.
115
+ */
116
+ hasActiveIncidentWithSuppression: proc({
117
+ operationType: "query",
118
+ userType: "service",
119
+ access: [incidentAccess.incident.read],
120
+ })
121
+ .input(z.object({ systemId: z.string() }))
122
+ .output(z.object({ suppressed: z.boolean() })),
111
123
  };
112
124
 
113
125
  // Export contract type
package/src/schemas.ts CHANGED
@@ -29,6 +29,7 @@ export const IncidentSchema = z.object({
29
29
  description: z.string().optional(),
30
30
  status: IncidentStatusEnum,
31
31
  severity: IncidentSeverityEnum,
32
+ suppressNotifications: z.boolean(),
32
33
  createdAt: z.date(),
33
34
  updatedAt: z.date(),
34
35
  });
@@ -68,6 +69,7 @@ export const CreateIncidentInputSchema = z.object({
68
69
  title: z.string().min(1, "Title is required"),
69
70
  description: z.string().optional(),
70
71
  severity: IncidentSeverityEnum,
72
+ suppressNotifications: z.boolean().optional().default(false),
71
73
  systemIds: z.array(z.string()).min(1, "At least one system is required"),
72
74
  initialMessage: z
73
75
  .string()
@@ -81,6 +83,7 @@ export const UpdateIncidentInputSchema = z.object({
81
83
  title: z.string().min(1).optional(),
82
84
  description: z.string().nullable().optional(),
83
85
  severity: IncidentSeverityEnum.optional(),
86
+ suppressNotifications: z.boolean().optional(),
84
87
  systemIds: z.array(z.string()).min(1).optional(),
85
88
  });
86
89
  export type UpdateIncidentInput = z.infer<typeof UpdateIncidentInputSchema>;