@checkstack/healthcheck-ping-backend 0.1.1 → 0.1.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,32 @@
1
1
  # @checkstack/healthcheck-ping-backend
2
2
 
3
+ ## 0.1.3
4
+
5
+ ### Patch Changes
6
+
7
+ - @checkstack/backend-api@0.3.1
8
+
9
+ ## 0.1.2
10
+
11
+ ### Patch Changes
12
+
13
+ - f533141: Enforce health result factory function usage via branded types
14
+
15
+ - Added `healthResultSchema()` builder that enforces the use of factory functions at compile-time
16
+ - Added `healthResultArray()` factory for array fields (e.g., DNS resolved values)
17
+ - Added branded `HealthResultField<T>` type to mark schemas created by factory functions
18
+ - Consolidated `ChartType` and `HealthResultMeta` into `@checkstack/common` as single source of truth
19
+ - Updated all 12 health check strategies and 11 collectors to use `healthResultSchema()`
20
+ - Using raw `z.number()` etc. inside `healthResultSchema()` now causes a TypeScript error
21
+
22
+ - Updated dependencies [9faec1f]
23
+ - Updated dependencies [827b286]
24
+ - Updated dependencies [f533141]
25
+ - Updated dependencies [aa4a8ab]
26
+ - @checkstack/backend-api@0.3.0
27
+ - @checkstack/common@0.2.0
28
+ - @checkstack/healthcheck-common@0.3.0
29
+
3
30
  ## 0.1.1
4
31
 
5
32
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@checkstack/healthcheck-ping-backend",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "type": "module",
5
5
  "main": "src/index.ts",
6
6
  "scripts": {
@@ -5,7 +5,10 @@ import {
5
5
  type CollectorResult,
6
6
  type CollectorStrategy,
7
7
  } from "@checkstack/backend-api";
8
- import { healthResultNumber } from "@checkstack/healthcheck-common";
8
+ import {
9
+ healthResultNumber,
10
+ healthResultSchema,
11
+ } from "@checkstack/healthcheck-common";
9
12
  import { pluginMetadata } from "./plugin-metadata";
10
13
  import type { PingTransportClient } from "./transport-client";
11
14
 
@@ -35,7 +38,7 @@ export type PingConfig = z.infer<typeof pingConfigSchema>;
35
38
  // RESULT SCHEMAS
36
39
  // ============================================================================
37
40
 
38
- const pingResultSchema = z.object({
41
+ const pingResultSchema = healthResultSchema({
39
42
  packetsSent: healthResultNumber({
40
43
  "x-chart-type": "counter",
41
44
  "x-chart-label": "Packets Sent",
@@ -68,7 +71,7 @@ const pingResultSchema = z.object({
68
71
 
69
72
  export type PingResult = z.infer<typeof pingResultSchema>;
70
73
 
71
- const pingAggregatedSchema = z.object({
74
+ const pingAggregatedSchema = healthResultSchema({
72
75
  avgPacketLoss: healthResultNumber({
73
76
  "x-chart-type": "gauge",
74
77
  "x-chart-label": "Avg Packet Loss",
package/src/strategy.ts CHANGED
@@ -8,6 +8,7 @@ import {
8
8
  import {
9
9
  healthResultNumber,
10
10
  healthResultString,
11
+ healthResultSchema,
11
12
  } from "@checkstack/healthcheck-common";
12
13
  import type {
13
14
  PingTransportClient,
@@ -43,7 +44,7 @@ interface PingConfigV1 {
43
44
  /**
44
45
  * Per-run result metadata.
45
46
  */
46
- const pingResultSchema = z.object({
47
+ const pingResultSchema = healthResultSchema({
47
48
  packetsSent: healthResultNumber({
48
49
  "x-chart-type": "counter",
49
50
  "x-chart-label": "Packets Sent",
@@ -83,7 +84,7 @@ type PingResult = z.infer<typeof pingResultSchema>;
83
84
  /**
84
85
  * Aggregated metadata for buckets.
85
86
  */
86
- const pingAggregatedSchema = z.object({
87
+ const pingAggregatedSchema = healthResultSchema({
87
88
  avgPacketLoss: healthResultNumber({
88
89
  "x-chart-type": "gauge",
89
90
  "x-chart-label": "Avg Packet Loss",