@checkstack/healthcheck-dns-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-dns-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-dns-backend",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "type": "module",
5
5
  "main": "src/index.ts",
6
6
  "scripts": {
@@ -5,7 +5,11 @@ import {
5
5
  type CollectorResult,
6
6
  type CollectorStrategy,
7
7
  } from "@checkstack/backend-api";
8
- import { healthResultNumber } from "@checkstack/healthcheck-common";
8
+ import {
9
+ healthResultNumber,
10
+ healthResultArray,
11
+ healthResultSchema,
12
+ } from "@checkstack/healthcheck-common";
9
13
  import { pluginMetadata } from "./plugin-metadata";
10
14
  import type { DnsTransportClient } from "./transport-client";
11
15
 
@@ -28,8 +32,8 @@ export type LookupConfig = z.infer<typeof lookupConfigSchema>;
28
32
  // RESULT SCHEMAS
29
33
  // ============================================================================
30
34
 
31
- const lookupResultSchema = z.object({
32
- values: z.array(z.string()).meta({
35
+ const lookupResultSchema = healthResultSchema({
36
+ values: healthResultArray({
33
37
  "x-chart-type": "text",
34
38
  "x-chart-label": "Resolved Values",
35
39
  }),
@@ -46,7 +50,7 @@ const lookupResultSchema = z.object({
46
50
 
47
51
  export type LookupResult = z.infer<typeof lookupResultSchema>;
48
52
 
49
- const lookupAggregatedSchema = z.object({
53
+ const lookupAggregatedSchema = healthResultSchema({
50
54
  avgResolutionTimeMs: healthResultNumber({
51
55
  "x-chart-type": "line",
52
56
  "x-chart-label": "Avg Resolution Time",
package/src/strategy.ts CHANGED
@@ -9,6 +9,8 @@ import {
9
9
  import {
10
10
  healthResultNumber,
11
11
  healthResultString,
12
+ healthResultArray,
13
+ healthResultSchema,
12
14
  } from "@checkstack/healthcheck-common";
13
15
  import type {
14
16
  DnsTransportClient,
@@ -46,8 +48,8 @@ interface DnsConfigV1 {
46
48
  /**
47
49
  * Per-run result metadata.
48
50
  */
49
- const dnsResultSchema = z.object({
50
- resolvedValues: z.array(z.string()).meta({
51
+ const dnsResultSchema = healthResultSchema({
52
+ resolvedValues: healthResultArray({
51
53
  "x-chart-type": "text",
52
54
  "x-chart-label": "Resolved Values",
53
55
  }),
@@ -71,7 +73,7 @@ type DnsResult = z.infer<typeof dnsResultSchema>;
71
73
  /**
72
74
  * Aggregated metadata for buckets.
73
75
  */
74
- const dnsAggregatedSchema = z.object({
76
+ const dnsAggregatedSchema = healthResultSchema({
75
77
  avgResolutionTime: healthResultNumber({
76
78
  "x-chart-type": "line",
77
79
  "x-chart-label": "Avg Resolution Time",