@eik/service 5.4.3 → 5.5.0

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,3 +1,10 @@
1
+ # [5.5.0](https://github.com/eik-lib/service/compare/v5.4.3...v5.5.0) (2026-08-24)
2
+
3
+
4
+ ### Features
5
+
6
+ * set traceId on every incoming request ([#802](https://github.com/eik-lib/service/issues/802)) ([23ce91f](https://github.com/eik-lib/service/commit/23ce91fec7cb2532bb99093539f57cbe79b65987))
7
+
1
8
  ## [5.4.3](https://github.com/eik-lib/service/compare/v5.4.2...v5.4.3) (2026-08-24)
2
9
 
3
10
 
package/lib/main.js CHANGED
@@ -247,6 +247,18 @@ const EikService = class EikService {
247
247
 
248
248
  await app.register(cors);
249
249
 
250
+ // Attach a trace ID to every incoming request so it can be
251
+ // threaded through the upload stack and included in all log lines.
252
+ // A plugin registered before service.api() may pre-set traceId
253
+ // (e.g. from a CDN-supplied header), in which case that value is
254
+ // used as-is. Configuring genReqId on the Fastify instance is the
255
+ // recommended way to source trace IDs from upstream infrastructure.
256
+ app.addHook("onRequest", async (request) => {
257
+ if (!request.raw.traceId) {
258
+ request.raw.traceId = request.id;
259
+ }
260
+ });
261
+
250
262
  // Authentication
251
263
  app.register(jwt, {
252
264
  secret: config.get("jwt.secret"),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eik/service",
3
- "version": "5.4.3",
3
+ "version": "5.5.0",
4
4
  "description": "Eik REST API as a standalone HTTP service",
5
5
  "type": "module",
6
6
  "main": "./lib/main.js",
@@ -43,9 +43,9 @@
43
43
  },
44
44
  "homepage": "https://github.com/eik-lib/service#readme",
45
45
  "dependencies": {
46
- "@eik/core": "2.2.3",
47
- "@eik/sink": "1.2.7",
48
- "@eik/sink-file-system": "2.2.0",
46
+ "@eik/core": "2.3.0",
47
+ "@eik/sink": "1.3.0",
48
+ "@eik/sink-file-system": "2.3.0",
49
49
  "@eik/sink-memory": "2.3.0",
50
50
  "@fastify/compress": "9.2.0",
51
51
  "@fastify/cors": "11.3.0",