@vapi-ai/mcp-server 0.0.8 → 0.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=mcp-server-mock.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mcp-server-mock.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/mcp-server-mock.test.ts"],"names":[],"mappings":""}
@@ -1,34 +0,0 @@
1
- import { jest } from '@jest/globals';
2
- import { createMcpServer } from '../index.js';
3
- import { createMockVapiClient } from './mocks/vapi-client.mock.js';
4
- jest.mock('../client.js', () => ({
5
- createVapiClient: jest.fn(() => createMockVapiClient()),
6
- }));
7
- process.env.VAPI_TOKEN = 'test-mock-token';
8
- describe('MCP Server Unit Test (with mocks)', () => {
9
- let mcpServer;
10
- beforeAll(() => {
11
- console.log('Creating MCP server with mocked Vapi client...');
12
- mcpServer = createMcpServer();
13
- console.log('MCP server created successfully');
14
- });
15
- test('server should be initialized correctly', () => {
16
- expect(mcpServer).toBeDefined();
17
- expect(typeof mcpServer).toBe('object');
18
- expect(mcpServer.constructor.name).toBe('McpServer');
19
- expect(mcpServer.connect).toBeDefined();
20
- expect(typeof mcpServer.connect).toBe('function');
21
- });
22
- test('server should have required internal structures', () => {
23
- expect(mcpServer._registeredTools).toBeDefined();
24
- expect(typeof mcpServer._registeredTools).toBe('object');
25
- });
26
- test('server should have registered Vapi tools', () => {
27
- const registeredTools = Object.keys(mcpServer._registeredTools);
28
- expect(registeredTools.length).toBeGreaterThan(0);
29
- console.log('Found registered tools:', registeredTools);
30
- expect(registeredTools).toContain('list_assistants');
31
- expect(registeredTools).toContain('create_assistant');
32
- expect(registeredTools).toContain('get_assistant');
33
- });
34
- });
@@ -1,9 +0,0 @@
1
- export declare class MockVapiClient {
2
- assistants: {
3
- list: jest.Mock<any, any, any>;
4
- get: jest.Mock<any, any, any>;
5
- create: jest.Mock<any, any, any>;
6
- };
7
- }
8
- export declare const createMockVapiClient: () => MockVapiClient;
9
- //# sourceMappingURL=vapi-client.mock.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"vapi-client.mock.d.ts","sourceRoot":"","sources":["../../../src/__tests__/mocks/vapi-client.mock.ts"],"names":[],"mappings":"AAAA,qBAAa,cAAc;IACzB,UAAU;;;;MAuCR;CACH;AAED,eAAO,MAAM,oBAAoB,sBAEhC,CAAC"}
@@ -1,43 +0,0 @@
1
- export class MockVapiClient {
2
- assistants = {
3
- list: jest.fn().mockResolvedValue([
4
- {
5
- id: 'mock-assistant-id-1',
6
- name: 'Mock Assistant 1',
7
- model: 'gpt-4',
8
- instructions: 'Example instructions',
9
- createdAt: new Date().toISOString(),
10
- updatedAt: new Date().toISOString(),
11
- },
12
- {
13
- id: 'mock-assistant-id-2',
14
- name: 'Mock Assistant 2',
15
- model: 'claude-3-opus',
16
- instructions: 'Another example',
17
- createdAt: new Date().toISOString(),
18
- updatedAt: new Date().toISOString(),
19
- },
20
- ]),
21
- get: jest.fn().mockImplementation((id) => {
22
- return Promise.resolve({
23
- id,
24
- name: `Mock Assistant ${id}`,
25
- model: 'gpt-4',
26
- instructions: 'Example instructions',
27
- createdAt: new Date().toISOString(),
28
- updatedAt: new Date().toISOString(),
29
- });
30
- }),
31
- create: jest.fn().mockImplementation((data) => {
32
- return Promise.resolve({
33
- id: 'new-mock-assistant-id',
34
- ...data,
35
- createdAt: new Date().toISOString(),
36
- updatedAt: new Date().toISOString(),
37
- });
38
- }),
39
- };
40
- }
41
- export const createMockVapiClient = () => {
42
- return new MockVapiClient();
43
- };