UNPKG

@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

20 lines (19 loc) 717 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.isRepoPublic = isRepoPublic; const index_js_1 = require("../constants/index.js"); const repository_js_1 = require("../api/repository.js"); const formatRepoUrl_js_1 = require("./formatRepoUrl.js"); async function isRepoPublic(client, url) { const repoPath = (0, formatRepoUrl_js_1.getRepoPath)(url); if (!repoPath) return true; try { const { visibility_level } = await (0, repository_js_1.getRepository)(client, repoPath); // 字段类型转换过,但 swagger 无法感知 return visibility_level === index_js_1.RepoVisibility.public; } catch (_a) { return true; } }