@checkstack/healthcheck-script-backend 0.1.1 → 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 +21 -0
- package/package.json +1 -1
- package/src/execute-collector.ts +3 -2
- package/src/strategy.ts +3 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# @checkstack/healthcheck-script-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
|
+
|
|
3
24
|
## 0.1.1
|
|
4
25
|
|
|
5
26
|
### Patch Changes
|
package/package.json
CHANGED
package/src/execute-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 { ScriptTransportClient } from "./transport-client";
|
|
@@ -38,7 +39,7 @@ export type ExecuteConfig = z.infer<typeof executeConfigSchema>;
|
|
|
38
39
|
// RESULT SCHEMAS
|
|
39
40
|
// ============================================================================
|
|
40
41
|
|
|
41
|
-
const executeResultSchema =
|
|
42
|
+
const executeResultSchema = healthResultSchema({
|
|
42
43
|
exitCode: healthResultNumber({
|
|
43
44
|
"x-chart-type": "counter",
|
|
44
45
|
"x-chart-label": "Exit Code",
|
|
@@ -68,7 +69,7 @@ const executeResultSchema = z.object({
|
|
|
68
69
|
|
|
69
70
|
export type ExecuteResult = z.infer<typeof executeResultSchema>;
|
|
70
71
|
|
|
71
|
-
const executeAggregatedSchema =
|
|
72
|
+
const executeAggregatedSchema = healthResultSchema({
|
|
72
73
|
avgExecutionTimeMs: healthResultNumber({
|
|
73
74
|
"x-chart-type": "line",
|
|
74
75
|
"x-chart-label": "Avg Execution Time",
|
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
|
ScriptTransportClient,
|
|
@@ -48,7 +49,7 @@ interface ScriptConfigV1 {
|
|
|
48
49
|
/**
|
|
49
50
|
* Per-run result metadata.
|
|
50
51
|
*/
|
|
51
|
-
const scriptResultSchema =
|
|
52
|
+
const scriptResultSchema = healthResultSchema({
|
|
52
53
|
executed: healthResultBoolean({
|
|
53
54
|
"x-chart-type": "boolean",
|
|
54
55
|
"x-chart-label": "Executed",
|
|
@@ -81,7 +82,7 @@ type ScriptResult = z.infer<typeof scriptResultSchema>;
|
|
|
81
82
|
/**
|
|
82
83
|
* Aggregated metadata for buckets.
|
|
83
84
|
*/
|
|
84
|
-
const scriptAggregatedSchema =
|
|
85
|
+
const scriptAggregatedSchema = healthResultSchema({
|
|
85
86
|
avgExecutionTime: healthResultNumber({
|
|
86
87
|
"x-chart-type": "line",
|
|
87
88
|
"x-chart-label": "Avg Execution Time",
|