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
9 changed files with 2954 additions and 1665 deletions
|
|
@ -1,5 +1,5 @@
|
|||
import type { AuthorizationServerMetadata, OAuthClientMetadata, OAuthTokens } from '@modelcontextprotocol/core';
|
||||
import { LATEST_PROTOCOL_VERSION, OAuthError, OAuthErrorCode } from '@modelcontextprotocol/core';
|
||||
import type { AuthorizationServerMetadata, OAuthClientMetadata, OAuthTokens } from '@modelcontextprotocol/core-internal';
|
||||
import { LATEST_PROTOCOL_VERSION, OAuthError, OAuthErrorCode } from '@modelcontextprotocol/core-internal';
|
||||
import type { Mock } from 'vitest';
|
||||
import { expect, vi } from 'vitest';
|
||||
|
||||
|
|
@ -3443,7 +3443,7 @@ describe('OAuth Authorization', () => {
|
|||
|
||||
describe('RequestInit headers passthrough', () => {
|
||||
it('custom headers from RequestInit are passed to auth discovery requests', async () => {
|
||||
const { createFetchWithInit } = await import('@modelcontextprotocol/core');
|
||||
const { createFetchWithInit } = await import('@modelcontextprotocol/core-internal');
|
||||
|
||||
const customFetch = vi.fn().mockResolvedValue({
|
||||
ok: true,
|
||||
|
|
@ -3476,7 +3476,7 @@ describe('OAuth Authorization', () => {
|
|||
});
|
||||
|
||||
it('auth-specific headers override base headers from RequestInit', async () => {
|
||||
const { createFetchWithInit } = await import('@modelcontextprotocol/core');
|
||||
const { createFetchWithInit } = await import('@modelcontextprotocol/core-internal');
|
||||
|
||||
const customFetch = vi.fn().mockResolvedValue({
|
||||
ok: true,
|
||||
|
|
@ -3514,7 +3514,7 @@ describe('OAuth Authorization', () => {
|
|||
});
|
||||
|
||||
it('other RequestInit options are passed through', async () => {
|
||||
const { createFetchWithInit } = await import('@modelcontextprotocol/core');
|
||||
const { createFetchWithInit } = await import('@modelcontextprotocol/core-internal');
|
||||
|
||||
const customFetch = vi.fn().mockResolvedValue({
|
||||
ok: true,
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import type { FetchLike } from '@modelcontextprotocol/core';
|
||||
import type { FetchLike } from '@modelcontextprotocol/core-internal';
|
||||
import { describe, expect, it, vi } from 'vitest';
|
||||
|
||||
import { discoverAndRequestJwtAuthGrant, exchangeJwtAuthGrant, requestJwtAuthorizationGrant } from '../../src/client/crossAppAccess';
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import type { ChildProcess } from 'node:child_process';
|
||||
|
||||
import type { JSONRPCMessage } from '@modelcontextprotocol/core';
|
||||
import type { JSONRPCMessage } from '@modelcontextprotocol/core-internal';
|
||||
import spawn from 'cross-spawn';
|
||||
import type { Mock, MockedFunction } from 'vitest';
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import type { JSONRPCMessage, JsonSchemaType, JsonSchemaValidatorResult, jsonSchemaValidator } from '@modelcontextprotocol/core';
|
||||
import { InMemoryTransport, LATEST_PROTOCOL_VERSION } from '@modelcontextprotocol/core';
|
||||
import type { JSONRPCMessage, JsonSchemaType, JsonSchemaValidatorResult, jsonSchemaValidator } from '@modelcontextprotocol/core-internal';
|
||||
import { InMemoryTransport, LATEST_PROTOCOL_VERSION } from '@modelcontextprotocol/core-internal';
|
||||
import { Client } from '../../src/client/client';
|
||||
import { fromJsonSchema } from '../../src/fromJsonSchema';
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import type { FetchLike } from '@modelcontextprotocol/core';
|
||||
import type { FetchLike } from '@modelcontextprotocol/core-internal';
|
||||
import type { Mocked, MockedFunction, MockInstance } from 'vitest';
|
||||
|
||||
import type { OAuthClientProvider } from '../../src/client/auth';
|
||||
|
|
|
|||
|
|
@ -2,8 +2,8 @@ import type { IncomingMessage, Server, ServerResponse } from 'node:http';
|
|||
import { createServer } from 'node:http';
|
||||
import type { AddressInfo } from 'node:net';
|
||||
|
||||
import type { JSONRPCMessage, OAuthTokens } from '@modelcontextprotocol/core';
|
||||
import { OAuthError, OAuthErrorCode, SdkErrorCode, SdkHttpError } from '@modelcontextprotocol/core';
|
||||
import type { JSONRPCMessage, OAuthTokens } from '@modelcontextprotocol/core-internal';
|
||||
import { OAuthError, OAuthErrorCode, SdkErrorCode, SdkHttpError } from '@modelcontextprotocol/core-internal';
|
||||
import { listenOnRandomPort } from '@modelcontextprotocol/test-helpers';
|
||||
import type { Mock, Mocked, MockedFunction, MockInstance } from 'vitest';
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import type { JSONRPCMessage } from '@modelcontextprotocol/core';
|
||||
import type { JSONRPCMessage } from '@modelcontextprotocol/core-internal';
|
||||
|
||||
import type { StdioServerParameters } from '../../src/client/stdio';
|
||||
import { StdioClientTransport } from '../../src/client/stdio';
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import type { JSONRPCMessage, JSONRPCRequest, OAuthTokens } from '@modelcontextprotocol/core';
|
||||
import { OAuthError, OAuthErrorCode, SdkErrorCode, SdkHttpError } from '@modelcontextprotocol/core';
|
||||
import type { JSONRPCMessage, JSONRPCRequest, OAuthTokens } from '@modelcontextprotocol/core-internal';
|
||||
import { OAuthError, OAuthErrorCode, SdkErrorCode, SdkHttpError } from '@modelcontextprotocol/core-internal';
|
||||
import type { Mock, Mocked } from 'vitest';
|
||||
|
||||
import type { OAuthClientProvider } from '../../src/client/auth';
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import type { IncomingMessage, Server } from 'node:http';
|
||||
import { createServer } from 'node:http';
|
||||
|
||||
import type { JSONRPCMessage, OAuthClientInformation, OAuthClientMetadata, OAuthTokens } from '@modelcontextprotocol/core';
|
||||
import { SdkErrorCode, SdkHttpError } from '@modelcontextprotocol/core';
|
||||
import type { JSONRPCMessage, OAuthClientInformation, OAuthClientMetadata, OAuthTokens } from '@modelcontextprotocol/core-internal';
|
||||
import { SdkErrorCode, SdkHttpError } from '@modelcontextprotocol/core-internal';
|
||||
import { listenOnRandomPort } from '@modelcontextprotocol/test-helpers';
|
||||
import type { Mock } from 'vitest';
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue