@checkstack/announcement-backend 0.3.8 → 0.3.10

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