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