@nest-mcp/nestjs 2.0.0-alpha.0 → 2.1.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 +231 -0
- package/dist/index.d.mts +24 -3
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +18 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,236 @@
|
|
|
1
1
|
# @nest-mcp/nestjs
|
|
2
2
|
|
|
3
|
+
## 2.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- ba91202: Add host-managed sign-in to the OAuth authorization-server proxy, for hosts whose identity provider
|
|
8
|
+
cannot be an OAuth redirect target (a client-side identity SDK, a session-cookie login). Configure
|
|
9
|
+
`hostSignIn` instead of `upstream` on `McpOAuthProxy` (`oauth.proxy.hostSignIn` in Nest, a provider
|
|
10
|
+
with `getHostSignIn()`): the approved consent sends the browser to the host's own sign-in page, and
|
|
11
|
+
the host completes the transaction with `McpOAuthProxy.completeHostSignIn()` (or
|
|
12
|
+
`McpOAuthService.completeHostSignIn()`), which returns the proxy callback URL with a single-use
|
|
13
|
+
sign-in code bound to the transaction. The callback keeps every proxy invariant: it verifies the
|
|
14
|
+
transaction's session-binding cookie before consuming the transaction or the code, the transaction
|
|
15
|
+
must have been consented to, and two-tier PKCE, single-use codes and refresh-family revocation are
|
|
16
|
+
unchanged. `hostSignIn.subject: "verbatim"` puts the host's opaque account id in `sub` instead of a
|
|
17
|
+
pseudonym, and `hostSignIn.confirmAccount()` re-checks the account on every refresh (`false` revokes
|
|
18
|
+
the grant). Grants from a host sign-in hold no upstream tokens (`McpGrantRecord.upstream` is now
|
|
19
|
+
optional).
|
|
20
|
+
|
|
21
|
+
The default consent page's CSP now admits the consent post's redirect targets (the sign-in page or
|
|
22
|
+
upstream authorization endpoint, and the client's redirect URI) in `form-action`, which browsers
|
|
23
|
+
apply to redirects after a form submission; custom consent renderers receive them as
|
|
24
|
+
`McpConsentViewModel.navigationTargets`.
|
|
25
|
+
|
|
26
|
+
### Patch Changes
|
|
27
|
+
|
|
28
|
+
- Updated dependencies [ba91202]
|
|
29
|
+
- @nest-mcp/auth@2.1.0
|
|
30
|
+
- @nest-mcp/client@2.1.0
|
|
31
|
+
- @nest-mcp/core@2.1.0
|
|
32
|
+
- @nest-mcp/gateway@2.1.0
|
|
33
|
+
- @nest-mcp/manager@2.1.0
|
|
34
|
+
- @nest-mcp/server@2.1.0
|
|
35
|
+
|
|
36
|
+
## 2.0.0
|
|
37
|
+
|
|
38
|
+
### Major Changes
|
|
39
|
+
|
|
40
|
+
- 4ddbd56: First stable release of the 2.x line. The packages build on the v2 MCP TypeScript SDK, implement the `2026-07-28` protocol revision, target NestJS 12 and Node.js 22.13 or newer, and are ESM-only. From this release the line follows Semantic Versioning: no breaking changes to the public API within 2.x.
|
|
41
|
+
|
|
42
|
+
The 1.x line stays available under a `1` version range (`@nest-mcp/server@1`, `@nest-mcp/client@1`, `@nest-mcp/gateway@1`). 2.x has a different package layout and API, so moving to it is a migration rather than an in-place upgrade.
|
|
43
|
+
|
|
44
|
+
### Minor Changes
|
|
45
|
+
|
|
46
|
+
- fea134c: Add optional static `httpRoutes` to `McpModule.forRoot` and `forRootAsync`. The module generates Nest
|
|
47
|
+
controllers for named MCP runtimes and optional OAuth resource discovery documents, preserving
|
|
48
|
+
class decorators, guards, interceptors, versioning, and the existing authenticated HTTP pipeline.
|
|
49
|
+
Applications can remove boilerplate MCP transport controllers while keeping their own consent,
|
|
50
|
+
upload, and other product routes. Existing controller factories and direct handlers remain supported.
|
|
51
|
+
- fea134c: Add process-local dynamic gateway topology with revision-fenced attach, detach, and atomic replace
|
|
52
|
+
operations. Dynamic gateways advertise list-change support from an empty topology while retaining
|
|
53
|
+
collision-free tool, prompt, resource, and resource-template routing.
|
|
54
|
+
- fea134c: **Breaking default:** MCP HTTP serving now applies a fail-closed security posture. Browser requests
|
|
55
|
+
from routable origins are rejected until their hostnames are listed in
|
|
56
|
+
`httpSecurity.allowedOriginHostnames` (requests without an `Origin` header are unaffected); opt out
|
|
57
|
+
entirely with `allowedOriginHostnames: false`. Request bodies are capped at 1 MiB by default
|
|
58
|
+
(`maxBodyBytes`), enforced on the raw Node stream before the SDK buffers it and again at the fetch
|
|
59
|
+
layer.
|
|
60
|
+
|
|
61
|
+
Added MCP-aware CORS: the 2026-07-28 revision's `Mcp-Method`/`Mcp-Name` headers make every browser
|
|
62
|
+
MCP POST CORS-preflighted, and the SDK handler answers preflights with 405 — the runtime now
|
|
63
|
+
answers them for allowed origins and decorates responses. `@nest-mcp/server/security` gains
|
|
64
|
+
`resolveMcpHttpSecurity`, `hardenMcpFetch`, `McpHardenedServer`, `withMcpNodeBodyLimit`, and the
|
|
65
|
+
`MCP_CORS_*` header constants; runtime observers see pre-dispatch rejections as `request:rejected`
|
|
66
|
+
events. `@nest-mcp/nestjs` adds `mcpCorsOptions()` for `app.enableCors()` and a
|
|
67
|
+
`getHttpSecurityOptions()` controller override that replaces the runtime posture for one route.
|
|
68
|
+
|
|
69
|
+
- fea134c: Bootstrap the Nest MCP v2 runtime, client, server, observability, gateway, and NestJS module packages.
|
|
70
|
+
- fea134c: Add a published, framework-neutral manager for bounded dynamic MCP client generations, including
|
|
71
|
+
deterministic draining, cleanup quarantine, key-free state lifecycle subscriptions, catalog and
|
|
72
|
+
operation delegation, a lease-scoped client-runtime integration callback, and optional lifecycle
|
|
73
|
+
observation for every managed client runtime.
|
|
74
|
+
|
|
75
|
+
Expose a thin Nest adapter at `@nest-mcp/nestjs/manager` with synchronous and asynchronous module
|
|
76
|
+
configuration, provider-token generation resolvers and observers, an injectable manager service,
|
|
77
|
+
and deterministic module shutdown.
|
|
78
|
+
|
|
79
|
+
- fea134c: Add a standalone Nest-owned `McpClientModule` and injectable `McpClientService` with synchronous
|
|
80
|
+
and asynchronous configuration, module-local collaborators, optional `bootstrap.connectAll`
|
|
81
|
+
connection, failed bootstrap rollback, and deterministic shutdown. The framework-neutral
|
|
82
|
+
`McpClientRuntime` remains directly constructible from `@nest-mcp/client`.
|
|
83
|
+
|
|
84
|
+
Compose outbound clients into `McpModule` through Nest module imports instead of embedding raw
|
|
85
|
+
client runtime options in the inbound server root. Resolve callback-bearing client, gateway, and
|
|
86
|
+
server collaborators from explicit singleton provider tokens, including transport/auth factories,
|
|
87
|
+
middleware and lifecycle observers, gateway codecs and caches, request-state verification, JSON
|
|
88
|
+
schema validators, and distributed server event buses. Context-aware gateway upstream selection is
|
|
89
|
+
now supplied by an injectable `McpGatewayClientProvider`; raw structural upstreams remain available
|
|
90
|
+
only from the framework-neutral gateway package. The neutral client's default implementation
|
|
91
|
+
identity now derives its version from package metadata so prerelease bumps cannot drift. Provider
|
|
92
|
+
binding also preserves client and gateway exact-transform identity and its typed continuation
|
|
93
|
+
guarantees.
|
|
94
|
+
|
|
95
|
+
`McpHttpControllerFor()` now accepts only the server name. Compose HTTP wrappers and Node-adapter
|
|
96
|
+
error reporting through the controller's protected overrides so those paths can use injected Nest
|
|
97
|
+
providers instead of factory-captured callbacks. Nest client configuration no longer accepts a raw
|
|
98
|
+
singleton `runtime.principal`; use the provider-backed `principalResolver` seam.
|
|
99
|
+
|
|
100
|
+
- fea134c: Narrow the Nest integration to a Nest-native public surface and remove redundant construction
|
|
101
|
+
aliases across the lower runtimes.
|
|
102
|
+
|
|
103
|
+
`@nest-mcp/nestjs` now exports its module, decorators, application services, Nest configuration types,
|
|
104
|
+
and a deliberately small set of callback helpers instead of mirroring every core, client, server,
|
|
105
|
+
gateway, and observability export. Import framework-neutral APIs from their owning packages.
|
|
106
|
+
`McpModule` is local by default, ordinary Nest modules replace `forFeature()`, low-level server
|
|
107
|
+
registration uses injectable contributors, server collaborators are configured through provider
|
|
108
|
+
tokens, catalog and gateway policies are singleton Nest providers, and internal registries/options
|
|
109
|
+
tokens are no longer public application services. A second configured root fails bootstrap; put all
|
|
110
|
+
clients and servers in the application's single shared root. Use `McpCapabilitiesService` for supported live
|
|
111
|
+
capability registration. Collaborators are explicitly registered under `McpModule` so Nest module
|
|
112
|
+
isolation and lifecycle ordering are preserved.
|
|
113
|
+
|
|
114
|
+
Remove the no-op `defineMcpServer`, `defineMcpServerFeature`, and
|
|
115
|
+
`defineMcpCatalogExposureResolver` helpers; use contextual typing or `satisfies` instead. Remove
|
|
116
|
+
the redundant `createMcpGateway`, `createMcpGatewayFeature`, and
|
|
117
|
+
`createDefaultMcpClientTransportFactory` factories; construct `McpGateway` directly and use the
|
|
118
|
+
shared default client transport factory. Remove `withMcpBearerAuth` and
|
|
119
|
+
`withMcpRequestValidation`; construct `McpResourceServer` and `McpValidatedServer` directly.
|
|
120
|
+
|
|
121
|
+
- fea134c: Add `@nest-mcp/auth`, a framework-neutral OAuth toolkit for MCP resource servers, and wire it into
|
|
122
|
+
the Nest adapter through a per-server `oauth` option group (Phase 1 of the authorization-server
|
|
123
|
+
proxy roadmap).
|
|
124
|
+
|
|
125
|
+
- **`@nest-mcp/auth`**: Client ID Metadata Document resolution (SEP-991) with strict URL admission,
|
|
126
|
+
document validation against `@modelcontextprotocol/core` schemas, and an SSRF-hardened `node:https`
|
|
127
|
+
fetcher that pins DNS at connect time (no `undici` dependency); a bounded, TTL-first
|
|
128
|
+
`McpOAuthStore` contract that maps onto Redis primitives, plus a capacity-rejecting in-memory
|
|
129
|
+
implementation; an asymmetric-by-default (EdDSA/ES256, HS256 for dev) JWT key ring, issuer, and
|
|
130
|
+
verifier with JWKS publication and algorithm pinning; `createMcpProxyTokenVerifier` and
|
|
131
|
+
`createJwksTokenVerifier` (`OAuthTokenVerifier`); and a token-free principal-claims projection.
|
|
132
|
+
Subpaths `./cimd`, `./stores`, and `./testing`; `jose` is an optional peer needed only for JWKS
|
|
133
|
+
verification.
|
|
134
|
+
- **`@nest-mcp/server`**: `McpResourceServer` gains an optional fail-closed `anonymous` policy,
|
|
135
|
+
consulted only after bearer verification refuses a request.
|
|
136
|
+
- **`@nest-mcp/nestjs`**: `McpNestServerDefinition.oauth.resource` composes `McpResourceServer` bearer
|
|
137
|
+
verification and RFC 9728/8414 metadata around the HTTP handler using injected provider tokens
|
|
138
|
+
(`verifier`, optional `anonymous`), exposed via `McpRuntimeService.composeHttpHandler()` and the
|
|
139
|
+
HTTP controller's default composition seam.
|
|
140
|
+
|
|
141
|
+
Adds the OAuth 2.1 **authorization-server proxy** in front of a real upstream IdP: `@nest-mcp/auth`
|
|
142
|
+
gains `McpOAuthProxy` (authorize → consent → callback → token, refresh rotation with reuse
|
|
143
|
+
detection, two-tier PKCE, RFC 8707 resource binding, RFC 9207 `iss` validation via the client SDK),
|
|
144
|
+
`createMcpOAuthRouter`, `McpOAuthServer`, `McpUpstreamAdapter` over the official client OAuth
|
|
145
|
+
helpers, provider presets (`googleUpstream`/`githubUpstream`/`azureUpstream`/`genericUpstream`), a
|
|
146
|
+
bounded `McpMemoryOAuthStore`, and an SSRF-guarded `createSsrfGuardedFetch`. `@nest-mcp/nestjs` adds the
|
|
147
|
+
`oauth.proxy` option group (all extensibility via provider tokens — no key material in options),
|
|
148
|
+
`McpOAuthControllerFor` (explicit per-endpoint routes, dispatch by handler identity), and
|
|
149
|
+
`McpOAuthService.upstreamTokens()` for gateway user-delegation. The proxy holds upstream tokens
|
|
150
|
+
server-side and mints its own EdDSA/ES256 access tokens, so the downstream MCP client never receives
|
|
151
|
+
an upstream credential. Adversarially reviewed (56-agent workflow); all confirmed findings fixed
|
|
152
|
+
before merge.
|
|
153
|
+
|
|
154
|
+
- fea134c: Rename the Nest capability decorators to `Tool`, `Prompt`, `Resource`, and `Targets`, and remove the redundant `Mcp` prefix from their option, definition, and method-decorator types. Module, runtime, and protocol-level names remain MCP-qualified.
|
|
155
|
+
- fea134c: Return a real Zod v4 schema from `createMcpClientToolSchema`. Its Zod refinement retains exact
|
|
156
|
+
Draft 2020-12 validation and identity parsing through the official MCP validator, while the schema
|
|
157
|
+
continues to implement Standard Schema and preserve the immutable, detached remote JSON Schema
|
|
158
|
+
definition. Explicit older dialects fail closed, and the previous async Standard Schema surface
|
|
159
|
+
remains compatible.
|
|
160
|
+
- fea134c: Publish `MCP_RUNTIME_PHASES` and `MCP_RUNTIME_PROTOCOL_ERAS` as frozen tuples that mirror the
|
|
161
|
+
`McpRuntimePhase` and `McpRuntimeProtocolEra` unions through a compile-time exhaustiveness fence,
|
|
162
|
+
together with `mcpRuntimeStateSnapshotSchema`, `mcpRuntimeProbeSnapshotSchema`, and
|
|
163
|
+
`mcpRuntimeCapabilitiesSnapshotSchema`. The validators implement Standard Schema v1 without adding
|
|
164
|
+
a runtime dependency: they accept exactly what the manager emits, reject unknown properties and
|
|
165
|
+
unpublished phases, eras, or state error codes, and return a frozen normalized snapshot so hosts
|
|
166
|
+
can validate persisted projections on the way back in.
|
|
167
|
+
|
|
168
|
+
Accept an `McpRuntimeToolCallOptions` object as the fourth `callTool` argument. A positional
|
|
169
|
+
`AbortSignal` stays source compatible as the cancellation-only form, and pinning `toolDefinition`
|
|
170
|
+
threads that exact definition to the managed client runtime so structured output is validated
|
|
171
|
+
against it instead of a cached `tools/list` view. `McpManagerService` from `@nest-mcp/nestjs/manager`
|
|
172
|
+
inherits the widened call surface.
|
|
173
|
+
|
|
174
|
+
- fea134c: Add authorization-safe per-request tool catalog exposure for Nest servers and exact method- or
|
|
175
|
+
operation-specific transform helpers for client and gateway middleware. Manual input-required
|
|
176
|
+
client calls now expose their continuation result in method-keyed and high-level return types.
|
|
177
|
+
|
|
178
|
+
### Patch Changes
|
|
179
|
+
|
|
180
|
+
- fea134c: Add opt-in bounded concurrent admission across process and connector capacity, nullable connector ceilings, fair FIFO scheduling across connector keys, and distinct queue-full and admission-timeout diagnostics. Reserve transports against the existing lease ledger and retain charges through cleanup; cancellation, retirement, and shutdown remove queued work without redispatch. Expose key-free admission timing and capacity notifications.
|
|
181
|
+
- fea134c: Declare `@nest-mcp/auth` as a runtime dependency so production installs can import the built Nest
|
|
182
|
+
module's OAuth integration without relying on development dependencies. Add a first-class
|
|
183
|
+
`@nest-mcp/nestjs/client` entrypoint for outbound-only Nest applications without loading inbound server,
|
|
184
|
+
gateway, or OAuth implementation code.
|
|
185
|
+
- fea134c: Declare stable NestJS 12 peer support and refresh the validated dependency toolchain.
|
|
186
|
+
- fea134c: Publish fixed-group packages sequentially and verify each registry tarball before continuing so
|
|
187
|
+
trusted-publisher credential exchanges cannot leave a release only partially available.
|
|
188
|
+
- fea134c: Support explicit tools-only gateway composition with local MCP handlers on one authenticated server. Gateway and native tool policies remain independent, SDK registrations reject exact name collisions, and local prompts/resources retain their handlers.
|
|
189
|
+
- Updated dependencies [fea134c]
|
|
190
|
+
- Updated dependencies [fea134c]
|
|
191
|
+
- Updated dependencies [fea134c]
|
|
192
|
+
- Updated dependencies [4ddbd56]
|
|
193
|
+
- Updated dependencies [fea134c]
|
|
194
|
+
- Updated dependencies [fea134c]
|
|
195
|
+
- Updated dependencies [fea134c]
|
|
196
|
+
- Updated dependencies [fea134c]
|
|
197
|
+
- Updated dependencies [fea134c]
|
|
198
|
+
- Updated dependencies [fea134c]
|
|
199
|
+
- Updated dependencies [fea134c]
|
|
200
|
+
- Updated dependencies [fea134c]
|
|
201
|
+
- Updated dependencies [fea134c]
|
|
202
|
+
- Updated dependencies [fea134c]
|
|
203
|
+
- Updated dependencies [fea134c]
|
|
204
|
+
- Updated dependencies [fea134c]
|
|
205
|
+
- Updated dependencies [fea134c]
|
|
206
|
+
- Updated dependencies [fea134c]
|
|
207
|
+
- Updated dependencies [fea134c]
|
|
208
|
+
- Updated dependencies [fea134c]
|
|
209
|
+
- Updated dependencies [fea134c]
|
|
210
|
+
- Updated dependencies [fea134c]
|
|
211
|
+
- Updated dependencies [fea134c]
|
|
212
|
+
- Updated dependencies [fea134c]
|
|
213
|
+
- Updated dependencies [fea134c]
|
|
214
|
+
- Updated dependencies [fea134c]
|
|
215
|
+
- Updated dependencies [fea134c]
|
|
216
|
+
- Updated dependencies [fea134c]
|
|
217
|
+
- Updated dependencies [fea134c]
|
|
218
|
+
- Updated dependencies [fea134c]
|
|
219
|
+
- Updated dependencies [fea134c]
|
|
220
|
+
- Updated dependencies [fea134c]
|
|
221
|
+
- Updated dependencies [fea134c]
|
|
222
|
+
- Updated dependencies [fea134c]
|
|
223
|
+
- Updated dependencies [fea134c]
|
|
224
|
+
- Updated dependencies [fea134c]
|
|
225
|
+
- Updated dependencies [fea134c]
|
|
226
|
+
- Updated dependencies [fea134c]
|
|
227
|
+
- @nest-mcp/auth@2.0.0
|
|
228
|
+
- @nest-mcp/server@2.0.0
|
|
229
|
+
- @nest-mcp/core@2.0.0
|
|
230
|
+
- @nest-mcp/client@2.0.0
|
|
231
|
+
- @nest-mcp/manager@2.0.0
|
|
232
|
+
- @nest-mcp/gateway@2.0.0
|
|
233
|
+
|
|
3
234
|
## 2.0.0-alpha.0
|
|
4
235
|
|
|
5
236
|
### Major Changes
|
package/dist/index.d.mts
CHANGED
|
@@ -9,7 +9,7 @@ import { MaybePromise, McpAuthorizationDecision, McpAuthorizationPolicy, McpLife
|
|
|
9
9
|
import { AuthInfo, CreateMcpHandlerOptions, OAuthMetadata, OAuthTokenVerifier, ServerContext as ServerContext$1, ServerEventBus, ServerOptions, Tool as Tool$1, jsonSchemaValidator } from "@modelcontextprotocol/server";
|
|
10
10
|
import { DiscoveryService, MetadataScanner, Reflector } from "@nestjs/core";
|
|
11
11
|
import { McpClientRuntime } from "@nest-mcp/client";
|
|
12
|
-
import { McpConsentRenderer, McpFetchLike, McpOAuthClientResolver, McpOAuthProxy, McpOAuthProxyTtl, McpOAuthStore, McpTokenKeyRing, McpUpstreamAuthorizationServer, McpUpstreamSubjectResolver } from "@nest-mcp/auth";
|
|
12
|
+
import { McpConsentRenderer, McpFetchLike, McpHostSignInCompletion, McpHostSignInOptions, McpOAuthClientResolver, McpOAuthProxy, McpOAuthProxyTtl, McpOAuthStore, McpTokenKeyRing, McpUpstreamAuthorizationServer, McpUpstreamSubjectResolver } from "@nest-mcp/auth";
|
|
13
13
|
import { McpFetchHandler } from "@nest-mcp/server/auth";
|
|
14
14
|
//#region src/mcp-catalog-exposure.d.ts
|
|
15
15
|
declare const MCP_CATALOG_SEARCH_TOOL_NAME = "nest-mcp.catalog.search";
|
|
@@ -244,6 +244,14 @@ interface McpOAuthSecretProvider {
|
|
|
244
244
|
interface McpOAuthUpstreamProvider {
|
|
245
245
|
getUpstream(): McpUpstreamAuthorizationServer;
|
|
246
246
|
}
|
|
247
|
+
/**
|
|
248
|
+
* Supplies host-managed sign-in: the host's own sign-in page and account
|
|
249
|
+
* re-check, in place of an upstream IdP (see `McpHostSignInOptions`). The host
|
|
250
|
+
* completes each sign-in through `McpOAuthService.completeHostSignIn()`.
|
|
251
|
+
*/
|
|
252
|
+
interface McpOAuthHostSignInProvider {
|
|
253
|
+
getHostSignIn(): McpHostSignInOptions;
|
|
254
|
+
}
|
|
247
255
|
/** Supplies the consent screen. */
|
|
248
256
|
interface McpOAuthConsentProvider {
|
|
249
257
|
render: McpConsentRenderer;
|
|
@@ -272,7 +280,10 @@ interface McpNestOAuthProxyOptions {
|
|
|
272
280
|
readonly scopesSupported?: readonly string[];
|
|
273
281
|
readonly signingKeys: McpProviderToken<McpOAuthSigningKeyProvider>;
|
|
274
282
|
readonly secret: McpProviderToken<McpOAuthSecretProvider>;
|
|
275
|
-
|
|
283
|
+
/** The upstream IdP. Exactly one of `upstream` and `hostSignIn`. */
|
|
284
|
+
readonly upstream?: McpProviderToken<McpOAuthUpstreamProvider>;
|
|
285
|
+
/** Host-managed sign-in on the host's own page, for hosts without a redirectable IdP. */
|
|
286
|
+
readonly hostSignIn?: McpProviderToken<McpOAuthHostSignInProvider>;
|
|
276
287
|
/** Token/state storage. `McpOAuthStore` is itself the provider (structural). */
|
|
277
288
|
readonly stateStore: McpProviderToken<McpOAuthStore>;
|
|
278
289
|
readonly tokenStore?: McpProviderToken<McpOAuthStore>;
|
|
@@ -687,6 +698,16 @@ declare class McpOAuthService {
|
|
|
687
698
|
* `AuthInfo` (via its `gid` claim). Returns `undefined` when the server has
|
|
688
699
|
* no proxy, the token carries no grant id, or the grant has been revoked.
|
|
689
700
|
*/
|
|
701
|
+
/**
|
|
702
|
+
* Host-managed sign-in (`oauth.proxy.hostSignIn`): once the host has
|
|
703
|
+
* authenticated the user for a transaction, returns the proxy callback URL
|
|
704
|
+
* the browser must navigate to. Throws `McpHostSignInError` for an unknown,
|
|
705
|
+
* expired or unconsented transaction, and `McpModuleError` when the server
|
|
706
|
+
* has no proxy.
|
|
707
|
+
*/
|
|
708
|
+
completeHostSignIn(serverName: string, completion: McpHostSignInCompletion): Promise<{
|
|
709
|
+
readonly redirectTo: string;
|
|
710
|
+
}>;
|
|
690
711
|
upstreamTokens(serverName: string, authInfo: Readonly<AuthInfo>): Promise<{
|
|
691
712
|
readonly accessToken: string;
|
|
692
713
|
readonly refreshToken?: string;
|
|
@@ -712,5 +733,5 @@ declare class McpModule extends ConfigurableModuleClass {
|
|
|
712
733
|
*/
|
|
713
734
|
declare function createMcpHandlerPassthroughMiddleware(middleware: McpHandlerPassthroughMiddleware): McpHandlerMiddleware;
|
|
714
735
|
//#endregion
|
|
715
|
-
export { type CacheHint, type CallToolResult, type CompletableSchema, type CompleteCallback, type CompleteResourceTemplateCallback, type ElicitInputParams, type GetPromptResult, type Icon, type InputRequiredResult, type InputRequiredSpec, type InputResponseView, MCP_CATALOG_SCHEMAS_TOOL_NAME, MCP_CATALOG_SEARCH_TOOL_NAME, type McpAnonymousAccessPolicy, type McpAuthorizationDecision, McpCapabilitiesService, type McpCapabilityDescriptor, type McpCapabilityMutation, type McpCapabilityMutationKind, type McpCapabilityMutationObserver, type McpCapabilityMutationType, type McpCapabilityVisibility, type McpCapabilityVisibilityPolicy, type McpCatalogEagerExposure, type McpCatalogExposureKind, type McpCatalogExposurePolicy, type McpCatalogExposureResolverInput, type McpCatalogExposureStrategy, type McpCatalogLazyExposure, type McpCatalogNameSelector, type McpCatalogPredicateSelector, type McpCatalogReadonly, type McpCatalogSchemasResult, type McpCatalogSearchExposure, type McpCatalogSearchResult, type McpCatalogSearchResultTool, type McpCatalogTagSelector, type McpCatalogTool, type McpCatalogToolSelector, type McpClientAttributesResolverProvider, type McpClientBootstrapOptions, type McpClientClock, type McpClientConfiguratorProvider, type McpClientFetchMiddlewareProvider, type McpClientFetchProvider, type McpClientForRootAsyncOptions, type McpClientForRootOptions, type McpClientLifecycleErrorReporter, type McpClientMiddlewareProvider, McpClientModule, type McpClientModuleExtras, type McpClientModuleOptions, type McpClientOperationIdFactory, type McpClientPrincipalResolverProvider, type McpClientProgressObserver, type McpClientReconnectionSchedulerProvider, McpClientService, type McpCorsInput, type McpCorsOptions, type McpDynamicHandlerRegistration, type McpForRootAsyncOptions, type McpForRootOptions, type McpGatewayAuthorizationContextProvider, type McpGatewayClientProvider, type McpGatewayDiscoveryCacheProvider, type McpGatewayLifecycleObserverProvider, type McpGatewayMiddlewareProvider, type McpGatewayNameCodecProvider, type McpGatewayObserverErrorReporter, type McpGatewayPromptNameCodecProvider, type McpGatewayResourceTemplateUriCodecProvider, type McpGatewayResourceUriCodecProvider, type McpHandlerAuthorizationPolicy, type McpHandlerInvocationInput, type McpHandlerInvocationOutput, type McpHandlerInvocationOutputFor, type McpHandlerInvocationOutputMap, type McpHandlerLifecycleObserver, type McpHandlerMiddleware, type McpHandlerMiddlewareProvider, type McpHandlerOperationContext, type McpHandlerPassthroughMiddleware, McpHttpController, type McpHttpControllerClass, McpHttpControllerFor, type McpHttpDiscoveryRoutes, type McpHttpRoute, type McpHttpSecurityOptions, type McpHttpSecurityPolicy, McpModule, McpModuleError, type McpModuleErrorCode, type McpModuleExtras, type McpModuleOptions, type McpNestCatalogExposureOptions, type McpNestClientConnectOptions, type McpNestClientDefinition, type McpNestClientIdMetadataOptions, type McpNestClientLifecycleOptions, type McpNestClientOptions, type McpNestClientRuntimeOptions, type McpNestClientTransportDefinition, type McpNestCollaborators, type McpNestCorsOptions, type McpNestGatewayOptions, type McpNestGatewayProviderUpstream, type McpNestGatewayUpstream, type McpNestGatewayUpstreamDefinition, type McpNestHttpClientTransportDefinition, type McpNestOAuthMetadataOptions, type McpNestOAuthProxyOptions, type McpNestOAuthResourceOptions, type McpNestServerDefinition, type McpNestServerHttpOptions, type McpNestServerOAuthOptions, type McpNestServerOptions, type McpNestStdioClientTransportDefinition, type McpOAuthConsentProvider, McpOAuthController, type McpOAuthControllerClass, McpOAuthControllerFor, type McpOAuthFetchProvider, type McpOAuthSecretProvider, McpOAuthService, type McpOAuthSigningKeyProvider, type McpOAuthSubjectResolverProvider, type McpOAuthTokenVerifierProvider, type McpOAuthUpstreamProvider, type McpProviderToken, type McpRequestStateVerifier, McpRuntimeService, type McpServerBuildContext, type McpServerContributor, type McpServerErrorReporter, type McpServerLifecycleObserver, type McpServerMiddleware, type McpServerMiddlewareProvider, type McpServerPrincipal, type McpServerPrincipalClaims, type McpServerPrincipalClaimsProvider, type McpServerRuntimeObserverProvider, Prompt, type PromptCallback, type PromptMethodDecorator, type PromptOptions, type ReadResourceCallback, type ReadResourceResult, type ReadResourceTemplateCallback, type RequestStateCodec, type RequestStateCodecOptions, Resource, type ResourceMetadata, type ResourceMethodDecorator, type ResourceOptions, ResourceTemplate, type ServerContext, type StandardSchemaWithJSON, Targets, Tool, type ToolAnnotations, type ToolCallback, type ToolMethodDecorator, type ToolOptions, acceptedContent, allowMcpOperation, completable, createMcpHandlerPassthroughMiddleware, createRequestStateCodec, denyMcpOperation, fromJsonSchema, inputRequired, inputResponse, mcpCorsOptions };
|
|
736
|
+
export { type CacheHint, type CallToolResult, type CompletableSchema, type CompleteCallback, type CompleteResourceTemplateCallback, type ElicitInputParams, type GetPromptResult, type Icon, type InputRequiredResult, type InputRequiredSpec, type InputResponseView, MCP_CATALOG_SCHEMAS_TOOL_NAME, MCP_CATALOG_SEARCH_TOOL_NAME, type McpAnonymousAccessPolicy, type McpAuthorizationDecision, McpCapabilitiesService, type McpCapabilityDescriptor, type McpCapabilityMutation, type McpCapabilityMutationKind, type McpCapabilityMutationObserver, type McpCapabilityMutationType, type McpCapabilityVisibility, type McpCapabilityVisibilityPolicy, type McpCatalogEagerExposure, type McpCatalogExposureKind, type McpCatalogExposurePolicy, type McpCatalogExposureResolverInput, type McpCatalogExposureStrategy, type McpCatalogLazyExposure, type McpCatalogNameSelector, type McpCatalogPredicateSelector, type McpCatalogReadonly, type McpCatalogSchemasResult, type McpCatalogSearchExposure, type McpCatalogSearchResult, type McpCatalogSearchResultTool, type McpCatalogTagSelector, type McpCatalogTool, type McpCatalogToolSelector, type McpClientAttributesResolverProvider, type McpClientBootstrapOptions, type McpClientClock, type McpClientConfiguratorProvider, type McpClientFetchMiddlewareProvider, type McpClientFetchProvider, type McpClientForRootAsyncOptions, type McpClientForRootOptions, type McpClientLifecycleErrorReporter, type McpClientMiddlewareProvider, McpClientModule, type McpClientModuleExtras, type McpClientModuleOptions, type McpClientOperationIdFactory, type McpClientPrincipalResolverProvider, type McpClientProgressObserver, type McpClientReconnectionSchedulerProvider, McpClientService, type McpCorsInput, type McpCorsOptions, type McpDynamicHandlerRegistration, type McpForRootAsyncOptions, type McpForRootOptions, type McpGatewayAuthorizationContextProvider, type McpGatewayClientProvider, type McpGatewayDiscoveryCacheProvider, type McpGatewayLifecycleObserverProvider, type McpGatewayMiddlewareProvider, type McpGatewayNameCodecProvider, type McpGatewayObserverErrorReporter, type McpGatewayPromptNameCodecProvider, type McpGatewayResourceTemplateUriCodecProvider, type McpGatewayResourceUriCodecProvider, type McpHandlerAuthorizationPolicy, type McpHandlerInvocationInput, type McpHandlerInvocationOutput, type McpHandlerInvocationOutputFor, type McpHandlerInvocationOutputMap, type McpHandlerLifecycleObserver, type McpHandlerMiddleware, type McpHandlerMiddlewareProvider, type McpHandlerOperationContext, type McpHandlerPassthroughMiddleware, McpHttpController, type McpHttpControllerClass, McpHttpControllerFor, type McpHttpDiscoveryRoutes, type McpHttpRoute, type McpHttpSecurityOptions, type McpHttpSecurityPolicy, McpModule, McpModuleError, type McpModuleErrorCode, type McpModuleExtras, type McpModuleOptions, type McpNestCatalogExposureOptions, type McpNestClientConnectOptions, type McpNestClientDefinition, type McpNestClientIdMetadataOptions, type McpNestClientLifecycleOptions, type McpNestClientOptions, type McpNestClientRuntimeOptions, type McpNestClientTransportDefinition, type McpNestCollaborators, type McpNestCorsOptions, type McpNestGatewayOptions, type McpNestGatewayProviderUpstream, type McpNestGatewayUpstream, type McpNestGatewayUpstreamDefinition, type McpNestHttpClientTransportDefinition, type McpNestOAuthMetadataOptions, type McpNestOAuthProxyOptions, type McpNestOAuthResourceOptions, type McpNestServerDefinition, type McpNestServerHttpOptions, type McpNestServerOAuthOptions, type McpNestServerOptions, type McpNestStdioClientTransportDefinition, type McpOAuthConsentProvider, McpOAuthController, type McpOAuthControllerClass, McpOAuthControllerFor, type McpOAuthFetchProvider, type McpOAuthHostSignInProvider, type McpOAuthSecretProvider, McpOAuthService, type McpOAuthSigningKeyProvider, type McpOAuthSubjectResolverProvider, type McpOAuthTokenVerifierProvider, type McpOAuthUpstreamProvider, type McpProviderToken, type McpRequestStateVerifier, McpRuntimeService, type McpServerBuildContext, type McpServerContributor, type McpServerErrorReporter, type McpServerLifecycleObserver, type McpServerMiddleware, type McpServerMiddlewareProvider, type McpServerPrincipal, type McpServerPrincipalClaims, type McpServerPrincipalClaimsProvider, type McpServerRuntimeObserverProvider, Prompt, type PromptCallback, type PromptMethodDecorator, type PromptOptions, type ReadResourceCallback, type ReadResourceResult, type ReadResourceTemplateCallback, type RequestStateCodec, type RequestStateCodecOptions, Resource, type ResourceMetadata, type ResourceMethodDecorator, type ResourceOptions, ResourceTemplate, type ServerContext, type StandardSchemaWithJSON, Targets, Tool, type ToolAnnotations, type ToolCallback, type ToolMethodDecorator, type ToolOptions, acceptedContent, allowMcpOperation, completable, createMcpHandlerPassthroughMiddleware, createRequestStateCodec, denyMcpOperation, fromJsonSchema, inputRequired, inputResponse, mcpCorsOptions };
|
|
716
737
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/mcp-catalog-exposure.ts","../src/mcp-capability.types.ts","../src/decorators/mcp-handler.decorators.ts","../src/http/mcp-http-route.types.ts","../src/oauth/mcp-oauth.types.ts","../src/server/mcp-server.types.ts","../src/mcp.types.ts","../src/discovery/mcp-handler.registry.ts","../src/mcp-capabilities.service.ts","../src/discovery/mcp-handler.explorer.ts","../src/mcp-runtime.service.ts","../src/mcp-http.controller.ts","../src/mcp-cors.ts","../src/oauth/mcp-oauth.controller.ts","../src/oauth/mcp-oauth.service.ts","../src/mcp.module-definition.ts","../src/mcp.module.ts","../src/mcp-handler.middleware.ts"],"mappings":";;;;;;;;;;;;;;cAIa;cACA;KAED;;KAGA,mBAAmB,SAAS,+CACzB,eAAe,QAAQ,mBAAmB,MAAM,aAC5D,mCACa,aAAa,QAAQ,mBAAmB,MAAM,WAC1D;;UAGa;WACP,MAAM,mBAAmB;WACzB;;UAGO;WACP;WACA;;UAGO;WACP;WACA;;UAGO;WACP;WACA,YAAY,MAAM;;KAGhB,yBACX,yBAAyB,wBAAwB;UAEjC;WACP;;UAGO;WACP;;WAEA,iBAAiB;;WAEjB,kBAAkB,SAAS;;UAGpB;WACP;;WAEA,iBAAiB;;KAGf,2BACX,aAAa,yBAAyB,0BACnC,QACH,0BAA0B,2BAA2B;WAC1C,MAAM;;;UAID;WACP;WACA,KAAK;WACL,YAAY,SAAS;WACrB,SAAS;WACT,gBAAgB;;KAGd,2BACX,iBAAiB,6BAA6B,+BAC1C,OAAO,oCAAoC,aAAa;;UAG5C,yBAChB,iBAAiB,6BAA6B;EAE9C,QAAQ,OAAO,kCAAkC,aAAa;;;UAI9C;WACP,UAAU;;UAGH;WACP;WACA;WACA;WACA;;UAGO;WACP,gBAAgB;WAChB;;UAGO;WACP,gBAAgB,mBAAmB;;;;;UClG5B;EAChB,UAAU,SAAS,SAAS,2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ts","../src/mcp-capability.types.ts","../src/decorators/mcp-handler.decorators.ts","../src/http/mcp-http-route.types.ts","../src/oauth/mcp-oauth.types.ts","../src/server/mcp-server.types.ts","../src/mcp.types.ts","../src/discovery/mcp-handler.registry.ts","../src/mcp-capabilities.service.ts","../src/discovery/mcp-handler.explorer.ts","../src/mcp-runtime.service.ts","../src/mcp-http.controller.ts","../src/mcp-cors.ts","../src/oauth/mcp-oauth.controller.ts","../src/oauth/mcp-oauth.service.ts","../src/mcp.module-definition.ts","../src/mcp.module.ts","../src/mcp-handler.middleware.ts"],"mappings":";;;;;;;;;;;;;;cAIa;cACA;KAED;;KAGA,mBAAmB,SAAS,+CACzB,eAAe,QAAQ,mBAAmB,MAAM,aAC5D,mCACa,aAAa,QAAQ,mBAAmB,MAAM,WAC1D;;UAGa;WACP,MAAM,mBAAmB;WACzB;;UAGO;WACP;WACA;;UAGO;WACP;WACA;;UAGO;WACP;WACA,YAAY,MAAM;;KAGhB,yBACX,yBAAyB,wBAAwB;UAEjC;WACP;;UAGO;WACP;;WAEA,iBAAiB;;WAEjB,kBAAkB,SAAS;;UAGpB;WACP;;WAEA,iBAAiB;;KAGf,2BACX,aAAa,yBAAyB,0BACnC,QACH,0BAA0B,2BAA2B;WAC1C,MAAM;;;UAID;WACP;WACA,KAAK;WACL,YAAY,SAAS;WACrB,SAAS;WACT,gBAAgB;;KAGd,2BACX,iBAAiB,6BAA6B,+BAC1C,OAAO,oCAAoC,aAAa;;UAG5C,yBAChB,iBAAiB,6BAA6B;EAE9C,QAAQ,OAAO,kCAAkC,aAAa;;;UAI9C;WACP,UAAU;;UAGH;WACP;WACA;WACA;WACA;;UAGO;WACP,gBAAgB;WAChB;;UAGO;WACP,gBAAgB,mBAAmB;;;;;UClG5B;EAChB,UAAU,SAAS,SAAS,2BAAyB;;;KAI1C,oCAAoC,eAAe;;UAG9C,8BAA8B;WACrC;;EAET,QAAQ,SAAS;;EAEjB;;KAGW;KACA;;UAGK;WACP,MAAM;WACN,MA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AOH,mBAAmB;;;;;KC1Zd,uCACX,gBAAgB,sBACZ;;;;;;;;;uBAUiB;;mBACmC;EAAxD,YAAwD,gBAAgB;gBAE1D;EASR,iBACE,kBACqB,oBAC1B;;;;;;YAgBO,oBAAoB,mBAAmB;;;;;;YASvC,qBAAqB,SAAS,mBAAmB;;YAKjD,yBAAyB,SAAS;;;;;;YASlC,0BAA0B;;;;;;;;;;;;;;;;;iBAwCrB,qBAAqB,qBAAqB;;;UC1HzC;;WAEP;;WAEA;WACA;WACA;WACA;;;;;;UAOO;EAChB;EACA;EACA;EACA;EACA;EACA;;;;;;;;;;iBAWe,eAAe,OAAO,eAAe;;;;KC3BzC,wCACX,gBAAgB,sBACZ;;;;;;;;;;uBAaiB;;mBACmC;EAAxD,YAAwD,gBAAgB;gBAE1D;EAOR,4BAAwD,oBAAoB;EAK5E,KAAiC,oBAAoB;EAKrD,0BAAsD,oBAAoB;EAK1E,UACE,kBACqB,oBAC1B;EAMG,QACE,kBACqB,oBAC1B;EAMG,SACE,kBACqB,oBAC1B;EAMG,MACE,kBACqB,oBAC1B;;;;;;;;;;;;;;iBAyCY,sBAAsB,qBAAqB;;;;;;;;cC/G9C;mBACiB;EAA7B,YAA6B,gBAAgB;;;;;;;;;;;;;EAcvC,mBACL,oBACA,YAAY,0BACV;aAAmB;;EAWhB,eACL,oBACA,UAAU,SAAS,YACjB;aACW;aAA8B;aAAgC;;;;;cCvC9D,kDAAuB,sBAAA,iDAAA,kBAAE,cAAY,mBAAA,QAAA,kBAAE,6CAAkB,+BAAA,wCAAA,QAAA;KAwB5D,2BAA2B;KAC3B,gCAAgC;;;cCF/B,kBAAkB;SACd,QAAQ,UAAS,oBAAyB;SAI1C,aAAa,SAAS,yBAAyB;;;;;;;;iBCpBhD,sCACf,YAAY,kCACV"}
|
package/dist/index.mjs
CHANGED
|
@@ -1338,7 +1338,9 @@ function resolveProxy(options, providers, serverName) {
|
|
|
1338
1338
|
if (!Array.isArray(proxyOptions.resources) || proxyOptions.resources.length === 0 || typeof primaryResource !== "string") throw new McpModuleError("INVALID_OPTIONS", `MCP server "${serverName}" oauth.proxy.resources must list at least one resource URL.`);
|
|
1339
1339
|
const signingKeys = requireMethodProvider(providers, proxyOptions.signingKeys, "getSigningKeys").getSigningKeys();
|
|
1340
1340
|
const masterSecret = requireMethodProvider(providers, proxyOptions.secret, "getMasterSecret").getMasterSecret();
|
|
1341
|
-
|
|
1341
|
+
if (proxyOptions.upstream === void 0 === (proxyOptions.hostSignIn === void 0)) throw new McpModuleError("INVALID_OPTIONS", `MCP server "${serverName}" oauth.proxy must configure exactly one of upstream and hostSignIn.`);
|
|
1342
|
+
const upstreamConfig = proxyOptions.upstream === void 0 ? void 0 : requireMethodProvider(providers, proxyOptions.upstream, "getUpstream").getUpstream();
|
|
1343
|
+
const hostSignIn = proxyOptions.hostSignIn === void 0 ? void 0 : requireMethodProvider(providers, proxyOptions.hostSignIn, "getHostSignIn").getHostSignIn();
|
|
1342
1344
|
const stateStore = requireMethodProvider(providers, proxyOptions.stateStore, "take");
|
|
1343
1345
|
const tokenStore = proxyOptions.tokenStore === void 0 ? void 0 : requireMethodProvider(providers, proxyOptions.tokenStore, "take");
|
|
1344
1346
|
const clientResolver = proxyOptions.clientResolver === void 0 ? void 0 : requireMethodProvider(providers, proxyOptions.clientResolver, "resolveClient");
|
|
@@ -1351,7 +1353,7 @@ function resolveProxy(options, providers, serverName) {
|
|
|
1351
1353
|
...proxyOptions.cimd.maxDocumentBytes === void 0 ? {} : { maxDocumentBytes: proxyOptions.cimd.maxDocumentBytes },
|
|
1352
1354
|
...proxyOptions.cimd.fetchTimeoutMs === void 0 ? {} : { fetchTimeoutMs: proxyOptions.cimd.fetchTimeoutMs }
|
|
1353
1355
|
}) : void 0;
|
|
1354
|
-
const upstream = new McpUpstreamAdapter({
|
|
1356
|
+
const upstream = upstreamConfig === void 0 ? void 0 : new McpUpstreamAdapter({
|
|
1355
1357
|
upstream: upstreamConfig,
|
|
1356
1358
|
...guardedFetch === void 0 ? {} : { fetch: guardedFetch }
|
|
1357
1359
|
});
|
|
@@ -1360,7 +1362,8 @@ function resolveProxy(options, providers, serverName) {
|
|
|
1360
1362
|
resources: proxyOptions.resources,
|
|
1361
1363
|
signingKeys,
|
|
1362
1364
|
secrets: new McpOAuthSecretKeyring(masterSecret),
|
|
1363
|
-
upstream,
|
|
1365
|
+
...upstream === void 0 ? {} : { upstream },
|
|
1366
|
+
...hostSignIn === void 0 ? {} : { hostSignIn },
|
|
1364
1367
|
stateStore,
|
|
1365
1368
|
...proxyOptions.basePath === void 0 ? {} : { basePath: proxyOptions.basePath },
|
|
1366
1369
|
...proxyOptions.scopesSupported === void 0 ? {} : { scopesSupported: proxyOptions.scopesSupported },
|
|
@@ -2053,6 +2056,18 @@ let McpOAuthService = class McpOAuthService {
|
|
|
2053
2056
|
* `AuthInfo` (via its `gid` claim). Returns `undefined` when the server has
|
|
2054
2057
|
* no proxy, the token carries no grant id, or the grant has been revoked.
|
|
2055
2058
|
*/
|
|
2059
|
+
/**
|
|
2060
|
+
* Host-managed sign-in (`oauth.proxy.hostSignIn`): once the host has
|
|
2061
|
+
* authenticated the user for a transaction, returns the proxy callback URL
|
|
2062
|
+
* the browser must navigate to. Throws `McpHostSignInError` for an unknown,
|
|
2063
|
+
* expired or unconsented transaction, and `McpModuleError` when the server
|
|
2064
|
+
* has no proxy.
|
|
2065
|
+
*/
|
|
2066
|
+
async completeHostSignIn(serverName, completion) {
|
|
2067
|
+
const proxy = this.runtimeService.oauthProxy(serverName);
|
|
2068
|
+
if (proxy === void 0) throw new McpModuleError("INVALID_OPTIONS", `MCP server "${serverName}" has no oauth.proxy configured.`);
|
|
2069
|
+
return proxy.completeHostSignIn(completion);
|
|
2070
|
+
}
|
|
2056
2071
|
async upstreamTokens(serverName, authInfo) {
|
|
2057
2072
|
const proxy = this.runtimeService.oauthProxy(serverName);
|
|
2058
2073
|
if (proxy === void 0) return void 0;
|