added all mcp
This commit is contained in:
23
baserow-mcp-server/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/auth-utils.d.ts
generated
vendored
Normal file
23
baserow-mcp-server/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/auth-utils.d.ts
generated
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
/**
|
||||
* Utilities for handling OAuth resource URIs.
|
||||
*/
|
||||
/**
|
||||
* Converts a server URL to a resource URL by removing the fragment.
|
||||
* RFC 8707 section 2 states that resource URIs "MUST NOT include a fragment component".
|
||||
* Keeps everything else unchanged (scheme, domain, port, path, query).
|
||||
*/
|
||||
export declare function resourceUrlFromServerUrl(url: URL | string): URL;
|
||||
/**
|
||||
* Checks if a requested resource URL matches a configured resource URL.
|
||||
* A requested resource matches if it has the same scheme, domain, port,
|
||||
* and its path starts with the configured resource's path.
|
||||
*
|
||||
* @param requestedResource The resource URL being requested
|
||||
* @param configuredResource The resource URL that has been configured
|
||||
* @returns true if the requested resource matches the configured resource, false otherwise
|
||||
*/
|
||||
export declare function checkResourceAllowed({ requestedResource, configuredResource }: {
|
||||
requestedResource: URL | string;
|
||||
configuredResource: URL | string;
|
||||
}): boolean;
|
||||
//# sourceMappingURL=auth-utils.d.ts.map
|
||||
1
baserow-mcp-server/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/auth-utils.d.ts.map
generated
vendored
Normal file
1
baserow-mcp-server/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/auth-utils.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"auth-utils.d.ts","sourceRoot":"","sources":["../../../src/shared/auth-utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,GAAG,GAAG,MAAM,GAAG,GAAG,CAI/D;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAAC,EACjC,iBAAiB,EACjB,kBAAkB,EACrB,EAAE;IACC,iBAAiB,EAAE,GAAG,GAAG,MAAM,CAAC;IAChC,kBAAkB,EAAE,GAAG,GAAG,MAAM,CAAC;CACpC,GAAG,OAAO,CAwBV"}
|
||||
48
baserow-mcp-server/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/auth-utils.js
generated
vendored
Normal file
48
baserow-mcp-server/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/auth-utils.js
generated
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
"use strict";
|
||||
/**
|
||||
* Utilities for handling OAuth resource URIs.
|
||||
*/
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.resourceUrlFromServerUrl = resourceUrlFromServerUrl;
|
||||
exports.checkResourceAllowed = checkResourceAllowed;
|
||||
/**
|
||||
* Converts a server URL to a resource URL by removing the fragment.
|
||||
* RFC 8707 section 2 states that resource URIs "MUST NOT include a fragment component".
|
||||
* Keeps everything else unchanged (scheme, domain, port, path, query).
|
||||
*/
|
||||
function resourceUrlFromServerUrl(url) {
|
||||
const resourceURL = typeof url === 'string' ? new URL(url) : new URL(url.href);
|
||||
resourceURL.hash = ''; // Remove fragment
|
||||
return resourceURL;
|
||||
}
|
||||
/**
|
||||
* Checks if a requested resource URL matches a configured resource URL.
|
||||
* A requested resource matches if it has the same scheme, domain, port,
|
||||
* and its path starts with the configured resource's path.
|
||||
*
|
||||
* @param requestedResource The resource URL being requested
|
||||
* @param configuredResource The resource URL that has been configured
|
||||
* @returns true if the requested resource matches the configured resource, false otherwise
|
||||
*/
|
||||
function checkResourceAllowed({ requestedResource, configuredResource }) {
|
||||
const requested = typeof requestedResource === 'string' ? new URL(requestedResource) : new URL(requestedResource.href);
|
||||
const configured = typeof configuredResource === 'string' ? new URL(configuredResource) : new URL(configuredResource.href);
|
||||
// Compare the origin (scheme, domain, and port)
|
||||
if (requested.origin !== configured.origin) {
|
||||
return false;
|
||||
}
|
||||
// Handle cases like requested=/foo and configured=/foo/
|
||||
if (requested.pathname.length < configured.pathname.length) {
|
||||
return false;
|
||||
}
|
||||
// Check if the requested path starts with the configured path
|
||||
// Ensure both paths end with / for proper comparison
|
||||
// This ensures that if we have paths like "/api" and "/api/users",
|
||||
// we properly detect that "/api/users" is a subpath of "/api"
|
||||
// By adding a trailing slash if missing, we avoid false positives
|
||||
// where paths like "/api123" would incorrectly match "/api"
|
||||
const requestedPath = requested.pathname.endsWith('/') ? requested.pathname : requested.pathname + '/';
|
||||
const configuredPath = configured.pathname.endsWith('/') ? configured.pathname : configured.pathname + '/';
|
||||
return requestedPath.startsWith(configuredPath);
|
||||
}
|
||||
//# sourceMappingURL=auth-utils.js.map
|
||||
1
baserow-mcp-server/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/auth-utils.js.map
generated
vendored
Normal file
1
baserow-mcp-server/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/auth-utils.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"auth-utils.js","sourceRoot":"","sources":["../../../src/shared/auth-utils.ts"],"names":[],"mappings":";AAAA;;GAEG;;AAOH,4DAIC;AAWD,oDA8BC;AAlDD;;;;GAIG;AACH,SAAgB,wBAAwB,CAAC,GAAiB;IACtD,MAAM,WAAW,GAAG,OAAO,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAC/E,WAAW,CAAC,IAAI,GAAG,EAAE,CAAC,CAAC,kBAAkB;IACzC,OAAO,WAAW,CAAC;AACvB,CAAC;AAED;;;;;;;;GAQG;AACH,SAAgB,oBAAoB,CAAC,EACjC,iBAAiB,EACjB,kBAAkB,EAIrB;IACG,MAAM,SAAS,GAAG,OAAO,iBAAiB,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;IACvH,MAAM,UAAU,GAAG,OAAO,kBAAkB,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;IAE3H,gDAAgD;IAChD,IAAI,SAAS,CAAC,MAAM,KAAK,UAAU,CAAC,MAAM,EAAE,CAAC;QACzC,OAAO,KAAK,CAAC;IACjB,CAAC;IAED,wDAAwD;IACxD,IAAI,SAAS,CAAC,QAAQ,CAAC,MAAM,GAAG,UAAU,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;QACzD,OAAO,KAAK,CAAC;IACjB,CAAC;IAED,8DAA8D;IAC9D,qDAAqD;IACrD,mEAAmE;IACnE,8DAA8D;IAC9D,kEAAkE;IAClE,4DAA4D;IAC5D,MAAM,aAAa,GAAG,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,QAAQ,GAAG,GAAG,CAAC;IACvG,MAAM,cAAc,GAAG,UAAU,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,QAAQ,GAAG,GAAG,CAAC;IAE3G,OAAO,aAAa,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC;AACpD,CAAC"}
|
||||
621
baserow-mcp-server/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/auth.d.ts
generated
vendored
Normal file
621
baserow-mcp-server/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/auth.d.ts
generated
vendored
Normal file
@@ -0,0 +1,621 @@
|
||||
import { z } from 'zod';
|
||||
/**
|
||||
* Reusable URL validation that disallows javascript: scheme
|
||||
*/
|
||||
export declare const SafeUrlSchema: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
||||
/**
|
||||
* RFC 9728 OAuth Protected Resource Metadata
|
||||
*/
|
||||
export declare const OAuthProtectedResourceMetadataSchema: z.ZodObject<{
|
||||
resource: z.ZodString;
|
||||
authorization_servers: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, "many">>;
|
||||
jwks_uri: z.ZodOptional<z.ZodString>;
|
||||
scopes_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
bearer_methods_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
resource_signing_alg_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
resource_name: z.ZodOptional<z.ZodString>;
|
||||
resource_documentation: z.ZodOptional<z.ZodString>;
|
||||
resource_policy_uri: z.ZodOptional<z.ZodString>;
|
||||
resource_tos_uri: z.ZodOptional<z.ZodString>;
|
||||
tls_client_certificate_bound_access_tokens: z.ZodOptional<z.ZodBoolean>;
|
||||
authorization_details_types_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
dpop_signing_alg_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
dpop_bound_access_tokens_required: z.ZodOptional<z.ZodBoolean>;
|
||||
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
||||
resource: z.ZodString;
|
||||
authorization_servers: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, "many">>;
|
||||
jwks_uri: z.ZodOptional<z.ZodString>;
|
||||
scopes_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
bearer_methods_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
resource_signing_alg_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
resource_name: z.ZodOptional<z.ZodString>;
|
||||
resource_documentation: z.ZodOptional<z.ZodString>;
|
||||
resource_policy_uri: z.ZodOptional<z.ZodString>;
|
||||
resource_tos_uri: z.ZodOptional<z.ZodString>;
|
||||
tls_client_certificate_bound_access_tokens: z.ZodOptional<z.ZodBoolean>;
|
||||
authorization_details_types_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
dpop_signing_alg_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
dpop_bound_access_tokens_required: z.ZodOptional<z.ZodBoolean>;
|
||||
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
||||
resource: z.ZodString;
|
||||
authorization_servers: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, "many">>;
|
||||
jwks_uri: z.ZodOptional<z.ZodString>;
|
||||
scopes_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
bearer_methods_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
resource_signing_alg_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
resource_name: z.ZodOptional<z.ZodString>;
|
||||
resource_documentation: z.ZodOptional<z.ZodString>;
|
||||
resource_policy_uri: z.ZodOptional<z.ZodString>;
|
||||
resource_tos_uri: z.ZodOptional<z.ZodString>;
|
||||
tls_client_certificate_bound_access_tokens: z.ZodOptional<z.ZodBoolean>;
|
||||
authorization_details_types_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
dpop_signing_alg_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
dpop_bound_access_tokens_required: z.ZodOptional<z.ZodBoolean>;
|
||||
}, z.ZodTypeAny, "passthrough">>;
|
||||
/**
|
||||
* RFC 8414 OAuth 2.0 Authorization Server Metadata
|
||||
*/
|
||||
export declare const OAuthMetadataSchema: z.ZodObject<{
|
||||
issuer: z.ZodString;
|
||||
authorization_endpoint: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
||||
token_endpoint: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
||||
registration_endpoint: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
|
||||
scopes_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
response_types_supported: z.ZodArray<z.ZodString, "many">;
|
||||
response_modes_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
grant_types_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
token_endpoint_auth_methods_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
token_endpoint_auth_signing_alg_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
service_documentation: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
|
||||
revocation_endpoint: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
|
||||
revocation_endpoint_auth_methods_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
revocation_endpoint_auth_signing_alg_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
introspection_endpoint: z.ZodOptional<z.ZodString>;
|
||||
introspection_endpoint_auth_methods_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
introspection_endpoint_auth_signing_alg_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
code_challenge_methods_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
||||
issuer: z.ZodString;
|
||||
authorization_endpoint: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
||||
token_endpoint: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
||||
registration_endpoint: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
|
||||
scopes_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
response_types_supported: z.ZodArray<z.ZodString, "many">;
|
||||
response_modes_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
grant_types_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
token_endpoint_auth_methods_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
token_endpoint_auth_signing_alg_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
service_documentation: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
|
||||
revocation_endpoint: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
|
||||
revocation_endpoint_auth_methods_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
revocation_endpoint_auth_signing_alg_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
introspection_endpoint: z.ZodOptional<z.ZodString>;
|
||||
introspection_endpoint_auth_methods_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
introspection_endpoint_auth_signing_alg_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
code_challenge_methods_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
||||
issuer: z.ZodString;
|
||||
authorization_endpoint: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
||||
token_endpoint: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
||||
registration_endpoint: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
|
||||
scopes_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
response_types_supported: z.ZodArray<z.ZodString, "many">;
|
||||
response_modes_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
grant_types_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
token_endpoint_auth_methods_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
token_endpoint_auth_signing_alg_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
service_documentation: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
|
||||
revocation_endpoint: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
|
||||
revocation_endpoint_auth_methods_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
revocation_endpoint_auth_signing_alg_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
introspection_endpoint: z.ZodOptional<z.ZodString>;
|
||||
introspection_endpoint_auth_methods_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
introspection_endpoint_auth_signing_alg_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
code_challenge_methods_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
}, z.ZodTypeAny, "passthrough">>;
|
||||
/**
|
||||
* OpenID Connect Discovery 1.0 Provider Metadata
|
||||
* see: https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderMetadata
|
||||
*/
|
||||
export declare const OpenIdProviderMetadataSchema: z.ZodObject<{
|
||||
issuer: z.ZodString;
|
||||
authorization_endpoint: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
||||
token_endpoint: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
||||
userinfo_endpoint: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
|
||||
jwks_uri: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
||||
registration_endpoint: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
|
||||
scopes_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
response_types_supported: z.ZodArray<z.ZodString, "many">;
|
||||
response_modes_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
grant_types_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
acr_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
subject_types_supported: z.ZodArray<z.ZodString, "many">;
|
||||
id_token_signing_alg_values_supported: z.ZodArray<z.ZodString, "many">;
|
||||
id_token_encryption_alg_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
id_token_encryption_enc_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
userinfo_signing_alg_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
userinfo_encryption_alg_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
userinfo_encryption_enc_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
request_object_signing_alg_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
request_object_encryption_alg_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
request_object_encryption_enc_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
token_endpoint_auth_methods_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
token_endpoint_auth_signing_alg_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
display_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
claim_types_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
claims_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
service_documentation: z.ZodOptional<z.ZodString>;
|
||||
claims_locales_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
ui_locales_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
claims_parameter_supported: z.ZodOptional<z.ZodBoolean>;
|
||||
request_parameter_supported: z.ZodOptional<z.ZodBoolean>;
|
||||
request_uri_parameter_supported: z.ZodOptional<z.ZodBoolean>;
|
||||
require_request_uri_registration: z.ZodOptional<z.ZodBoolean>;
|
||||
op_policy_uri: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
|
||||
op_tos_uri: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
|
||||
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
||||
issuer: z.ZodString;
|
||||
authorization_endpoint: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
||||
token_endpoint: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
||||
userinfo_endpoint: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
|
||||
jwks_uri: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
||||
registration_endpoint: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
|
||||
scopes_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
response_types_supported: z.ZodArray<z.ZodString, "many">;
|
||||
response_modes_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
grant_types_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
acr_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
subject_types_supported: z.ZodArray<z.ZodString, "many">;
|
||||
id_token_signing_alg_values_supported: z.ZodArray<z.ZodString, "many">;
|
||||
id_token_encryption_alg_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
id_token_encryption_enc_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
userinfo_signing_alg_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
userinfo_encryption_alg_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
userinfo_encryption_enc_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
request_object_signing_alg_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
request_object_encryption_alg_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
request_object_encryption_enc_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
token_endpoint_auth_methods_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
token_endpoint_auth_signing_alg_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
display_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
claim_types_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
claims_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
service_documentation: z.ZodOptional<z.ZodString>;
|
||||
claims_locales_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
ui_locales_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
claims_parameter_supported: z.ZodOptional<z.ZodBoolean>;
|
||||
request_parameter_supported: z.ZodOptional<z.ZodBoolean>;
|
||||
request_uri_parameter_supported: z.ZodOptional<z.ZodBoolean>;
|
||||
require_request_uri_registration: z.ZodOptional<z.ZodBoolean>;
|
||||
op_policy_uri: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
|
||||
op_tos_uri: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
|
||||
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
||||
issuer: z.ZodString;
|
||||
authorization_endpoint: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
||||
token_endpoint: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
||||
userinfo_endpoint: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
|
||||
jwks_uri: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
||||
registration_endpoint: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
|
||||
scopes_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
response_types_supported: z.ZodArray<z.ZodString, "many">;
|
||||
response_modes_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
grant_types_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
acr_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
subject_types_supported: z.ZodArray<z.ZodString, "many">;
|
||||
id_token_signing_alg_values_supported: z.ZodArray<z.ZodString, "many">;
|
||||
id_token_encryption_alg_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
id_token_encryption_enc_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
userinfo_signing_alg_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
userinfo_encryption_alg_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
userinfo_encryption_enc_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
request_object_signing_alg_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
request_object_encryption_alg_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
request_object_encryption_enc_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
token_endpoint_auth_methods_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
token_endpoint_auth_signing_alg_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
display_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
claim_types_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
claims_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
service_documentation: z.ZodOptional<z.ZodString>;
|
||||
claims_locales_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
ui_locales_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
claims_parameter_supported: z.ZodOptional<z.ZodBoolean>;
|
||||
request_parameter_supported: z.ZodOptional<z.ZodBoolean>;
|
||||
request_uri_parameter_supported: z.ZodOptional<z.ZodBoolean>;
|
||||
require_request_uri_registration: z.ZodOptional<z.ZodBoolean>;
|
||||
op_policy_uri: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
|
||||
op_tos_uri: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
|
||||
}, z.ZodTypeAny, "passthrough">>;
|
||||
/**
|
||||
* OpenID Connect Discovery metadata that may include OAuth 2.0 fields
|
||||
* This schema represents the real-world scenario where OIDC providers
|
||||
* return a mix of OpenID Connect and OAuth 2.0 metadata fields
|
||||
*/
|
||||
export declare const OpenIdProviderDiscoveryMetadataSchema: z.ZodObject<z.objectUtil.extendShape<{
|
||||
issuer: z.ZodString;
|
||||
authorization_endpoint: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
||||
token_endpoint: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
||||
userinfo_endpoint: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
|
||||
jwks_uri: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
||||
registration_endpoint: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
|
||||
scopes_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
response_types_supported: z.ZodArray<z.ZodString, "many">;
|
||||
response_modes_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
grant_types_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
acr_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
subject_types_supported: z.ZodArray<z.ZodString, "many">;
|
||||
id_token_signing_alg_values_supported: z.ZodArray<z.ZodString, "many">;
|
||||
id_token_encryption_alg_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
id_token_encryption_enc_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
userinfo_signing_alg_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
userinfo_encryption_alg_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
userinfo_encryption_enc_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
request_object_signing_alg_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
request_object_encryption_alg_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
request_object_encryption_enc_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
token_endpoint_auth_methods_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
token_endpoint_auth_signing_alg_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
display_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
claim_types_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
claims_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
service_documentation: z.ZodOptional<z.ZodString>;
|
||||
claims_locales_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
ui_locales_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
claims_parameter_supported: z.ZodOptional<z.ZodBoolean>;
|
||||
request_parameter_supported: z.ZodOptional<z.ZodBoolean>;
|
||||
request_uri_parameter_supported: z.ZodOptional<z.ZodBoolean>;
|
||||
require_request_uri_registration: z.ZodOptional<z.ZodBoolean>;
|
||||
op_policy_uri: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
|
||||
op_tos_uri: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
|
||||
}, Pick<{
|
||||
issuer: z.ZodString;
|
||||
authorization_endpoint: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
||||
token_endpoint: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
||||
registration_endpoint: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
|
||||
scopes_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
response_types_supported: z.ZodArray<z.ZodString, "many">;
|
||||
response_modes_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
grant_types_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
token_endpoint_auth_methods_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
token_endpoint_auth_signing_alg_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
service_documentation: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
|
||||
revocation_endpoint: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
|
||||
revocation_endpoint_auth_methods_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
revocation_endpoint_auth_signing_alg_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
introspection_endpoint: z.ZodOptional<z.ZodString>;
|
||||
introspection_endpoint_auth_methods_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
introspection_endpoint_auth_signing_alg_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
code_challenge_methods_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
}, "code_challenge_methods_supported">>, "passthrough", z.ZodTypeAny, z.objectOutputType<z.objectUtil.extendShape<{
|
||||
issuer: z.ZodString;
|
||||
authorization_endpoint: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
||||
token_endpoint: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
||||
userinfo_endpoint: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
|
||||
jwks_uri: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
||||
registration_endpoint: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
|
||||
scopes_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
response_types_supported: z.ZodArray<z.ZodString, "many">;
|
||||
response_modes_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
grant_types_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
acr_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
subject_types_supported: z.ZodArray<z.ZodString, "many">;
|
||||
id_token_signing_alg_values_supported: z.ZodArray<z.ZodString, "many">;
|
||||
id_token_encryption_alg_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
id_token_encryption_enc_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
userinfo_signing_alg_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
userinfo_encryption_alg_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
userinfo_encryption_enc_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
request_object_signing_alg_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
request_object_encryption_alg_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
request_object_encryption_enc_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
token_endpoint_auth_methods_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
token_endpoint_auth_signing_alg_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
display_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
claim_types_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
claims_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
service_documentation: z.ZodOptional<z.ZodString>;
|
||||
claims_locales_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
ui_locales_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
claims_parameter_supported: z.ZodOptional<z.ZodBoolean>;
|
||||
request_parameter_supported: z.ZodOptional<z.ZodBoolean>;
|
||||
request_uri_parameter_supported: z.ZodOptional<z.ZodBoolean>;
|
||||
require_request_uri_registration: z.ZodOptional<z.ZodBoolean>;
|
||||
op_policy_uri: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
|
||||
op_tos_uri: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
|
||||
}, Pick<{
|
||||
issuer: z.ZodString;
|
||||
authorization_endpoint: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
||||
token_endpoint: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
||||
registration_endpoint: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
|
||||
scopes_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
response_types_supported: z.ZodArray<z.ZodString, "many">;
|
||||
response_modes_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
grant_types_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
token_endpoint_auth_methods_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
token_endpoint_auth_signing_alg_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
service_documentation: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
|
||||
revocation_endpoint: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
|
||||
revocation_endpoint_auth_methods_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
revocation_endpoint_auth_signing_alg_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
introspection_endpoint: z.ZodOptional<z.ZodString>;
|
||||
introspection_endpoint_auth_methods_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
introspection_endpoint_auth_signing_alg_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
code_challenge_methods_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
}, "code_challenge_methods_supported">>, z.ZodTypeAny, "passthrough">, z.objectInputType<z.objectUtil.extendShape<{
|
||||
issuer: z.ZodString;
|
||||
authorization_endpoint: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
||||
token_endpoint: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
||||
userinfo_endpoint: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
|
||||
jwks_uri: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
||||
registration_endpoint: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
|
||||
scopes_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
response_types_supported: z.ZodArray<z.ZodString, "many">;
|
||||
response_modes_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
grant_types_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
acr_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
subject_types_supported: z.ZodArray<z.ZodString, "many">;
|
||||
id_token_signing_alg_values_supported: z.ZodArray<z.ZodString, "many">;
|
||||
id_token_encryption_alg_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
id_token_encryption_enc_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
userinfo_signing_alg_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
userinfo_encryption_alg_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
userinfo_encryption_enc_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
request_object_signing_alg_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
request_object_encryption_alg_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
request_object_encryption_enc_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
token_endpoint_auth_methods_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
token_endpoint_auth_signing_alg_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
display_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
claim_types_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
claims_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
service_documentation: z.ZodOptional<z.ZodString>;
|
||||
claims_locales_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
ui_locales_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
claims_parameter_supported: z.ZodOptional<z.ZodBoolean>;
|
||||
request_parameter_supported: z.ZodOptional<z.ZodBoolean>;
|
||||
request_uri_parameter_supported: z.ZodOptional<z.ZodBoolean>;
|
||||
require_request_uri_registration: z.ZodOptional<z.ZodBoolean>;
|
||||
op_policy_uri: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
|
||||
op_tos_uri: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
|
||||
}, Pick<{
|
||||
issuer: z.ZodString;
|
||||
authorization_endpoint: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
||||
token_endpoint: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
||||
registration_endpoint: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
|
||||
scopes_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
response_types_supported: z.ZodArray<z.ZodString, "many">;
|
||||
response_modes_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
grant_types_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
token_endpoint_auth_methods_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
token_endpoint_auth_signing_alg_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
service_documentation: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
|
||||
revocation_endpoint: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
|
||||
revocation_endpoint_auth_methods_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
revocation_endpoint_auth_signing_alg_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
introspection_endpoint: z.ZodOptional<z.ZodString>;
|
||||
introspection_endpoint_auth_methods_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
introspection_endpoint_auth_signing_alg_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
code_challenge_methods_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
}, "code_challenge_methods_supported">>, z.ZodTypeAny, "passthrough">>;
|
||||
/**
|
||||
* OAuth 2.1 token response
|
||||
*/
|
||||
export declare const OAuthTokensSchema: z.ZodObject<{
|
||||
access_token: z.ZodString;
|
||||
id_token: z.ZodOptional<z.ZodString>;
|
||||
token_type: z.ZodString;
|
||||
expires_in: z.ZodOptional<z.ZodNumber>;
|
||||
scope: z.ZodOptional<z.ZodString>;
|
||||
refresh_token: z.ZodOptional<z.ZodString>;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
access_token: string;
|
||||
token_type: string;
|
||||
id_token?: string | undefined;
|
||||
expires_in?: number | undefined;
|
||||
scope?: string | undefined;
|
||||
refresh_token?: string | undefined;
|
||||
}, {
|
||||
access_token: string;
|
||||
token_type: string;
|
||||
id_token?: string | undefined;
|
||||
expires_in?: number | undefined;
|
||||
scope?: string | undefined;
|
||||
refresh_token?: string | undefined;
|
||||
}>;
|
||||
/**
|
||||
* OAuth 2.1 error response
|
||||
*/
|
||||
export declare const OAuthErrorResponseSchema: z.ZodObject<{
|
||||
error: z.ZodString;
|
||||
error_description: z.ZodOptional<z.ZodString>;
|
||||
error_uri: z.ZodOptional<z.ZodString>;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
error: string;
|
||||
error_description?: string | undefined;
|
||||
error_uri?: string | undefined;
|
||||
}, {
|
||||
error: string;
|
||||
error_description?: string | undefined;
|
||||
error_uri?: string | undefined;
|
||||
}>;
|
||||
/**
|
||||
* RFC 7591 OAuth 2.0 Dynamic Client Registration metadata
|
||||
*/
|
||||
export declare const OAuthClientMetadataSchema: z.ZodObject<{
|
||||
redirect_uris: z.ZodArray<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, "many">;
|
||||
token_endpoint_auth_method: z.ZodOptional<z.ZodString>;
|
||||
grant_types: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
response_types: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
client_name: z.ZodOptional<z.ZodString>;
|
||||
client_uri: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
|
||||
logo_uri: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
|
||||
scope: z.ZodOptional<z.ZodString>;
|
||||
contacts: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
tos_uri: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
|
||||
policy_uri: z.ZodOptional<z.ZodString>;
|
||||
jwks_uri: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
|
||||
jwks: z.ZodOptional<z.ZodAny>;
|
||||
software_id: z.ZodOptional<z.ZodString>;
|
||||
software_version: z.ZodOptional<z.ZodString>;
|
||||
software_statement: z.ZodOptional<z.ZodString>;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
redirect_uris: string[];
|
||||
jwks_uri?: string | undefined;
|
||||
scope?: string | undefined;
|
||||
token_endpoint_auth_method?: string | undefined;
|
||||
grant_types?: string[] | undefined;
|
||||
response_types?: string[] | undefined;
|
||||
client_name?: string | undefined;
|
||||
client_uri?: string | undefined;
|
||||
logo_uri?: string | undefined;
|
||||
contacts?: string[] | undefined;
|
||||
tos_uri?: string | undefined;
|
||||
policy_uri?: string | undefined;
|
||||
jwks?: any;
|
||||
software_id?: string | undefined;
|
||||
software_version?: string | undefined;
|
||||
software_statement?: string | undefined;
|
||||
}, {
|
||||
redirect_uris: string[];
|
||||
jwks_uri?: string | undefined;
|
||||
scope?: string | undefined;
|
||||
token_endpoint_auth_method?: string | undefined;
|
||||
grant_types?: string[] | undefined;
|
||||
response_types?: string[] | undefined;
|
||||
client_name?: string | undefined;
|
||||
client_uri?: string | undefined;
|
||||
logo_uri?: string | undefined;
|
||||
contacts?: string[] | undefined;
|
||||
tos_uri?: string | undefined;
|
||||
policy_uri?: string | undefined;
|
||||
jwks?: any;
|
||||
software_id?: string | undefined;
|
||||
software_version?: string | undefined;
|
||||
software_statement?: string | undefined;
|
||||
}>;
|
||||
/**
|
||||
* RFC 7591 OAuth 2.0 Dynamic Client Registration client information
|
||||
*/
|
||||
export declare const OAuthClientInformationSchema: z.ZodObject<{
|
||||
client_id: z.ZodString;
|
||||
client_secret: z.ZodOptional<z.ZodString>;
|
||||
client_id_issued_at: z.ZodOptional<z.ZodNumber>;
|
||||
client_secret_expires_at: z.ZodOptional<z.ZodNumber>;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
client_id: string;
|
||||
client_secret?: string | undefined;
|
||||
client_id_issued_at?: number | undefined;
|
||||
client_secret_expires_at?: number | undefined;
|
||||
}, {
|
||||
client_id: string;
|
||||
client_secret?: string | undefined;
|
||||
client_id_issued_at?: number | undefined;
|
||||
client_secret_expires_at?: number | undefined;
|
||||
}>;
|
||||
/**
|
||||
* RFC 7591 OAuth 2.0 Dynamic Client Registration full response (client information plus metadata)
|
||||
*/
|
||||
export declare const OAuthClientInformationFullSchema: z.ZodObject<z.objectUtil.extendShape<{
|
||||
redirect_uris: z.ZodArray<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, "many">;
|
||||
token_endpoint_auth_method: z.ZodOptional<z.ZodString>;
|
||||
grant_types: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
response_types: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
client_name: z.ZodOptional<z.ZodString>;
|
||||
client_uri: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
|
||||
logo_uri: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
|
||||
scope: z.ZodOptional<z.ZodString>;
|
||||
contacts: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
tos_uri: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
|
||||
policy_uri: z.ZodOptional<z.ZodString>;
|
||||
jwks_uri: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
|
||||
jwks: z.ZodOptional<z.ZodAny>;
|
||||
software_id: z.ZodOptional<z.ZodString>;
|
||||
software_version: z.ZodOptional<z.ZodString>;
|
||||
software_statement: z.ZodOptional<z.ZodString>;
|
||||
}, {
|
||||
client_id: z.ZodString;
|
||||
client_secret: z.ZodOptional<z.ZodString>;
|
||||
client_id_issued_at: z.ZodOptional<z.ZodNumber>;
|
||||
client_secret_expires_at: z.ZodOptional<z.ZodNumber>;
|
||||
}>, "strip", z.ZodTypeAny, {
|
||||
redirect_uris: string[];
|
||||
client_id: string;
|
||||
jwks_uri?: string | undefined;
|
||||
scope?: string | undefined;
|
||||
token_endpoint_auth_method?: string | undefined;
|
||||
grant_types?: string[] | undefined;
|
||||
response_types?: string[] | undefined;
|
||||
client_name?: string | undefined;
|
||||
client_uri?: string | undefined;
|
||||
logo_uri?: string | undefined;
|
||||
contacts?: string[] | undefined;
|
||||
tos_uri?: string | undefined;
|
||||
policy_uri?: string | undefined;
|
||||
jwks?: any;
|
||||
software_id?: string | undefined;
|
||||
software_version?: string | undefined;
|
||||
software_statement?: string | undefined;
|
||||
client_secret?: string | undefined;
|
||||
client_id_issued_at?: number | undefined;
|
||||
client_secret_expires_at?: number | undefined;
|
||||
}, {
|
||||
redirect_uris: string[];
|
||||
client_id: string;
|
||||
jwks_uri?: string | undefined;
|
||||
scope?: string | undefined;
|
||||
token_endpoint_auth_method?: string | undefined;
|
||||
grant_types?: string[] | undefined;
|
||||
response_types?: string[] | undefined;
|
||||
client_name?: string | undefined;
|
||||
client_uri?: string | undefined;
|
||||
logo_uri?: string | undefined;
|
||||
contacts?: string[] | undefined;
|
||||
tos_uri?: string | undefined;
|
||||
policy_uri?: string | undefined;
|
||||
jwks?: any;
|
||||
software_id?: string | undefined;
|
||||
software_version?: string | undefined;
|
||||
software_statement?: string | undefined;
|
||||
client_secret?: string | undefined;
|
||||
client_id_issued_at?: number | undefined;
|
||||
client_secret_expires_at?: number | undefined;
|
||||
}>;
|
||||
/**
|
||||
* RFC 7591 OAuth 2.0 Dynamic Client Registration error response
|
||||
*/
|
||||
export declare const OAuthClientRegistrationErrorSchema: z.ZodObject<{
|
||||
error: z.ZodString;
|
||||
error_description: z.ZodOptional<z.ZodString>;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
error: string;
|
||||
error_description?: string | undefined;
|
||||
}, {
|
||||
error: string;
|
||||
error_description?: string | undefined;
|
||||
}>;
|
||||
/**
|
||||
* RFC 7009 OAuth 2.0 Token Revocation request
|
||||
*/
|
||||
export declare const OAuthTokenRevocationRequestSchema: z.ZodObject<{
|
||||
token: z.ZodString;
|
||||
token_type_hint: z.ZodOptional<z.ZodString>;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
token: string;
|
||||
token_type_hint?: string | undefined;
|
||||
}, {
|
||||
token: string;
|
||||
token_type_hint?: string | undefined;
|
||||
}>;
|
||||
export type OAuthMetadata = z.infer<typeof OAuthMetadataSchema>;
|
||||
export type OpenIdProviderMetadata = z.infer<typeof OpenIdProviderMetadataSchema>;
|
||||
export type OpenIdProviderDiscoveryMetadata = z.infer<typeof OpenIdProviderDiscoveryMetadataSchema>;
|
||||
export type OAuthTokens = z.infer<typeof OAuthTokensSchema>;
|
||||
export type OAuthErrorResponse = z.infer<typeof OAuthErrorResponseSchema>;
|
||||
export type OAuthClientMetadata = z.infer<typeof OAuthClientMetadataSchema>;
|
||||
export type OAuthClientInformation = z.infer<typeof OAuthClientInformationSchema>;
|
||||
export type OAuthClientInformationFull = z.infer<typeof OAuthClientInformationFullSchema>;
|
||||
export type OAuthClientRegistrationError = z.infer<typeof OAuthClientRegistrationErrorSchema>;
|
||||
export type OAuthTokenRevocationRequest = z.infer<typeof OAuthTokenRevocationRequestSchema>;
|
||||
export type OAuthProtectedResourceMetadata = z.infer<typeof OAuthProtectedResourceMetadataSchema>;
|
||||
export type AuthorizationServerMetadata = OAuthMetadata | OpenIdProviderDiscoveryMetadata;
|
||||
//# sourceMappingURL=auth.d.ts.map
|
||||
1
baserow-mcp-server/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/auth.d.ts.map
generated
vendored
Normal file
1
baserow-mcp-server/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/auth.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../src/shared/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AACH,eAAO,MAAM,aAAa,yEAoBrB,CAAC;AAEN;;GAEG;AACH,eAAO,MAAM,oCAAoC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCAiB/B,CAAC;AAEnB;;GAEG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCAqBd,CAAC;AAEnB;;;GAGG;AACH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCAsCvB,CAAC;AAEnB;;;;GAIG;AACH,eAAO,MAAM,qCAAqC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sEAIjD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;EASlB,CAAC;AAEb;;GAEG;AACH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;EAInC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmB1B,CAAC;AAEb;;GAEG;AACH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;EAO7B,CAAC;AAEb;;GAEG;AACH,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAgE,CAAC;AAE9G;;GAEG;AACH,eAAO,MAAM,kCAAkC;;;;;;;;;EAKnC,CAAC;AAEb;;GAEG;AACH,eAAO,MAAM,iCAAiC;;;;;;;;;EAKlC,CAAC;AAEb,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAChE,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAClF,MAAM,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qCAAqC,CAAC,CAAC;AAEpG,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAC5D,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAC1E,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAC5E,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAClF,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gCAAgC,CAAC,CAAC;AAC1F,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kCAAkC,CAAC,CAAC;AAC9F,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iCAAiC,CAAC,CAAC;AAC5F,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oCAAoC,CAAC,CAAC;AAGlG,MAAM,MAAM,2BAA2B,GAAG,aAAa,GAAG,+BAA+B,CAAC"}
|
||||
199
baserow-mcp-server/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/auth.js
generated
vendored
Normal file
199
baserow-mcp-server/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/auth.js
generated
vendored
Normal file
@@ -0,0 +1,199 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.OAuthTokenRevocationRequestSchema = exports.OAuthClientRegistrationErrorSchema = exports.OAuthClientInformationFullSchema = exports.OAuthClientInformationSchema = exports.OAuthClientMetadataSchema = exports.OAuthErrorResponseSchema = exports.OAuthTokensSchema = exports.OpenIdProviderDiscoveryMetadataSchema = exports.OpenIdProviderMetadataSchema = exports.OAuthMetadataSchema = exports.OAuthProtectedResourceMetadataSchema = exports.SafeUrlSchema = void 0;
|
||||
const zod_1 = require("zod");
|
||||
/**
|
||||
* Reusable URL validation that disallows javascript: scheme
|
||||
*/
|
||||
exports.SafeUrlSchema = zod_1.z
|
||||
.string()
|
||||
.url()
|
||||
.superRefine((val, ctx) => {
|
||||
if (!URL.canParse(val)) {
|
||||
ctx.addIssue({
|
||||
code: zod_1.z.ZodIssueCode.custom,
|
||||
message: 'URL must be parseable',
|
||||
fatal: true
|
||||
});
|
||||
return zod_1.z.NEVER;
|
||||
}
|
||||
})
|
||||
.refine(url => {
|
||||
const u = new URL(url);
|
||||
return u.protocol !== 'javascript:' && u.protocol !== 'data:' && u.protocol !== 'vbscript:';
|
||||
}, { message: 'URL cannot use javascript:, data:, or vbscript: scheme' });
|
||||
/**
|
||||
* RFC 9728 OAuth Protected Resource Metadata
|
||||
*/
|
||||
exports.OAuthProtectedResourceMetadataSchema = zod_1.z
|
||||
.object({
|
||||
resource: zod_1.z.string().url(),
|
||||
authorization_servers: zod_1.z.array(exports.SafeUrlSchema).optional(),
|
||||
jwks_uri: zod_1.z.string().url().optional(),
|
||||
scopes_supported: zod_1.z.array(zod_1.z.string()).optional(),
|
||||
bearer_methods_supported: zod_1.z.array(zod_1.z.string()).optional(),
|
||||
resource_signing_alg_values_supported: zod_1.z.array(zod_1.z.string()).optional(),
|
||||
resource_name: zod_1.z.string().optional(),
|
||||
resource_documentation: zod_1.z.string().optional(),
|
||||
resource_policy_uri: zod_1.z.string().url().optional(),
|
||||
resource_tos_uri: zod_1.z.string().url().optional(),
|
||||
tls_client_certificate_bound_access_tokens: zod_1.z.boolean().optional(),
|
||||
authorization_details_types_supported: zod_1.z.array(zod_1.z.string()).optional(),
|
||||
dpop_signing_alg_values_supported: zod_1.z.array(zod_1.z.string()).optional(),
|
||||
dpop_bound_access_tokens_required: zod_1.z.boolean().optional()
|
||||
})
|
||||
.passthrough();
|
||||
/**
|
||||
* RFC 8414 OAuth 2.0 Authorization Server Metadata
|
||||
*/
|
||||
exports.OAuthMetadataSchema = zod_1.z
|
||||
.object({
|
||||
issuer: zod_1.z.string(),
|
||||
authorization_endpoint: exports.SafeUrlSchema,
|
||||
token_endpoint: exports.SafeUrlSchema,
|
||||
registration_endpoint: exports.SafeUrlSchema.optional(),
|
||||
scopes_supported: zod_1.z.array(zod_1.z.string()).optional(),
|
||||
response_types_supported: zod_1.z.array(zod_1.z.string()),
|
||||
response_modes_supported: zod_1.z.array(zod_1.z.string()).optional(),
|
||||
grant_types_supported: zod_1.z.array(zod_1.z.string()).optional(),
|
||||
token_endpoint_auth_methods_supported: zod_1.z.array(zod_1.z.string()).optional(),
|
||||
token_endpoint_auth_signing_alg_values_supported: zod_1.z.array(zod_1.z.string()).optional(),
|
||||
service_documentation: exports.SafeUrlSchema.optional(),
|
||||
revocation_endpoint: exports.SafeUrlSchema.optional(),
|
||||
revocation_endpoint_auth_methods_supported: zod_1.z.array(zod_1.z.string()).optional(),
|
||||
revocation_endpoint_auth_signing_alg_values_supported: zod_1.z.array(zod_1.z.string()).optional(),
|
||||
introspection_endpoint: zod_1.z.string().optional(),
|
||||
introspection_endpoint_auth_methods_supported: zod_1.z.array(zod_1.z.string()).optional(),
|
||||
introspection_endpoint_auth_signing_alg_values_supported: zod_1.z.array(zod_1.z.string()).optional(),
|
||||
code_challenge_methods_supported: zod_1.z.array(zod_1.z.string()).optional()
|
||||
})
|
||||
.passthrough();
|
||||
/**
|
||||
* OpenID Connect Discovery 1.0 Provider Metadata
|
||||
* see: https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderMetadata
|
||||
*/
|
||||
exports.OpenIdProviderMetadataSchema = zod_1.z
|
||||
.object({
|
||||
issuer: zod_1.z.string(),
|
||||
authorization_endpoint: exports.SafeUrlSchema,
|
||||
token_endpoint: exports.SafeUrlSchema,
|
||||
userinfo_endpoint: exports.SafeUrlSchema.optional(),
|
||||
jwks_uri: exports.SafeUrlSchema,
|
||||
registration_endpoint: exports.SafeUrlSchema.optional(),
|
||||
scopes_supported: zod_1.z.array(zod_1.z.string()).optional(),
|
||||
response_types_supported: zod_1.z.array(zod_1.z.string()),
|
||||
response_modes_supported: zod_1.z.array(zod_1.z.string()).optional(),
|
||||
grant_types_supported: zod_1.z.array(zod_1.z.string()).optional(),
|
||||
acr_values_supported: zod_1.z.array(zod_1.z.string()).optional(),
|
||||
subject_types_supported: zod_1.z.array(zod_1.z.string()),
|
||||
id_token_signing_alg_values_supported: zod_1.z.array(zod_1.z.string()),
|
||||
id_token_encryption_alg_values_supported: zod_1.z.array(zod_1.z.string()).optional(),
|
||||
id_token_encryption_enc_values_supported: zod_1.z.array(zod_1.z.string()).optional(),
|
||||
userinfo_signing_alg_values_supported: zod_1.z.array(zod_1.z.string()).optional(),
|
||||
userinfo_encryption_alg_values_supported: zod_1.z.array(zod_1.z.string()).optional(),
|
||||
userinfo_encryption_enc_values_supported: zod_1.z.array(zod_1.z.string()).optional(),
|
||||
request_object_signing_alg_values_supported: zod_1.z.array(zod_1.z.string()).optional(),
|
||||
request_object_encryption_alg_values_supported: zod_1.z.array(zod_1.z.string()).optional(),
|
||||
request_object_encryption_enc_values_supported: zod_1.z.array(zod_1.z.string()).optional(),
|
||||
token_endpoint_auth_methods_supported: zod_1.z.array(zod_1.z.string()).optional(),
|
||||
token_endpoint_auth_signing_alg_values_supported: zod_1.z.array(zod_1.z.string()).optional(),
|
||||
display_values_supported: zod_1.z.array(zod_1.z.string()).optional(),
|
||||
claim_types_supported: zod_1.z.array(zod_1.z.string()).optional(),
|
||||
claims_supported: zod_1.z.array(zod_1.z.string()).optional(),
|
||||
service_documentation: zod_1.z.string().optional(),
|
||||
claims_locales_supported: zod_1.z.array(zod_1.z.string()).optional(),
|
||||
ui_locales_supported: zod_1.z.array(zod_1.z.string()).optional(),
|
||||
claims_parameter_supported: zod_1.z.boolean().optional(),
|
||||
request_parameter_supported: zod_1.z.boolean().optional(),
|
||||
request_uri_parameter_supported: zod_1.z.boolean().optional(),
|
||||
require_request_uri_registration: zod_1.z.boolean().optional(),
|
||||
op_policy_uri: exports.SafeUrlSchema.optional(),
|
||||
op_tos_uri: exports.SafeUrlSchema.optional()
|
||||
})
|
||||
.passthrough();
|
||||
/**
|
||||
* OpenID Connect Discovery metadata that may include OAuth 2.0 fields
|
||||
* This schema represents the real-world scenario where OIDC providers
|
||||
* return a mix of OpenID Connect and OAuth 2.0 metadata fields
|
||||
*/
|
||||
exports.OpenIdProviderDiscoveryMetadataSchema = exports.OpenIdProviderMetadataSchema.merge(exports.OAuthMetadataSchema.pick({
|
||||
code_challenge_methods_supported: true
|
||||
}));
|
||||
/**
|
||||
* OAuth 2.1 token response
|
||||
*/
|
||||
exports.OAuthTokensSchema = zod_1.z
|
||||
.object({
|
||||
access_token: zod_1.z.string(),
|
||||
id_token: zod_1.z.string().optional(), // Optional for OAuth 2.1, but necessary in OpenID Connect
|
||||
token_type: zod_1.z.string(),
|
||||
expires_in: zod_1.z.number().optional(),
|
||||
scope: zod_1.z.string().optional(),
|
||||
refresh_token: zod_1.z.string().optional()
|
||||
})
|
||||
.strip();
|
||||
/**
|
||||
* OAuth 2.1 error response
|
||||
*/
|
||||
exports.OAuthErrorResponseSchema = zod_1.z.object({
|
||||
error: zod_1.z.string(),
|
||||
error_description: zod_1.z.string().optional(),
|
||||
error_uri: zod_1.z.string().optional()
|
||||
});
|
||||
/**
|
||||
* RFC 7591 OAuth 2.0 Dynamic Client Registration metadata
|
||||
*/
|
||||
exports.OAuthClientMetadataSchema = zod_1.z
|
||||
.object({
|
||||
redirect_uris: zod_1.z.array(exports.SafeUrlSchema),
|
||||
token_endpoint_auth_method: zod_1.z.string().optional(),
|
||||
grant_types: zod_1.z.array(zod_1.z.string()).optional(),
|
||||
response_types: zod_1.z.array(zod_1.z.string()).optional(),
|
||||
client_name: zod_1.z.string().optional(),
|
||||
client_uri: exports.SafeUrlSchema.optional(),
|
||||
logo_uri: exports.SafeUrlSchema.optional(),
|
||||
scope: zod_1.z.string().optional(),
|
||||
contacts: zod_1.z.array(zod_1.z.string()).optional(),
|
||||
tos_uri: exports.SafeUrlSchema.optional(),
|
||||
policy_uri: zod_1.z.string().optional(),
|
||||
jwks_uri: exports.SafeUrlSchema.optional(),
|
||||
jwks: zod_1.z.any().optional(),
|
||||
software_id: zod_1.z.string().optional(),
|
||||
software_version: zod_1.z.string().optional(),
|
||||
software_statement: zod_1.z.string().optional()
|
||||
})
|
||||
.strip();
|
||||
/**
|
||||
* RFC 7591 OAuth 2.0 Dynamic Client Registration client information
|
||||
*/
|
||||
exports.OAuthClientInformationSchema = zod_1.z
|
||||
.object({
|
||||
client_id: zod_1.z.string(),
|
||||
client_secret: zod_1.z.string().optional(),
|
||||
client_id_issued_at: zod_1.z.number().optional(),
|
||||
client_secret_expires_at: zod_1.z.number().optional()
|
||||
})
|
||||
.strip();
|
||||
/**
|
||||
* RFC 7591 OAuth 2.0 Dynamic Client Registration full response (client information plus metadata)
|
||||
*/
|
||||
exports.OAuthClientInformationFullSchema = exports.OAuthClientMetadataSchema.merge(exports.OAuthClientInformationSchema);
|
||||
/**
|
||||
* RFC 7591 OAuth 2.0 Dynamic Client Registration error response
|
||||
*/
|
||||
exports.OAuthClientRegistrationErrorSchema = zod_1.z
|
||||
.object({
|
||||
error: zod_1.z.string(),
|
||||
error_description: zod_1.z.string().optional()
|
||||
})
|
||||
.strip();
|
||||
/**
|
||||
* RFC 7009 OAuth 2.0 Token Revocation request
|
||||
*/
|
||||
exports.OAuthTokenRevocationRequestSchema = zod_1.z
|
||||
.object({
|
||||
token: zod_1.z.string(),
|
||||
token_type_hint: zod_1.z.string().optional()
|
||||
})
|
||||
.strip();
|
||||
//# sourceMappingURL=auth.js.map
|
||||
1
baserow-mcp-server/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/auth.js.map
generated
vendored
Normal file
1
baserow-mcp-server/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/auth.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
12
baserow-mcp-server/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/metadataUtils.d.ts
generated
vendored
Normal file
12
baserow-mcp-server/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/metadataUtils.d.ts
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
import { BaseMetadata } from '../types.js';
|
||||
/**
|
||||
* Utilities for working with BaseMetadata objects.
|
||||
*/
|
||||
/**
|
||||
* Gets the display name for an object with BaseMetadata.
|
||||
* For tools, the precedence is: title → annotations.title → name
|
||||
* For other objects: title → name
|
||||
* This implements the spec requirement: "if no title is provided, name should be used for display purposes"
|
||||
*/
|
||||
export declare function getDisplayName(metadata: BaseMetadata): string;
|
||||
//# sourceMappingURL=metadataUtils.d.ts.map
|
||||
1
baserow-mcp-server/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/metadataUtils.d.ts.map
generated
vendored
Normal file
1
baserow-mcp-server/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/metadataUtils.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"metadataUtils.d.ts","sourceRoot":"","sources":["../../../src/shared/metadataUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C;;GAEG;AAEH;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,YAAY,GAAG,MAAM,CAgB7D"}
|
||||
29
baserow-mcp-server/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/metadataUtils.js
generated
vendored
Normal file
29
baserow-mcp-server/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/metadataUtils.js
generated
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getDisplayName = getDisplayName;
|
||||
/**
|
||||
* Utilities for working with BaseMetadata objects.
|
||||
*/
|
||||
/**
|
||||
* Gets the display name for an object with BaseMetadata.
|
||||
* For tools, the precedence is: title → annotations.title → name
|
||||
* For other objects: title → name
|
||||
* This implements the spec requirement: "if no title is provided, name should be used for display purposes"
|
||||
*/
|
||||
function getDisplayName(metadata) {
|
||||
var _a;
|
||||
// First check for title (not undefined and not empty string)
|
||||
if (metadata.title !== undefined && metadata.title !== '') {
|
||||
return metadata.title;
|
||||
}
|
||||
// Then check for annotations.title (only present in Tool objects)
|
||||
if ('annotations' in metadata) {
|
||||
const metadataWithAnnotations = metadata;
|
||||
if ((_a = metadataWithAnnotations.annotations) === null || _a === void 0 ? void 0 : _a.title) {
|
||||
return metadataWithAnnotations.annotations.title;
|
||||
}
|
||||
}
|
||||
// Finally fall back to name
|
||||
return metadata.name;
|
||||
}
|
||||
//# sourceMappingURL=metadataUtils.js.map
|
||||
1
baserow-mcp-server/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/metadataUtils.js.map
generated
vendored
Normal file
1
baserow-mcp-server/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/metadataUtils.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"metadataUtils.js","sourceRoot":"","sources":["../../../src/shared/metadataUtils.ts"],"names":[],"mappings":";;AAYA,wCAgBC;AA1BD;;GAEG;AAEH;;;;;GAKG;AACH,SAAgB,cAAc,CAAC,QAAsB;;IACjD,6DAA6D;IAC7D,IAAI,QAAQ,CAAC,KAAK,KAAK,SAAS,IAAI,QAAQ,CAAC,KAAK,KAAK,EAAE,EAAE,CAAC;QACxD,OAAO,QAAQ,CAAC,KAAK,CAAC;IAC1B,CAAC;IAED,kEAAkE;IAClE,IAAI,aAAa,IAAI,QAAQ,EAAE,CAAC;QAC5B,MAAM,uBAAuB,GAAG,QAA+D,CAAC;QAChG,IAAI,MAAA,uBAAuB,CAAC,WAAW,0CAAE,KAAK,EAAE,CAAC;YAC7C,OAAO,uBAAuB,CAAC,WAAW,CAAC,KAAK,CAAC;QACrD,CAAC;IACL,CAAC;IAED,4BAA4B;IAC5B,OAAO,QAAQ,CAAC,IAAI,CAAC;AACzB,CAAC"}
|
||||
229
baserow-mcp-server/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/protocol.d.ts
generated
vendored
Normal file
229
baserow-mcp-server/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/protocol.d.ts
generated
vendored
Normal file
@@ -0,0 +1,229 @@
|
||||
import { ZodLiteral, ZodObject, ZodType, z } from 'zod';
|
||||
import { ClientCapabilities, JSONRPCRequest, Notification, Progress, Request, RequestId, Result, ServerCapabilities, RequestMeta, RequestInfo } from '../types.js';
|
||||
import { Transport, TransportSendOptions } from './transport.js';
|
||||
import { AuthInfo } from '../server/auth/types.js';
|
||||
/**
|
||||
* Callback for progress notifications.
|
||||
*/
|
||||
export type ProgressCallback = (progress: Progress) => void;
|
||||
/**
|
||||
* Additional initialization options.
|
||||
*/
|
||||
export type ProtocolOptions = {
|
||||
/**
|
||||
* Whether to restrict emitted requests to only those that the remote side has indicated that they can handle, through their advertised capabilities.
|
||||
*
|
||||
* Note that this DOES NOT affect checking of _local_ side capabilities, as it is considered a logic error to mis-specify those.
|
||||
*
|
||||
* Currently this defaults to false, for backwards compatibility with SDK versions that did not advertise capabilities correctly. In future, this will default to true.
|
||||
*/
|
||||
enforceStrictCapabilities?: boolean;
|
||||
/**
|
||||
* An array of notification method names that should be automatically debounced.
|
||||
* Any notifications with a method in this list will be coalesced if they
|
||||
* occur in the same tick of the event loop.
|
||||
* e.g., ['notifications/tools/list_changed']
|
||||
*/
|
||||
debouncedNotificationMethods?: string[];
|
||||
};
|
||||
/**
|
||||
* The default request timeout, in miliseconds.
|
||||
*/
|
||||
export declare const DEFAULT_REQUEST_TIMEOUT_MSEC = 60000;
|
||||
/**
|
||||
* Options that can be given per request.
|
||||
*/
|
||||
export type RequestOptions = {
|
||||
/**
|
||||
* If set, requests progress notifications from the remote end (if supported). When progress notifications are received, this callback will be invoked.
|
||||
*/
|
||||
onprogress?: ProgressCallback;
|
||||
/**
|
||||
* Can be used to cancel an in-flight request. This will cause an AbortError to be raised from request().
|
||||
*/
|
||||
signal?: AbortSignal;
|
||||
/**
|
||||
* A timeout (in milliseconds) for this request. If exceeded, an McpError with code `RequestTimeout` will be raised from request().
|
||||
*
|
||||
* If not specified, `DEFAULT_REQUEST_TIMEOUT_MSEC` will be used as the timeout.
|
||||
*/
|
||||
timeout?: number;
|
||||
/**
|
||||
* If true, receiving a progress notification will reset the request timeout.
|
||||
* This is useful for long-running operations that send periodic progress updates.
|
||||
* Default: false
|
||||
*/
|
||||
resetTimeoutOnProgress?: boolean;
|
||||
/**
|
||||
* Maximum total time (in milliseconds) to wait for a response.
|
||||
* If exceeded, an McpError with code `RequestTimeout` will be raised, regardless of progress notifications.
|
||||
* If not specified, there is no maximum total timeout.
|
||||
*/
|
||||
maxTotalTimeout?: number;
|
||||
} & TransportSendOptions;
|
||||
/**
|
||||
* Options that can be given per notification.
|
||||
*/
|
||||
export type NotificationOptions = {
|
||||
/**
|
||||
* May be used to indicate to the transport which incoming request to associate this outgoing notification with.
|
||||
*/
|
||||
relatedRequestId?: RequestId;
|
||||
};
|
||||
/**
|
||||
* Extra data given to request handlers.
|
||||
*/
|
||||
export type RequestHandlerExtra<SendRequestT extends Request, SendNotificationT extends Notification> = {
|
||||
/**
|
||||
* An abort signal used to communicate if the request was cancelled from the sender's side.
|
||||
*/
|
||||
signal: AbortSignal;
|
||||
/**
|
||||
* Information about a validated access token, provided to request handlers.
|
||||
*/
|
||||
authInfo?: AuthInfo;
|
||||
/**
|
||||
* The session ID from the transport, if available.
|
||||
*/
|
||||
sessionId?: string;
|
||||
/**
|
||||
* Metadata from the original request.
|
||||
*/
|
||||
_meta?: RequestMeta;
|
||||
/**
|
||||
* The JSON-RPC ID of the request being handled.
|
||||
* This can be useful for tracking or logging purposes.
|
||||
*/
|
||||
requestId: RequestId;
|
||||
/**
|
||||
* The original HTTP request.
|
||||
*/
|
||||
requestInfo?: RequestInfo;
|
||||
/**
|
||||
* Sends a notification that relates to the current request being handled.
|
||||
*
|
||||
* This is used by certain transports to correctly associate related messages.
|
||||
*/
|
||||
sendNotification: (notification: SendNotificationT) => Promise<void>;
|
||||
/**
|
||||
* Sends a request that relates to the current request being handled.
|
||||
*
|
||||
* This is used by certain transports to correctly associate related messages.
|
||||
*/
|
||||
sendRequest: <U extends ZodType<object>>(request: SendRequestT, resultSchema: U, options?: RequestOptions) => Promise<z.infer<U>>;
|
||||
};
|
||||
/**
|
||||
* Implements MCP protocol framing on top of a pluggable transport, including
|
||||
* features like request/response linking, notifications, and progress.
|
||||
*/
|
||||
export declare abstract class Protocol<SendRequestT extends Request, SendNotificationT extends Notification, SendResultT extends Result> {
|
||||
private _options?;
|
||||
private _transport?;
|
||||
private _requestMessageId;
|
||||
private _requestHandlers;
|
||||
private _requestHandlerAbortControllers;
|
||||
private _notificationHandlers;
|
||||
private _responseHandlers;
|
||||
private _progressHandlers;
|
||||
private _timeoutInfo;
|
||||
private _pendingDebouncedNotifications;
|
||||
/**
|
||||
* Callback for when the connection is closed for any reason.
|
||||
*
|
||||
* This is invoked when close() is called as well.
|
||||
*/
|
||||
onclose?: () => void;
|
||||
/**
|
||||
* Callback for when an error occurs.
|
||||
*
|
||||
* Note that errors are not necessarily fatal; they are used for reporting any kind of exceptional condition out of band.
|
||||
*/
|
||||
onerror?: (error: Error) => void;
|
||||
/**
|
||||
* A handler to invoke for any request types that do not have their own handler installed.
|
||||
*/
|
||||
fallbackRequestHandler?: (request: JSONRPCRequest, extra: RequestHandlerExtra<SendRequestT, SendNotificationT>) => Promise<SendResultT>;
|
||||
/**
|
||||
* A handler to invoke for any notification types that do not have their own handler installed.
|
||||
*/
|
||||
fallbackNotificationHandler?: (notification: Notification) => Promise<void>;
|
||||
constructor(_options?: ProtocolOptions | undefined);
|
||||
private _setupTimeout;
|
||||
private _resetTimeout;
|
||||
private _cleanupTimeout;
|
||||
/**
|
||||
* Attaches to the given transport, starts it, and starts listening for messages.
|
||||
*
|
||||
* The Protocol object assumes ownership of the Transport, replacing any callbacks that have already been set, and expects that it is the only user of the Transport instance going forward.
|
||||
*/
|
||||
connect(transport: Transport): Promise<void>;
|
||||
private _onclose;
|
||||
private _onerror;
|
||||
private _onnotification;
|
||||
private _onrequest;
|
||||
private _onprogress;
|
||||
private _onresponse;
|
||||
get transport(): Transport | undefined;
|
||||
/**
|
||||
* Closes the connection.
|
||||
*/
|
||||
close(): Promise<void>;
|
||||
/**
|
||||
* A method to check if a capability is supported by the remote side, for the given method to be called.
|
||||
*
|
||||
* This should be implemented by subclasses.
|
||||
*/
|
||||
protected abstract assertCapabilityForMethod(method: SendRequestT['method']): void;
|
||||
/**
|
||||
* A method to check if a notification is supported by the local side, for the given method to be sent.
|
||||
*
|
||||
* This should be implemented by subclasses.
|
||||
*/
|
||||
protected abstract assertNotificationCapability(method: SendNotificationT['method']): void;
|
||||
/**
|
||||
* A method to check if a request handler is supported by the local side, for the given method to be handled.
|
||||
*
|
||||
* This should be implemented by subclasses.
|
||||
*/
|
||||
protected abstract assertRequestHandlerCapability(method: string): void;
|
||||
/**
|
||||
* Sends a request and wait for a response.
|
||||
*
|
||||
* Do not use this method to emit notifications! Use notification() instead.
|
||||
*/
|
||||
request<T extends ZodType<object>>(request: SendRequestT, resultSchema: T, options?: RequestOptions): Promise<z.infer<T>>;
|
||||
/**
|
||||
* Emits a notification, which is a one-way message that does not expect a response.
|
||||
*/
|
||||
notification(notification: SendNotificationT, options?: NotificationOptions): Promise<void>;
|
||||
/**
|
||||
* Registers a handler to invoke when this protocol object receives a request with the given method.
|
||||
*
|
||||
* Note that this will replace any previous request handler for the same method.
|
||||
*/
|
||||
setRequestHandler<T extends ZodObject<{
|
||||
method: ZodLiteral<string>;
|
||||
}>>(requestSchema: T, handler: (request: z.infer<T>, extra: RequestHandlerExtra<SendRequestT, SendNotificationT>) => SendResultT | Promise<SendResultT>): void;
|
||||
/**
|
||||
* Removes the request handler for the given method.
|
||||
*/
|
||||
removeRequestHandler(method: string): void;
|
||||
/**
|
||||
* Asserts that a request handler has not already been set for the given method, in preparation for a new one being automatically installed.
|
||||
*/
|
||||
assertCanSetRequestHandler(method: string): void;
|
||||
/**
|
||||
* Registers a handler to invoke when this protocol object receives a notification with the given method.
|
||||
*
|
||||
* Note that this will replace any previous notification handler for the same method.
|
||||
*/
|
||||
setNotificationHandler<T extends ZodObject<{
|
||||
method: ZodLiteral<string>;
|
||||
}>>(notificationSchema: T, handler: (notification: z.infer<T>) => void | Promise<void>): void;
|
||||
/**
|
||||
* Removes the notification handler for the given method.
|
||||
*/
|
||||
removeNotificationHandler(method: string): void;
|
||||
}
|
||||
export declare function mergeCapabilities<T extends ServerCapabilities | ClientCapabilities>(base: T, additional: T): T;
|
||||
//# sourceMappingURL=protocol.d.ts.map
|
||||
1
baserow-mcp-server/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/protocol.d.ts.map
generated
vendored
Normal file
1
baserow-mcp-server/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/protocol.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../../../src/shared/protocol.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxD,OAAO,EAEH,kBAAkB,EAQlB,cAAc,EAGd,YAAY,EAEZ,QAAQ,EAGR,OAAO,EACP,SAAS,EACT,MAAM,EACN,kBAAkB,EAClB,WAAW,EAEX,WAAW,EACd,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,SAAS,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AACjE,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAEnD;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,QAAQ,EAAE,QAAQ,KAAK,IAAI,CAAC;AAE5D;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAC1B;;;;;;OAMG;IACH,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC;;;;;OAKG;IACH,4BAA4B,CAAC,EAAE,MAAM,EAAE,CAAC;CAC3C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,4BAA4B,QAAQ,CAAC;AAElD;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;IACzB;;OAEG;IACH,UAAU,CAAC,EAAE,gBAAgB,CAAC;IAE9B;;OAEG;IACH,MAAM,CAAC,EAAE,WAAW,CAAC;IAErB;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;;OAIG;IACH,sBAAsB,CAAC,EAAE,OAAO,CAAC;IAEjC;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;CAC5B,GAAG,oBAAoB,CAAC;AAEzB;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAC9B;;OAEG;IACH,gBAAgB,CAAC,EAAE,SAAS,CAAC;CAChC,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,mBAAmB,CAAC,YAAY,SAAS,OAAO,EAAE,iBAAiB,SAAS,YAAY,IAAI;IACpG;;OAEG;IACH,MAAM,EAAE,WAAW,CAAC;IAEpB;;OAEG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAC;IAEpB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,KAAK,CAAC,EAAE,WAAW,CAAC;IAEpB;;;OAGG;IACH,SAAS,EAAE,SAAS,CAAC;IAErB;;OAEG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC;IAE1B;;;;OAIG;IACH,gBAAgB,EAAE,CAAC,YAAY,EAAE,iBAAiB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAErE;;;;OAIG;IACH,WAAW,EAAE,CAAC,CAAC,SAAS,OAAO,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,CAAC,EAAE,OAAO,CAAC,EAAE,cAAc,KAAK,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;CACrI,CAAC;AAcF;;;GAGG;AACH,8BAAsB,QAAQ,CAAC,YAAY,SAAS,OAAO,EAAE,iBAAiB,SAAS,YAAY,EAAE,WAAW,SAAS,MAAM;IAsC/G,OAAO,CAAC,QAAQ,CAAC;IArC7B,OAAO,CAAC,UAAU,CAAC,CAAY;IAC/B,OAAO,CAAC,iBAAiB,CAAK;IAC9B,OAAO,CAAC,gBAAgB,CAGV;IACd,OAAO,CAAC,+BAA+B,CAA8C;IACrF,OAAO,CAAC,qBAAqB,CAAgF;IAC7G,OAAO,CAAC,iBAAiB,CAAuE;IAChG,OAAO,CAAC,iBAAiB,CAA4C;IACrE,OAAO,CAAC,YAAY,CAAuC;IAC3D,OAAO,CAAC,8BAA8B,CAAqB;IAE3D;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IAErB;;;;OAIG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IAEjC;;OAEG;IACH,sBAAsB,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,mBAAmB,CAAC,YAAY,EAAE,iBAAiB,CAAC,KAAK,OAAO,CAAC,WAAW,CAAC,CAAC;IAExI;;OAEG;IACH,2BAA2B,CAAC,EAAE,CAAC,YAAY,EAAE,YAAY,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;gBAExD,QAAQ,CAAC,EAAE,eAAe,YAAA;IAiB9C,OAAO,CAAC,aAAa;IAiBrB,OAAO,CAAC,aAAa;IAkBrB,OAAO,CAAC,eAAe;IAQvB;;;;OAIG;IACG,OAAO,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC;IA+BlD,OAAO,CAAC,QAAQ;IAchB,OAAO,CAAC,QAAQ;IAIhB,OAAO,CAAC,eAAe;IAcvB,OAAO,CAAC,UAAU;IAsElB,OAAO,CAAC,WAAW;IAyBnB,OAAO,CAAC,WAAW;IAoBnB,IAAI,SAAS,IAAI,SAAS,GAAG,SAAS,CAErC;IAED;;OAEG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAI5B;;;;OAIG;IACH,SAAS,CAAC,QAAQ,CAAC,yBAAyB,CAAC,MAAM,EAAE,YAAY,CAAC,QAAQ,CAAC,GAAG,IAAI;IAElF;;;;OAIG;IACH,SAAS,CAAC,QAAQ,CAAC,4BAA4B,CAAC,MAAM,EAAE,iBAAiB,CAAC,QAAQ,CAAC,GAAG,IAAI;IAE1F;;;;OAIG;IACH,SAAS,CAAC,QAAQ,CAAC,8BAA8B,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAEvE;;;;OAIG;IACH,OAAO,CAAC,CAAC,SAAS,OAAO,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,CAAC,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAwFzH;;OAEG;IACG,YAAY,CAAC,YAAY,EAAE,iBAAiB,EAAE,OAAO,CAAC,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC;IAqDjG;;;;OAIG;IACH,iBAAiB,CACb,CAAC,SAAS,SAAS,CAAC;QAChB,MAAM,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC;KAC9B,CAAC,EAEF,aAAa,EAAE,CAAC,EAChB,OAAO,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,mBAAmB,CAAC,YAAY,EAAE,iBAAiB,CAAC,KAAK,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC,GAClI,IAAI;IASP;;OAEG;IACH,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAI1C;;OAEG;IACH,0BAA0B,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAMhD;;;;OAIG;IACH,sBAAsB,CAClB,CAAC,SAAS,SAAS,CAAC;QAChB,MAAM,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC;KAC9B,CAAC,EACJ,kBAAkB,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,YAAY,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI;IAM3F;;OAEG;IACH,yBAAyB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;CAGlD;AAED,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,kBAAkB,GAAG,kBAAkB,EAAE,IAAI,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,GAAG,CAAC,CAY9G"}
|
||||
419
baserow-mcp-server/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/protocol.js
generated
vendored
Normal file
419
baserow-mcp-server/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/protocol.js
generated
vendored
Normal file
@@ -0,0 +1,419 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.Protocol = exports.DEFAULT_REQUEST_TIMEOUT_MSEC = void 0;
|
||||
exports.mergeCapabilities = mergeCapabilities;
|
||||
const types_js_1 = require("../types.js");
|
||||
/**
|
||||
* The default request timeout, in miliseconds.
|
||||
*/
|
||||
exports.DEFAULT_REQUEST_TIMEOUT_MSEC = 60000;
|
||||
/**
|
||||
* Implements MCP protocol framing on top of a pluggable transport, including
|
||||
* features like request/response linking, notifications, and progress.
|
||||
*/
|
||||
class Protocol {
|
||||
constructor(_options) {
|
||||
this._options = _options;
|
||||
this._requestMessageId = 0;
|
||||
this._requestHandlers = new Map();
|
||||
this._requestHandlerAbortControllers = new Map();
|
||||
this._notificationHandlers = new Map();
|
||||
this._responseHandlers = new Map();
|
||||
this._progressHandlers = new Map();
|
||||
this._timeoutInfo = new Map();
|
||||
this._pendingDebouncedNotifications = new Set();
|
||||
this.setNotificationHandler(types_js_1.CancelledNotificationSchema, notification => {
|
||||
const controller = this._requestHandlerAbortControllers.get(notification.params.requestId);
|
||||
controller === null || controller === void 0 ? void 0 : controller.abort(notification.params.reason);
|
||||
});
|
||||
this.setNotificationHandler(types_js_1.ProgressNotificationSchema, notification => {
|
||||
this._onprogress(notification);
|
||||
});
|
||||
this.setRequestHandler(types_js_1.PingRequestSchema,
|
||||
// Automatic pong by default.
|
||||
_request => ({}));
|
||||
}
|
||||
_setupTimeout(messageId, timeout, maxTotalTimeout, onTimeout, resetTimeoutOnProgress = false) {
|
||||
this._timeoutInfo.set(messageId, {
|
||||
timeoutId: setTimeout(onTimeout, timeout),
|
||||
startTime: Date.now(),
|
||||
timeout,
|
||||
maxTotalTimeout,
|
||||
resetTimeoutOnProgress,
|
||||
onTimeout
|
||||
});
|
||||
}
|
||||
_resetTimeout(messageId) {
|
||||
const info = this._timeoutInfo.get(messageId);
|
||||
if (!info)
|
||||
return false;
|
||||
const totalElapsed = Date.now() - info.startTime;
|
||||
if (info.maxTotalTimeout && totalElapsed >= info.maxTotalTimeout) {
|
||||
this._timeoutInfo.delete(messageId);
|
||||
throw new types_js_1.McpError(types_js_1.ErrorCode.RequestTimeout, 'Maximum total timeout exceeded', {
|
||||
maxTotalTimeout: info.maxTotalTimeout,
|
||||
totalElapsed
|
||||
});
|
||||
}
|
||||
clearTimeout(info.timeoutId);
|
||||
info.timeoutId = setTimeout(info.onTimeout, info.timeout);
|
||||
return true;
|
||||
}
|
||||
_cleanupTimeout(messageId) {
|
||||
const info = this._timeoutInfo.get(messageId);
|
||||
if (info) {
|
||||
clearTimeout(info.timeoutId);
|
||||
this._timeoutInfo.delete(messageId);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Attaches to the given transport, starts it, and starts listening for messages.
|
||||
*
|
||||
* The Protocol object assumes ownership of the Transport, replacing any callbacks that have already been set, and expects that it is the only user of the Transport instance going forward.
|
||||
*/
|
||||
async connect(transport) {
|
||||
var _a, _b, _c;
|
||||
this._transport = transport;
|
||||
const _onclose = (_a = this.transport) === null || _a === void 0 ? void 0 : _a.onclose;
|
||||
this._transport.onclose = () => {
|
||||
_onclose === null || _onclose === void 0 ? void 0 : _onclose();
|
||||
this._onclose();
|
||||
};
|
||||
const _onerror = (_b = this.transport) === null || _b === void 0 ? void 0 : _b.onerror;
|
||||
this._transport.onerror = (error) => {
|
||||
_onerror === null || _onerror === void 0 ? void 0 : _onerror(error);
|
||||
this._onerror(error);
|
||||
};
|
||||
const _onmessage = (_c = this._transport) === null || _c === void 0 ? void 0 : _c.onmessage;
|
||||
this._transport.onmessage = (message, extra) => {
|
||||
_onmessage === null || _onmessage === void 0 ? void 0 : _onmessage(message, extra);
|
||||
if ((0, types_js_1.isJSONRPCResponse)(message) || (0, types_js_1.isJSONRPCError)(message)) {
|
||||
this._onresponse(message);
|
||||
}
|
||||
else if ((0, types_js_1.isJSONRPCRequest)(message)) {
|
||||
this._onrequest(message, extra);
|
||||
}
|
||||
else if ((0, types_js_1.isJSONRPCNotification)(message)) {
|
||||
this._onnotification(message);
|
||||
}
|
||||
else {
|
||||
this._onerror(new Error(`Unknown message type: ${JSON.stringify(message)}`));
|
||||
}
|
||||
};
|
||||
await this._transport.start();
|
||||
}
|
||||
_onclose() {
|
||||
var _a;
|
||||
const responseHandlers = this._responseHandlers;
|
||||
this._responseHandlers = new Map();
|
||||
this._progressHandlers.clear();
|
||||
this._pendingDebouncedNotifications.clear();
|
||||
this._transport = undefined;
|
||||
(_a = this.onclose) === null || _a === void 0 ? void 0 : _a.call(this);
|
||||
const error = new types_js_1.McpError(types_js_1.ErrorCode.ConnectionClosed, 'Connection closed');
|
||||
for (const handler of responseHandlers.values()) {
|
||||
handler(error);
|
||||
}
|
||||
}
|
||||
_onerror(error) {
|
||||
var _a;
|
||||
(_a = this.onerror) === null || _a === void 0 ? void 0 : _a.call(this, error);
|
||||
}
|
||||
_onnotification(notification) {
|
||||
var _a;
|
||||
const handler = (_a = this._notificationHandlers.get(notification.method)) !== null && _a !== void 0 ? _a : this.fallbackNotificationHandler;
|
||||
// Ignore notifications not being subscribed to.
|
||||
if (handler === undefined) {
|
||||
return;
|
||||
}
|
||||
// Starting with Promise.resolve() puts any synchronous errors into the monad as well.
|
||||
Promise.resolve()
|
||||
.then(() => handler(notification))
|
||||
.catch(error => this._onerror(new Error(`Uncaught error in notification handler: ${error}`)));
|
||||
}
|
||||
_onrequest(request, extra) {
|
||||
var _a, _b;
|
||||
const handler = (_a = this._requestHandlers.get(request.method)) !== null && _a !== void 0 ? _a : this.fallbackRequestHandler;
|
||||
// Capture the current transport at request time to ensure responses go to the correct client
|
||||
const capturedTransport = this._transport;
|
||||
if (handler === undefined) {
|
||||
capturedTransport === null || capturedTransport === void 0 ? void 0 : capturedTransport.send({
|
||||
jsonrpc: '2.0',
|
||||
id: request.id,
|
||||
error: {
|
||||
code: types_js_1.ErrorCode.MethodNotFound,
|
||||
message: 'Method not found'
|
||||
}
|
||||
}).catch(error => this._onerror(new Error(`Failed to send an error response: ${error}`)));
|
||||
return;
|
||||
}
|
||||
const abortController = new AbortController();
|
||||
this._requestHandlerAbortControllers.set(request.id, abortController);
|
||||
const fullExtra = {
|
||||
signal: abortController.signal,
|
||||
sessionId: capturedTransport === null || capturedTransport === void 0 ? void 0 : capturedTransport.sessionId,
|
||||
_meta: (_b = request.params) === null || _b === void 0 ? void 0 : _b._meta,
|
||||
sendNotification: notification => this.notification(notification, { relatedRequestId: request.id }),
|
||||
sendRequest: (r, resultSchema, options) => this.request(r, resultSchema, { ...options, relatedRequestId: request.id }),
|
||||
authInfo: extra === null || extra === void 0 ? void 0 : extra.authInfo,
|
||||
requestId: request.id,
|
||||
requestInfo: extra === null || extra === void 0 ? void 0 : extra.requestInfo
|
||||
};
|
||||
// Starting with Promise.resolve() puts any synchronous errors into the monad as well.
|
||||
Promise.resolve()
|
||||
.then(() => handler(request, fullExtra))
|
||||
.then(result => {
|
||||
if (abortController.signal.aborted) {
|
||||
return;
|
||||
}
|
||||
return capturedTransport === null || capturedTransport === void 0 ? void 0 : capturedTransport.send({
|
||||
result,
|
||||
jsonrpc: '2.0',
|
||||
id: request.id
|
||||
});
|
||||
}, error => {
|
||||
var _a;
|
||||
if (abortController.signal.aborted) {
|
||||
return;
|
||||
}
|
||||
return capturedTransport === null || capturedTransport === void 0 ? void 0 : capturedTransport.send({
|
||||
jsonrpc: '2.0',
|
||||
id: request.id,
|
||||
error: {
|
||||
code: Number.isSafeInteger(error['code']) ? error['code'] : types_js_1.ErrorCode.InternalError,
|
||||
message: (_a = error.message) !== null && _a !== void 0 ? _a : 'Internal error'
|
||||
}
|
||||
});
|
||||
})
|
||||
.catch(error => this._onerror(new Error(`Failed to send response: ${error}`)))
|
||||
.finally(() => {
|
||||
this._requestHandlerAbortControllers.delete(request.id);
|
||||
});
|
||||
}
|
||||
_onprogress(notification) {
|
||||
const { progressToken, ...params } = notification.params;
|
||||
const messageId = Number(progressToken);
|
||||
const handler = this._progressHandlers.get(messageId);
|
||||
if (!handler) {
|
||||
this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(notification)}`));
|
||||
return;
|
||||
}
|
||||
const responseHandler = this._responseHandlers.get(messageId);
|
||||
const timeoutInfo = this._timeoutInfo.get(messageId);
|
||||
if (timeoutInfo && responseHandler && timeoutInfo.resetTimeoutOnProgress) {
|
||||
try {
|
||||
this._resetTimeout(messageId);
|
||||
}
|
||||
catch (error) {
|
||||
responseHandler(error);
|
||||
return;
|
||||
}
|
||||
}
|
||||
handler(params);
|
||||
}
|
||||
_onresponse(response) {
|
||||
const messageId = Number(response.id);
|
||||
const handler = this._responseHandlers.get(messageId);
|
||||
if (handler === undefined) {
|
||||
this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(response)}`));
|
||||
return;
|
||||
}
|
||||
this._responseHandlers.delete(messageId);
|
||||
this._progressHandlers.delete(messageId);
|
||||
this._cleanupTimeout(messageId);
|
||||
if ((0, types_js_1.isJSONRPCResponse)(response)) {
|
||||
handler(response);
|
||||
}
|
||||
else {
|
||||
const error = new types_js_1.McpError(response.error.code, response.error.message, response.error.data);
|
||||
handler(error);
|
||||
}
|
||||
}
|
||||
get transport() {
|
||||
return this._transport;
|
||||
}
|
||||
/**
|
||||
* Closes the connection.
|
||||
*/
|
||||
async close() {
|
||||
var _a;
|
||||
await ((_a = this._transport) === null || _a === void 0 ? void 0 : _a.close());
|
||||
}
|
||||
/**
|
||||
* Sends a request and wait for a response.
|
||||
*
|
||||
* Do not use this method to emit notifications! Use notification() instead.
|
||||
*/
|
||||
request(request, resultSchema, options) {
|
||||
const { relatedRequestId, resumptionToken, onresumptiontoken } = options !== null && options !== void 0 ? options : {};
|
||||
return new Promise((resolve, reject) => {
|
||||
var _a, _b, _c, _d, _e, _f;
|
||||
if (!this._transport) {
|
||||
reject(new Error('Not connected'));
|
||||
return;
|
||||
}
|
||||
if (((_a = this._options) === null || _a === void 0 ? void 0 : _a.enforceStrictCapabilities) === true) {
|
||||
this.assertCapabilityForMethod(request.method);
|
||||
}
|
||||
(_b = options === null || options === void 0 ? void 0 : options.signal) === null || _b === void 0 ? void 0 : _b.throwIfAborted();
|
||||
const messageId = this._requestMessageId++;
|
||||
const jsonrpcRequest = {
|
||||
...request,
|
||||
jsonrpc: '2.0',
|
||||
id: messageId
|
||||
};
|
||||
if (options === null || options === void 0 ? void 0 : options.onprogress) {
|
||||
this._progressHandlers.set(messageId, options.onprogress);
|
||||
jsonrpcRequest.params = {
|
||||
...request.params,
|
||||
_meta: {
|
||||
...(((_c = request.params) === null || _c === void 0 ? void 0 : _c._meta) || {}),
|
||||
progressToken: messageId
|
||||
}
|
||||
};
|
||||
}
|
||||
const cancel = (reason) => {
|
||||
var _a;
|
||||
this._responseHandlers.delete(messageId);
|
||||
this._progressHandlers.delete(messageId);
|
||||
this._cleanupTimeout(messageId);
|
||||
(_a = this._transport) === null || _a === void 0 ? void 0 : _a.send({
|
||||
jsonrpc: '2.0',
|
||||
method: 'notifications/cancelled',
|
||||
params: {
|
||||
requestId: messageId,
|
||||
reason: String(reason)
|
||||
}
|
||||
}, { relatedRequestId, resumptionToken, onresumptiontoken }).catch(error => this._onerror(new Error(`Failed to send cancellation: ${error}`)));
|
||||
reject(reason);
|
||||
};
|
||||
this._responseHandlers.set(messageId, response => {
|
||||
var _a;
|
||||
if ((_a = options === null || options === void 0 ? void 0 : options.signal) === null || _a === void 0 ? void 0 : _a.aborted) {
|
||||
return;
|
||||
}
|
||||
if (response instanceof Error) {
|
||||
return reject(response);
|
||||
}
|
||||
try {
|
||||
const result = resultSchema.parse(response.result);
|
||||
resolve(result);
|
||||
}
|
||||
catch (error) {
|
||||
reject(error);
|
||||
}
|
||||
});
|
||||
(_d = options === null || options === void 0 ? void 0 : options.signal) === null || _d === void 0 ? void 0 : _d.addEventListener('abort', () => {
|
||||
var _a;
|
||||
cancel((_a = options === null || options === void 0 ? void 0 : options.signal) === null || _a === void 0 ? void 0 : _a.reason);
|
||||
});
|
||||
const timeout = (_e = options === null || options === void 0 ? void 0 : options.timeout) !== null && _e !== void 0 ? _e : exports.DEFAULT_REQUEST_TIMEOUT_MSEC;
|
||||
const timeoutHandler = () => cancel(new types_js_1.McpError(types_js_1.ErrorCode.RequestTimeout, 'Request timed out', { timeout }));
|
||||
this._setupTimeout(messageId, timeout, options === null || options === void 0 ? void 0 : options.maxTotalTimeout, timeoutHandler, (_f = options === null || options === void 0 ? void 0 : options.resetTimeoutOnProgress) !== null && _f !== void 0 ? _f : false);
|
||||
this._transport.send(jsonrpcRequest, { relatedRequestId, resumptionToken, onresumptiontoken }).catch(error => {
|
||||
this._cleanupTimeout(messageId);
|
||||
reject(error);
|
||||
});
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Emits a notification, which is a one-way message that does not expect a response.
|
||||
*/
|
||||
async notification(notification, options) {
|
||||
var _a, _b;
|
||||
if (!this._transport) {
|
||||
throw new Error('Not connected');
|
||||
}
|
||||
this.assertNotificationCapability(notification.method);
|
||||
const debouncedMethods = (_b = (_a = this._options) === null || _a === void 0 ? void 0 : _a.debouncedNotificationMethods) !== null && _b !== void 0 ? _b : [];
|
||||
// A notification can only be debounced if it's in the list AND it's "simple"
|
||||
// (i.e., has no parameters and no related request ID that could be lost).
|
||||
const canDebounce = debouncedMethods.includes(notification.method) && !notification.params && !(options === null || options === void 0 ? void 0 : options.relatedRequestId);
|
||||
if (canDebounce) {
|
||||
// If a notification of this type is already scheduled, do nothing.
|
||||
if (this._pendingDebouncedNotifications.has(notification.method)) {
|
||||
return;
|
||||
}
|
||||
// Mark this notification type as pending.
|
||||
this._pendingDebouncedNotifications.add(notification.method);
|
||||
// Schedule the actual send to happen in the next microtask.
|
||||
// This allows all synchronous calls in the current event loop tick to be coalesced.
|
||||
Promise.resolve().then(() => {
|
||||
var _a;
|
||||
// Un-mark the notification so the next one can be scheduled.
|
||||
this._pendingDebouncedNotifications.delete(notification.method);
|
||||
// SAFETY CHECK: If the connection was closed while this was pending, abort.
|
||||
if (!this._transport) {
|
||||
return;
|
||||
}
|
||||
const jsonrpcNotification = {
|
||||
...notification,
|
||||
jsonrpc: '2.0'
|
||||
};
|
||||
// Send the notification, but don't await it here to avoid blocking.
|
||||
// Handle potential errors with a .catch().
|
||||
(_a = this._transport) === null || _a === void 0 ? void 0 : _a.send(jsonrpcNotification, options).catch(error => this._onerror(error));
|
||||
});
|
||||
// Return immediately.
|
||||
return;
|
||||
}
|
||||
const jsonrpcNotification = {
|
||||
...notification,
|
||||
jsonrpc: '2.0'
|
||||
};
|
||||
await this._transport.send(jsonrpcNotification, options);
|
||||
}
|
||||
/**
|
||||
* Registers a handler to invoke when this protocol object receives a request with the given method.
|
||||
*
|
||||
* Note that this will replace any previous request handler for the same method.
|
||||
*/
|
||||
setRequestHandler(requestSchema, handler) {
|
||||
const method = requestSchema.shape.method.value;
|
||||
this.assertRequestHandlerCapability(method);
|
||||
this._requestHandlers.set(method, (request, extra) => {
|
||||
return Promise.resolve(handler(requestSchema.parse(request), extra));
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Removes the request handler for the given method.
|
||||
*/
|
||||
removeRequestHandler(method) {
|
||||
this._requestHandlers.delete(method);
|
||||
}
|
||||
/**
|
||||
* Asserts that a request handler has not already been set for the given method, in preparation for a new one being automatically installed.
|
||||
*/
|
||||
assertCanSetRequestHandler(method) {
|
||||
if (this._requestHandlers.has(method)) {
|
||||
throw new Error(`A request handler for ${method} already exists, which would be overridden`);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Registers a handler to invoke when this protocol object receives a notification with the given method.
|
||||
*
|
||||
* Note that this will replace any previous notification handler for the same method.
|
||||
*/
|
||||
setNotificationHandler(notificationSchema, handler) {
|
||||
this._notificationHandlers.set(notificationSchema.shape.method.value, notification => Promise.resolve(handler(notificationSchema.parse(notification))));
|
||||
}
|
||||
/**
|
||||
* Removes the notification handler for the given method.
|
||||
*/
|
||||
removeNotificationHandler(method) {
|
||||
this._notificationHandlers.delete(method);
|
||||
}
|
||||
}
|
||||
exports.Protocol = Protocol;
|
||||
function mergeCapabilities(base, additional) {
|
||||
return Object.entries(additional).reduce((acc, [key, value]) => {
|
||||
if (value && typeof value === 'object') {
|
||||
acc[key] = acc[key] ? { ...acc[key], ...value } : value;
|
||||
}
|
||||
else {
|
||||
acc[key] = value;
|
||||
}
|
||||
return acc;
|
||||
}, { ...base });
|
||||
}
|
||||
//# sourceMappingURL=protocol.js.map
|
||||
1
baserow-mcp-server/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/protocol.js.map
generated
vendored
Normal file
1
baserow-mcp-server/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/protocol.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
13
baserow-mcp-server/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/stdio.d.ts
generated
vendored
Normal file
13
baserow-mcp-server/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/stdio.d.ts
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
import { JSONRPCMessage } from '../types.js';
|
||||
/**
|
||||
* Buffers a continuous stdio stream into discrete JSON-RPC messages.
|
||||
*/
|
||||
export declare class ReadBuffer {
|
||||
private _buffer?;
|
||||
append(chunk: Buffer): void;
|
||||
readMessage(): JSONRPCMessage | null;
|
||||
clear(): void;
|
||||
}
|
||||
export declare function deserializeMessage(line: string): JSONRPCMessage;
|
||||
export declare function serializeMessage(message: JSONRPCMessage): string;
|
||||
//# sourceMappingURL=stdio.d.ts.map
|
||||
1
baserow-mcp-server/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/stdio.d.ts.map
generated
vendored
Normal file
1
baserow-mcp-server/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/stdio.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"stdio.d.ts","sourceRoot":"","sources":["../../../src/shared/stdio.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAwB,MAAM,aAAa,CAAC;AAEnE;;GAEG;AACH,qBAAa,UAAU;IACnB,OAAO,CAAC,OAAO,CAAC,CAAS;IAEzB,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAI3B,WAAW,IAAI,cAAc,GAAG,IAAI;IAepC,KAAK,IAAI,IAAI;CAGhB;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,CAE/D;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,cAAc,GAAG,MAAM,CAEhE"}
|
||||
37
baserow-mcp-server/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/stdio.js
generated
vendored
Normal file
37
baserow-mcp-server/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/stdio.js
generated
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.ReadBuffer = void 0;
|
||||
exports.deserializeMessage = deserializeMessage;
|
||||
exports.serializeMessage = serializeMessage;
|
||||
const types_js_1 = require("../types.js");
|
||||
/**
|
||||
* Buffers a continuous stdio stream into discrete JSON-RPC messages.
|
||||
*/
|
||||
class ReadBuffer {
|
||||
append(chunk) {
|
||||
this._buffer = this._buffer ? Buffer.concat([this._buffer, chunk]) : chunk;
|
||||
}
|
||||
readMessage() {
|
||||
if (!this._buffer) {
|
||||
return null;
|
||||
}
|
||||
const index = this._buffer.indexOf('\n');
|
||||
if (index === -1) {
|
||||
return null;
|
||||
}
|
||||
const line = this._buffer.toString('utf8', 0, index).replace(/\r$/, '');
|
||||
this._buffer = this._buffer.subarray(index + 1);
|
||||
return deserializeMessage(line);
|
||||
}
|
||||
clear() {
|
||||
this._buffer = undefined;
|
||||
}
|
||||
}
|
||||
exports.ReadBuffer = ReadBuffer;
|
||||
function deserializeMessage(line) {
|
||||
return types_js_1.JSONRPCMessageSchema.parse(JSON.parse(line));
|
||||
}
|
||||
function serializeMessage(message) {
|
||||
return JSON.stringify(message) + '\n';
|
||||
}
|
||||
//# sourceMappingURL=stdio.js.map
|
||||
1
baserow-mcp-server/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/stdio.js.map
generated
vendored
Normal file
1
baserow-mcp-server/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/stdio.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"stdio.js","sourceRoot":"","sources":["../../../src/shared/stdio.ts"],"names":[],"mappings":";;;AAgCA,gDAEC;AAED,4CAEC;AAtCD,0CAAmE;AAEnE;;GAEG;AACH,MAAa,UAAU;IAGnB,MAAM,CAAC,KAAa;QAChB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;IAC/E,CAAC;IAED,WAAW;QACP,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;YAChB,OAAO,IAAI,CAAC;QAChB,CAAC;QAED,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACzC,IAAI,KAAK,KAAK,CAAC,CAAC,EAAE,CAAC;YACf,OAAO,IAAI,CAAC;QAChB,CAAC;QAED,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QACxE,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;QAChD,OAAO,kBAAkB,CAAC,IAAI,CAAC,CAAC;IACpC,CAAC;IAED,KAAK;QACD,IAAI,CAAC,OAAO,GAAG,SAAS,CAAC;IAC7B,CAAC;CACJ;AAzBD,gCAyBC;AAED,SAAgB,kBAAkB,CAAC,IAAY;IAC3C,OAAO,+BAAoB,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;AACxD,CAAC;AAED,SAAgB,gBAAgB,CAAC,OAAuB;IACpD,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC;AAC1C,CAAC"}
|
||||
75
baserow-mcp-server/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/transport.d.ts
generated
vendored
Normal file
75
baserow-mcp-server/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/transport.d.ts
generated
vendored
Normal file
@@ -0,0 +1,75 @@
|
||||
import { JSONRPCMessage, MessageExtraInfo, RequestId } from '../types.js';
|
||||
export type FetchLike = (url: string | URL, init?: RequestInit) => Promise<Response>;
|
||||
/**
|
||||
* Options for sending a JSON-RPC message.
|
||||
*/
|
||||
export type TransportSendOptions = {
|
||||
/**
|
||||
* If present, `relatedRequestId` is used to indicate to the transport which incoming request to associate this outgoing message with.
|
||||
*/
|
||||
relatedRequestId?: RequestId;
|
||||
/**
|
||||
* The resumption token used to continue long-running requests that were interrupted.
|
||||
*
|
||||
* This allows clients to reconnect and continue from where they left off, if supported by the transport.
|
||||
*/
|
||||
resumptionToken?: string;
|
||||
/**
|
||||
* A callback that is invoked when the resumption token changes, if supported by the transport.
|
||||
*
|
||||
* This allows clients to persist the latest token for potential reconnection.
|
||||
*/
|
||||
onresumptiontoken?: (token: string) => void;
|
||||
};
|
||||
/**
|
||||
* Describes the minimal contract for a MCP transport that a client or server can communicate over.
|
||||
*/
|
||||
export interface Transport {
|
||||
/**
|
||||
* Starts processing messages on the transport, including any connection steps that might need to be taken.
|
||||
*
|
||||
* This method should only be called after callbacks are installed, or else messages may be lost.
|
||||
*
|
||||
* NOTE: This method should not be called explicitly when using Client, Server, or Protocol classes, as they will implicitly call start().
|
||||
*/
|
||||
start(): Promise<void>;
|
||||
/**
|
||||
* Sends a JSON-RPC message (request or response).
|
||||
*
|
||||
* If present, `relatedRequestId` is used to indicate to the transport which incoming request to associate this outgoing message with.
|
||||
*/
|
||||
send(message: JSONRPCMessage, options?: TransportSendOptions): Promise<void>;
|
||||
/**
|
||||
* Closes the connection.
|
||||
*/
|
||||
close(): Promise<void>;
|
||||
/**
|
||||
* Callback for when the connection is closed for any reason.
|
||||
*
|
||||
* This should be invoked when close() is called as well.
|
||||
*/
|
||||
onclose?: () => void;
|
||||
/**
|
||||
* Callback for when an error occurs.
|
||||
*
|
||||
* Note that errors are not necessarily fatal; they are used for reporting any kind of exceptional condition out of band.
|
||||
*/
|
||||
onerror?: (error: Error) => void;
|
||||
/**
|
||||
* Callback for when a message (request or response) is received over the connection.
|
||||
*
|
||||
* Includes the requestInfo and authInfo if the transport is authenticated.
|
||||
*
|
||||
* The requestInfo can be used to get the original request information (headers, etc.)
|
||||
*/
|
||||
onmessage?: (message: JSONRPCMessage, extra?: MessageExtraInfo) => void;
|
||||
/**
|
||||
* The session ID generated for this connection.
|
||||
*/
|
||||
sessionId?: string;
|
||||
/**
|
||||
* Sets the protocol version used for the connection (called when the initialize response is received).
|
||||
*/
|
||||
setProtocolVersion?: (version: string) => void;
|
||||
}
|
||||
//# sourceMappingURL=transport.d.ts.map
|
||||
1
baserow-mcp-server/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/transport.d.ts.map
generated
vendored
Normal file
1
baserow-mcp-server/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/transport.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"transport.d.ts","sourceRoot":"","sources":["../../../src/shared/transport.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE1E,MAAM,MAAM,SAAS,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,EAAE,IAAI,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;AAErF;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG;IAC/B;;OAEG;IACH,gBAAgB,CAAC,EAAE,SAAS,CAAC;IAE7B;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CAC/C,CAAC;AACF;;GAEG;AACH,MAAM,WAAW,SAAS;IACtB;;;;;;OAMG;IACH,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAEvB;;;;OAIG;IACH,IAAI,CAAC,OAAO,EAAE,cAAc,EAAE,OAAO,CAAC,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE7E;;OAEG;IACH,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAEvB;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IAErB;;;;OAIG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IAEjC;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,EAAE,KAAK,CAAC,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAExE;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,kBAAkB,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CAClD"}
|
||||
3
baserow-mcp-server/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/transport.js
generated
vendored
Normal file
3
baserow-mcp-server/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/transport.js
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
//# sourceMappingURL=transport.js.map
|
||||
1
baserow-mcp-server/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/transport.js.map
generated
vendored
Normal file
1
baserow-mcp-server/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/transport.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"transport.js","sourceRoot":"","sources":["../../../src/shared/transport.ts"],"names":[],"mappings":""}
|
||||
25
baserow-mcp-server/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/uriTemplate.d.ts
generated
vendored
Normal file
25
baserow-mcp-server/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/uriTemplate.d.ts
generated
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
export type Variables = Record<string, string | string[]>;
|
||||
export declare class UriTemplate {
|
||||
/**
|
||||
* Returns true if the given string contains any URI template expressions.
|
||||
* A template expression is a sequence of characters enclosed in curly braces,
|
||||
* like {foo} or {?bar}.
|
||||
*/
|
||||
static isTemplate(str: string): boolean;
|
||||
private static validateLength;
|
||||
private readonly template;
|
||||
private readonly parts;
|
||||
get variableNames(): string[];
|
||||
constructor(template: string);
|
||||
toString(): string;
|
||||
private parse;
|
||||
private getOperator;
|
||||
private getNames;
|
||||
private encodeValue;
|
||||
private expandPart;
|
||||
expand(variables: Variables): string;
|
||||
private escapeRegExp;
|
||||
private partToRegExp;
|
||||
match(uri: string): Variables | null;
|
||||
}
|
||||
//# sourceMappingURL=uriTemplate.d.ts.map
|
||||
1
baserow-mcp-server/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/uriTemplate.d.ts.map
generated
vendored
Normal file
1
baserow-mcp-server/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/uriTemplate.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"uriTemplate.d.ts","sourceRoot":"","sources":["../../../src/shared/uriTemplate.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAAC;AAO1D,qBAAa,WAAW;IACpB;;;;OAIG;IACH,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAMvC,OAAO,CAAC,MAAM,CAAC,cAAc;IAK7B,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;IAClC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAyF;IAE/G,IAAI,aAAa,IAAI,MAAM,EAAE,CAE5B;gBAEW,QAAQ,EAAE,MAAM;IAM5B,QAAQ,IAAI,MAAM;IAIlB,OAAO,CAAC,KAAK;IA8Cb,OAAO,CAAC,WAAW;IAKnB,OAAO,CAAC,QAAQ;IAShB,OAAO,CAAC,WAAW;IAQnB,OAAO,CAAC,UAAU;IAsDlB,MAAM,CAAC,SAAS,EAAE,SAAS,GAAG,MAAM;IA4BpC,OAAO,CAAC,YAAY;IAIpB,OAAO,CAAC,YAAY;IAkDpB,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI;CAuCvC"}
|
||||
243
baserow-mcp-server/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/uriTemplate.js
generated
vendored
Normal file
243
baserow-mcp-server/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/uriTemplate.js
generated
vendored
Normal file
@@ -0,0 +1,243 @@
|
||||
"use strict";
|
||||
// Claude-authored implementation of RFC 6570 URI Templates
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.UriTemplate = void 0;
|
||||
const MAX_TEMPLATE_LENGTH = 1000000; // 1MB
|
||||
const MAX_VARIABLE_LENGTH = 1000000; // 1MB
|
||||
const MAX_TEMPLATE_EXPRESSIONS = 10000;
|
||||
const MAX_REGEX_LENGTH = 1000000; // 1MB
|
||||
class UriTemplate {
|
||||
/**
|
||||
* Returns true if the given string contains any URI template expressions.
|
||||
* A template expression is a sequence of characters enclosed in curly braces,
|
||||
* like {foo} or {?bar}.
|
||||
*/
|
||||
static isTemplate(str) {
|
||||
// Look for any sequence of characters between curly braces
|
||||
// that isn't just whitespace
|
||||
return /\{[^}\s]+\}/.test(str);
|
||||
}
|
||||
static validateLength(str, max, context) {
|
||||
if (str.length > max) {
|
||||
throw new Error(`${context} exceeds maximum length of ${max} characters (got ${str.length})`);
|
||||
}
|
||||
}
|
||||
get variableNames() {
|
||||
return this.parts.flatMap(part => (typeof part === 'string' ? [] : part.names));
|
||||
}
|
||||
constructor(template) {
|
||||
UriTemplate.validateLength(template, MAX_TEMPLATE_LENGTH, 'Template');
|
||||
this.template = template;
|
||||
this.parts = this.parse(template);
|
||||
}
|
||||
toString() {
|
||||
return this.template;
|
||||
}
|
||||
parse(template) {
|
||||
const parts = [];
|
||||
let currentText = '';
|
||||
let i = 0;
|
||||
let expressionCount = 0;
|
||||
while (i < template.length) {
|
||||
if (template[i] === '{') {
|
||||
if (currentText) {
|
||||
parts.push(currentText);
|
||||
currentText = '';
|
||||
}
|
||||
const end = template.indexOf('}', i);
|
||||
if (end === -1)
|
||||
throw new Error('Unclosed template expression');
|
||||
expressionCount++;
|
||||
if (expressionCount > MAX_TEMPLATE_EXPRESSIONS) {
|
||||
throw new Error(`Template contains too many expressions (max ${MAX_TEMPLATE_EXPRESSIONS})`);
|
||||
}
|
||||
const expr = template.slice(i + 1, end);
|
||||
const operator = this.getOperator(expr);
|
||||
const exploded = expr.includes('*');
|
||||
const names = this.getNames(expr);
|
||||
const name = names[0];
|
||||
// Validate variable name length
|
||||
for (const name of names) {
|
||||
UriTemplate.validateLength(name, MAX_VARIABLE_LENGTH, 'Variable name');
|
||||
}
|
||||
parts.push({ name, operator, names, exploded });
|
||||
i = end + 1;
|
||||
}
|
||||
else {
|
||||
currentText += template[i];
|
||||
i++;
|
||||
}
|
||||
}
|
||||
if (currentText) {
|
||||
parts.push(currentText);
|
||||
}
|
||||
return parts;
|
||||
}
|
||||
getOperator(expr) {
|
||||
const operators = ['+', '#', '.', '/', '?', '&'];
|
||||
return operators.find(op => expr.startsWith(op)) || '';
|
||||
}
|
||||
getNames(expr) {
|
||||
const operator = this.getOperator(expr);
|
||||
return expr
|
||||
.slice(operator.length)
|
||||
.split(',')
|
||||
.map(name => name.replace('*', '').trim())
|
||||
.filter(name => name.length > 0);
|
||||
}
|
||||
encodeValue(value, operator) {
|
||||
UriTemplate.validateLength(value, MAX_VARIABLE_LENGTH, 'Variable value');
|
||||
if (operator === '+' || operator === '#') {
|
||||
return encodeURI(value);
|
||||
}
|
||||
return encodeURIComponent(value);
|
||||
}
|
||||
expandPart(part, variables) {
|
||||
if (part.operator === '?' || part.operator === '&') {
|
||||
const pairs = part.names
|
||||
.map(name => {
|
||||
const value = variables[name];
|
||||
if (value === undefined)
|
||||
return '';
|
||||
const encoded = Array.isArray(value)
|
||||
? value.map(v => this.encodeValue(v, part.operator)).join(',')
|
||||
: this.encodeValue(value.toString(), part.operator);
|
||||
return `${name}=${encoded}`;
|
||||
})
|
||||
.filter(pair => pair.length > 0);
|
||||
if (pairs.length === 0)
|
||||
return '';
|
||||
const separator = part.operator === '?' ? '?' : '&';
|
||||
return separator + pairs.join('&');
|
||||
}
|
||||
if (part.names.length > 1) {
|
||||
const values = part.names.map(name => variables[name]).filter(v => v !== undefined);
|
||||
if (values.length === 0)
|
||||
return '';
|
||||
return values.map(v => (Array.isArray(v) ? v[0] : v)).join(',');
|
||||
}
|
||||
const value = variables[part.name];
|
||||
if (value === undefined)
|
||||
return '';
|
||||
const values = Array.isArray(value) ? value : [value];
|
||||
const encoded = values.map(v => this.encodeValue(v, part.operator));
|
||||
switch (part.operator) {
|
||||
case '':
|
||||
return encoded.join(',');
|
||||
case '+':
|
||||
return encoded.join(',');
|
||||
case '#':
|
||||
return '#' + encoded.join(',');
|
||||
case '.':
|
||||
return '.' + encoded.join('.');
|
||||
case '/':
|
||||
return '/' + encoded.join('/');
|
||||
default:
|
||||
return encoded.join(',');
|
||||
}
|
||||
}
|
||||
expand(variables) {
|
||||
let result = '';
|
||||
let hasQueryParam = false;
|
||||
for (const part of this.parts) {
|
||||
if (typeof part === 'string') {
|
||||
result += part;
|
||||
continue;
|
||||
}
|
||||
const expanded = this.expandPart(part, variables);
|
||||
if (!expanded)
|
||||
continue;
|
||||
// Convert ? to & if we already have a query parameter
|
||||
if ((part.operator === '?' || part.operator === '&') && hasQueryParam) {
|
||||
result += expanded.replace('?', '&');
|
||||
}
|
||||
else {
|
||||
result += expanded;
|
||||
}
|
||||
if (part.operator === '?' || part.operator === '&') {
|
||||
hasQueryParam = true;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
escapeRegExp(str) {
|
||||
return str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
||||
}
|
||||
partToRegExp(part) {
|
||||
const patterns = [];
|
||||
// Validate variable name length for matching
|
||||
for (const name of part.names) {
|
||||
UriTemplate.validateLength(name, MAX_VARIABLE_LENGTH, 'Variable name');
|
||||
}
|
||||
if (part.operator === '?' || part.operator === '&') {
|
||||
for (let i = 0; i < part.names.length; i++) {
|
||||
const name = part.names[i];
|
||||
const prefix = i === 0 ? '\\' + part.operator : '&';
|
||||
patterns.push({
|
||||
pattern: prefix + this.escapeRegExp(name) + '=([^&]+)',
|
||||
name
|
||||
});
|
||||
}
|
||||
return patterns;
|
||||
}
|
||||
let pattern;
|
||||
const name = part.name;
|
||||
switch (part.operator) {
|
||||
case '':
|
||||
pattern = part.exploded ? '([^/]+(?:,[^/]+)*)' : '([^/,]+)';
|
||||
break;
|
||||
case '+':
|
||||
case '#':
|
||||
pattern = '(.+)';
|
||||
break;
|
||||
case '.':
|
||||
pattern = '\\.([^/,]+)';
|
||||
break;
|
||||
case '/':
|
||||
pattern = '/' + (part.exploded ? '([^/]+(?:,[^/]+)*)' : '([^/,]+)');
|
||||
break;
|
||||
default:
|
||||
pattern = '([^/]+)';
|
||||
}
|
||||
patterns.push({ pattern, name });
|
||||
return patterns;
|
||||
}
|
||||
match(uri) {
|
||||
UriTemplate.validateLength(uri, MAX_TEMPLATE_LENGTH, 'URI');
|
||||
let pattern = '^';
|
||||
const names = [];
|
||||
for (const part of this.parts) {
|
||||
if (typeof part === 'string') {
|
||||
pattern += this.escapeRegExp(part);
|
||||
}
|
||||
else {
|
||||
const patterns = this.partToRegExp(part);
|
||||
for (const { pattern: partPattern, name } of patterns) {
|
||||
pattern += partPattern;
|
||||
names.push({ name, exploded: part.exploded });
|
||||
}
|
||||
}
|
||||
}
|
||||
pattern += '$';
|
||||
UriTemplate.validateLength(pattern, MAX_REGEX_LENGTH, 'Generated regex pattern');
|
||||
const regex = new RegExp(pattern);
|
||||
const match = uri.match(regex);
|
||||
if (!match)
|
||||
return null;
|
||||
const result = {};
|
||||
for (let i = 0; i < names.length; i++) {
|
||||
const { name, exploded } = names[i];
|
||||
const value = match[i + 1];
|
||||
const cleanName = name.replace('*', '');
|
||||
if (exploded && value.includes(',')) {
|
||||
result[cleanName] = value.split(',');
|
||||
}
|
||||
else {
|
||||
result[cleanName] = value;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
exports.UriTemplate = UriTemplate;
|
||||
//# sourceMappingURL=uriTemplate.js.map
|
||||
1
baserow-mcp-server/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/uriTemplate.js.map
generated
vendored
Normal file
1
baserow-mcp-server/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/uriTemplate.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user