@checkstack/healthcheck-grpc-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/health-collector.ts +5 -4
- package/src/strategy.ts +3 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,37 @@
|
|
|
1
1
|
# @checkstack/healthcheck-grpc-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/health-collector.ts
CHANGED
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
healthResultNumber,
|
|
10
10
|
healthResultString,
|
|
11
11
|
healthResultBoolean,
|
|
12
|
+
healthResultSchema,
|
|
12
13
|
} from "@checkstack/healthcheck-common";
|
|
13
14
|
import { pluginMetadata } from "./plugin-metadata";
|
|
14
15
|
import type { GrpcTransportClient } from "./transport-client";
|
|
@@ -30,7 +31,7 @@ export type HealthConfig = z.infer<typeof healthConfigSchema>;
|
|
|
30
31
|
// RESULT SCHEMAS
|
|
31
32
|
// ============================================================================
|
|
32
33
|
|
|
33
|
-
const
|
|
34
|
+
const grpcHealthResultSchema = healthResultSchema({
|
|
34
35
|
status: healthResultString({
|
|
35
36
|
"x-chart-type": "text",
|
|
36
37
|
"x-chart-label": "Status",
|
|
@@ -46,9 +47,9 @@ const healthResultSchema = z.object({
|
|
|
46
47
|
}),
|
|
47
48
|
});
|
|
48
49
|
|
|
49
|
-
export type HealthResult = z.infer<typeof
|
|
50
|
+
export type HealthResult = z.infer<typeof grpcHealthResultSchema>;
|
|
50
51
|
|
|
51
|
-
const healthAggregatedSchema =
|
|
52
|
+
const healthAggregatedSchema = healthResultSchema({
|
|
52
53
|
avgResponseTimeMs: healthResultNumber({
|
|
53
54
|
"x-chart-type": "line",
|
|
54
55
|
"x-chart-label": "Avg Response Time",
|
|
@@ -89,7 +90,7 @@ export class HealthCollector
|
|
|
89
90
|
allowMultiple = true;
|
|
90
91
|
|
|
91
92
|
config = new Versioned({ version: 1, schema: healthConfigSchema });
|
|
92
|
-
result = new Versioned({ version: 1, schema:
|
|
93
|
+
result = new Versioned({ version: 1, schema: grpcHealthResultSchema });
|
|
93
94
|
aggregatedResult = new Versioned({
|
|
94
95
|
version: 1,
|
|
95
96
|
schema: healthAggregatedSchema,
|
package/src/strategy.ts
CHANGED
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
healthResultBoolean,
|
|
11
11
|
healthResultNumber,
|
|
12
12
|
healthResultString,
|
|
13
|
+
healthResultSchema,
|
|
13
14
|
} from "@checkstack/healthcheck-common";
|
|
14
15
|
import type {
|
|
15
16
|
GrpcTransportClient,
|
|
@@ -57,7 +58,7 @@ export type GrpcConfigInput = z.input<typeof grpcConfigSchema>;
|
|
|
57
58
|
/**
|
|
58
59
|
* Per-run result metadata.
|
|
59
60
|
*/
|
|
60
|
-
const grpcResultSchema =
|
|
61
|
+
const grpcResultSchema = healthResultSchema({
|
|
61
62
|
connected: healthResultBoolean({
|
|
62
63
|
"x-chart-type": "boolean",
|
|
63
64
|
"x-chart-label": "Connected",
|
|
@@ -82,7 +83,7 @@ type GrpcResult = z.infer<typeof grpcResultSchema>;
|
|
|
82
83
|
/**
|
|
83
84
|
* Aggregated metadata for buckets.
|
|
84
85
|
*/
|
|
85
|
-
const grpcAggregatedSchema =
|
|
86
|
+
const grpcAggregatedSchema = healthResultSchema({
|
|
86
87
|
avgResponseTime: healthResultNumber({
|
|
87
88
|
"x-chart-type": "line",
|
|
88
89
|
"x-chart-label": "Avg Response Time",
|