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