* Rclone API GET 请求
( path: string, ignoreError?: boolean )
| 173 | * Rclone API GET 请求 |
| 174 | */ |
| 175 | async function rclone_api_get( |
| 176 | path: string, |
| 177 | ignoreError?: boolean |
| 178 | ): Promise<RcloneApiResponse | undefined> { |
| 179 | const fullPath = buildApiUrl(path) |
| 180 | |
| 181 | try { |
| 182 | const res = await fetch(fullPath, { |
| 183 | method: 'GET', |
| 184 | headers: getRcloneApiHeaders(), |
| 185 | }) |
| 186 | |
| 187 | const data = await handleApiResponse(res, fullPath, 'GET') |
| 188 | return data |
| 189 | } catch (error) { |
| 190 | if (!ignoreError) { |
| 191 | await printError(error as Error | Response) |
| 192 | } |
| 193 | return undefined |
| 194 | } |
| 195 | } |
| 196 | |
| 197 | // 异步任务响应接口 |
| 198 | interface AsyncJobResponse { |
nothing calls this directly
no test coverage detected