chore: switch to module ESNext + moduleResolution bundler (#2095)

This commit is contained in:
Matt 2026-06-25 12:49:17 +02:00 • committed by GitHub
commit ee732d64b6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 668 additions and 863 deletions

View file

@ -1,11 +1,11 @@
import { authorizationHandler, AuthorizationHandlerOptions, redirectUriMatches } from '../../../src/auth/handlers/authorize.js';
import { OAuthServerProvider, AuthorizationParams } from '../../../src/auth/provider.js';
import { OAuthRegisteredClientsStore } from '../../../src/auth/clients.js';
import { authorizationHandler, AuthorizationHandlerOptions, redirectUriMatches } from '../../../src/auth/handlers/authorize';
import { OAuthServerProvider, AuthorizationParams } from '../../../src/auth/provider';
import { OAuthRegisteredClientsStore } from '../../../src/auth/clients';
import { OAuthClientInformationFull, OAuthTokens } from '@modelcontextprotocol/core';
import express, { Response } from 'express';
import supertest from 'supertest';
import { AuthInfo } from '../../../src/auth/types.js';
import { InvalidTokenError } from '../../../src/auth/errors.js';
import { AuthInfo } from '../../../src/auth/types';
import { InvalidTokenError } from '../../../src/auth/errors';
describe('Authorization Handler', () => {
// Mock client data

View file

@ -1,4 +1,4 @@
import { metadataHandler } from '../../../src/auth/handlers/metadata.js';
import { metadataHandler } from '../../../src/auth/handlers/metadata';
import { OAuthMetadata } from '@modelcontextprotocol/core';
import express from 'express';
import supertest from 'supertest';

View file

@ -1,5 +1,5 @@
import { clientRegistrationHandler, ClientRegistrationHandlerOptions } from '../../../src/auth/handlers/register.js';
import { OAuthRegisteredClientsStore } from '../../../src/auth/clients.js';
import { clientRegistrationHandler, ClientRegistrationHandlerOptions } from '../../../src/auth/handlers/register';
import { OAuthRegisteredClientsStore } from '../../../src/auth/clients';
import { OAuthClientInformationFull, OAuthClientMetadata } from '@modelcontextprotocol/core';
import express from 'express';
import supertest from 'supertest';

View file

@ -1,11 +1,11 @@
import { revocationHandler, RevocationHandlerOptions } from '../../../src/auth/handlers/revoke.js';
import { OAuthServerProvider, AuthorizationParams } from '../../../src/auth/provider.js';
import { OAuthRegisteredClientsStore } from '../../../src/auth/clients.js';
import { revocationHandler, RevocationHandlerOptions } from '../../../src/auth/handlers/revoke';
import { OAuthServerProvider, AuthorizationParams } from '../../../src/auth/provider';
import { OAuthRegisteredClientsStore } from '../../../src/auth/clients';
import { OAuthClientInformationFull, OAuthTokenRevocationRequest, OAuthTokens } from '@modelcontextprotocol/core';
import express, { Response } from 'express';
import supertest from 'supertest';
import { AuthInfo } from '../../../src/auth/types.js';
import { InvalidTokenError } from '../../../src/auth/errors.js';
import { AuthInfo } from '../../../src/auth/types';
import { InvalidTokenError } from '../../../src/auth/errors';
import { MockInstance } from 'vitest';
describe('Revocation Handler', () => {

View file

@ -1,13 +1,13 @@
import { tokenHandler, TokenHandlerOptions } from '../../../src/auth/handlers/token.js';
import { OAuthServerProvider, AuthorizationParams } from '../../../src/auth/provider.js';
import { OAuthRegisteredClientsStore } from '../../../src/auth/clients.js';
import { tokenHandler, TokenHandlerOptions } from '../../../src/auth/handlers/token';
import { OAuthServerProvider, AuthorizationParams } from '../../../src/auth/provider';
import { OAuthRegisteredClientsStore } from '../../../src/auth/clients';
import { OAuthClientInformationFull, OAuthTokenRevocationRequest, OAuthTokens } from '@modelcontextprotocol/core';
import express, { Response } from 'express';
import supertest from 'supertest';
import * as pkceChallenge from 'pkce-challenge';
import { InvalidGrantError, InvalidTokenError } from '../../../src/auth/errors.js';
import { AuthInfo } from '../../../src/auth/types.js';
import { ProxyOAuthServerProvider } from '../../../src/auth/providers/proxyProvider.js';
import { InvalidGrantError, InvalidTokenError } from '../../../src/auth/errors';
import { AuthInfo } from '../../../src/auth/types';
import { ProxyOAuthServerProvider } from '../../../src/auth/providers/proxyProvider';
import { type Mock } from 'vitest';
// Mock pkce-challenge

View file

@ -1,4 +1,4 @@
import { allowedMethods } from '../../../src/auth/middleware/allowedMethods.js';
import { allowedMethods } from '../../../src/auth/middleware/allowedMethods';
import express, { Request, Response } from 'express';
import request from 'supertest';

View file

@ -1,10 +1,10 @@
import { Request, Response } from 'express';
import { Mock } from 'vitest';
import { requireBearerAuth } from '../../../src/auth/middleware/bearerAuth.js';
import { AuthInfo } from '../../../src/auth/types.js';
import { InsufficientScopeError, InvalidTokenError, CustomOAuthError, ServerError } from '../../../src/auth/errors.js';
import { OAuthTokenVerifier } from '../../../src/auth/provider.js';
import { createExpressResponseMock } from '../../helpers/http.js';
import { requireBearerAuth } from '../../../src/auth/middleware/bearerAuth';
import { AuthInfo } from '../../../src/auth/types';
import { InsufficientScopeError, InvalidTokenError, CustomOAuthError, ServerError } from '../../../src/auth/errors';
import { OAuthTokenVerifier } from '../../../src/auth/provider';
import { createExpressResponseMock } from '../../helpers/http';
// Mock verifier
const mockVerifyAccessToken = vi.fn();

View file

@ -1,5 +1,5 @@
import { authenticateClient, ClientAuthenticationMiddlewareOptions } from '../../../src/auth/middleware/clientAuth.js';
import { OAuthRegisteredClientsStore } from '../../../src/auth/clients.js';
import { authenticateClient, ClientAuthenticationMiddlewareOptions } from '../../../src/auth/middleware/clientAuth';
import { OAuthRegisteredClientsStore } from '../../../src/auth/clients';
import { OAuthClientInformationFull } from '@modelcontextprotocol/core';
import express from 'express';
import supertest from 'supertest';

View file

@ -1,10 +1,10 @@
import { Response } from 'express';
import { ProxyOAuthServerProvider, ProxyOptions } from '../../../src/auth/providers/proxyProvider.js';
import { AuthInfo } from '../../../src/auth/types.js';
import { ProxyOAuthServerProvider, ProxyOptions } from '../../../src/auth/providers/proxyProvider';
import { AuthInfo } from '../../../src/auth/types';
import { OAuthClientInformationFull, OAuthTokens } from '@modelcontextprotocol/core';
import { ServerError } from '../../../src/auth/errors.js';
import { InvalidTokenError } from '../../../src/auth/errors.js';
import { InsufficientScopeError } from '../../../src/auth/errors.js';
import { ServerError } from '../../../src/auth/errors';
import { InvalidTokenError } from '../../../src/auth/errors';
import { InsufficientScopeError } from '../../../src/auth/errors';
import { type Mock } from 'vitest';
describe('Proxy OAuth Server Provider', () => {

View file

@ -1,11 +1,11 @@
import { mcpAuthRouter, AuthRouterOptions, mcpAuthMetadataRouter, AuthMetadataOptions } from '../../src/auth/router.js';
import { OAuthServerProvider, AuthorizationParams } from '../../src/auth/provider.js';
import { OAuthRegisteredClientsStore } from '../../src/auth/clients.js';
import { mcpAuthRouter, AuthRouterOptions, mcpAuthMetadataRouter, AuthMetadataOptions } from '../../src/auth/router';
import { OAuthServerProvider, AuthorizationParams } from '../../src/auth/provider';
import { OAuthRegisteredClientsStore } from '../../src/auth/clients';
import { OAuthClientInformationFull, OAuthMetadata, OAuthTokenRevocationRequest, OAuthTokens } from '@modelcontextprotocol/core';
import express, { Response } from 'express';
import supertest from 'supertest';
import { AuthInfo } from '../../src/auth/types.js';
import { InvalidTokenError } from '../../src/auth/errors.js';
import { AuthInfo } from '../../src/auth/types';
import { InvalidTokenError } from '../../src/auth/errors';
describe('MCP Auth Router', () => {
// Setup mock provider with full capabilities

View file

@ -1,7 +1,7 @@
import http from 'node:http';
import { type Mocked } from 'vitest';
import { SSEServerTransport } from '../../src/sse/sse.js';
import { SSEServerTransport } from '../../src/sse/sse';
import type { JSONRPCMessage } from '@modelcontextprotocol/core';
const createMockResponse = () => {