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