()
| 119 | async 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 | |
| 135 | class GitManagerPlugin extends Plugin { |
| 136 | description: string = `通过Git API管理PR\n\n${help_text}`; |
| 137 | |
| 138 | cmdHandlers = { |
no test coverage detected