@checkstack/healthcheck-ssh-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 CHANGED
@@ -1,5 +1,39 @@
1
1
  # @checkstack/healthcheck-ssh-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
+ - @checkstack/healthcheck-ssh-common@0.1.2
24
+
25
+ ## 0.1.1
26
+
27
+ ### Patch Changes
28
+
29
+ - Updated dependencies [97c5a6b]
30
+ - Updated dependencies [8e43507]
31
+ - Updated dependencies [97c5a6b]
32
+ - @checkstack/backend-api@0.2.0
33
+ - @checkstack/common@0.1.0
34
+ - @checkstack/healthcheck-common@0.2.0
35
+ - @checkstack/healthcheck-ssh-common@0.1.1
36
+
3
37
  ## 0.1.0
4
38
 
5
39
  ### Minor Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@checkstack/healthcheck-ssh-backend",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "type": "module",
5
5
  "main": "src/index.ts",
6
6
  "scripts": {
@@ -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 { pluginMetadata as sshPluginMetadata } from "./plugin-metadata";
13
14
  import type { SshTransportClient } from "@checkstack/healthcheck-ssh-common";
@@ -26,7 +27,7 @@ export type CommandConfig = z.infer<typeof commandConfigSchema>;
26
27
  // RESULT SCHEMAS
27
28
  // ============================================================================
28
29
 
29
- const commandResultSchema = z.object({
30
+ const commandResultSchema = healthResultSchema({
30
31
  exitCode: healthResultNumber({
31
32
  "x-chart-type": "counter",
32
33
  "x-chart-label": "Exit Code",
@@ -48,7 +49,7 @@ const commandResultSchema = z.object({
48
49
 
49
50
  export type CommandResult = z.infer<typeof commandResultSchema>;
50
51
 
51
- const commandAggregatedSchema = z.object({
52
+ const commandAggregatedSchema = healthResultSchema({
52
53
  avgExecutionTimeMs: healthResultNumber({
53
54
  "x-chart-type": "line",
54
55
  "x-chart-label": "Avg Execution Time",
package/src/strategy.ts CHANGED
@@ -12,6 +12,7 @@ import {
12
12
  healthResultBoolean,
13
13
  healthResultNumber,
14
14
  healthResultString,
15
+ healthResultSchema,
15
16
  } from "@checkstack/healthcheck-common";
16
17
  import type { SshTransportClient, SshCommandResult } from "./transport-client";
17
18
 
@@ -47,7 +48,7 @@ export type SshConfigInput = z.input<typeof sshConfigSchema>;
47
48
  /**
48
49
  * Per-run result metadata.
49
50
  */
50
- const sshResultSchema = z.object({
51
+ const sshResultSchema = healthResultSchema({
51
52
  connected: healthResultBoolean({
52
53
  "x-chart-type": "boolean",
53
54
  "x-chart-label": "Connected",
@@ -68,7 +69,7 @@ type SshResult = z.infer<typeof sshResultSchema>;
68
69
  /**
69
70
  * Aggregated metadata for buckets.
70
71
  */
71
- const sshAggregatedSchema = z.object({
72
+ const sshAggregatedSchema = healthResultSchema({
72
73
  avgConnectionTime: healthResultNumber({
73
74
  "x-chart-type": "line",
74
75
  "x-chart-label": "Avg Connection Time",