@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
28 lines (27 loc) • 1.09 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.listWorkspace = listWorkspace;
exports.deleteWorkspace = deleteWorkspace;
const client_js_1 = __importDefault(require("./client.js"));
async function listWorkspace(params) {
const cnbInst = client_js_1.default.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}`);
}
async function deleteWorkspace(params) {
const cnbInst = client_js_1.default.getInstance();
const url = new URL('/workspace/delete', cnbInst.baseUrl);
return cnbInst.request('POST', `${url.pathname}`, params, {
header: { 'Content-Type': 'application/json' }
});
}