@stainlessdev/xray-core 0.5.1 → 0.6.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.
@@ -20,7 +20,17 @@ interface RedactionConfig {
20
20
  replacement: string;
21
21
  }
22
22
  interface RequestIdConfig {
23
+ /**
24
+ * Incoming request header name to read request IDs from. Set or overwrite
25
+ * this header in your own middleware before X-ray runs if you don't want to
26
+ * trust client-supplied IDs. This is normalized to lowercase during
27
+ * configuration.
28
+ */
23
29
  header: string;
30
+ /**
31
+ * Generate a UUIDv7 when no request ID is present on the request or header.
32
+ * When disabled and no ID is found, X-ray uses an empty string.
33
+ */
24
34
  generate: boolean;
25
35
  }
26
36
  interface RouteConfig {
@@ -37,6 +47,11 @@ interface XrayConfig {
37
47
  exporter?: Partial<ExporterConfig>;
38
48
  capture?: Partial<CaptureConfig>;
39
49
  redaction?: Partial<RedactionConfig>;
50
+ /**
51
+ * Request ID resolution settings. The header is read from incoming request headers.
52
+ * Set or overwrite that header before X-ray runs if you don't want to trust
53
+ * client-supplied IDs.
54
+ */
40
55
  requestId?: Partial<RequestIdConfig>;
41
56
  route?: Partial<RouteConfig>;
42
57
  }
@@ -117,6 +132,12 @@ interface NormalizedRequest {
117
132
  route?: string;
118
133
  headers: Record<string, string | string[]>;
119
134
  body?: CapturedBody;
135
+ /**
136
+ * Optional explicit request ID. If omitted, X-ray reads from incoming request
137
+ * headers (and generates a UUIDv7 if enabled). When generation is disabled
138
+ * and no ID is found, X-ray uses an empty string. Set or overwrite that
139
+ * header before X-ray runs if you don't want to trust client-supplied IDs.
140
+ */
120
141
  requestId?: string;
121
142
  remoteAddress?: string;
122
143
  startTimeMs: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stainlessdev/xray-core",
3
- "version": "0.5.1",
3
+ "version": "0.6.0",
4
4
  "description": "Core instrumentation for Stainless X-ray request logging",
5
5
  "files": [
6
6
  "dist"