@masonator/coolify-mcp 0.2.16 → 0.2.18
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.
- package/package.json +5 -3
- package/dist/__tests__/coolify-client.test.d.ts +0 -1
- package/dist/__tests__/coolify-client.test.js +0 -208
- package/dist/__tests__/mcp-server.test.d.ts +0 -1
- package/dist/__tests__/mcp-server.test.js +0 -282
- package/dist/__tests__/resources/application-resources.test.d.ts +0 -1
- package/dist/__tests__/resources/application-resources.test.js +0 -33
- package/dist/__tests__/resources/database-resources.test.d.ts +0 -1
- package/dist/__tests__/resources/database-resources.test.js +0 -68
- package/dist/__tests__/resources/deployment-resources.test.d.ts +0 -1
- package/dist/__tests__/resources/deployment-resources.test.js +0 -46
- package/dist/__tests__/resources/service-resources.test.d.ts +0 -1
- package/dist/__tests__/resources/service-resources.test.js +0 -76
- package/dist/index.cjs +0 -1403
- package/dist/index.d.ts +0 -2
- package/dist/lib/coolify-client.d.ts +0 -44
- package/dist/lib/coolify-client.js +0 -161
- package/dist/lib/mcp-server.d.ts +0 -56
- package/dist/lib/mcp-server.js +0 -423
- package/dist/lib/resource.d.ts +0 -13
- package/dist/lib/resource.js +0 -25
- package/dist/resources/application-resources.d.ts +0 -14
- package/dist/resources/application-resources.js +0 -55
- package/dist/resources/database-resources.d.ts +0 -17
- package/dist/resources/database-resources.js +0 -51
- package/dist/resources/deployment-resources.d.ts +0 -12
- package/dist/resources/deployment-resources.js +0 -44
- package/dist/resources/index.d.ts +0 -4
- package/dist/resources/index.js +0 -4
- package/dist/resources/service-resources.d.ts +0 -15
- package/dist/resources/service-resources.js +0 -51
- package/dist/types/coolify.d.ts +0 -228
- package/dist/types/coolify.js +0 -1
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import { ServiceResources } from '../../resources/service-resources.js';
|
|
2
|
-
import { jest } from '@jest/globals';
|
|
3
|
-
jest.mock('../../lib/coolify-client.js');
|
|
4
|
-
describe('ServiceResources', () => {
|
|
5
|
-
let mockClient;
|
|
6
|
-
let resources;
|
|
7
|
-
const mockService = {
|
|
8
|
-
id: 1,
|
|
9
|
-
uuid: 'test-uuid',
|
|
10
|
-
name: 'test-service',
|
|
11
|
-
description: 'test description',
|
|
12
|
-
type: 'code-server',
|
|
13
|
-
status: 'running',
|
|
14
|
-
created_at: '2024-01-01',
|
|
15
|
-
updated_at: '2024-01-01',
|
|
16
|
-
project_uuid: 'project-uuid',
|
|
17
|
-
environment_name: 'test-env',
|
|
18
|
-
environment_uuid: 'env-uuid',
|
|
19
|
-
server_uuid: 'server-uuid',
|
|
20
|
-
domains: ['test.com'],
|
|
21
|
-
};
|
|
22
|
-
beforeEach(() => {
|
|
23
|
-
mockClient = {
|
|
24
|
-
listServices: jest.fn(),
|
|
25
|
-
getService: jest.fn(),
|
|
26
|
-
createService: jest.fn(),
|
|
27
|
-
deleteService: jest.fn(),
|
|
28
|
-
};
|
|
29
|
-
resources = new ServiceResources(mockClient);
|
|
30
|
-
});
|
|
31
|
-
describe('listServices', () => {
|
|
32
|
-
it('should return a list of services', async () => {
|
|
33
|
-
mockClient.listServices.mockResolvedValue([mockService]);
|
|
34
|
-
const result = await resources.listServices();
|
|
35
|
-
expect(result).toEqual([mockService]);
|
|
36
|
-
expect(mockClient.listServices).toHaveBeenCalled();
|
|
37
|
-
});
|
|
38
|
-
});
|
|
39
|
-
describe('getService', () => {
|
|
40
|
-
it('should return a service by uuid', async () => {
|
|
41
|
-
mockClient.getService.mockResolvedValue(mockService);
|
|
42
|
-
const result = await resources.getService('test-uuid');
|
|
43
|
-
expect(result).toEqual(mockService);
|
|
44
|
-
expect(mockClient.getService).toHaveBeenCalledWith('test-uuid');
|
|
45
|
-
});
|
|
46
|
-
});
|
|
47
|
-
describe('createService', () => {
|
|
48
|
-
it('should create a new service', async () => {
|
|
49
|
-
const createData = {
|
|
50
|
-
name: 'new-service',
|
|
51
|
-
type: 'code-server',
|
|
52
|
-
project_uuid: 'project-uuid',
|
|
53
|
-
environment_name: 'test-env',
|
|
54
|
-
environment_uuid: 'env-uuid',
|
|
55
|
-
server_uuid: 'server-uuid',
|
|
56
|
-
};
|
|
57
|
-
const mockResponse = {
|
|
58
|
-
uuid: 'new-uuid',
|
|
59
|
-
domains: ['new-service.test.com'],
|
|
60
|
-
};
|
|
61
|
-
mockClient.createService.mockResolvedValue(mockResponse);
|
|
62
|
-
const result = await resources.createService(createData);
|
|
63
|
-
expect(result).toEqual(mockResponse);
|
|
64
|
-
expect(mockClient.createService).toHaveBeenCalledWith(createData);
|
|
65
|
-
});
|
|
66
|
-
});
|
|
67
|
-
describe('deleteService', () => {
|
|
68
|
-
it('should delete a service', async () => {
|
|
69
|
-
const mockResponse = { message: 'Service deleted' };
|
|
70
|
-
mockClient.deleteService.mockResolvedValue(mockResponse);
|
|
71
|
-
const result = await resources.deleteService('test-uuid');
|
|
72
|
-
expect(result).toEqual(mockResponse);
|
|
73
|
-
expect(mockClient.deleteService).toHaveBeenCalledWith('test-uuid', undefined);
|
|
74
|
-
});
|
|
75
|
-
});
|
|
76
|
-
});
|