@checkstack/healthcheck-http-backend 0.1.1 → 0.1.3

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,32 @@
1
1
  # @checkstack/healthcheck-http-backend
2
2
 
3
+ ## 0.1.3
4
+
5
+ ### Patch Changes
6
+
7
+ - @checkstack/backend-api@0.3.1
8
+
9
+ ## 0.1.2
10
+
11
+ ### Patch Changes
12
+
13
+ - f533141: Enforce health result factory function usage via branded types
14
+
15
+ - Added `healthResultSchema()` builder that enforces the use of factory functions at compile-time
16
+ - Added `healthResultArray()` factory for array fields (e.g., DNS resolved values)
17
+ - Added branded `HealthResultField<T>` type to mark schemas created by factory functions
18
+ - Consolidated `ChartType` and `HealthResultMeta` into `@checkstack/common` as single source of truth
19
+ - Updated all 12 health check strategies and 11 collectors to use `healthResultSchema()`
20
+ - Using raw `z.number()` etc. inside `healthResultSchema()` now causes a TypeScript error
21
+
22
+ - Updated dependencies [9faec1f]
23
+ - Updated dependencies [827b286]
24
+ - Updated dependencies [f533141]
25
+ - Updated dependencies [aa4a8ab]
26
+ - @checkstack/backend-api@0.3.0
27
+ - @checkstack/common@0.2.0
28
+ - @checkstack/healthcheck-common@0.3.0
29
+
3
30
  ## 0.1.1
4
31
 
5
32
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@checkstack/healthcheck-http-backend",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "type": "module",
5
5
  "main": "src/index.ts",
6
6
  "scripts": {
@@ -10,6 +10,7 @@ import {
10
10
  healthResultString,
11
11
  healthResultBoolean,
12
12
  healthResultJSONPath,
13
+ healthResultSchema,
13
14
  } from "@checkstack/healthcheck-common";
14
15
  import { pluginMetadata } from "./plugin-metadata";
15
16
  import type { HttpTransportClient } from "./transport-client";
@@ -42,7 +43,7 @@ export type RequestConfig = z.infer<typeof requestConfigSchema>;
42
43
  // RESULT SCHEMAS
43
44
  // ============================================================================
44
45
 
45
- const requestResultSchema = z.object({
46
+ const requestResultSchema = healthResultSchema({
46
47
  statusCode: healthResultNumber({
47
48
  "x-chart-type": "counter",
48
49
  "x-chart-label": "Status Code",
@@ -70,7 +71,7 @@ const requestResultSchema = z.object({
70
71
 
71
72
  export type RequestResult = z.infer<typeof requestResultSchema>;
72
73
 
73
- const requestAggregatedSchema = z.object({
74
+ const requestAggregatedSchema = healthResultSchema({
74
75
  avgResponseTimeMs: healthResultNumber({
75
76
  "x-chart-type": "line",
76
77
  "x-chart-label": "Avg Response Time",
package/src/strategy.ts CHANGED
@@ -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 type {
13
14
  HttpTransportClient,
@@ -47,7 +48,7 @@ interface HttpConfigV2 extends HttpConfigV1 {
47
48
  }
48
49
 
49
50
  /** Per-run result metadata */
50
- const httpResultMetadataSchema = z.object({
51
+ const httpResultMetadataSchema = healthResultSchema({
51
52
  error: healthResultString({
52
53
  "x-chart-type": "status",
53
54
  "x-chart-label": "Error",
@@ -57,7 +58,7 @@ const httpResultMetadataSchema = z.object({
57
58
  type HttpResultMetadata = z.infer<typeof httpResultMetadataSchema>;
58
59
 
59
60
  /** Aggregated metadata for buckets */
60
- const httpAggregatedMetadataSchema = z.object({
61
+ const httpAggregatedMetadataSchema = healthResultSchema({
61
62
  errorCount: healthResultNumber({
62
63
  "x-chart-type": "counter",
63
64
  "x-chart-label": "Errors",