Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump @octokit/request from 8.1.4 to 8.4.1 #660

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
126 changes: 59 additions & 67 deletions dist/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -27401,53 +27401,6 @@ function requireBeforeAfterHook () {
return beforeAfterHook.exports;
}

var isPlainObject = {};

var hasRequiredIsPlainObject;

function requireIsPlainObject () {
if (hasRequiredIsPlainObject) return isPlainObject;
hasRequiredIsPlainObject = 1;

Object.defineProperty(isPlainObject, '__esModule', { value: true });

/*!
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
*
* Copyright (c) 2014-2017, Jon Schlinkert.
* Released under the MIT License.
*/

function isObject(o) {
return Object.prototype.toString.call(o) === '[object Object]';
}

function isPlainObject$1(o) {
var ctor,prot;

if (isObject(o) === false) return false;

// If has modified constructor
ctor = o.constructor;
if (ctor === undefined) return true;

// If has modified prototype
prot = ctor.prototype;
if (isObject(prot) === false) return false;

// If constructor does not have an Object-specific method
if (prot.hasOwnProperty('isPrototypeOf') === false) {
return false;
}

// Most likely a plain Object
return true;
}

isPlainObject.isPlainObject = isPlainObject$1;
return isPlainObject;
}

var distNode$8;
var hasRequiredDistNode$8;

Expand Down Expand Up @@ -27483,7 +27436,7 @@ function requireDistNode$8 () {
var import_universal_user_agent = /*@__PURE__*/ requireDistNode$9();

// pkg/dist-src/version.js
var VERSION = "9.0.1";
var VERSION = "9.0.6";

// pkg/dist-src/defaults.js
var userAgent = `octokit-endpoint.js/${VERSION} ${(0, import_universal_user_agent.getUserAgent)()}`;
Expand All @@ -27510,12 +27463,24 @@ function requireDistNode$8 () {
}, {});
}

// pkg/dist-src/util/is-plain-object.js
function isPlainObject(value) {
if (typeof value !== "object" || value === null)
return false;
if (Object.prototype.toString.call(value) !== "[object Object]")
return false;
const proto = Object.getPrototypeOf(value);
if (proto === null)
return true;
const Ctor = Object.prototype.hasOwnProperty.call(proto, "constructor") && proto.constructor;
return typeof Ctor === "function" && Ctor instanceof Ctor && Function.prototype.call(Ctor) === Function.prototype.call(value);
}

// pkg/dist-src/util/merge-deep.js
var import_is_plain_object = requireIsPlainObject();
function mergeDeep(defaults, options) {
const result = Object.assign({}, defaults);
Object.keys(options).forEach((key) => {
if ((0, import_is_plain_object.isPlainObject)(options[key])) {
if (isPlainObject(options[key])) {
if (!(key in defaults))
Object.assign(result, { [key]: options[key] });
else
Expand Down Expand Up @@ -27576,9 +27541,9 @@ function requireDistNode$8 () {
}

// pkg/dist-src/util/extract-url-variable-names.js
var urlVariableRegex = /\{[^}]+\}/g;
var urlVariableRegex = /\{[^{}}]+\}/g;
function removeNonChars(variableName) {
return variableName.replace(/^\W+|\W+$/g, "").split(/,/);
return variableName.replace(/(?:^\W+)|(?:(?<!\W)\W+$)/g, "").split(/,/);
}
function extractUrlVariableNames(url) {
const matches = url.match(urlVariableRegex);
Expand All @@ -27590,10 +27555,13 @@ function requireDistNode$8 () {

// pkg/dist-src/util/omit.js
function omit(object, keysToOmit) {
return Object.keys(object).filter((option) => !keysToOmit.includes(option)).reduce((obj, key) => {
obj[key] = object[key];
return obj;
}, {});
const result = { __proto__: null };
for (const key of Object.keys(object)) {
if (keysToOmit.indexOf(key) === -1) {
result[key] = object[key];
}
}
return result;
}

// pkg/dist-src/util/url-template.js
Expand Down Expand Up @@ -27691,7 +27659,7 @@ function requireDistNode$8 () {
}
function expand(template, context) {
var operators = ["+", "#", ".", "/", ";", "?", "&"];
return template.replace(
template = template.replace(
/\{([^\{\}]+)\}|([^\{\}]+)/g,
function(_, expression, literal) {
if (expression) {
Expand Down Expand Up @@ -27721,6 +27689,11 @@ function requireDistNode$8 () {
}
}
);
if (template === "/") {
return template;
} else {
return template.replace(/\/$/, "");
}
}

// pkg/dist-src/parse.js
Expand Down Expand Up @@ -27756,7 +27729,7 @@ function requireDistNode$8 () {
}
if (url.endsWith("/graphql")) {
if (options.mediaType.previews?.length) {
const previewsFromAcceptHeader = headers.accept.match(/[\w-]+(?=-preview)/g) || [];
const previewsFromAcceptHeader = headers.accept.match(/(?<![\w-])[\w-]+(?=-preview)/g) || [];
headers.accept = previewsFromAcceptHeader.concat(options.mediaType.previews).map((preview) => {
const format = options.mediaType.format ? `.${options.mediaType.format}` : "+json";
return `application/vnd.github.${preview}-preview${format}`;
Expand Down Expand Up @@ -28063,10 +28036,22 @@ function requireDistNode$5 () {
var import_universal_user_agent = /*@__PURE__*/ requireDistNode$9();

// pkg/dist-src/version.js
var VERSION = "8.1.4";
var VERSION = "8.4.1";

// pkg/dist-src/is-plain-object.js
function isPlainObject(value) {
if (typeof value !== "object" || value === null)
return false;
if (Object.prototype.toString.call(value) !== "[object Object]")
return false;
const proto = Object.getPrototypeOf(value);
if (proto === null)
return true;
const Ctor = Object.prototype.hasOwnProperty.call(proto, "constructor") && proto.constructor;
return typeof Ctor === "function" && Ctor instanceof Ctor && Function.prototype.call(Ctor) === Function.prototype.call(value);
}

// pkg/dist-src/fetch-wrapper.js
var import_is_plain_object = requireIsPlainObject();
var import_request_error = /*@__PURE__*/ requireDistNode$6();

// pkg/dist-src/get-buffer-response.js
Expand All @@ -28076,10 +28061,10 @@ function requireDistNode$5 () {

// pkg/dist-src/fetch-wrapper.js
function fetchWrapper(requestOptions) {
var _a, _b, _c;
var _a, _b, _c, _d;
const log = requestOptions.request && requestOptions.request.log ? requestOptions.request.log : console;
const parseSuccessResponseBody = ((_a = requestOptions.request) == null ? void 0 : _a.parseSuccessResponseBody) !== false;
if ((0, import_is_plain_object.isPlainObject)(requestOptions.body) || Array.isArray(requestOptions.body)) {
if (isPlainObject(requestOptions.body) || Array.isArray(requestOptions.body)) {
requestOptions.body = JSON.stringify(requestOptions.body);
}
let headers = {};
Expand All @@ -28097,8 +28082,9 @@ function requireDistNode$5 () {
return fetch(requestOptions.url, {
method: requestOptions.method,
body: requestOptions.body,
redirect: (_c = requestOptions.request) == null ? void 0 : _c.redirect,
headers: requestOptions.headers,
signal: (_c = requestOptions.request) == null ? void 0 : _c.signal,
signal: (_d = requestOptions.request) == null ? void 0 : _d.signal,
// duplex must be set if request.body is ReadableStream or Async Iterables.
// See https://fetch.spec.whatwg.org/#dom-requestinit-duplex.
...requestOptions.body && { duplex: "half" }
Expand All @@ -28109,7 +28095,7 @@ function requireDistNode$5 () {
headers[keyAndValue[0]] = keyAndValue[1];
}
if ("deprecation" in headers) {
const matches = headers.link && headers.link.match(/<([^>]+)>; rel="deprecation"/);
const matches = headers.link && headers.link.match(/<([^<>]+)>; rel="deprecation"/);
const deprecationLink = matches && matches.pop();
log.warn(
`[@octokit/request] "${requestOptions.method} ${requestOptions.url}" is deprecated. It is scheduled to be removed on ${headers.sunset}${deprecationLink ? `. See ${deprecationLink}` : ""}`
Expand Down Expand Up @@ -28185,7 +28171,7 @@ function requireDistNode$5 () {
async function getResponseData(response) {
const contentType = response.headers.get("content-type");
if (/application\/json/.test(contentType)) {
return response.json();
return response.json().catch(() => response.text()).catch(() => "");
}
if (!contentType || /^text\/|charset=utf-8$/.test(contentType)) {
return response.text();
Expand All @@ -28195,11 +28181,17 @@ function requireDistNode$5 () {
function toErrorMessage(data) {
if (typeof data === "string")
return data;
let suffix;
if ("documentation_url" in data) {
suffix = ` - ${data.documentation_url}`;
} else {
suffix = "";
}
if ("message" in data) {
if (Array.isArray(data.errors)) {
return `${data.message}: ${data.errors.map(JSON.stringify).join(", ")}`;
return `${data.message}: ${data.errors.map(JSON.stringify).join(", ")}${suffix}`;
}
return data.message;
return `${data.message}${suffix}`;
}
return `Unknown error: ${JSON.stringify(data)}`;
}
Expand Down
Loading