mirror of
https://github.com/actions/labeler.git
synced 2025-12-16 15:10:37 +00:00
Bump actions/github to 2.2.0 to support GHES (#72)
* Bumping actions/github to 2.2.0 * Husky commit correct node modules
This commit is contained in:
6624
node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/generated/endpoints.js
generated
vendored
Normal file
6624
node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/generated/endpoints.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
0
node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/generated/rest-endpoint-methods-types.js
generated
vendored
Normal file
0
node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/generated/rest-endpoint-methods-types.js
generated
vendored
Normal file
38
node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/index.js
generated
vendored
Normal file
38
node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/index.js
generated
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
import { Deprecation } from "deprecation";
|
||||
import endpointsByScope from "./generated/endpoints";
|
||||
import { VERSION } from "./version";
|
||||
import { registerEndpoints } from "./register-endpoints";
|
||||
/**
|
||||
* 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) {
|
||||
// @ts-ignore
|
||||
octokit.registerEndpoints = registerEndpoints.bind(null, octokit);
|
||||
registerEndpoints(octokit, endpointsByScope);
|
||||
// Aliasing scopes for backward compatibility
|
||||
// See https://github.com/octokit/rest.js/pull/1134
|
||||
[
|
||||
["gitdata", "git"],
|
||||
["authorization", "oauthAuthorizations"],
|
||||
["pullRequests", "pulls"]
|
||||
].forEach(([deprecatedScope, scope]) => {
|
||||
Object.defineProperty(octokit, deprecatedScope, {
|
||||
get() {
|
||||
octokit.log.warn(
|
||||
// @ts-ignore
|
||||
new Deprecation(`[@octokit/plugin-rest-endpoint-methods] "octokit.${deprecatedScope}.*" methods are deprecated, use "octokit.${scope}.*" instead`));
|
||||
// @ts-ignore
|
||||
return octokit[scope];
|
||||
}
|
||||
});
|
||||
});
|
||||
return {};
|
||||
}
|
||||
restEndpointMethods.VERSION = VERSION;
|
||||
60
node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/register-endpoints.js
generated
vendored
Normal file
60
node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/register-endpoints.js
generated
vendored
Normal file
@@ -0,0 +1,60 @@
|
||||
import { Deprecation } from "deprecation";
|
||||
export function registerEndpoints(octokit, routes) {
|
||||
Object.keys(routes).forEach(namespaceName => {
|
||||
if (!octokit[namespaceName]) {
|
||||
octokit[namespaceName] = {};
|
||||
}
|
||||
Object.keys(routes[namespaceName]).forEach(apiName => {
|
||||
const apiOptions = routes[namespaceName][apiName];
|
||||
const endpointDefaults = ["method", "url", "headers"].reduce((map, key) => {
|
||||
if (typeof apiOptions[key] !== "undefined") {
|
||||
map[key] = apiOptions[key];
|
||||
}
|
||||
return map;
|
||||
}, {});
|
||||
endpointDefaults.request = {
|
||||
validate: apiOptions.params
|
||||
};
|
||||
let request = octokit.request.defaults(endpointDefaults);
|
||||
// patch request & endpoint methods to support deprecated parameters.
|
||||
// Not the most elegant solution, but we don’t want to move deprecation
|
||||
// logic into octokit/endpoint.js as it’s out of scope
|
||||
const hasDeprecatedParam = Object.keys(apiOptions.params || {}).find(key => apiOptions.params[key].deprecated);
|
||||
if (hasDeprecatedParam) {
|
||||
const patch = patchForDeprecation.bind(null, octokit, apiOptions);
|
||||
request = patch(octokit.request.defaults(endpointDefaults), `.${namespaceName}.${apiName}()`);
|
||||
request.endpoint = patch(request.endpoint, `.${namespaceName}.${apiName}.endpoint()`);
|
||||
request.endpoint.merge = patch(request.endpoint.merge, `.${namespaceName}.${apiName}.endpoint.merge()`);
|
||||
}
|
||||
if (apiOptions.deprecated) {
|
||||
octokit[namespaceName][apiName] = Object.assign(function deprecatedEndpointMethod() {
|
||||
octokit.log.warn(new Deprecation(`[@octokit/rest] ${apiOptions.deprecated}`));
|
||||
octokit[namespaceName][apiName] = request;
|
||||
return request.apply(null, arguments);
|
||||
}, request);
|
||||
return;
|
||||
}
|
||||
octokit[namespaceName][apiName] = request;
|
||||
});
|
||||
});
|
||||
}
|
||||
function patchForDeprecation(octokit, apiOptions, method, methodName) {
|
||||
const patchedMethod = (options) => {
|
||||
options = Object.assign({}, options);
|
||||
Object.keys(options).forEach(key => {
|
||||
if (apiOptions.params[key] && apiOptions.params[key].deprecated) {
|
||||
const aliasKey = apiOptions.params[key].alias;
|
||||
octokit.log.warn(new Deprecation(`[@octokit/rest] "${key}" parameter is deprecated for "${methodName}". Use "${aliasKey}" instead`));
|
||||
if (!(aliasKey in options)) {
|
||||
options[aliasKey] = options[key];
|
||||
}
|
||||
delete options[key];
|
||||
}
|
||||
});
|
||||
return method(options);
|
||||
};
|
||||
Object.keys(method).forEach(key => {
|
||||
patchedMethod[key] = method[key];
|
||||
});
|
||||
return patchedMethod;
|
||||
}
|
||||
0
node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/types.js
generated
vendored
Normal file
0
node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/types.js
generated
vendored
Normal file
1
node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/version.js
generated
vendored
Normal file
1
node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/version.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export const VERSION = "2.4.0";
|
||||
Reference in New Issue
Block a user