@checkstack/healthcheck-common 0.7.0 → 0.8.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/healthcheck-common
2
2
 
3
+ ## 0.8.0
4
+
5
+ ### Minor Changes
6
+
7
+ - d6f7449: Add availability statistics display to HealthCheckSystemOverview
8
+
9
+ - New `getAvailabilityStats` RPC endpoint that calculates availability percentages for 31-day and 365-day periods
10
+ - Availability is calculated as `(healthyRuns / totalRuns) * 100`
11
+ - Data is sourced from both daily aggregates and recent raw runs to include the most up-to-date information
12
+ - Frontend displays availability stats with color-coded badges (green ≥99.9%, yellow ≥99%, red <99%)
13
+ - Shows total run counts for each period
14
+
3
15
  ## 0.7.0
4
16
 
5
17
  ### Minor Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@checkstack/healthcheck-common",
3
- "version": "0.7.0",
3
+ "version": "0.8.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -363,8 +363,27 @@ export const healthCheckContract = {
363
363
  ),
364
364
  }),
365
365
  ),
366
- };
367
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
+ };
368
387
  // Export contract type
369
388
  export type HealthCheckContract = typeof healthCheckContract;
370
389