v2: codemod iterations, canonical zod schema exports from sdk-shared (#2354)
Co-authored-by: Felix Weinberger <fweinberger@anthropic.com>
This commit is contained in:
parent
7ea6fde1b6
commit
0fb8406d83
24 changed files with 2954 additions and 1665 deletions
|
|
@ -6,7 +6,7 @@ export default [
|
|||
...baseConfig,
|
||||
{
|
||||
settings: {
|
||||
'import/internal-regex': '^@modelcontextprotocol/core'
|
||||
'import/internal-regex': '^@modelcontextprotocol/core-internal'
|
||||
}
|
||||
}
|
||||
];
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@
|
|||
}
|
||||
},
|
||||
"devDependencies": {
|
||||
"@modelcontextprotocol/core": "workspace:^",
|
||||
"@modelcontextprotocol/core-internal": "workspace:^",
|
||||
"@modelcontextprotocol/tsconfig": "workspace:^",
|
||||
"@modelcontextprotocol/eslint-config": "workspace:^",
|
||||
"@modelcontextprotocol/vitest-config": "workspace:^",
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import type { OAuthClientInformationFull } from '@modelcontextprotocol/core';
|
||||
import type { OAuthClientInformationFull } from '@modelcontextprotocol/core-internal';
|
||||
|
||||
/**
|
||||
* Stores information about registered OAuth clients for this server.
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import type { OAuthErrorResponse } from '@modelcontextprotocol/core';
|
||||
import type { OAuthErrorResponse } from '@modelcontextprotocol/core-internal';
|
||||
|
||||
/**
|
||||
* Base class for all OAuth errors
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import type { OAuthMetadata, OAuthProtectedResourceMetadata } from '@modelcontextprotocol/core';
|
||||
import type { OAuthMetadata, OAuthProtectedResourceMetadata } from '@modelcontextprotocol/core-internal';
|
||||
import cors from 'cors';
|
||||
import type { RequestHandler } from 'express';
|
||||
import express from 'express';
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import crypto from 'node:crypto';
|
||||
|
||||
import type { OAuthClientInformationFull } from '@modelcontextprotocol/core';
|
||||
import { OAuthClientMetadataSchema } from '@modelcontextprotocol/core';
|
||||
import type { OAuthClientInformationFull } from '@modelcontextprotocol/core-internal';
|
||||
import { OAuthClientMetadataSchema } from '@modelcontextprotocol/core-internal';
|
||||
import cors from 'cors';
|
||||
import type { RequestHandler } from 'express';
|
||||
import express from 'express';
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { OAuthTokenRevocationRequestSchema } from '@modelcontextprotocol/core';
|
||||
import { OAuthTokenRevocationRequestSchema } from '@modelcontextprotocol/core-internal';
|
||||
import cors from 'cors';
|
||||
import type { RequestHandler } from 'express';
|
||||
import express from 'express';
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import type { OAuthClientInformationFull } from '@modelcontextprotocol/core';
|
||||
import type { OAuthClientInformationFull } from '@modelcontextprotocol/core-internal';
|
||||
import type { RequestHandler } from 'express';
|
||||
import * as z from 'zod/v4';
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import type { OAuthClientInformationFull, OAuthTokenRevocationRequest, OAuthTokens } from '@modelcontextprotocol/core';
|
||||
import type { OAuthClientInformationFull, OAuthTokenRevocationRequest, OAuthTokens } from '@modelcontextprotocol/core-internal';
|
||||
import type { Response } from 'express';
|
||||
|
||||
import type { OAuthRegisteredClientsStore } from './clients';
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import type { FetchLike, OAuthClientInformationFull, OAuthTokenRevocationRequest, OAuthTokens } from '@modelcontextprotocol/core';
|
||||
import { OAuthClientInformationFullSchema, OAuthTokensSchema } from '@modelcontextprotocol/core';
|
||||
import type { FetchLike, OAuthClientInformationFull, OAuthTokenRevocationRequest, OAuthTokens } from '@modelcontextprotocol/core-internal';
|
||||
import { OAuthClientInformationFullSchema, OAuthTokensSchema } from '@modelcontextprotocol/core-internal';
|
||||
import type { Response } from 'express';
|
||||
|
||||
import type { OAuthRegisteredClientsStore } from '../clients';
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import type { OAuthMetadata, OAuthProtectedResourceMetadata } from '@modelcontextprotocol/core';
|
||||
import type { OAuthMetadata, OAuthProtectedResourceMetadata } from '@modelcontextprotocol/core-internal';
|
||||
import type { RequestHandler } from 'express';
|
||||
import express from 'express';
|
||||
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
export type { AuthInfo } from '@modelcontextprotocol/core';
|
||||
export type { AuthInfo } from '@modelcontextprotocol/core-internal';
|
||||
|
|
|
|||
|
|
@ -2,8 +2,8 @@ import { randomUUID } from 'node:crypto';
|
|||
import type { IncomingMessage, ServerResponse } from 'node:http';
|
||||
import { TLSSocket } from 'node:tls';
|
||||
|
||||
import type { AuthInfo, JSONRPCMessage, MessageExtraInfo, Transport, TransportSendOptions } from '@modelcontextprotocol/core';
|
||||
import { JSONRPCMessageSchema } from '@modelcontextprotocol/core';
|
||||
import type { AuthInfo, JSONRPCMessage, MessageExtraInfo, Transport, TransportSendOptions } from '@modelcontextprotocol/core-internal';
|
||||
import { JSONRPCMessageSchema } from '@modelcontextprotocol/core-internal';
|
||||
import contentType from 'content-type';
|
||||
import getRawBody from 'raw-body';
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
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 { OAuthClientInformationFull, OAuthTokens } from '@modelcontextprotocol/core-internal';
|
||||
import express, { Response } from 'express';
|
||||
import supertest from 'supertest';
|
||||
import { AuthInfo } from '../../../src/auth/types';
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { metadataHandler } from '../../../src/auth/handlers/metadata';
|
||||
import { OAuthMetadata } from '@modelcontextprotocol/core';
|
||||
import { OAuthMetadata } from '@modelcontextprotocol/core-internal';
|
||||
import express from 'express';
|
||||
import supertest from 'supertest';
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { clientRegistrationHandler, ClientRegistrationHandlerOptions } from '../../../src/auth/handlers/register';
|
||||
import { OAuthRegisteredClientsStore } from '../../../src/auth/clients';
|
||||
import { OAuthClientInformationFull, OAuthClientMetadata } from '@modelcontextprotocol/core';
|
||||
import { OAuthClientInformationFull, OAuthClientMetadata } from '@modelcontextprotocol/core-internal';
|
||||
import express from 'express';
|
||||
import supertest from 'supertest';
|
||||
import { MockInstance } from 'vitest';
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
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 { OAuthClientInformationFull, OAuthTokenRevocationRequest, OAuthTokens } from '@modelcontextprotocol/core-internal';
|
||||
import express, { Response } from 'express';
|
||||
import supertest from 'supertest';
|
||||
import { AuthInfo } from '../../../src/auth/types';
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
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 { OAuthClientInformationFull, OAuthTokenRevocationRequest, OAuthTokens } from '@modelcontextprotocol/core-internal';
|
||||
import express, { Response } from 'express';
|
||||
import supertest from 'supertest';
|
||||
import * as pkceChallenge from 'pkce-challenge';
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { authenticateClient, ClientAuthenticationMiddlewareOptions } from '../../../src/auth/middleware/clientAuth';
|
||||
import { OAuthRegisteredClientsStore } from '../../../src/auth/clients';
|
||||
import { OAuthClientInformationFull } from '@modelcontextprotocol/core';
|
||||
import { OAuthClientInformationFull } from '@modelcontextprotocol/core-internal';
|
||||
import express from 'express';
|
||||
import supertest from 'supertest';
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { Response } from 'express';
|
||||
import { ProxyOAuthServerProvider, ProxyOptions } from '../../../src/auth/providers/proxyProvider';
|
||||
import { AuthInfo } from '../../../src/auth/types';
|
||||
import { OAuthClientInformationFull, OAuthTokens } from '@modelcontextprotocol/core';
|
||||
import { OAuthClientInformationFull, OAuthTokens } from '@modelcontextprotocol/core-internal';
|
||||
import { ServerError } from '../../../src/auth/errors';
|
||||
import { InvalidTokenError } from '../../../src/auth/errors';
|
||||
import { InsufficientScopeError } from '../../../src/auth/errors';
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue