diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7621472..6b95e82 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -30,7 +30,6 @@ jobs: node-version: 20 cache: 'pnpm' registry-url: 'https://registry.npmjs.org' - provenance: true # Try with --frozen-lockfile first, fallback to regular install if it fails - name: Install dependencies diff --git a/.github/workflows/semantics.yml b/.github/workflows/semantics.yml index ebf2f04..9f8dfb4 100644 --- a/.github/workflows/semantics.yml +++ b/.github/workflows/semantics.yml @@ -1,10 +1,11 @@ name: Pull Request Semantics on: - pull_request: - branches: - - master - types: [opened, edited, reopened, synchronize] + workflow_dispatch: + # pull_request: + # branches: + # - master + # types: [opened, edited, reopened, synchronize] jobs: semantics: diff --git a/README.md b/README.md index 62a584b..fc7d84f 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,6 @@ import { Tadata, OpenApiSource, ApiVersion } from '@tadata/node-sdk'; // Initialize the SDK const tadata = new Tadata({ apiKey: process.env.TADATA_KEY!, - dev: process.env.NODE_ENV !== 'production', version: ApiVersion.V_05_2025, // Optional: specify API version logger: pino(), // Optional: use custom logger }); @@ -33,7 +32,7 @@ const source = await OpenApiSource.fromFile('./acme-openapi.json'); // Deploy the MCP server const deployment = await tadata.mcp.deploy({ spec: source, - specBaseUrl: 'https://acme.com/api', + apiBaseUrl: 'https://acme.com/api', name: 'Acme API', // Optional // Optional: Configure authentication handling diff --git a/package.json b/package.json index 51a54bb..8b75a89 100644 --- a/package.json +++ b/package.json @@ -70,6 +70,5 @@ "ts-node": "^10.9.1", "typescript": "^5.2.2", "uuid": "^11.1.0" - }, - "packageManager": "pnpm@10.10.0+sha512.d615db246fe70f25dcfea6d8d73dee782ce23e2245e3c4f6f888249fb568149318637dca73c2c5c8ef2a4ca0d5657fb9567188bfab47f566d1ee6ce987815c39" + } } diff --git a/src/contract/client.ts b/src/contract/client.ts index df9f106..95c9edf 100644 --- a/src/contract/client.ts +++ b/src/contract/client.ts @@ -40,7 +40,7 @@ export function createApiClient(apiKey: string, options: ClientOptions) { if (logger) { axiosInstance.interceptors.request.use( config => { - logger.debug(`Making request to ${config.method?.toUpperCase()} ${config.url}`); + logger.debug(`Making request to ${config.method?.toUpperCase()} ${config.baseURL}`); // Log API version header specifically logger.debug(`Using API version: ${config.headers['x-api-version']}`); return config; diff --git a/src/core/sdk.ts b/src/core/sdk.ts index acdcd14..247b2a9 100644 --- a/src/core/sdk.ts +++ b/src/core/sdk.ts @@ -50,7 +50,6 @@ export interface TadataOptions { * * const tadata = new Tadata({ * apiKey: process.env.TADATA_KEY!, - * dev: process.env.NODE_ENV !== 'production', * version: ApiVersion.V_05_2025, // Optional: Defaults to ApiVersion.LATEST * // logger: pino(), // Optional: Provide a custom logger * }); @@ -60,7 +59,7 @@ export interface TadataOptions { * // const source = await OpenApiSource.fromFile('./my-api-spec.json'); * // const deployment = await tadata.mcp.deploy({ * // spec: source, - * // specBaseUrl: 'https://api.example.com', + * // apiBaseUrl: 'https://api.example.com', * // name: 'My API Proxy' * // }); * // console.log('Deployment URL:', deployment.url); diff --git a/src/resources/mcp/mcp-resource.ts b/src/resources/mcp/mcp-resource.ts index 6a316d6..7e75b26 100644 --- a/src/resources/mcp/mcp-resource.ts +++ b/src/resources/mcp/mcp-resource.ts @@ -14,8 +14,6 @@ interface DeploymentSuccessResponse { deployment: { id: string; name: string; - url?: string; // URL is optional in the server response - specVersion?: string; // specVersion is optional in the server response createdAt?: string; updatedAt?: string; }; @@ -63,7 +61,7 @@ export class McpResource { * try { * const deployment = await tadata.mcp.deploy({ * spec: source, // Your OpenApiSource object - * specBaseUrl: 'https://api.example.com', // The base URL your API will be proxied to + * apiBaseUrl: 'https://api.example.com', // The base URL your API will be proxied to * name: 'MyFirstMcpDeployment' // An optional descriptive name * }); * console.log(`Successfully deployed MCP: ${deployment.id} at ${deployment.url}`); @@ -76,7 +74,7 @@ export class McpResource { * \`\`\` */ async deploy(input: McpDeployInput): Promise { - this.logger.info('Deploying Model Context Protocol (MCP) server from OpenAPI spec'); + this.logger.info('Deploying MCP server from OpenAPI spec'); // Type guard to check for the response structure const isDeploymentResponse = (body: unknown): body is DeploymentResponse => { @@ -96,7 +94,7 @@ export class McpResource { body: { openApiSpec: openapiSpec, name: input.name, - baseUrl: input.specBaseUrl, + baseUrl: input.apiBaseUrl, }, }); @@ -105,10 +103,7 @@ export class McpResource { return { id: deploymentData.id, - // Provide a default value for specVersion if undefined - specVersion: deploymentData.specVersion || '1.0.0', - // Provide a default URL value (required by type) if not returned from server - url: deploymentData.url || `http://localhost:3000/mcp/${deploymentData.id}`, + updated: response.body.data.updated, createdAt: deploymentData.createdAt ? new Date(deploymentData.createdAt) : new Date(), }; } diff --git a/src/resources/mcp/types.ts b/src/resources/mcp/types.ts index 047cc29..c332d21 100644 --- a/src/resources/mcp/types.ts +++ b/src/resources/mcp/types.ts @@ -18,7 +18,7 @@ export interface McpDeployInput { * This is the actual endpoint where your backend service is running. * @example "https://api.example.com/v1" */ - specBaseUrl?: string; + apiBaseUrl?: string; /** * An optional descriptive name for this MCP deployment. @@ -69,15 +69,10 @@ export interface McpDeploymentResult { id: string; /** - * The URL at which the deployed MCP instance is accessible. + * Whether the MCP server was updated or not. + * Normally this will be `false` if the spec has not changed, and `true` if the spec has changed. */ - url: string; - - /** - * The version of the OpenAPI specification used for this deployment. - * This typically corresponds to the `version` field in your OpenAPI document's `info` object. - */ - specVersion: string; + updated: boolean; /** * The date and time when this MCP instance was created. diff --git a/test/integration/deployments.int.test.ts b/test/integration/deployments.int.test.ts index 313fcee..aa24dcb 100644 --- a/test/integration/deployments.int.test.ts +++ b/test/integration/deployments.int.test.ts @@ -66,8 +66,6 @@ describe('Deployments Integration Test (Nock)', () => { it('should successfully deploy an MCP server', async () => { const mockDeploymentId = uuidv4(); const mockCreatedAt = new Date().toISOString(); - const mockSpecVersionInResponse = '1.0.0'; // Match with validOpenApiSpec.info.version - const mockUrl = `/test-deploys/${mockDeploymentId}`; const serviceNameInMockedResponse = 'Service Name From Mocked Server Response'; const mockServerResponseData = { @@ -75,8 +73,7 @@ describe('Deployments Integration Test (Nock)', () => { deployment: { id: mockDeploymentId, name: serviceNameInMockedResponse, - url: mockUrl, - specVersion: mockSpecVersionInResponse, + updated: true, createdAt: mockCreatedAt, createdBy: 'test-user', updatedBy: 'test-user', @@ -120,13 +117,13 @@ describe('Deployments Integration Test (Nock)', () => { const result = await sdk.mcp.deploy({ spec: source, name: requestedDeploymentName, - specBaseUrl: 'https://example.com/api', + apiBaseUrl: 'https://example.com/api', }); // Validate expected response structure expect(result).toBeDefined(); expect(result.id).toBe(mockDeploymentId); - expect(result.specVersion).toBe(mockSpecVersionInResponse); + expect(result.updated).toBe(true); expect(result.createdAt).toBeInstanceOf(Date); expect(Date.now() - result.createdAt.getTime()).toBeLessThan(60000);