@cedvict/http-guardian 0.0.1-next.10 → 0.0.1-next.11

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.
Files changed (2) hide show
  1. package/README.md +12 -0
  2. package/package.json +7 -3
package/README.md CHANGED
@@ -100,6 +100,18 @@ entre retries** (mémorisé sur le ctx). Si la réponse contient le même header
100
100
  il est copié dans `ctx.meta.correlationId` pour les plugins downstream
101
101
  (logger, sentry, otel).
102
102
 
103
+ > 💡 **Pattern "X-Request-Id"** : si ton backend (ops, ELK, Datadog…) utilise
104
+ > le header `X-Request-Id` plutôt que `X-Correlation-Id` pour stitcher les
105
+ > logs front/back, change juste `headerName` :
106
+ >
107
+ > ```ts
108
+ > correlationIdGuard({ headerName: "X-Request-Id" })
109
+ > ```
110
+ >
111
+ > Pas besoin d'OpenTelemetry côté front, ni d'un second guard : c'est le même
112
+ > mécanisme avec un nom différent. Combinable avec un OTel `traceparent` :
113
+ > les deux headers coexistent sans conflit.
114
+
103
115
  ### `idempotencyGuard({ headerName?, applyTo?, respectExisting? })`
104
116
 
105
117
  Injecte un header `X-Idempotency-Key` (UUID par défaut) sur `POST`/`PUT`/`PATCH`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cedvict/http-guardian",
3
- "version": "0.0.1-next.10",
3
+ "version": "0.0.1-next.11",
4
4
  "description": "Configurable HTTP client for TypeScript: auth (bearer/cookie), guards, cache+dedupe, dynamic envelope parsing presets, notifications, redirect handling.",
5
5
  "type": "module",
6
6
  "exports": {
@@ -43,7 +43,7 @@
43
43
  "license": "MIT",
44
44
  "repository": {
45
45
  "type": "git",
46
- "url": "git+https://github.com/cedvict/http-guardian.git"
46
+ "url": "git+https://gitlab.com/code-libs/npm/http-guardian.git"
47
47
  },
48
48
  "scripts": {
49
49
  "build": "tsup && tsc -p tsconfig.dts.json",
@@ -66,5 +66,9 @@
66
66
  "vitest": "^1.5.0",
67
67
  "@typescript-eslint/parser": "^8.0.0",
68
68
  "@typescript-eslint/eslint-plugin": "^8.0.0"
69
- }
69
+ },
70
+ "bugs": {
71
+ "url": "https://gitlab.com/code-libs/npm/http-guardian/-/issues"
72
+ },
73
+ "homepage": "https://gitlab.com/code-libs/npm/http-guardian"
70
74
  }