use @actions/github
This commit is contained in:
parent
9da537eb33
commit
0086c2ecdb
199 changed files with 95598 additions and 6141 deletions
7
node_modules/@octokit/plugin-rest-endpoint-methods/LICENSE
generated
vendored
7
node_modules/@octokit/plugin-rest-endpoint-methods/LICENSE
generated
vendored
|
|
@ -1,7 +0,0 @@
|
|||
MIT License Copyright (c) 2019 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.
|
||||
60
node_modules/@octokit/plugin-rest-endpoint-methods/README.md
generated
vendored
60
node_modules/@octokit/plugin-rest-endpoint-methods/README.md
generated
vendored
|
|
@ -1,60 +0,0 @@
|
|||
# plugin-rest-endpoint-methods.js
|
||||
|
||||
> Octokit plugin adding one method for all of api.github.com REST API endpoints
|
||||
|
||||
[](https://www.npmjs.com/package/@octokit/plugin-rest-endpoint-methods)
|
||||
[](https://github.com/octokit/plugin-rest-endpoint-methods.js/actions?workflow=Test)
|
||||
[](https://greenkeeper.io/)
|
||||
|
||||
## Usage
|
||||
|
||||
<table>
|
||||
<tbody valign=top align=left>
|
||||
<tr><th>
|
||||
Browsers
|
||||
</th><td width=100%>
|
||||
|
||||
Load `@octokit/plugin-rest-endpoint-methods` and [`@octokit/core`](https://github.com/octokit/core.js) (or core-compatible module) directly from [cdn.pika.dev](https://cdn.pika.dev)
|
||||
|
||||
```html
|
||||
<script type="module">
|
||||
import { Octokit } from "https://cdn.pika.dev/@octokit/core";
|
||||
import { restEndpointMethods } from "https://cdn.pika.dev/@octokit/plugin-rest-endpoint-methods";
|
||||
</script>
|
||||
```
|
||||
|
||||
</td></tr>
|
||||
<tr><th>
|
||||
Node
|
||||
</th><td>
|
||||
|
||||
Install with `npm install @octokit/core @octokit/plugin-rest-endpoint-methods`. Optionally replace `@octokit/core` with a compatible module
|
||||
|
||||
```js
|
||||
const { Octokit } = require("@octokit/core");
|
||||
const {
|
||||
restEndpointMethods
|
||||
} = require("@octokit/plugin-rest-endpoint-methods");
|
||||
```
|
||||
|
||||
</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
```js
|
||||
const MyOctokit = Octokit.plugin(restEndpointMethods);
|
||||
const octokit = new MyOctokit({ auth: "secret123" });
|
||||
|
||||
// https://developer.github.com/v3/users/#get-the-authenticated-user
|
||||
octokit.users.getAuthenticated();
|
||||
```
|
||||
|
||||
There is one method for each REST API endpoint documented at [https://developer.github.com/v3](https://developer.github.com/v3). All endpoint methods are documented in the [docs/](docs/) folder, e.g. [docs/users/getAuthenticated.md](docs/users/getAuthenticated.md)
|
||||
|
||||
## Contributing
|
||||
|
||||
See [CONTRIBUTING.md](CONTRIBUTING.md)
|
||||
|
||||
## License
|
||||
|
||||
[MIT](LICENSE)
|
||||
1250
node_modules/@octokit/plugin-rest-endpoint-methods/dist-node/index.js
generated
vendored
1250
node_modules/@octokit/plugin-rest-endpoint-methods/dist-node/index.js
generated
vendored
File diff suppressed because it is too large
Load diff
1
node_modules/@octokit/plugin-rest-endpoint-methods/dist-node/index.js.map
generated
vendored
1
node_modules/@octokit/plugin-rest-endpoint-methods/dist-node/index.js.map
generated
vendored
File diff suppressed because one or more lines are too long
66
node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/endpoints-to-methods.js
generated
vendored
66
node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/endpoints-to-methods.js
generated
vendored
|
|
@ -1,66 +0,0 @@
|
|||
export function endpointsToMethods(octokit, endpointsMap) {
|
||||
const newMethods = {};
|
||||
for (const [scope, endpoints] of Object.entries(endpointsMap)) {
|
||||
for (const [methodName, endpoint] of Object.entries(endpoints)) {
|
||||
const [route, defaults, decorations] = endpoint;
|
||||
const [method, url] = route.split(/ /);
|
||||
const endpointDefaults = Object.assign({ method, url }, defaults);
|
||||
if (!newMethods[scope]) {
|
||||
newMethods[scope] = {};
|
||||
}
|
||||
const scopeMethods = newMethods[scope];
|
||||
if (decorations) {
|
||||
scopeMethods[methodName] = decorate(octokit, scope, methodName, endpointDefaults, decorations);
|
||||
continue;
|
||||
}
|
||||
scopeMethods[methodName] = octokit.request.defaults(endpointDefaults);
|
||||
}
|
||||
}
|
||||
return newMethods;
|
||||
}
|
||||
function decorate(octokit, scope, methodName, defaults, decorations) {
|
||||
const requestWithDefaults = octokit.request.defaults(defaults);
|
||||
function withDecorations(...args) {
|
||||
// @ts-ignore https://github.com/microsoft/TypeScript/issues/25488
|
||||
let options = requestWithDefaults.endpoint.merge(...args);
|
||||
// There are currently no other decorations than `.mapToData`
|
||||
if (decorations.mapToData) {
|
||||
options = Object.assign({}, options, {
|
||||
data: options[decorations.mapToData],
|
||||
[decorations.mapToData]: undefined
|
||||
});
|
||||
return requestWithDefaults(options);
|
||||
}
|
||||
// NOTE: there are currently no deprecations. But we keep the code
|
||||
// below for future reference
|
||||
if (decorations.renamed) {
|
||||
const [newScope, newMethodName] = decorations.renamed;
|
||||
octokit.log.warn(`octokit.${scope}.${methodName}() has been renamed to octokit.${newScope}.${newMethodName}()`);
|
||||
}
|
||||
if (decorations.deprecated) {
|
||||
octokit.log.warn(decorations.deprecated);
|
||||
}
|
||||
// There currently are no renamed parameters
|
||||
// if (decorations.renamedParameters) {
|
||||
// // @ts-ignore https://github.com/microsoft/TypeScript/issues/25488
|
||||
// const options = requestWithDefaults.endpoint.merge(...args);
|
||||
// for (const [name, alias] of Object.entries(
|
||||
// decorations.renamedParameters
|
||||
// )) {
|
||||
// if (name in options) {
|
||||
// octokit.log.warn(
|
||||
// `"${name}" parameter is deprecated for "octokit.${scope}.${methodName}()". Use "${alias}" instead`
|
||||
// );
|
||||
// if (!(alias in options)) {
|
||||
// options[alias] = options[name];
|
||||
// }
|
||||
// delete options[name];
|
||||
// }
|
||||
// }
|
||||
// return requestWithDefaults(options);
|
||||
// }
|
||||
// @ts-ignore https://github.com/microsoft/TypeScript/issues/25488
|
||||
return requestWithDefaults(...args);
|
||||
}
|
||||
return Object.assign(withDecorations, requestWithDefaults);
|
||||
}
|
||||
1244
node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/generated/endpoints.js
generated
vendored
1244
node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/generated/endpoints.js
generated
vendored
File diff suppressed because it is too large
Load diff
0
node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/generated/types.js
generated
vendored
0
node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/generated/types.js
generated
vendored
17
node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/index.js
generated
vendored
17
node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/index.js
generated
vendored
|
|
@ -1,17 +0,0 @@
|
|||
import ENDPOINTS from "./generated/endpoints";
|
||||
import { VERSION } from "./version";
|
||||
import { endpointsToMethods } from "./endpoints-to-methods";
|
||||
/**
|
||||
* This plugin is a 1:1 copy of internal @octokit/rest plugins. The primary
|
||||
* goal is to rebuild @octokit/rest on top of @octokit/core. Once that is
|
||||
* done, we will remove the registerEndpoints methods and return the methods
|
||||
* directly as with the other plugins. At that point we will also remove the
|
||||
* legacy workarounds and deprecations.
|
||||
*
|
||||
* See the plan at
|
||||
* https://github.com/octokit/plugin-rest-endpoint-methods.js/pull/1
|
||||
*/
|
||||
export function restEndpointMethods(octokit) {
|
||||
return endpointsToMethods(octokit, ENDPOINTS);
|
||||
}
|
||||
restEndpointMethods.VERSION = VERSION;
|
||||
0
node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/types.js
generated
vendored
0
node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/types.js
generated
vendored
1
node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/version.js
generated
vendored
1
node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/version.js
generated
vendored
|
|
@ -1 +0,0 @@
|
|||
export const VERSION = "3.3.1";
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
import { Octokit } from "@octokit/core";
|
||||
import { EndpointsDefaultsAndDecorations } from "./types";
|
||||
import { RestEndpointMethods } from "./generated/types";
|
||||
export declare function endpointsToMethods(octokit: Octokit, endpointsMap: EndpointsDefaultsAndDecorations): RestEndpointMethods;
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
import { EndpointsDefaultsAndDecorations } from "../types";
|
||||
declare const Endpoints: EndpointsDefaultsAndDecorations;
|
||||
export default Endpoints;
|
||||
32467
node_modules/@octokit/plugin-rest-endpoint-methods/dist-types/generated/types.d.ts
generated
vendored
32467
node_modules/@octokit/plugin-rest-endpoint-methods/dist-types/generated/types.d.ts
generated
vendored
File diff suppressed because it is too large
Load diff
16
node_modules/@octokit/plugin-rest-endpoint-methods/dist-types/index.d.ts
generated
vendored
16
node_modules/@octokit/plugin-rest-endpoint-methods/dist-types/index.d.ts
generated
vendored
|
|
@ -1,16 +0,0 @@
|
|||
import { Octokit } from "@octokit/core";
|
||||
import { Api } from "./types";
|
||||
/**
|
||||
* This plugin is a 1:1 copy of internal @octokit/rest plugins. The primary
|
||||
* goal is to rebuild @octokit/rest on top of @octokit/core. Once that is
|
||||
* done, we will remove the registerEndpoints methods and return the methods
|
||||
* directly as with the other plugins. At that point we will also remove the
|
||||
* legacy workarounds and deprecations.
|
||||
*
|
||||
* See the plan at
|
||||
* https://github.com/octokit/plugin-rest-endpoint-methods.js/pull/1
|
||||
*/
|
||||
export declare function restEndpointMethods(octokit: Octokit): Api;
|
||||
export declare namespace restEndpointMethods {
|
||||
var VERSION: string;
|
||||
}
|
||||
16
node_modules/@octokit/plugin-rest-endpoint-methods/dist-types/types.d.ts
generated
vendored
16
node_modules/@octokit/plugin-rest-endpoint-methods/dist-types/types.d.ts
generated
vendored
|
|
@ -1,16 +0,0 @@
|
|||
import { Route, RequestParameters } from "@octokit/types";
|
||||
import { RestEndpointMethods } from "./generated/types";
|
||||
export declare type Api = RestEndpointMethods;
|
||||
export declare type EndpointDecorations = {
|
||||
mapToData?: string;
|
||||
deprecated?: string;
|
||||
renamed?: [string, string];
|
||||
renamedParameters?: {
|
||||
[name: string]: string;
|
||||
};
|
||||
};
|
||||
export declare type EndpointsDefaultsAndDecorations = {
|
||||
[scope: string]: {
|
||||
[methodName: string]: [Route, RequestParameters?, EndpointDecorations?];
|
||||
};
|
||||
};
|
||||
1
node_modules/@octokit/plugin-rest-endpoint-methods/dist-types/version.d.ts
generated
vendored
1
node_modules/@octokit/plugin-rest-endpoint-methods/dist-types/version.d.ts
generated
vendored
|
|
@ -1 +0,0 @@
|
|||
export declare const VERSION = "3.3.1";
|
||||
1330
node_modules/@octokit/plugin-rest-endpoint-methods/dist-web/index.js
generated
vendored
1330
node_modules/@octokit/plugin-rest-endpoint-methods/dist-web/index.js
generated
vendored
File diff suppressed because it is too large
Load diff
1
node_modules/@octokit/plugin-rest-endpoint-methods/dist-web/index.js.map
generated
vendored
1
node_modules/@octokit/plugin-rest-endpoint-methods/dist-web/index.js.map
generated
vendored
File diff suppressed because one or more lines are too long
57
node_modules/@octokit/plugin-rest-endpoint-methods/package.json
generated
vendored
57
node_modules/@octokit/plugin-rest-endpoint-methods/package.json
generated
vendored
|
|
@ -1,57 +0,0 @@
|
|||
{
|
||||
"name": "@octokit/plugin-rest-endpoint-methods",
|
||||
"description": "Octokit plugin adding one method for all of api.github.com REST API endpoints",
|
||||
"version": "3.3.1",
|
||||
"license": "MIT",
|
||||
"files": [
|
||||
"dist-*/",
|
||||
"bin/"
|
||||
],
|
||||
"pika": true,
|
||||
"sideEffects": false,
|
||||
"keywords": [
|
||||
"github",
|
||||
"api",
|
||||
"sdk",
|
||||
"toolkit"
|
||||
],
|
||||
"repository": "https://github.com/octokit/plugin-rest-endpoint-methods.js",
|
||||
"dependencies": {
|
||||
"@octokit/types": "^2.0.1",
|
||||
"deprecation": "^2.3.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@gimenete/type-writer": "^0.1.4",
|
||||
"@octokit/core": "^2.1.2",
|
||||
"@octokit/graphql": "^4.3.1",
|
||||
"@pika/pack": "^0.5.0",
|
||||
"@pika/plugin-build-node": "^0.9.0",
|
||||
"@pika/plugin-build-web": "^0.9.0",
|
||||
"@pika/plugin-ts-standard-pkg": "^0.9.0",
|
||||
"@types/fetch-mock": "^7.3.1",
|
||||
"@types/jest": "^25.1.0",
|
||||
"@types/node": "^13.1.0",
|
||||
"fetch-mock": "^9.0.0",
|
||||
"fs-extra": "^8.1.0",
|
||||
"jest": "^25.1.0",
|
||||
"lodash.camelcase": "^4.3.0",
|
||||
"lodash.set": "^4.3.2",
|
||||
"lodash.upperfirst": "^4.3.1",
|
||||
"mustache": "^4.0.0",
|
||||
"npm-run-all": "^4.1.5",
|
||||
"prettier": "^1.19.1",
|
||||
"semantic-release": "^17.0.0",
|
||||
"semantic-release-plugin-update-version-in-files": "^1.0.0",
|
||||
"sort-keys": "^4.0.0",
|
||||
"string-to-jsdoc-comment": "^1.0.0",
|
||||
"ts-jest": "^25.1.0",
|
||||
"typescript": "^3.7.2"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"source": "dist-src/index.js",
|
||||
"types": "dist-types/index.d.ts",
|
||||
"main": "dist-node/index.js",
|
||||
"module": "dist-web/index.js"
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue