Update distributables

This commit is contained in:
James M. Greene
2023-06-15 15:14:49 -05:00
parent b4d15f6490
commit c7b5c1034e
2 changed files with 58 additions and 33 deletions

89
dist/index.js generated vendored
View File

@@ -4093,28 +4093,51 @@ exports.restEndpointMethods = restEndpointMethods;
/***/ }), /***/ }),
/***/ 537: /***/ 537:
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
"use strict"; "use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
Object.defineProperty(exports, "__esModule", ({ value: true })); // pkg/dist-src/index.js
var dist_src_exports = {};
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } __export(dist_src_exports, {
RequestError: () => RequestError
var deprecation = __nccwpck_require__(8932); });
var once = _interopDefault(__nccwpck_require__(1223)); module.exports = __toCommonJS(dist_src_exports);
var import_deprecation = __nccwpck_require__(8932);
const logOnceCode = once(deprecation => console.warn(deprecation)); var import_once = __toESM(__nccwpck_require__(1223));
const logOnceHeaders = once(deprecation => console.warn(deprecation)); var logOnceCode = (0, import_once.default)((deprecation) => console.warn(deprecation));
/** var logOnceHeaders = (0, import_once.default)((deprecation) => console.warn(deprecation));
* Error with extra properties to help with debugging var RequestError = class extends Error {
*/
class RequestError extends Error {
constructor(message, statusCode, options) { constructor(message, statusCode, options) {
super(message); super(message);
// Maintains proper stack trace (only available on V8)
/* istanbul ignore next */
if (Error.captureStackTrace) { if (Error.captureStackTrace) {
Error.captureStackTrace(this, this.constructor); Error.captureStackTrace(this, this.constructor);
} }
@@ -4128,39 +4151,41 @@ class RequestError extends Error {
this.response = options.response; this.response = options.response;
headers = options.response.headers; headers = options.response.headers;
} }
// redact request credentials without mutating original request options
const requestCopy = Object.assign({}, options.request); const requestCopy = Object.assign({}, options.request);
if (options.request.headers.authorization) { if (options.request.headers.authorization) {
requestCopy.headers = Object.assign({}, options.request.headers, { requestCopy.headers = Object.assign({}, options.request.headers, {
authorization: options.request.headers.authorization.replace(/ .*$/, " [REDACTED]") authorization: options.request.headers.authorization.replace(
/ .*$/,
" [REDACTED]"
)
}); });
} }
requestCopy.url = requestCopy.url requestCopy.url = requestCopy.url.replace(/\bclient_secret=\w+/g, "client_secret=[REDACTED]").replace(/\baccess_token=\w+/g, "access_token=[REDACTED]");
// client_id & client_secret can be passed as URL query parameters to increase rate limit
// see https://developer.github.com/v3/#increasing-the-unauthenticated-rate-limit-for-oauth-applications
.replace(/\bclient_secret=\w+/g, "client_secret=[REDACTED]")
// OAuth tokens can be passed as URL query parameters, although it is not recommended
// see https://developer.github.com/v3/#oauth2-token-sent-in-a-header
.replace(/\baccess_token=\w+/g, "access_token=[REDACTED]");
this.request = requestCopy; this.request = requestCopy;
// deprecations
Object.defineProperty(this, "code", { Object.defineProperty(this, "code", {
get() { get() {
logOnceCode(new deprecation.Deprecation("[@octokit/request-error] `error.code` is deprecated, use `error.status`.")); logOnceCode(
new import_deprecation.Deprecation(
"[@octokit/request-error] `error.code` is deprecated, use `error.status`."
)
);
return statusCode; return statusCode;
} }
}); });
Object.defineProperty(this, "headers", { Object.defineProperty(this, "headers", {
get() { get() {
logOnceHeaders(new deprecation.Deprecation("[@octokit/request-error] `error.headers` is deprecated, use `error.response.headers`.")); logOnceHeaders(
new import_deprecation.Deprecation(
"[@octokit/request-error] `error.headers` is deprecated, use `error.response.headers`."
)
);
return headers || {}; return headers || {};
} }
}); });
} }
} };
// Annotate the CommonJS export names for ESM import in node:
exports.RequestError = RequestError; 0 && (0);
//# sourceMappingURL=index.js.map
/***/ }), /***/ }),

2
dist/index.js.map generated vendored

File diff suppressed because one or more lines are too long