@cnbcool/mcp-server
Version:
CNB MCP Server. A comprehensive MCP server that provides seamless integration to the CNB's API(https://cnb.cool), offering a wide range of tools for repository management, pipelines operations and collaboration features
21 lines (20 loc) • 767 B
JavaScript
import CnbApiClient from './client.js';
export async function listWorkspace(params) {
const cnbInst = CnbApiClient.getInstance();
const url = new URL('/workspace/list', cnbInst.baseUrl);
if (params) {
for (const [key, value] of Object.entries(params)) {
if (value === undefined)
continue;
url.searchParams.set(key, value.toString());
}
}
return cnbInst.request('GET', `${url.pathname}${url.search}`);
}
export async function deleteWorkspace(params) {
const cnbInst = CnbApiClient.getInstance();
const url = new URL('/workspace/delete', cnbInst.baseUrl);
return cnbInst.request('POST', `${url.pathname}`, params, {
header: { 'Content-Type': 'application/json' }
});
}