@checkstack/slo-backend 0.4.4 → 0.4.6

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,75 @@
1
1
  # @checkstack/slo-backend
2
2
 
3
+ ## 0.4.6
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [ba07ae2]
8
+ - @checkstack/healthcheck-common@1.2.0
9
+ - @checkstack/healthcheck-backend@1.2.0
10
+ - @checkstack/backend-api@0.17.1
11
+ - @checkstack/cache-api@0.3.5
12
+ - @checkstack/catalog-backend@1.1.6
13
+ - @checkstack/command-backend@0.1.30
14
+ - @checkstack/gitops-backend@0.3.6
15
+ - @checkstack/integration-backend@0.1.30
16
+ - @checkstack/queue-api@0.3.5
17
+ - @checkstack/cache-utils@0.2.10
18
+
19
+ ## 0.4.5
20
+
21
+ ### Patch Changes
22
+
23
+ - f23f3c9: Add `correlationMiddleware` to `@checkstack/backend-api` and apply it
24
+ to every plugin/core router so each request carries a stable
25
+ `x-correlation-id` (read from the inbound header, or freshly minted
26
+ via `crypto.randomUUID()` when absent) and an auto-injected child
27
+ logger bound with `{ correlationId, pluginId, userId? }`. The ID is
28
+ echoed back on the response header so the caller can correlate their
29
+ client-side trace to the server logs.
30
+
31
+ The `Logger` interface in `@checkstack/backend-api` now formally
32
+ documents the structured-metadata convention (`logger.info("msg",
33
+ { ...meta })`) alongside the long-standing varargs shape. Winston's
34
+ splat handling already routes both shapes through the same vararg
35
+ slot, so existing call sites are unaffected. A new optional
36
+ `Logger.child(meta)` method captures the metadata-binding contract the
37
+ new middleware relies on; production loggers always implement it,
38
+ minimal test mocks may omit it (the middleware falls back gracefully).
39
+
40
+ `RpcContext` grew two optional `Headers` bags, `requestHeaders` and
41
+ `responseHeaders`, populated by the outer Hono `/api/*` and `/rest/*`
42
+ handlers in `@checkstack/backend`. They are write-through observation
43
+ points for middleware; an `RpcContext` constructed without them (S2S
44
+ clients, tests) keeps working — the echo is a silent no-op and the ID
45
+ is still bound onto the child logger for server-side correlation.
46
+
47
+ The scaffolding template in `@checkstack/scripts` was updated so any
48
+ new plugin generated via `bun run create` wires the middleware in the
49
+ expected `.use(correlationMiddleware).use(autoAuthMiddleware)` order
50
+ out of the box.
51
+
52
+ - Updated dependencies [f23f3c9]
53
+ - Updated dependencies [f23f3c9]
54
+ - Updated dependencies [f23f3c9]
55
+ - @checkstack/common@0.11.0
56
+ - @checkstack/backend-api@0.17.0
57
+ - @checkstack/catalog-backend@1.1.5
58
+ - @checkstack/command-backend@0.1.29
59
+ - @checkstack/gitops-backend@0.3.5
60
+ - @checkstack/healthcheck-backend@1.1.4
61
+ - @checkstack/integration-backend@0.1.29
62
+ - @checkstack/integration-common@0.5.0
63
+ - @checkstack/catalog-common@2.2.2
64
+ - @checkstack/dependency-common@1.1.2
65
+ - @checkstack/gitops-common@0.4.1
66
+ - @checkstack/healthcheck-common@1.1.2
67
+ - @checkstack/signal-common@0.2.4
68
+ - @checkstack/slo-common@0.4.1
69
+ - @checkstack/cache-api@0.3.4
70
+ - @checkstack/queue-api@0.3.4
71
+ - @checkstack/cache-utils@0.2.9
72
+
3
73
  ## 0.4.4
4
74
 
5
75
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@checkstack/slo-backend",
3
- "version": "0.4.4",
3
+ "version": "0.4.6",
4
4
  "license": "Elastic-2.0",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
@@ -14,31 +14,31 @@
14
14
  "lint:code": "eslint . --max-warnings 0"
15
15
  },
16
16
  "dependencies": {
17
- "@checkstack/backend-api": "0.15.3",
18
- "@checkstack/cache-api": "0.3.2",
19
- "@checkstack/cache-utils": "0.2.7",
20
- "@checkstack/slo-common": "0.4.0",
21
- "@checkstack/healthcheck-common": "1.1.0",
22
- "@checkstack/healthcheck-backend": "1.1.2",
23
- "@checkstack/dependency-common": "1.1.0",
24
- "@checkstack/catalog-common": "2.2.0",
25
- "@checkstack/catalog-backend": "1.1.3",
26
- "@checkstack/command-backend": "0.1.27",
27
- "@checkstack/signal-common": "0.2.3",
28
- "@checkstack/integration-backend": "0.1.27",
29
- "@checkstack/integration-common": "0.4.0",
30
- "@checkstack/gitops-backend": "0.3.3",
31
- "@checkstack/gitops-common": "0.4.0",
32
- "@checkstack/common": "0.10.0",
33
- "@checkstack/queue-api": "0.3.2",
17
+ "@checkstack/backend-api": "0.17.0",
18
+ "@checkstack/cache-api": "0.3.4",
19
+ "@checkstack/cache-utils": "0.2.9",
20
+ "@checkstack/slo-common": "0.4.1",
21
+ "@checkstack/healthcheck-common": "1.1.2",
22
+ "@checkstack/healthcheck-backend": "1.1.4",
23
+ "@checkstack/dependency-common": "1.1.2",
24
+ "@checkstack/catalog-common": "2.2.2",
25
+ "@checkstack/catalog-backend": "1.1.5",
26
+ "@checkstack/command-backend": "0.1.29",
27
+ "@checkstack/signal-common": "0.2.4",
28
+ "@checkstack/integration-backend": "0.1.29",
29
+ "@checkstack/integration-common": "0.5.0",
30
+ "@checkstack/gitops-backend": "0.3.5",
31
+ "@checkstack/gitops-common": "0.4.1",
32
+ "@checkstack/common": "0.11.0",
33
+ "@checkstack/queue-api": "0.3.4",
34
34
  "drizzle-orm": "^0.45.0",
35
35
  "zod": "^4.2.1",
36
36
  "@orpc/server": "^1.13.2"
37
37
  },
38
38
  "devDependencies": {
39
39
  "@checkstack/drizzle-helper": "0.0.5",
40
- "@checkstack/scripts": "0.3.2",
41
- "@checkstack/test-utils-backend": "0.1.27",
40
+ "@checkstack/scripts": "0.3.3",
41
+ "@checkstack/test-utils-backend": "0.1.29",
42
42
  "@checkstack/tsconfig": "0.0.7",
43
43
  "@types/bun": "^1.0.0",
44
44
  "drizzle-kit": "^0.31.10",
package/src/router.ts CHANGED
@@ -5,6 +5,7 @@ import {
5
5
  } from "@checkstack/slo-common";
6
6
  import {
7
7
  autoAuthMiddleware,
8
+ correlationMiddleware,
8
9
  type RpcContext,
9
10
  type RpcClient,
10
11
  } from "@checkstack/backend-api";
@@ -29,6 +30,7 @@ export function createRouter({
29
30
  }) {
30
31
  const os = implement(sloContract)
31
32
  .$context<RpcContext>()
33
+ .use(correlationMiddleware)
32
34
  .use(autoAuthMiddleware);
33
35
 
34
36
  return os.router({