@checkstack/healthcheck-redis-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,37 @@
1
1
  # @checkstack/healthcheck-redis-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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@checkstack/healthcheck-redis-backend",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "type": "module",
5
5
  "main": "src/index.ts",
6
6
  "scripts": {
@@ -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 { RedisTransportClient } from "./transport-client";
@@ -34,7 +35,7 @@ export type CommandConfig = z.infer<typeof commandConfigSchema>;
34
35
  // RESULT SCHEMAS
35
36
  // ============================================================================
36
37
 
37
- const commandResultSchema = z.object({
38
+ const commandResultSchema = healthResultSchema({
38
39
  response: healthResultString({
39
40
  "x-chart-type": "text",
40
41
  "x-chart-label": "Response",
@@ -52,7 +53,7 @@ const commandResultSchema = z.object({
52
53
 
53
54
  export type CommandResult = z.infer<typeof commandResultSchema>;
54
55
 
55
- const commandAggregatedSchema = z.object({
56
+ const commandAggregatedSchema = healthResultSchema({
56
57
  avgResponseTimeMs: healthResultNumber({
57
58
  "x-chart-type": "line",
58
59
  "x-chart-label": "Avg Response Time",
package/src/strategy.ts CHANGED
@@ -13,6 +13,7 @@ import {
13
13
  healthResultBoolean,
14
14
  healthResultNumber,
15
15
  healthResultString,
16
+ healthResultSchema,
16
17
  } from "@checkstack/healthcheck-common";
17
18
  import type {
18
19
  RedisTransportClient,
@@ -56,7 +57,7 @@ export type RedisConfigInput = z.input<typeof redisConfigSchema>;
56
57
  /**
57
58
  * Per-run result metadata.
58
59
  */
59
- const redisResultSchema = z.object({
60
+ const redisResultSchema = healthResultSchema({
60
61
  connected: healthResultBoolean({
61
62
  "x-chart-type": "boolean",
62
63
  "x-chart-label": "Connected",
@@ -77,7 +78,7 @@ type RedisResult = z.infer<typeof redisResultSchema>;
77
78
  /**
78
79
  * Aggregated metadata for buckets.
79
80
  */
80
- const redisAggregatedSchema = z.object({
81
+ const redisAggregatedSchema = healthResultSchema({
81
82
  avgConnectionTime: healthResultNumber({
82
83
  "x-chart-type": "line",
83
84
  "x-chart-label": "Avg Connection Time",