@checkstack/healthcheck-ping-backend 0.1.0 → 0.1.2
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 +32 -0
- package/package.json +1 -1
- package/src/ping-collector.ts +6 -3
- package/src/strategy.ts +3 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,37 @@
|
|
|
1
1
|
# @checkstack/healthcheck-ping-backend
|
|
2
2
|
|
|
3
|
+
## 0.1.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- f533141: Enforce health result factory function usage via branded types
|
|
8
|
+
|
|
9
|
+
- Added `healthResultSchema()` builder that enforces the use of factory functions at compile-time
|
|
10
|
+
- Added `healthResultArray()` factory for array fields (e.g., DNS resolved values)
|
|
11
|
+
- Added branded `HealthResultField<T>` type to mark schemas created by factory functions
|
|
12
|
+
- Consolidated `ChartType` and `HealthResultMeta` into `@checkstack/common` as single source of truth
|
|
13
|
+
- Updated all 12 health check strategies and 11 collectors to use `healthResultSchema()`
|
|
14
|
+
- Using raw `z.number()` etc. inside `healthResultSchema()` now causes a TypeScript error
|
|
15
|
+
|
|
16
|
+
- Updated dependencies [9faec1f]
|
|
17
|
+
- Updated dependencies [827b286]
|
|
18
|
+
- Updated dependencies [f533141]
|
|
19
|
+
- Updated dependencies [aa4a8ab]
|
|
20
|
+
- @checkstack/backend-api@0.3.0
|
|
21
|
+
- @checkstack/common@0.2.0
|
|
22
|
+
- @checkstack/healthcheck-common@0.3.0
|
|
23
|
+
|
|
24
|
+
## 0.1.1
|
|
25
|
+
|
|
26
|
+
### Patch Changes
|
|
27
|
+
|
|
28
|
+
- Updated dependencies [97c5a6b]
|
|
29
|
+
- Updated dependencies [8e43507]
|
|
30
|
+
- Updated dependencies [97c5a6b]
|
|
31
|
+
- @checkstack/backend-api@0.2.0
|
|
32
|
+
- @checkstack/common@0.1.0
|
|
33
|
+
- @checkstack/healthcheck-common@0.2.0
|
|
34
|
+
|
|
3
35
|
## 0.1.0
|
|
4
36
|
|
|
5
37
|
### Minor Changes
|
package/package.json
CHANGED
package/src/ping-collector.ts
CHANGED
|
@@ -5,7 +5,10 @@ import {
|
|
|
5
5
|
type CollectorResult,
|
|
6
6
|
type CollectorStrategy,
|
|
7
7
|
} from "@checkstack/backend-api";
|
|
8
|
-
import {
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
87
|
+
const pingAggregatedSchema = healthResultSchema({
|
|
87
88
|
avgPacketLoss: healthResultNumber({
|
|
88
89
|
"x-chart-type": "gauge",
|
|
89
90
|
"x-chart-label": "Avg Packet Loss",
|