first commit

This commit is contained in:
2025-10-26 23:10:15 +08:00
commit 8f0345b7be
14961 changed files with 2356381 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
import { VERSION } from "./version.js";
function requestLog(octokit) {
octokit.hook.wrap("request", (request, options) => {
octokit.log.debug("request", options);
const start = Date.now();
const requestOptions = octokit.request.endpoint.parse(options);
const path = requestOptions.url.replace(options.baseUrl, "");
return request(options).then((response) => {
const requestId = response.headers["x-github-request-id"];
octokit.log.info(
`${requestOptions.method} ${path} - ${response.status} with id ${requestId} in ${Date.now() - start}ms`
);
return response;
}).catch((error) => {
const requestId = error.response?.headers["x-github-request-id"] || "UNKNOWN";
octokit.log.error(
`${requestOptions.method} ${path} - ${error.status} with id ${requestId} in ${Date.now() - start}ms`
);
throw error;
});
});
}
requestLog.VERSION = VERSION;
export {
requestLog
};

View File

@@ -0,0 +1,4 @@
const VERSION = "6.0.0";
export {
VERSION
};