@stackone/transport 2.40.2 → 2.41.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/dist/index.d.cts CHANGED
@@ -6,7 +6,7 @@ import * as redis from "redis";
6
6
  import * as tls$1 from "tls";
7
7
  import { Readable } from "node:stream";
8
8
  import { z } from "@stackone/utils";
9
- import { Client, ClientOptions, StreamableHTTPClientTransportOptions, Transport } from "@modelcontextprotocol/client";
9
+ import { AuthorizationServerMetadata, Client, ClientOptions, FetchLike, OAuthProtectedResourceMetadata, OAuthServerInfo, StreamableHTTPClientTransportOptions, Transport } from "@modelcontextprotocol/client";
10
10
 
11
11
  //#region \0rolldown/runtime.js
12
12
  //#endregion
@@ -1140,6 +1140,28 @@ declare class McpClient implements IMcpClient {
1140
1140
  type McpIconFinder = (serverUrl: string, advertisedIconUrl?: string) => Promise<string | undefined>;
1141
1141
  declare const findMcpIcon: (serverUrl: string, advertisedIconUrl?: string, fetchFn?: typeof fetch) => Promise<string | undefined>;
1142
1142
  //#endregion
1143
+ //#region src/mcpClient/mcpOAuthDiscovery.d.ts
1144
+ type SameSiteIssuerFallback = {
1145
+ expectedIssuer: string;
1146
+ receivedIssuer: string;
1147
+ };
1148
+ type McpOAuthDiscoveryOptions = {
1149
+ fetchFn?: FetchLike;
1150
+ onSameSiteIssuerFallback?: (fallback: SameSiteIssuerFallback) => void;
1151
+ };
1152
+ type McpOAuthDiscoveryDependencies = {
1153
+ discoverServerInfo: (serverUrl: string, options: {
1154
+ fetchFn?: FetchLike;
1155
+ }) => Promise<OAuthServerInfo>;
1156
+ discoverResourceMetadata: (serverUrl: string, fetchFn?: FetchLike) => Promise<OAuthProtectedResourceMetadata>;
1157
+ discoverAuthorizationServerMetadata: (authorizationServerUrl: string, options: {
1158
+ fetchFn?: FetchLike;
1159
+ }) => Promise<AuthorizationServerMetadata | undefined>;
1160
+ };
1161
+ declare const isSameSiteIssuer: (expected: string | undefined, received: string | undefined) => boolean;
1162
+ declare const discoverSameSiteAuthorizationServerMetadata: (authorizationServerUrl: string, options?: McpOAuthDiscoveryOptions, dependencies?: McpOAuthDiscoveryDependencies) => Promise<AuthorizationServerMetadata | undefined>;
1163
+ declare const discoverMcpOAuthServerInfo: (serverUrl: string, options?: McpOAuthDiscoveryOptions, dependencies?: McpOAuthDiscoveryDependencies) => Promise<OAuthServerInfo>;
1164
+ //#endregion
1143
1165
  //#region src/mcpClient/probeMcpServer.d.ts
1144
1166
  type McpServerProbe = {
1145
1167
  requiresAuthorization: boolean;
@@ -1150,6 +1172,7 @@ type McpServerProbe = {
1150
1172
  resourceMetadataUrl?: string;
1151
1173
  tokenEndpoint?: string;
1152
1174
  refreshTokenGrant?: boolean;
1175
+ tokenEndpointAuthMethods?: string[];
1153
1176
  };
1154
1177
  resource?: {
1155
1178
  name?: string;
@@ -1168,17 +1191,18 @@ type ResourceMetadata = {
1168
1191
  resource_documentation?: string;
1169
1192
  authorization_servers?: string[];
1170
1193
  };
1171
- type AuthorizationServerMetadata = {
1194
+ type AuthorizationServerMetadata$1 = {
1172
1195
  registration_endpoint?: string;
1173
1196
  token_endpoint?: string;
1174
1197
  grant_types_supported?: string[];
1175
1198
  scopes_supported?: string[];
1199
+ token_endpoint_auth_methods_supported?: string[];
1176
1200
  };
1177
1201
  type ProbeDependencies = {
1178
1202
  createClient: (serverUrl: string) => IMcpClient;
1179
1203
  fetchAuthorizationChallenge: (serverUrl: string) => Promise<AuthorizationChallenge | undefined>;
1180
1204
  discoverResourceMetadata: (serverUrl: string, resourceMetadataUrl?: string) => Promise<ResourceMetadata>;
1181
- discoverAuthorizationServer: (authorizationServerUrl: string) => Promise<AuthorizationServerMetadata | undefined>;
1205
+ discoverAuthorizationServer: (authorizationServerUrl: string) => Promise<AuthorizationServerMetadata$1 | undefined>;
1182
1206
  };
1183
1207
  declare const probeMcpServer: (serverUrl: string, dependencies?: ProbeDependencies) => Promise<McpServerProbe>;
1184
1208
  //#endregion
@@ -1361,4 +1385,4 @@ type LockEntry = {
1361
1385
  unlock: Unlock;
1362
1386
  };
1363
1387
  //#endregion
1364
- export { type AuthorizationChallenge, type AxiosErrorWithRequestMetadata, type AxiosErrorWithRetryCount, CUSTOM_ERROR_CONFIG_SCHEMA, type CertificatesInput, type ConcurrencyConfig, ConcurrencyManager, type CustomErrorConfig, type ErrorInterceptor, type ErrorMappingFn, EventClient, HttpClient, HttpClientManager, HttpErrorMessages, type HttpHeader, type HttpHeaders, type HttpMethod, HttpMethods, type HttpParameters, type HttpQueryParamValue, type HttpQueryParams, type HttpResponse, HttpResponseError, HttpTransportFactory, type HttpTransportInstanceConfig, type ICacheClient, type IHttpClient, type IMcpClient, type IRequestClient, type InitializedTransportManagers, InstanceManager, type Interceptor, type InterceptorConfigs, type InterceptorDependencies, type InterceptorDependencyInjector, type InterceptorManager, type Lock, type LockEntry, LockManager, type McpCallToolParams, type McpCallToolResult, McpClient, type McpClientConfig, type McpClientInfo, type McpIconFinder, type McpListToolsParams, type McpListToolsResult, type McpSdkDependencies, type McpServerInfo, type McpServerProbe, type McpServerProber, type McpToolContentBlock, type McpToolDefinition, MemoryStore, type MemoryStoreConfig, type OnFulfilledInterceptors, PersistentInstanceManager, type ProbeDependencies, type PruneCount, type PubSubListener, type QueryArrayFormat, QueryArrayFormats, QueueManager, type RateLimitConfig, RateLimitManager, RedisClient, type RedisClientConfig, type RedisClientType, type RequestAbortReason, RequestAbortedError, RequestClientFactory, type RequestConfig, type RequestContext, type RequestInterceptor, type RequestInterceptorConfig, type RequestInterceptorTuple, type RequestParameter, RequestParameterLocations, type ResponseInterceptor, type ResponseInterceptorConfig, type ResponseInterceptorTuple, type ResponseType, ScriptManager, type SigningCredentials, type SigningOptions, type SigningRequest, type SigningStrategy, type StreamHttpResponse, SubscriptionManager, type TransportInitializationOptions, TransportManagersUnavailableError, type Unlock, buildHttpClientInstance, buildHttpsAgent, convertError, createAuthorizationHeaders, findMcpIcon, getCancelledCallCount, getRetryAfterWaitTime, getSigningStrategy, getTransportInstance, getTransportManagers, initializeTransportSystem, isFailedStatusCode, isInfoStatusCode, isRequestAbortedError, isSuccessStatusCode, isTransportSystemReady, parseRequestParameters, probeMcpServer, registerSigningStrategy, serializeHttpResponseError, shutdownTransportSystem, superNormalizeHeaders, translateCustomError };
1388
+ export { type AuthorizationChallenge, type AxiosErrorWithRequestMetadata, type AxiosErrorWithRetryCount, CUSTOM_ERROR_CONFIG_SCHEMA, type CertificatesInput, type ConcurrencyConfig, ConcurrencyManager, type CustomErrorConfig, type ErrorInterceptor, type ErrorMappingFn, EventClient, HttpClient, HttpClientManager, HttpErrorMessages, type HttpHeader, type HttpHeaders, type HttpMethod, HttpMethods, type HttpParameters, type HttpQueryParamValue, type HttpQueryParams, type HttpResponse, HttpResponseError, HttpTransportFactory, type HttpTransportInstanceConfig, type ICacheClient, type IHttpClient, type IMcpClient, type IRequestClient, type InitializedTransportManagers, InstanceManager, type Interceptor, type InterceptorConfigs, type InterceptorDependencies, type InterceptorDependencyInjector, type InterceptorManager, type Lock, type LockEntry, LockManager, type McpCallToolParams, type McpCallToolResult, McpClient, type McpClientConfig, type McpClientInfo, type McpIconFinder, type McpListToolsParams, type McpListToolsResult, type McpOAuthDiscoveryDependencies, type McpOAuthDiscoveryOptions, type McpSdkDependencies, type McpServerInfo, type McpServerProbe, type McpServerProber, type McpToolContentBlock, type McpToolDefinition, MemoryStore, type MemoryStoreConfig, type OnFulfilledInterceptors, PersistentInstanceManager, type ProbeDependencies, type PruneCount, type PubSubListener, type QueryArrayFormat, QueryArrayFormats, QueueManager, type RateLimitConfig, RateLimitManager, RedisClient, type RedisClientConfig, type RedisClientType, type RequestAbortReason, RequestAbortedError, RequestClientFactory, type RequestConfig, type RequestContext, type RequestInterceptor, type RequestInterceptorConfig, type RequestInterceptorTuple, type RequestParameter, RequestParameterLocations, type ResponseInterceptor, type ResponseInterceptorConfig, type ResponseInterceptorTuple, type ResponseType, type SameSiteIssuerFallback, ScriptManager, type SigningCredentials, type SigningOptions, type SigningRequest, type SigningStrategy, type StreamHttpResponse, SubscriptionManager, type TransportInitializationOptions, TransportManagersUnavailableError, type Unlock, buildHttpClientInstance, buildHttpsAgent, convertError, createAuthorizationHeaders, discoverMcpOAuthServerInfo, discoverSameSiteAuthorizationServerMetadata, findMcpIcon, getCancelledCallCount, getRetryAfterWaitTime, getSigningStrategy, getTransportInstance, getTransportManagers, initializeTransportSystem, isFailedStatusCode, isInfoStatusCode, isRequestAbortedError, isSameSiteIssuer, isSuccessStatusCode, isTransportSystemReady, parseRequestParameters, probeMcpServer, registerSigningStrategy, serializeHttpResponseError, shutdownTransportSystem, superNormalizeHeaders, translateCustomError };
package/dist/index.d.mts CHANGED
@@ -5,7 +5,7 @@ import { AxiosError, AxiosInstance, AxiosInterceptorManager, AxiosInterceptorOpt
5
5
  import https from "node:https";
6
6
  import http, { AgentOptions } from "node:http";
7
7
  import { Readable } from "node:stream";
8
- import { Client, ClientOptions, StreamableHTTPClientTransportOptions, Transport } from "@modelcontextprotocol/client";
8
+ import { AuthorizationServerMetadata, Client, ClientOptions, FetchLike, OAuthProtectedResourceMetadata, OAuthServerInfo, StreamableHTTPClientTransportOptions, Transport } from "@modelcontextprotocol/client";
9
9
  import { ILogger } from "@stackone/logger";
10
10
  import * as tls$1 from "tls";
11
11
 
@@ -1139,6 +1139,28 @@ declare class McpClient implements IMcpClient {
1139
1139
  type McpIconFinder = (serverUrl: string, advertisedIconUrl?: string) => Promise<string | undefined>;
1140
1140
  declare const findMcpIcon: (serverUrl: string, advertisedIconUrl?: string, fetchFn?: typeof fetch) => Promise<string | undefined>;
1141
1141
  //#endregion
1142
+ //#region src/mcpClient/mcpOAuthDiscovery.d.ts
1143
+ type SameSiteIssuerFallback = {
1144
+ expectedIssuer: string;
1145
+ receivedIssuer: string;
1146
+ };
1147
+ type McpOAuthDiscoveryOptions = {
1148
+ fetchFn?: FetchLike;
1149
+ onSameSiteIssuerFallback?: (fallback: SameSiteIssuerFallback) => void;
1150
+ };
1151
+ type McpOAuthDiscoveryDependencies = {
1152
+ discoverServerInfo: (serverUrl: string, options: {
1153
+ fetchFn?: FetchLike;
1154
+ }) => Promise<OAuthServerInfo>;
1155
+ discoverResourceMetadata: (serverUrl: string, fetchFn?: FetchLike) => Promise<OAuthProtectedResourceMetadata>;
1156
+ discoverAuthorizationServerMetadata: (authorizationServerUrl: string, options: {
1157
+ fetchFn?: FetchLike;
1158
+ }) => Promise<AuthorizationServerMetadata | undefined>;
1159
+ };
1160
+ declare const isSameSiteIssuer: (expected: string | undefined, received: string | undefined) => boolean;
1161
+ declare const discoverSameSiteAuthorizationServerMetadata: (authorizationServerUrl: string, options?: McpOAuthDiscoveryOptions, dependencies?: McpOAuthDiscoveryDependencies) => Promise<AuthorizationServerMetadata | undefined>;
1162
+ declare const discoverMcpOAuthServerInfo: (serverUrl: string, options?: McpOAuthDiscoveryOptions, dependencies?: McpOAuthDiscoveryDependencies) => Promise<OAuthServerInfo>;
1163
+ //#endregion
1142
1164
  //#region src/mcpClient/probeMcpServer.d.ts
1143
1165
  type McpServerProbe = {
1144
1166
  requiresAuthorization: boolean;
@@ -1149,6 +1171,7 @@ type McpServerProbe = {
1149
1171
  resourceMetadataUrl?: string;
1150
1172
  tokenEndpoint?: string;
1151
1173
  refreshTokenGrant?: boolean;
1174
+ tokenEndpointAuthMethods?: string[];
1152
1175
  };
1153
1176
  resource?: {
1154
1177
  name?: string;
@@ -1167,17 +1190,18 @@ type ResourceMetadata = {
1167
1190
  resource_documentation?: string;
1168
1191
  authorization_servers?: string[];
1169
1192
  };
1170
- type AuthorizationServerMetadata = {
1193
+ type AuthorizationServerMetadata$1 = {
1171
1194
  registration_endpoint?: string;
1172
1195
  token_endpoint?: string;
1173
1196
  grant_types_supported?: string[];
1174
1197
  scopes_supported?: string[];
1198
+ token_endpoint_auth_methods_supported?: string[];
1175
1199
  };
1176
1200
  type ProbeDependencies = {
1177
1201
  createClient: (serverUrl: string) => IMcpClient;
1178
1202
  fetchAuthorizationChallenge: (serverUrl: string) => Promise<AuthorizationChallenge | undefined>;
1179
1203
  discoverResourceMetadata: (serverUrl: string, resourceMetadataUrl?: string) => Promise<ResourceMetadata>;
1180
- discoverAuthorizationServer: (authorizationServerUrl: string) => Promise<AuthorizationServerMetadata | undefined>;
1204
+ discoverAuthorizationServer: (authorizationServerUrl: string) => Promise<AuthorizationServerMetadata$1 | undefined>;
1181
1205
  };
1182
1206
  declare const probeMcpServer: (serverUrl: string, dependencies?: ProbeDependencies) => Promise<McpServerProbe>;
1183
1207
  //#endregion
@@ -1360,4 +1384,4 @@ type LockEntry = {
1360
1384
  unlock: Unlock;
1361
1385
  };
1362
1386
  //#endregion
1363
- export { type AuthorizationChallenge, type AxiosErrorWithRequestMetadata, type AxiosErrorWithRetryCount, CUSTOM_ERROR_CONFIG_SCHEMA, type CertificatesInput, type ConcurrencyConfig, ConcurrencyManager, type CustomErrorConfig, type ErrorInterceptor, type ErrorMappingFn, EventClient, HttpClient, HttpClientManager, HttpErrorMessages, type HttpHeader, type HttpHeaders, type HttpMethod, HttpMethods, type HttpParameters, type HttpQueryParamValue, type HttpQueryParams, type HttpResponse, HttpResponseError, HttpTransportFactory, type HttpTransportInstanceConfig, type ICacheClient, type IHttpClient, type IMcpClient, type IRequestClient, type InitializedTransportManagers, InstanceManager, type Interceptor, type InterceptorConfigs, type InterceptorDependencies, type InterceptorDependencyInjector, type InterceptorManager, type Lock, type LockEntry, LockManager, type McpCallToolParams, type McpCallToolResult, McpClient, type McpClientConfig, type McpClientInfo, type McpIconFinder, type McpListToolsParams, type McpListToolsResult, type McpSdkDependencies, type McpServerInfo, type McpServerProbe, type McpServerProber, type McpToolContentBlock, type McpToolDefinition, MemoryStore, type MemoryStoreConfig, type OnFulfilledInterceptors, PersistentInstanceManager, type ProbeDependencies, type PruneCount, type PubSubListener, type QueryArrayFormat, QueryArrayFormats, QueueManager, type RateLimitConfig, RateLimitManager, RedisClient, type RedisClientConfig, type RedisClientType, type RequestAbortReason, RequestAbortedError, RequestClientFactory, type RequestConfig, type RequestContext, type RequestInterceptor, type RequestInterceptorConfig, type RequestInterceptorTuple, type RequestParameter, RequestParameterLocations, type ResponseInterceptor, type ResponseInterceptorConfig, type ResponseInterceptorTuple, type ResponseType, ScriptManager, type SigningCredentials, type SigningOptions, type SigningRequest, type SigningStrategy, type StreamHttpResponse, SubscriptionManager, type TransportInitializationOptions, TransportManagersUnavailableError, type Unlock, buildHttpClientInstance, buildHttpsAgent, convertError, createAuthorizationHeaders, findMcpIcon, getCancelledCallCount, getRetryAfterWaitTime, getSigningStrategy, getTransportInstance, getTransportManagers, initializeTransportSystem, isFailedStatusCode, isInfoStatusCode, isRequestAbortedError, isSuccessStatusCode, isTransportSystemReady, parseRequestParameters, probeMcpServer, registerSigningStrategy, serializeHttpResponseError, shutdownTransportSystem, superNormalizeHeaders, translateCustomError };
1387
+ export { type AuthorizationChallenge, type AxiosErrorWithRequestMetadata, type AxiosErrorWithRetryCount, CUSTOM_ERROR_CONFIG_SCHEMA, type CertificatesInput, type ConcurrencyConfig, ConcurrencyManager, type CustomErrorConfig, type ErrorInterceptor, type ErrorMappingFn, EventClient, HttpClient, HttpClientManager, HttpErrorMessages, type HttpHeader, type HttpHeaders, type HttpMethod, HttpMethods, type HttpParameters, type HttpQueryParamValue, type HttpQueryParams, type HttpResponse, HttpResponseError, HttpTransportFactory, type HttpTransportInstanceConfig, type ICacheClient, type IHttpClient, type IMcpClient, type IRequestClient, type InitializedTransportManagers, InstanceManager, type Interceptor, type InterceptorConfigs, type InterceptorDependencies, type InterceptorDependencyInjector, type InterceptorManager, type Lock, type LockEntry, LockManager, type McpCallToolParams, type McpCallToolResult, McpClient, type McpClientConfig, type McpClientInfo, type McpIconFinder, type McpListToolsParams, type McpListToolsResult, type McpOAuthDiscoveryDependencies, type McpOAuthDiscoveryOptions, type McpSdkDependencies, type McpServerInfo, type McpServerProbe, type McpServerProber, type McpToolContentBlock, type McpToolDefinition, MemoryStore, type MemoryStoreConfig, type OnFulfilledInterceptors, PersistentInstanceManager, type ProbeDependencies, type PruneCount, type PubSubListener, type QueryArrayFormat, QueryArrayFormats, QueueManager, type RateLimitConfig, RateLimitManager, RedisClient, type RedisClientConfig, type RedisClientType, type RequestAbortReason, RequestAbortedError, RequestClientFactory, type RequestConfig, type RequestContext, type RequestInterceptor, type RequestInterceptorConfig, type RequestInterceptorTuple, type RequestParameter, RequestParameterLocations, type ResponseInterceptor, type ResponseInterceptorConfig, type ResponseInterceptorTuple, type ResponseType, type SameSiteIssuerFallback, ScriptManager, type SigningCredentials, type SigningOptions, type SigningRequest, type SigningStrategy, type StreamHttpResponse, SubscriptionManager, type TransportInitializationOptions, TransportManagersUnavailableError, type Unlock, buildHttpClientInstance, buildHttpsAgent, convertError, createAuthorizationHeaders, discoverMcpOAuthServerInfo, discoverSameSiteAuthorizationServerMetadata, findMcpIcon, getCancelledCallCount, getRetryAfterWaitTime, getSigningStrategy, getTransportInstance, getTransportManagers, initializeTransportSystem, isFailedStatusCode, isInfoStatusCode, isRequestAbortedError, isSameSiteIssuer, isSuccessStatusCode, isTransportSystemReady, parseRequestParameters, probeMcpServer, registerSigningStrategy, serializeHttpResponseError, shutdownTransportSystem, superNormalizeHeaders, translateCustomError };