@cyanheads/federal-regulations-mcp-server 0.2.2 → 0.2.4
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/AGENTS.md +9 -9
- package/CLAUDE.md +9 -9
- package/Dockerfile +12 -5
- package/README.md +2 -1
- package/changelog/0.2.x/0.2.3.md +24 -0
- package/changelog/0.2.x/0.2.4.md +11 -0
- package/changelog/template.md +55 -16
- package/dist/mcp-server/tools/definitions/browse-cfr.tool.d.ts +3 -3
- package/dist/mcp-server/tools/definitions/browse-cfr.tool.js +3 -3
- package/dist/mcp-server/tools/definitions/browse-cfr.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/find-comments.tool.d.ts +2 -2
- package/dist/mcp-server/tools/definitions/find-comments.tool.js +2 -2
- package/dist/mcp-server/tools/definitions/find-comments.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/get-cfr-section.tool.d.ts +3 -3
- package/dist/mcp-server/tools/definitions/get-cfr-section.tool.js +3 -3
- package/dist/mcp-server/tools/definitions/get-cfr-section.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/index.d.ts +8 -8
- package/dist/mcp-server/tools/definitions/list-open-comments.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/list-open-comments.tool.js +2 -2
- package/dist/mcp-server/tools/definitions/list-open-comments.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/search-rules.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/search-rules.tool.js +2 -2
- package/dist/mcp-server/tools/definitions/search-rules.tool.js.map +1 -1
- package/dist/services/ecfr/ecfr-service.d.ts +26 -7
- package/dist/services/ecfr/ecfr-service.d.ts.map +1 -1
- package/dist/services/ecfr/ecfr-service.js +53 -27
- package/dist/services/ecfr/ecfr-service.js.map +1 -1
- package/dist/services/ecfr-mirror/ecfr-mirror.d.ts.map +1 -1
- package/dist/services/ecfr-mirror/ecfr-mirror.js +27 -2
- package/dist/services/ecfr-mirror/ecfr-mirror.js.map +1 -1
- package/dist/services/federal-register/federal-register-service.d.ts +3 -2
- package/dist/services/federal-register/federal-register-service.d.ts.map +1 -1
- package/dist/services/federal-register/federal-register-service.js +19 -16
- package/dist/services/federal-register/federal-register-service.js.map +1 -1
- package/dist/services/regulations-gov/regulations-gov-service.d.ts +10 -0
- package/dist/services/regulations-gov/regulations-gov-service.d.ts.map +1 -1
- package/dist/services/regulations-gov/regulations-gov-service.js +39 -17
- package/dist/services/regulations-gov/regulations-gov-service.js.map +1 -1
- package/dist/services/request-budget.d.ts +63 -0
- package/dist/services/request-budget.d.ts.map +1 -0
- package/dist/services/request-budget.js +95 -0
- package/dist/services/request-budget.js.map +1 -0
- package/dist/services/upstream-failure.d.ts +48 -19
- package/dist/services/upstream-failure.d.ts.map +1 -1
- package/dist/services/upstream-failure.js +86 -11
- package/dist/services/upstream-failure.js.map +1 -1
- package/package.json +8 -8
- package/scripts/_mirror-context.ts +1 -1
- package/server.json +3 -3
- package/dist/services/request-context.d.ts +0 -13
- package/dist/services/request-context.d.ts.map +0 -1
- package/dist/services/request-context.js +0 -23
- package/dist/services/request-context.js.map +0 -1
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @fileoverview
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
2
|
+
* @fileoverview How every upstream call on this surface is run, and how whatever
|
|
3
|
+
* it fails with becomes `upstream_unavailable`. `runUpstream` is the one pipeline
|
|
4
|
+
* all three services fetch through — attempt deadline, retry, request budget,
|
|
5
|
+
* classification — and the rest are the pieces it composes: `fetchUpstream`
|
|
6
|
+
* raises a transport failure from a request that never produced a response,
|
|
7
|
+
* `rethrowTransportFailure` re-codes the 5xx statuses the status→code map does
|
|
8
|
+
* not call one, `retryTransportOnly` says which of them a retry can fix, and
|
|
9
|
+
* `withUpstreamReason` stamps the contract reason onto whichever transport
|
|
10
|
+
* failure reaches it.
|
|
8
11
|
*
|
|
9
12
|
* Every tool on this surface declares `upstream_unavailable`, but the failure it
|
|
10
13
|
* describes is raised below any handler: the framework's fetch pipeline
|
|
@@ -21,7 +24,8 @@
|
|
|
21
24
|
* site).
|
|
22
25
|
* @module services/upstream-failure
|
|
23
26
|
*/
|
|
24
|
-
import { JsonRpcErrorCode, McpError, serviceUnavailable } from '@cyanheads/mcp-ts-core/errors';
|
|
27
|
+
import { JsonRpcErrorCode, McpError, serviceUnavailable, timeout, } from '@cyanheads/mcp-ts-core/errors';
|
|
28
|
+
import { withRetry } from '@cyanheads/mcp-ts-core/utils';
|
|
25
29
|
/**
|
|
26
30
|
* Perform an upstream request, raising a classified `ServiceUnavailable` when it
|
|
27
31
|
* never produced a response.
|
|
@@ -45,9 +49,9 @@ import { JsonRpcErrorCode, McpError, serviceUnavailable } from '@cyanheads/mcp-t
|
|
|
45
49
|
*
|
|
46
50
|
* An abort is the exception and re-throws untouched: the caller ending its own
|
|
47
51
|
* request is not an upstream failure, and the framework already classifies it.
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
52
|
+
* That covers an attempt deadline too — {@link runUpstream} composes it into
|
|
53
|
+
* `init.signal` and identifies its own expiry above this wrapper, so the raw
|
|
54
|
+
* rejection is exactly what it needs to see.
|
|
51
55
|
*/
|
|
52
56
|
export async function fetchUpstream(url, init, { service, operation }) {
|
|
53
57
|
try {
|
|
@@ -133,11 +137,82 @@ export function retryTransportOnly(error) {
|
|
|
133
137
|
* Anything else passes through untouched — an already-classified domain failure,
|
|
134
138
|
* a parse error, a caller abort, a programmer error.
|
|
135
139
|
*/
|
|
136
|
-
|
|
140
|
+
function withUpstreamReason(work, ctx) {
|
|
137
141
|
return work.catch((err) => {
|
|
138
142
|
if (!(err instanceof McpError) || !TRANSPORT_CODES.has(err.code))
|
|
139
143
|
throw err;
|
|
140
144
|
throw serviceUnavailable(err.message, { ...err.data, reason: 'upstream_unavailable', ...ctx.recoveryFor('upstream_unavailable') }, { cause: err });
|
|
141
145
|
});
|
|
142
146
|
}
|
|
147
|
+
/**
|
|
148
|
+
* Run one upstream fetch+parse pipeline: an attempt deadline, `withRetry` around
|
|
149
|
+
* it, the request's shared wall-clock budget over both, and the classification
|
|
150
|
+
* that turns whatever comes out into a reason the caller can switch on.
|
|
151
|
+
*
|
|
152
|
+
* **Three deadlines, one clock.** `attempt` is handed the deadline for *this*
|
|
153
|
+
* attempt — the shorter of the leg's own and what the budget has left — and a
|
|
154
|
+
* signal that fires when it expires. The budget's signal drives `withRetry`, so
|
|
155
|
+
* a spent budget ends the loop and cuts short a backoff already sleeping rather
|
|
156
|
+
* than waiting out an attempt that cannot finish in time. Nothing here is
|
|
157
|
+
* per-call: a tool making three upstream calls draws all of them down the same
|
|
158
|
+
* budget, so the answer arrives inside the client's request timeout regardless
|
|
159
|
+
* of how the work is split.
|
|
160
|
+
*
|
|
161
|
+
* **A deadline is not a cancellation.** The attempt signal composes the caller's
|
|
162
|
+
* own, so both abort the same fetch — but the two answer differently, and have
|
|
163
|
+
* to. A deadline is the upstream failing to respond, so it leaves as a `Timeout`
|
|
164
|
+
* that {@link withUpstreamReason} stamps `upstream_unavailable`, retryable and
|
|
165
|
+
* actionable. A caller abort is the caller ending its own request, with nothing
|
|
166
|
+
* to recover and nothing to advertise, so it passes through with whatever
|
|
167
|
+
* classification the layer that caught it gave it. They are told apart by
|
|
168
|
+
* identity — this attempt's own abort reason, and the caller's `ctx.signal` —
|
|
169
|
+
* never by the rejection's text, which is a different string per runtime.
|
|
170
|
+
*/
|
|
171
|
+
export function runUpstream(ctx, budget, spec, attempt) {
|
|
172
|
+
const attempts = withRetry(() => runAttempt(ctx, budget.attemptMs(spec.attemptMs), spec.operation, attempt), {
|
|
173
|
+
operation: spec.operation,
|
|
174
|
+
context: spec.context,
|
|
175
|
+
baseDelayMs: spec.baseDelayMs,
|
|
176
|
+
signal: budget.signal,
|
|
177
|
+
...(spec.isTransient && { isTransient: spec.isTransient }),
|
|
178
|
+
});
|
|
179
|
+
return withUpstreamReason(asSpentBudget(attempts, ctx, budget, spec.operation), ctx);
|
|
180
|
+
}
|
|
181
|
+
/** One attempt under its own deadline, raised as a `Timeout` when it expires. */
|
|
182
|
+
async function runAttempt(ctx, deadlineMs, operation, attempt) {
|
|
183
|
+
const controller = new AbortController();
|
|
184
|
+
const message = `${operation} exceeded its ${deadlineMs}ms deadline.`;
|
|
185
|
+
const expiry = new DOMException(message, 'TimeoutError');
|
|
186
|
+
const timer = setTimeout(() => controller.abort(expiry), deadlineMs);
|
|
187
|
+
try {
|
|
188
|
+
return await attempt(deadlineMs, AbortSignal.any([controller.signal, ctx.signal]));
|
|
189
|
+
}
|
|
190
|
+
catch (error) {
|
|
191
|
+
// Identity, not message: the rejection a runtime raises for an aborted fetch
|
|
192
|
+
// says nothing reliable, and the caller's own abort travels the same signal.
|
|
193
|
+
if (controller.signal.reason !== expiry || ctx.signal.aborted)
|
|
194
|
+
throw error;
|
|
195
|
+
throw timeout(message, { operation, errorSource: 'AttemptDeadline' }, { cause: error });
|
|
196
|
+
}
|
|
197
|
+
finally {
|
|
198
|
+
clearTimeout(timer);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Classify a budget that ran out between attempts.
|
|
203
|
+
*
|
|
204
|
+
* A budget spent mid-backoff rejects out of `withRetry`'s sleep with the raw
|
|
205
|
+
* abort reason, which carries no code — so an exhausted budget would answer as
|
|
206
|
+
* whatever the framework's classifier made of a `DOMException`, while the same
|
|
207
|
+
* budget spent mid-attempt answered `upstream_unavailable`. One failure, one
|
|
208
|
+
* answer. An error that already classified itself is left alone, and a caller
|
|
209
|
+
* abort is never read as a spent budget.
|
|
210
|
+
*/
|
|
211
|
+
function asSpentBudget(work, ctx, budget, operation) {
|
|
212
|
+
return work.catch((error) => {
|
|
213
|
+
if (error instanceof McpError || ctx.signal.aborted || !budget.expired())
|
|
214
|
+
throw error;
|
|
215
|
+
throw timeout(`${operation} exhausted the request's upstream budget.`, { operation, errorSource: 'RequestBudget' }, { cause: error });
|
|
216
|
+
});
|
|
217
|
+
}
|
|
143
218
|
//# sourceMappingURL=upstream-failure.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upstream-failure.js","sourceRoot":"","sources":["../../src/services/upstream-failure.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"upstream-failure.js","sourceRoot":"","sources":["../../src/services/upstream-failure.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAGH,OAAO,EACL,gBAAgB,EAChB,QAAQ,EACR,kBAAkB,EAClB,OAAO,GACR,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAuB,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAW9E;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,GAAW,EACX,IAAiB,EACjB,EAAE,OAAO,EAAE,SAAS,EAA0B;IAE9C,IAAI,CAAC;QACH,OAAO,MAAM,KAAK,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;IAChC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,IAAI,CAAC,MAAM,EAAE,OAAO,IAAI,CAAC,KAAK,YAAY,KAAK,IAAI,KAAK,CAAC,IAAI,KAAK,YAAY,CAAC,EAAE,CAAC;YACpF,MAAM,KAAK,CAAC;QACd,CAAC;QACD,MAAM,MAAM,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACtE,MAAM,kBAAkB,CACtB,GAAG,OAAO,0BAA0B,MAAM,EAAE,EAC5C,EAAE,SAAS,EAAE,EACb;YACE,KAAK,EAAE,KAAK;SACb,CACF,CAAC;IACJ,CAAC;AACH,CAAC;AAED;;;;;GAKG;AACH,MAAM,eAAe,GAAG,IAAI,GAAG,CA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AU,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IACrF,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,6EAA6E;QAC7E,6EAA6E;QAC7E,IAAI,UAAU,CAAC,MAAM,CAAC,MAAM,KAAK,MAAM,IAAI,GAAG,CAAC,MAAM,CAAC,OAAO;YAAE,MAAM,KAAK,CAAC;QAC3E,MAAM,OAAO,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,WAAW,EAAE,iBAAiB,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;IAC1F,CAAC;YAAS,CAAC;QACT,YAAY,CAAC,KAAK,CAAC,CAAC;IACtB,CAAC;AACH,CAAC;AAED;;;;;;;;;GASG;AACH,SAAS,aAAa,CACpB,IAAgB,EAChB,GAAY,EACZ,MAAqB,EACrB,SAAiB;IAEjB,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,KAAc,EAAE,EAAE;QACnC,IAAI,KAAK,YAAY,QAAQ,IAAI,GAAG,CAAC,MAAM,CAAC,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE;YAAE,MAAM,KAAK,CAAC;QACtF,MAAM,OAAO,CACX,GAAG,SAAS,2CAA2C,EACvD,EAAE,SAAS,EAAE,WAAW,EAAE,eAAe,EAAE,EAC3C,EAAE,KAAK,EAAE,KAAK,EAAE,CACjB,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cyanheads/federal-regulations-mcp-server",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.4",
|
|
4
4
|
"mcpName": "io.github.cyanheads/federal-regulations-mcp-server",
|
|
5
5
|
"description": "Search and trace US federal rules across the Federal Register (proposed/final rules and notices), the eCFR (codified, point-in-time CFR full text, locally mirrored), and Regulations.gov (rulemaking dockets and public comments) via MCP. STDIO or Streamable HTTP.",
|
|
6
6
|
"type": "module",
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
},
|
|
70
70
|
"homepage": "https://github.com/cyanheads/federal-regulations-mcp-server#readme",
|
|
71
71
|
"license": "Apache-2.0",
|
|
72
|
-
"packageManager": "bun@1.
|
|
72
|
+
"packageManager": "bun@1.4.0",
|
|
73
73
|
"author": "Casey Hand <casey@caseyjhand.com> (https://caseyjhand.com)",
|
|
74
74
|
"engines": {
|
|
75
75
|
"bun": ">=1.3.0",
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
"access": "public"
|
|
80
80
|
},
|
|
81
81
|
"dependencies": {
|
|
82
|
-
"@cyanheads/mcp-ts-core": "
|
|
82
|
+
"@cyanheads/mcp-ts-core": "0.12.3",
|
|
83
83
|
"pino-pretty": "^13.1.3",
|
|
84
84
|
"zod": "^4.4.3"
|
|
85
85
|
},
|
|
@@ -92,14 +92,14 @@
|
|
|
92
92
|
"postcss": "^8.5.23"
|
|
93
93
|
},
|
|
94
94
|
"devDependencies": {
|
|
95
|
-
"@biomejs/biome": "2.5.
|
|
95
|
+
"@biomejs/biome": "2.5.9",
|
|
96
96
|
"@socketsecurity/bun-security-scanner": "^1.1.2",
|
|
97
|
-
"@types/node": "26.
|
|
98
|
-
"better-sqlite3": "^13.0.
|
|
97
|
+
"@types/node": "26.2.0",
|
|
98
|
+
"better-sqlite3": "^13.0.3",
|
|
99
99
|
"depcheck": "^1.4.7",
|
|
100
100
|
"ignore": "^7.0.6",
|
|
101
|
-
"tsc-alias": "^1.9.
|
|
101
|
+
"tsc-alias": "^1.9.2",
|
|
102
102
|
"typescript": "^7.0.2",
|
|
103
|
-
"vitest": "^4.1.
|
|
103
|
+
"vitest": "^4.1.11"
|
|
104
104
|
}
|
|
105
105
|
}
|
|
@@ -27,7 +27,7 @@ export function mirrorLogContext(
|
|
|
27
27
|
operation: string,
|
|
28
28
|
fields: Record<string, unknown>,
|
|
29
29
|
): RequestContext {
|
|
30
|
-
return requestContextService.createRequestContext({ operation,
|
|
30
|
+
return requestContextService.createRequestContext({ operation, additionalContext: fields });
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
/**
|
package/server.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"url": "https://github.com/cyanheads/federal-regulations-mcp-server",
|
|
7
7
|
"source": "github"
|
|
8
8
|
},
|
|
9
|
-
"version": "0.2.
|
|
9
|
+
"version": "0.2.4",
|
|
10
10
|
"remotes": [
|
|
11
11
|
{
|
|
12
12
|
"type": "streamable-http",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"registryBaseUrl": "https://registry.npmjs.org",
|
|
20
20
|
"identifier": "@cyanheads/federal-regulations-mcp-server",
|
|
21
21
|
"runtimeHint": "node",
|
|
22
|
-
"version": "0.2.
|
|
22
|
+
"version": "0.2.4",
|
|
23
23
|
"packageArguments": [
|
|
24
24
|
{
|
|
25
25
|
"type": "positional",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"registryBaseUrl": "https://registry.npmjs.org",
|
|
56
56
|
"identifier": "@cyanheads/federal-regulations-mcp-server",
|
|
57
57
|
"runtimeHint": "node",
|
|
58
|
-
"version": "0.2.
|
|
58
|
+
"version": "0.2.4",
|
|
59
59
|
"packageArguments": [
|
|
60
60
|
{
|
|
61
61
|
"type": "positional",
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview Shared helper to derive a framework `RequestContext` from the
|
|
3
|
-
* handler `Context` for the HTTP utilities (`fetchWithTimeout`, `withRetry`),
|
|
4
|
-
* which are typed against the open `RequestContext` bag rather than the closed
|
|
5
|
-
* handler `Context`. Centralizes the canonical-field projection so the three
|
|
6
|
-
* data-source services don't each repeat it.
|
|
7
|
-
* @module services/request-context
|
|
8
|
-
*/
|
|
9
|
-
import type { Context } from '@cyanheads/mcp-ts-core';
|
|
10
|
-
import type { RequestContext } from '@cyanheads/mcp-ts-core/utils';
|
|
11
|
-
/** Build a correlated `RequestContext` from a handler `Context` for an operation. */
|
|
12
|
-
export declare function toRequestContext(ctx: Context, operation: string): RequestContext;
|
|
13
|
-
//# sourceMappingURL=request-context.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"request-context.d.ts","sourceRoot":"","sources":["../../src/services/request-context.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAGnE,qFAAqF;AACrF,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,GAAG,cAAc,CAWhF"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview Shared helper to derive a framework `RequestContext` from the
|
|
3
|
-
* handler `Context` for the HTTP utilities (`fetchWithTimeout`, `withRetry`),
|
|
4
|
-
* which are typed against the open `RequestContext` bag rather than the closed
|
|
5
|
-
* handler `Context`. Centralizes the canonical-field projection so the three
|
|
6
|
-
* data-source services don't each repeat it.
|
|
7
|
-
* @module services/request-context
|
|
8
|
-
*/
|
|
9
|
-
import { requestContextService } from '@cyanheads/mcp-ts-core/utils';
|
|
10
|
-
/** Build a correlated `RequestContext` from a handler `Context` for an operation. */
|
|
11
|
-
export function toRequestContext(ctx, operation) {
|
|
12
|
-
return requestContextService.createRequestContext({
|
|
13
|
-
operation,
|
|
14
|
-
parentContext: {
|
|
15
|
-
requestId: ctx.requestId,
|
|
16
|
-
timestamp: ctx.timestamp,
|
|
17
|
-
...(ctx.traceId ? { traceId: ctx.traceId } : {}),
|
|
18
|
-
...(ctx.spanId ? { spanId: ctx.spanId } : {}),
|
|
19
|
-
...(ctx.tenantId ? { tenantId: ctx.tenantId } : {}),
|
|
20
|
-
},
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
//# sourceMappingURL=request-context.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"request-context.js","sourceRoot":"","sources":["../../src/services/request-context.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAErE,qFAAqF;AACrF,MAAM,UAAU,gBAAgB,CAAC,GAAY,EAAE,SAAiB;IAC9D,OAAO,qBAAqB,CAAC,oBAAoB,CAAC;QAChD,SAAS;QACT,aAAa,EAAE;YACb,SAAS,EAAE,GAAG,CAAC,SAAS;YACxB,SAAS,EAAE,GAAG,CAAC,SAAS;YACxB,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YAChD,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YAC7C,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SACpD;KACF,CAAC,CAAC;AACL,CAAC"}
|