Skip to content

Commit

Permalink
build(release): compiled action for 1.1.75
Browse files Browse the repository at this point in the history
[skip ci]
  • Loading branch information
semantic-release-bot committed Mar 17, 2022
1 parent 3402b0f commit 01e798a
Showing 1 changed file with 23 additions and 33 deletions.
56 changes: 23 additions & 33 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10772,14 +10772,14 @@ function _defineProperty(obj, key, value) {
return obj;
}

const VERSION = "3.6.1";
const VERSION = "3.6.2";

const noop = () => Promise.resolve(); // @ts-ignore
const noop = () => Promise.resolve(); // @ts-expect-error


function wrapRequest(state, request, options) {
return state.retryLimiter.schedule(doRequest, state, request, options);
} // @ts-ignore
} // @ts-expect-error

async function doRequest(state, request, options) {
const isWrite = options.method !== "GET" && options.method !== "HEAD";
Expand All @@ -10797,7 +10797,7 @@ async function doRequest(state, request, options) {
if (state.clustering) {
// Remove a job from Redis if it has not completed or failed within 60s
// Examples: Node process terminated, client disconnected, etc.
// @ts-ignore
// @ts-expect-error
jobOptions.expiration = 1000 * 60;
} // Guarantee at least 1000ms between writes
// GraphQL can also trigger writes
Expand All @@ -10822,7 +10822,7 @@ async function doRequest(state, request, options) {
if (isGraphQL) {
const res = await req;

if (res.data.errors != null && // @ts-ignore
if (res.data.errors != null && // @ts-expect-error
res.data.errors.some(error => error.type === "RATE_LIMITED")) {
const error = Object.assign(new Error("GraphQL Rate Limit Exceeded"), {
response: res,
Expand All @@ -10837,23 +10837,19 @@ async function doRequest(state, request, options) {

var triggersNotificationPaths = ["/orgs/{org}/invitations", "/orgs/{org}/invitations/{invitation_id}", "/orgs/{org}/teams/{team_slug}/discussions", "/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments", "/repos/{owner}/{repo}/collaborators/{username}", "/repos/{owner}/{repo}/commits/{commit_sha}/comments", "/repos/{owner}/{repo}/issues", "/repos/{owner}/{repo}/issues/{issue_number}/comments", "/repos/{owner}/{repo}/pulls", "/repos/{owner}/{repo}/pulls/{pull_number}/comments", "/repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies", "/repos/{owner}/{repo}/pulls/{pull_number}/merge", "/repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers", "/repos/{owner}/{repo}/pulls/{pull_number}/reviews", "/repos/{owner}/{repo}/releases", "/teams/{team_id}/discussions", "/teams/{team_id}/discussions/{discussion_number}/comments"];

// @ts-ignore
function routeMatcher(paths) {
// EXAMPLE. For the following paths:

/* [
"/orgs/{org}/invitations",
"/repos/{owner}/{repo}/collaborators/{username}"
] */
// @ts-ignore
const regexes = paths.map(path => path.split("/") // @ts-ignore
.map(c => c.startsWith("{") ? "(?:.+?)" : c).join("/")); // 'regexes' would contain:
const regexes = paths.map(path => path.split("/").map(c => c.startsWith("{") ? "(?:.+?)" : c).join("/")); // 'regexes' would contain:

/* [
'/orgs/(?:.+?)/invitations',
'/repos/(?:.+?)/(?:.+?)/collaborators/(?:.+?)'
] */
// @ts-ignore

const regex = `^(?:${regexes.map(r => `(?:${r})`).join("|")})[^/]*$`; // 'regex' would contain:

Expand All @@ -10868,43 +10864,38 @@ function routeMatcher(paths) {

const regex = routeMatcher(triggersNotificationPaths);
const triggersNotification = regex.test.bind(regex);
const groups = {}; // @ts-ignore
const groups = {}; // @ts-expect-error

const createGroups = function (Bottleneck, common) {
// @ts-ignore
groups.global = new Bottleneck.Group(_objectSpread2({
id: "octokit-global",
maxConcurrent: 10
}, common)); // @ts-ignore

}, common));
groups.search = new Bottleneck.Group(_objectSpread2({
id: "octokit-search",
maxConcurrent: 1,
minTime: 2000
}, common)); // @ts-ignore

}, common));
groups.write = new Bottleneck.Group(_objectSpread2({
id: "octokit-write",
maxConcurrent: 1,
minTime: 1000
}, common)); // @ts-ignore

}, common));
groups.notifications = new Bottleneck.Group(_objectSpread2({
id: "octokit-notifications",
maxConcurrent: 1,
minTime: 3000
}, common));
};

function throttling(octokit, octokitOptions = {}) {
function throttling(octokit, octokitOptions) {
const {
enabled = true,
Bottleneck = BottleneckLight,
id = "no-id",
timeout = 1000 * 60 * 2,
// Redis TTL: 2 minutes
connection // @ts-ignore

connection
} = octokitOptions.throttle || {};

if (!enabled) {
Expand All @@ -10914,7 +10905,7 @@ function throttling(octokit, octokitOptions = {}) {
const common = {
connection,
timeout
}; // @ts-ignore
};

if (groups.global == null) {
createGroups(Bottleneck, common);
Expand All @@ -10927,10 +10918,10 @@ function throttling(octokit, octokitOptions = {}) {
retryAfterBaseValue: 1000,
retryLimiter: new Bottleneck(),
id
}, groups), // @ts-ignore
octokitOptions.throttle);
}, groups), octokitOptions.throttle);
const isUsingDeprecatedOnAbuseLimitHandler = typeof state.onAbuseLimit === "function" && state.onAbuseLimit;

if (typeof state.onSecondaryRateLimit !== "function" && typeof state.onAbuseLimit !== "function" || typeof state.onRateLimit !== "function") {
if (typeof (isUsingDeprecatedOnAbuseLimitHandler ? state.onAbuseLimit : state.onSecondaryRateLimit) !== "function" || typeof state.onRateLimit !== "function") {
throw new Error(`octokit/plugin-throttling error:
You must pass the onSecondaryRateLimit and onRateLimit error handlers.
See https://github.com/octokit/rest.js#throttling
Expand All @@ -10945,16 +10936,16 @@ function throttling(octokit, octokitOptions = {}) {
}

const events = {};
const emitter = new Bottleneck.Events(events); // @ts-ignore
const emitter = new Bottleneck.Events(events); // @ts-expect-error

events.on("secondary-limit", state.onSecondaryRateLimit || function (...args) {
events.on("secondary-limit", isUsingDeprecatedOnAbuseLimitHandler ? function (...args) {
octokit.log.warn("[@octokit/plugin-throttling] `onAbuseLimit()` is deprecated and will be removed in a future release of `@octokit/plugin-throttling`, please use the `onSecondaryRateLimit` handler instead");
return state.onAbuseLimit(...args);
}); // @ts-ignore
} : state.onSecondaryRateLimit); // @ts-expect-error

events.on("rate-limit", state.onRateLimit); // @ts-ignore
events.on("rate-limit", state.onRateLimit); // @ts-expect-error

events.on("error", e => octokit.log.warn("Error in throttling-plugin limit handler", e)); // @ts-ignore
events.on("error", e => octokit.log.warn("Error in throttling-plugin limit handler", e)); // @ts-expect-error

state.retryLimiter.on("failed", async function (error, info) {
const options = info.args[info.args.length - 1];
Expand All @@ -10971,7 +10962,7 @@ function throttling(octokit, octokitOptions = {}) {
options.request.retryCount = retryCount;
const {
wantRetry,
retryAfter
retryAfter = 0
} = await async function () {
if (/\bsecondary rate\b/i.test(error.message)) {
// The user has hit the secondary rate limit. (REST and GraphQL)
Expand Down Expand Up @@ -11003,8 +10994,7 @@ function throttling(octokit, octokitOptions = {}) {
}();

if (wantRetry) {
options.request.retryCount++; // @ts-ignore

options.request.retryCount++;
return retryAfter * state.retryAfterBaseValue;
}
});
Expand Down

0 comments on commit 01e798a

Please sign in to comment.