MCPcopy Create free account
hub / github.com/TeleBoxOrg/TeleBox_Plugins / getApi

Function getApi

git_PR/git_PR.ts:121–135  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

119async function getApi() {
120 const baseURL = await ConfigManager.get(CONFIG_KEYS.API_BASE_URL);
121 const token = await ConfigManager.get(CONFIG_KEYS.TOKEN);
122 if (!token) throw new Error("请先使用 `login` 命令登录");
123
124 return axios.create({
125 baseURL,
126 headers: {
127 Authorization: `Bearer ${token}`,
128 Accept: "application/vnd.github+json",
129 "User-Agent": "telebox-git-plugin",
130 "X-GitHub-Api-Version": "2022-11-28"
131 }
132 });
133}
134
135class GitManagerPlugin extends Plugin {
136 description: string = `通过Git API管理PR\n\n${help_text}`;
137
138 cmdHandlers = {

Callers 4

handleReposMethod · 0.85
handlePRsMethod · 0.85
handleMergeMethod · 0.85
handleMergeAllMethod · 0.85

Calls 1

getMethod · 0.45

Tested by

no test coverage detected