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

7
node_modules/@octokit/plugin-request-log/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,7 @@
MIT License Copyright (c) 2020 Octokit contributors
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

76
node_modules/@octokit/plugin-request-log/README.md generated vendored Normal file
View File

@@ -0,0 +1,76 @@
# plugin-request-log.js
> Log all requests and request errors
[![@latest](https://img.shields.io/npm/v/@octokit/plugin-request-log.svg)](https://www.npmjs.com/package/@octokit/plugin-request-log)
[![Build Status](https://github.com/octokit/plugin-request-log.js/workflows/Test/badge.svg)](https://github.com/octokit/plugin-request-log.js/actions?workflow=Test)
## Usage
<table>
<tbody valign=top align=left>
<tr><th>
Browsers
</th><td width=100%>
Load `@octokit/plugin-request-log` and [`@octokit/core`](https://github.com/octokit/core.js) (or core-compatible module) directly from [esm.sh](https://esm.sh)
```html
<script type="module">
import { Octokit } from "https://esm.sh/@octokit/core";
import { requestLog } from "https://esm.sh/@octokit/plugin-request-log";
</script>
```
</td></tr>
<tr><th>
Node
</th><td>
Install with `npm install @octokit/core @octokit/plugin-request-log`. Optionally replace `@octokit/core` with a core-compatible module
```js
import { Octokit } from "@octokit/core";
import { requestLog } from "@octokit/plugin-request-log";
```
</td></tr>
</tbody>
</table>
> [!IMPORTANT]
> As we use [conditional exports](https://nodejs.org/api/packages.html#conditional-exports), you will need to adapt your `tsconfig.json` by setting `"moduleResolution": "node16", "module": "node16"`.
>
> See the TypeScript docs on [package.json "exports"](https://www.typescriptlang.org/docs/handbook/modules/reference.html#packagejson-exports).<br>
> See this [helpful guide on transitioning to ESM](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c) from [@sindresorhus](https://github.com/sindresorhus)
```js
const MyOctokit = Octokit.plugin(requestLog);
const octokit = new MyOctokit({ auth: "secret123" });
octokit.request("GET /");
// logs "GET / - 200 in 123ms
octokit.request("GET /oops");
// logs "GET / - 404 in 123ms
```
In order to log all request options, the `log.debug` option needs to be set. We recommend the [console-log-level](https://github.com/watson/console-log-level) package for a configurable log level
```js
import consoleLogLevel from "console-log-level";
const octokit = new MyOctokit({
log: consoleLogLevel({
auth: "secret123",
level: "info",
}),
});
```
## Contributing
See [CONTRIBUTING.md](CONTRIBUTING.md)
## License
[MIT](LICENSE)

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
};

View File

@@ -0,0 +1,9 @@
import type { Octokit } from "@octokit/core";
/**
* @param octokit Octokit instance
* @param options Options passed to Octokit constructor
*/
export declare function requestLog(octokit: Octokit): void;
export declare namespace requestLog {
var VERSION: string;
}

View File

@@ -0,0 +1 @@
export declare const VERSION = "6.0.0";

51
node_modules/@octokit/plugin-request-log/package.json generated vendored Normal file
View File

@@ -0,0 +1,51 @@
{
"name": "@octokit/plugin-request-log",
"version": "6.0.0",
"description": "Log all requests and request errors",
"type": "module",
"repository": "github:octokit/plugin-request-log.js",
"keywords": [
"github",
"api",
"sdk",
"toolkit"
],
"author": "Gregor Martynus (https://twitter.com/gr2m)",
"license": "MIT",
"peerDependencies": {
"@octokit/core": ">=6"
},
"devDependencies": {
"@octokit/core": "^7.0.0",
"@octokit/tsconfig": "^4.0.0",
"@types/node": "^22.0.0",
"@vitest/coverage-v8": "^3.1.4",
"esbuild": "^0.25.0",
"fetch-mock": "^11.0.0",
"prettier": "3.5.3",
"semantic-release-plugin-update-version-in-files": "^2.0.0",
"tinyglobby": "^0.2.13",
"typescript": "^5.0.0",
"vitest": "^3.1.4"
},
"publishConfig": {
"access": "public",
"provenance": true
},
"engines": {
"node": ">= 20"
},
"files": [
"dist-*/**",
"bin/**"
],
"types": "dist-types/index.d.ts",
"exports": {
".": {
"types": "./dist-types/index.d.ts",
"import": "./dist-src/index.js",
"default": "./dist-src/index.js"
}
},
"sideEffects": false
}