1 Commits
v2 ... v1.0.2

Author SHA1 Message Date
Trent Jones
27fa13ebc8 new build 2020-05-28 11:25:42 -05:00

488
dist/index.js vendored
View File

@@ -704,12 +704,7 @@ function getPromiseCtor(promiseCtor) {
//# sourceMappingURL=Observable.js.map //# sourceMappingURL=Observable.js.map
/***/ }), /***/ }),
/* 34 */ /* 34 */,
/***/ (function(module) {
module.exports = require("https");
/***/ }),
/* 35 */, /* 35 */,
/* 36 */, /* 36 */,
/* 37 */, /* 37 */,
@@ -921,7 +916,7 @@ var skip_1 = __webpack_require__(230);
exports.skip = skip_1.skip; exports.skip = skip_1.skip;
var skipLast_1 = __webpack_require__(744); var skipLast_1 = __webpack_require__(744);
exports.skipLast = skipLast_1.skipLast; exports.skipLast = skipLast_1.skipLast;
var skipUntil_1 = __webpack_require__(497); var skipUntil_1 = __webpack_require__(120);
exports.skipUntil = skipUntil_1.skipUntil; exports.skipUntil = skipUntil_1.skipUntil;
var skipWhile_1 = __webpack_require__(101); var skipWhile_1 = __webpack_require__(101);
exports.skipWhile = skipWhile_1.skipWhile; exports.skipWhile = skipWhile_1.skipWhile;
@@ -2520,13 +2515,21 @@ const windowsRelease = release => {
const ver = (version || [])[0]; const ver = (version || [])[0];
// Server 2008, 2012 and 2016 versions are ambiguous with desktop versions and must be detected at runtime. // Server 2008, 2012, 2016, and 2019 versions are ambiguous with desktop versions and must be detected at runtime.
// If `release` is omitted or we're on a Windows system, and the version number is an ambiguous version // If `release` is omitted or we're on a Windows system, and the version number is an ambiguous version
// then use `wmic` to get the OS caption: https://msdn.microsoft.com/en-us/library/aa394531(v=vs.85).aspx // then use `wmic` to get the OS caption: https://msdn.microsoft.com/en-us/library/aa394531(v=vs.85).aspx
// If the resulting caption contains the year 2008, 2012 or 2016, it is a server version, so return a server OS name. // If `wmic` is obsoloete (later versions of Windows 10), use PowerShell instead.
// If the resulting caption contains the year 2008, 2012, 2016 or 2019, it is a server version, so return a server OS name.
if ((!release || release === os.release()) && ['6.1', '6.2', '6.3', '10.0'].includes(ver)) { if ((!release || release === os.release()) && ['6.1', '6.2', '6.3', '10.0'].includes(ver)) {
const stdout = execa.sync('wmic', ['os', 'get', 'Caption']).stdout || ''; let stdout;
const year = (stdout.match(/2008|2012|2016/) || [])[0]; try {
stdout = execa.sync('powershell', ['(Get-CimInstance -ClassName Win32_OperatingSystem).caption']).stdout || '';
} catch (_) {
stdout = execa.sync('wmic', ['os', 'get', 'Caption']).stdout || '';
}
const year = (stdout.match(/2008|2012|2016|2019/) || [])[0];
if (year) { if (year) {
return `Server ${year}`; return `Server ${year}`;
} }
@@ -3801,7 +3804,74 @@ module.exports.default = macosRelease;
/***/ }), /***/ }),
/* 119 */, /* 119 */,
/* 120 */, /* 120 */
/***/ (function(__unusedmodule, exports, __webpack_require__) {
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
}
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
var OuterSubscriber_1 = __webpack_require__(565);
var InnerSubscriber_1 = __webpack_require__(668);
var subscribeToResult_1 = __webpack_require__(591);
function skipUntil(notifier) {
return function (source) { return source.lift(new SkipUntilOperator(notifier)); };
}
exports.skipUntil = skipUntil;
var SkipUntilOperator = (function () {
function SkipUntilOperator(notifier) {
this.notifier = notifier;
}
SkipUntilOperator.prototype.call = function (destination, source) {
return source.subscribe(new SkipUntilSubscriber(destination, this.notifier));
};
return SkipUntilOperator;
}());
var SkipUntilSubscriber = (function (_super) {
__extends(SkipUntilSubscriber, _super);
function SkipUntilSubscriber(destination, notifier) {
var _this = _super.call(this, destination) || this;
_this.hasValue = false;
var innerSubscriber = new InnerSubscriber_1.InnerSubscriber(_this, undefined, undefined);
_this.add(innerSubscriber);
_this.innerSubscription = innerSubscriber;
var innerSubscription = subscribeToResult_1.subscribeToResult(_this, notifier, undefined, undefined, innerSubscriber);
if (innerSubscription !== innerSubscriber) {
_this.add(innerSubscription);
_this.innerSubscription = innerSubscription;
}
return _this;
}
SkipUntilSubscriber.prototype._next = function (value) {
if (this.hasValue) {
_super.prototype._next.call(this, value);
}
};
SkipUntilSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
this.hasValue = true;
if (this.innerSubscription) {
this.innerSubscription.unsubscribe();
}
};
SkipUntilSubscriber.prototype.notifyComplete = function () {
};
return SkipUntilSubscriber;
}(OuterSubscriber_1.OuterSubscriber));
//# sourceMappingURL=skipUntil.js.map
/***/ }),
/* 121 */, /* 121 */,
/* 122 */, /* 122 */,
/* 123 */, /* 123 */,
@@ -4829,7 +4899,7 @@ var EverySubscriber = (function (_super) {
var net = __webpack_require__(631); var net = __webpack_require__(631);
var tls = __webpack_require__(16); var tls = __webpack_require__(16);
var http = __webpack_require__(605); var http = __webpack_require__(605);
var https = __webpack_require__(34); var https = __webpack_require__(211);
var events = __webpack_require__(614); var events = __webpack_require__(614);
var assert = __webpack_require__(357); var assert = __webpack_require__(357);
var util = __webpack_require__(669); var util = __webpack_require__(669);
@@ -6225,32 +6295,9 @@ exports.toArray = toArray;
/* 209 */, /* 209 */,
/* 210 */, /* 210 */,
/* 211 */ /* 211 */
/***/ (function(__unusedmodule, exports, __webpack_require__) { /***/ (function(module) {
"use strict";
Object.defineProperty(exports, '__esModule', { value: true });
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
var osName = _interopDefault(__webpack_require__(2));
function getUserAgent() {
try {
return `Node.js/${process.version.substr(1)} (${osName()}; ${process.arch})`;
} catch (error) {
if (/wmic os get Caption/.test(error.message)) {
return "Windows <version undetectable>";
}
return "<environment undetectable>";
}
}
exports.getUserAgent = getUserAgent;
//# sourceMappingURL=index.js.map
module.exports = require("https");
/***/ }), /***/ }),
/* 212 */, /* 212 */,
@@ -6437,8 +6484,8 @@ exports.QueueAction = QueueAction;
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
const rxjs_1 = __webpack_require__(931); const rxjs_1 = __webpack_require__(931);
const graphql_1 = __webpack_require__(898);
const operators_1 = __webpack_require__(43); const operators_1 = __webpack_require__(43);
const graphql_1 = __webpack_require__(767);
const mutation = ` const mutation = `
mutation deletePackageVersion($packageVersionId: String!) { mutation deletePackageVersion($packageVersionId: String!) {
deletePackageVersion(input: {packageVersionId: $packageVersionId}) { deletePackageVersion(input: {packageVersionId: $packageVersionId}) {
@@ -6446,10 +6493,9 @@ const mutation = `
} }
}`; }`;
function deletePackageVersion(packageVersionId, token) { function deletePackageVersion(packageVersionId, token) {
return rxjs_1.from(graphql_1.graphql(mutation, { return rxjs_1.from(graphql_1.graphql(token, mutation, {
packageVersionId, packageVersionId,
headers: { headers: {
authorization: `token ${token}`,
Accept: 'application/vnd.github.package-deletes-preview+json' Accept: 'application/vnd.github.package-deletes-preview+json'
} }
})).pipe(operators_1.catchError((err) => { })).pipe(operators_1.catchError((err) => {
@@ -7500,7 +7546,7 @@ var AuditSubscriber = (function (_super) {
module.exports = authenticationRequestError; module.exports = authenticationRequestError;
const { RequestError } = __webpack_require__(463); const { RequestError } = __webpack_require__(497);
function authenticationRequestError(state, error, options) { function authenticationRequestError(state, error, options) {
if (!error.headers) throw error; if (!error.headers) throw error;
@@ -7568,7 +7614,7 @@ function authenticationRequestError(state, error, options) {
module.exports = parseOptions; module.exports = parseOptions;
const { Deprecation } = __webpack_require__(692); const { Deprecation } = __webpack_require__(692);
const { getUserAgent } = __webpack_require__(796); const { getUserAgent } = __webpack_require__(619);
const once = __webpack_require__(969); const once = __webpack_require__(969);
const pkg = __webpack_require__(215); const pkg = __webpack_require__(215);
@@ -8485,7 +8531,7 @@ exports.Notification = Notification;
module.exports = validate; module.exports = validate;
const { RequestError } = __webpack_require__(463); const { RequestError } = __webpack_require__(497);
const get = __webpack_require__(854); const get = __webpack_require__(854);
const set = __webpack_require__(883); const set = __webpack_require__(883);
@@ -8640,7 +8686,7 @@ function validate(octokit, options) {
module.exports = authenticationRequestError; module.exports = authenticationRequestError;
const { RequestError } = __webpack_require__(463); const { RequestError } = __webpack_require__(497);
function authenticationRequestError(state, error, options) { function authenticationRequestError(state, error, options) {
/* istanbul ignore next */ /* istanbul ignore next */
@@ -8816,7 +8862,7 @@ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'defau
var Stream = _interopDefault(__webpack_require__(413)); var Stream = _interopDefault(__webpack_require__(413));
var http = _interopDefault(__webpack_require__(605)); var http = _interopDefault(__webpack_require__(605));
var Url = _interopDefault(__webpack_require__(835)); var Url = _interopDefault(__webpack_require__(835));
var https = _interopDefault(__webpack_require__(34)); var https = _interopDefault(__webpack_require__(211));
var zlib = _interopDefault(__webpack_require__(761)); var zlib = _interopDefault(__webpack_require__(761));
// Based on https://github.com/tmpvar/jsdom/blob/aa85b2abf07766ff7bf5c1f6daafb3726f2f2db5/lib/jsdom/living/blob.js // Based on https://github.com/tmpvar/jsdom/blob/aa85b2abf07766ff7bf5c1f6daafb3726f2f2db5/lib/jsdom/living/blob.js
@@ -10739,7 +10785,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
var isPlainObject = _interopDefault(__webpack_require__(626)); var isPlainObject = _interopDefault(__webpack_require__(626));
var universalUserAgent = __webpack_require__(562); var universalUserAgent = __webpack_require__(796);
function lowercaseKeys(object) { function lowercaseKeys(object) {
if (!object) { if (!object) {
@@ -11089,7 +11135,7 @@ function withDefaults(oldDefaults, newDefaults) {
}); });
} }
const VERSION = "5.5.3"; const VERSION = "6.0.1";
const userAgent = `octokit-endpoint.js/${VERSION} ${universalUserAgent.getUserAgent()}`; // DEFAULTS has all properties set that EndpointOptions has, except url. const userAgent = `octokit-endpoint.js/${VERSION} ${universalUserAgent.getUserAgent()}`; // DEFAULTS has all properties set that EndpointOptions has, except url.
// So we use RequestParameters and add method as additional required property. // So we use RequestParameters and add method as additional required property.
@@ -12733,13 +12779,15 @@ class GitHub extends rest_1.Octokit {
static getOctokitOptions(args) { static getOctokitOptions(args) {
const token = args[0]; const token = args[0];
const options = Object.assign({}, args[1]); // Shallow clone - don't mutate the object provided by the caller const options = Object.assign({}, args[1]); // Shallow clone - don't mutate the object provided by the caller
// Base URL - GHES or Dotcom
options.baseUrl = options.baseUrl || this.getApiBaseUrl();
// Auth // Auth
const auth = GitHub.getAuthString(token, options); const auth = GitHub.getAuthString(token, options);
if (auth) { if (auth) {
options.auth = auth; options.auth = auth;
} }
// Proxy // Proxy
const agent = GitHub.getProxyAgent(options); const agent = GitHub.getProxyAgent(options.baseUrl, options);
if (agent) { if (agent) {
// Shallow clone - don't mutate the object provided by the caller // Shallow clone - don't mutate the object provided by the caller
options.request = options.request ? Object.assign({}, options.request) : {}; options.request = options.request ? Object.assign({}, options.request) : {};
@@ -12750,6 +12798,7 @@ class GitHub extends rest_1.Octokit {
} }
static getGraphQL(args) { static getGraphQL(args) {
const defaults = {}; const defaults = {};
defaults.baseUrl = this.getGraphQLBaseUrl();
const token = args[0]; const token = args[0];
const options = args[1]; const options = args[1];
// Authorization // Authorization
@@ -12760,7 +12809,7 @@ class GitHub extends rest_1.Octokit {
}; };
} }
// Proxy // Proxy
const agent = GitHub.getProxyAgent(options); const agent = GitHub.getProxyAgent(defaults.baseUrl, options);
if (agent) { if (agent) {
defaults.request = { agent }; defaults.request = { agent };
} }
@@ -12776,17 +12825,31 @@ class GitHub extends rest_1.Octokit {
} }
return typeof options.auth === 'string' ? options.auth : `token ${token}`; return typeof options.auth === 'string' ? options.auth : `token ${token}`;
} }
static getProxyAgent(options) { static getProxyAgent(destinationUrl, options) {
var _a; var _a;
if (!((_a = options.request) === null || _a === void 0 ? void 0 : _a.agent)) { if (!((_a = options.request) === null || _a === void 0 ? void 0 : _a.agent)) {
const serverUrl = 'https://api.github.com'; if (httpClient.getProxyUrl(destinationUrl)) {
if (httpClient.getProxyUrl(serverUrl)) {
const hc = new httpClient.HttpClient(); const hc = new httpClient.HttpClient();
return hc.getAgent(serverUrl); return hc.getAgent(destinationUrl);
} }
} }
return undefined; return undefined;
} }
static getApiBaseUrl() {
return process.env['GITHUB_API_URL'] || 'https://api.github.com';
}
static getGraphQLBaseUrl() {
let url = process.env['GITHUB_GRAPHQL_URL'] || 'https://api.github.com/graphql';
// Shouldn't be a trailing slash, but remove if so
if (url.endsWith('/')) {
url = url.substr(0, url.length - 1);
}
// Remove trailing "/graphql"
if (url.toUpperCase().endsWith('/GRAPHQL')) {
url = url.substr(0, url.length - '/graphql'.length);
}
return url;
}
} }
exports.GitHub = GitHub; exports.GitHub = GitHub;
//# sourceMappingURL=github.js.map //# sourceMappingURL=github.js.map
@@ -13299,67 +13362,61 @@ exports.isArray = (function () { return Array.isArray || (function (x) { return
"use strict"; "use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) { Object.defineProperty(exports, '__esModule', { value: true });
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b); var deprecation = __webpack_require__(692);
var once = _interopDefault(__webpack_require__(969));
const logOnce = once(deprecation => console.warn(deprecation));
/**
* Error with extra properties to help with debugging
*/
class RequestError extends Error {
constructor(message, statusCode, options) {
super(message); // Maintains proper stack trace (only available on V8)
/* istanbul ignore next */
if (Error.captureStackTrace) {
Error.captureStackTrace(this, this.constructor);
} }
return function (d, b) {
extendStatics(d, b); this.name = "HttpError";
function __() { this.constructor = d; } this.status = statusCode;
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); Object.defineProperty(this, "code", {
}; get() {
})(); logOnce(new deprecation.Deprecation("[@octokit/request-error] `error.code` is deprecated, use `error.status`."));
Object.defineProperty(exports, "__esModule", { value: true }); return statusCode;
var OuterSubscriber_1 = __webpack_require__(565); }
var InnerSubscriber_1 = __webpack_require__(668);
var subscribeToResult_1 = __webpack_require__(591); });
function skipUntil(notifier) { this.headers = options.headers || {}; // redact request credentials without mutating original request options
return function (source) { return source.lift(new SkipUntilOperator(notifier)); };
const requestCopy = Object.assign({}, options.request);
if (options.request.headers.authorization) {
requestCopy.headers = Object.assign({}, options.request.headers, {
authorization: options.request.headers.authorization.replace(/ .*$/, " [REDACTED]")
});
}
requestCopy.url = requestCopy.url // 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;
}
} }
exports.skipUntil = skipUntil;
var SkipUntilOperator = (function () { exports.RequestError = RequestError;
function SkipUntilOperator(notifier) { //# sourceMappingURL=index.js.map
this.notifier = notifier;
}
SkipUntilOperator.prototype.call = function (destination, source) {
return source.subscribe(new SkipUntilSubscriber(destination, this.notifier));
};
return SkipUntilOperator;
}());
var SkipUntilSubscriber = (function (_super) {
__extends(SkipUntilSubscriber, _super);
function SkipUntilSubscriber(destination, notifier) {
var _this = _super.call(this, destination) || this;
_this.hasValue = false;
var innerSubscriber = new InnerSubscriber_1.InnerSubscriber(_this, undefined, undefined);
_this.add(innerSubscriber);
_this.innerSubscription = innerSubscriber;
var innerSubscription = subscribeToResult_1.subscribeToResult(_this, notifier, undefined, undefined, innerSubscriber);
if (innerSubscription !== innerSubscriber) {
_this.add(innerSubscription);
_this.innerSubscription = innerSubscription;
}
return _this;
}
SkipUntilSubscriber.prototype._next = function (value) {
if (this.hasValue) {
_super.prototype._next.call(this, value);
}
};
SkipUntilSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
this.hasValue = true;
if (this.innerSubscription) {
this.innerSubscription.unsubscribe();
}
};
SkipUntilSubscriber.prototype.notifyComplete = function () {
};
return SkipUntilSubscriber;
}(OuterSubscriber_1.OuterSubscriber));
//# sourceMappingURL=skipUntil.js.map
/***/ }), /***/ }),
/* 498 */, /* 498 */,
@@ -14129,7 +14186,7 @@ exports.publishReplay = publishReplay;
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
const url = __webpack_require__(835); const url = __webpack_require__(835);
const http = __webpack_require__(605); const http = __webpack_require__(605);
const https = __webpack_require__(34); const https = __webpack_require__(211);
const pm = __webpack_require__(950); const pm = __webpack_require__(950);
let tunnel; let tunnel;
var HttpCodes; var HttpCodes;
@@ -14155,6 +14212,7 @@ var HttpCodes;
HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout"; HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout";
HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict"; HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict";
HttpCodes[HttpCodes["Gone"] = 410] = "Gone"; HttpCodes[HttpCodes["Gone"] = 410] = "Gone";
HttpCodes[HttpCodes["TooManyRequests"] = 429] = "TooManyRequests";
HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError"; HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError";
HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented"; HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented";
HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway"; HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway";
@@ -14179,8 +14237,18 @@ function getProxyUrl(serverUrl) {
return proxyUrl ? proxyUrl.href : ''; return proxyUrl ? proxyUrl.href : '';
} }
exports.getProxyUrl = getProxyUrl; exports.getProxyUrl = getProxyUrl;
const HttpRedirectCodes = [HttpCodes.MovedPermanently, HttpCodes.ResourceMoved, HttpCodes.SeeOther, HttpCodes.TemporaryRedirect, HttpCodes.PermanentRedirect]; const HttpRedirectCodes = [
const HttpResponseRetryCodes = [HttpCodes.BadGateway, HttpCodes.ServiceUnavailable, HttpCodes.GatewayTimeout]; HttpCodes.MovedPermanently,
HttpCodes.ResourceMoved,
HttpCodes.SeeOther,
HttpCodes.TemporaryRedirect,
HttpCodes.PermanentRedirect
];
const HttpResponseRetryCodes = [
HttpCodes.BadGateway,
HttpCodes.ServiceUnavailable,
HttpCodes.GatewayTimeout
];
const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD']; const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];
const ExponentialBackoffCeiling = 10; const ExponentialBackoffCeiling = 10;
const ExponentialBackoffTimeSlice = 5; const ExponentialBackoffTimeSlice = 5;
@@ -14305,18 +14373,22 @@ class HttpClient {
*/ */
async request(verb, requestUrl, data, headers) { async request(verb, requestUrl, data, headers) {
if (this._disposed) { if (this._disposed) {
throw new Error("Client has already been disposed."); throw new Error('Client has already been disposed.');
} }
let parsedUrl = url.parse(requestUrl); let parsedUrl = url.parse(requestUrl);
let info = this._prepareRequest(verb, parsedUrl, headers); let info = this._prepareRequest(verb, parsedUrl, headers);
// Only perform retries on reads since writes may not be idempotent. // Only perform retries on reads since writes may not be idempotent.
let maxTries = (this._allowRetries && RetryableHttpVerbs.indexOf(verb) != -1) ? this._maxRetries + 1 : 1; let maxTries = this._allowRetries && RetryableHttpVerbs.indexOf(verb) != -1
? this._maxRetries + 1
: 1;
let numTries = 0; let numTries = 0;
let response; let response;
while (numTries < maxTries) { while (numTries < maxTries) {
response = await this.requestRaw(info, data); response = await this.requestRaw(info, data);
// Check if it's an authentication challenge // Check if it's an authentication challenge
if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) { if (response &&
response.message &&
response.message.statusCode === HttpCodes.Unauthorized) {
let authenticationHandler; let authenticationHandler;
for (let i = 0; i < this.handlers.length; i++) { for (let i = 0; i < this.handlers.length; i++) {
if (this.handlers[i].canHandleAuthentication(response)) { if (this.handlers[i].canHandleAuthentication(response)) {
@@ -14334,21 +14406,32 @@ class HttpClient {
} }
} }
let redirectsRemaining = this._maxRedirects; let redirectsRemaining = this._maxRedirects;
while (HttpRedirectCodes.indexOf(response.message.statusCode) != -1 while (HttpRedirectCodes.indexOf(response.message.statusCode) != -1 &&
&& this._allowRedirects this._allowRedirects &&
&& redirectsRemaining > 0) { redirectsRemaining > 0) {
const redirectUrl = response.message.headers["location"]; const redirectUrl = response.message.headers['location'];
if (!redirectUrl) { if (!redirectUrl) {
// if there's no location to redirect to, we won't // if there's no location to redirect to, we won't
break; break;
} }
let parsedRedirectUrl = url.parse(redirectUrl); let parsedRedirectUrl = url.parse(redirectUrl);
if (parsedUrl.protocol == 'https:' && parsedUrl.protocol != parsedRedirectUrl.protocol && !this._allowRedirectDowngrade) { if (parsedUrl.protocol == 'https:' &&
throw new Error("Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true."); parsedUrl.protocol != parsedRedirectUrl.protocol &&
!this._allowRedirectDowngrade) {
throw new Error('Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true.');
} }
// we need to finish reading the response before reassigning response // we need to finish reading the response before reassigning response
// which will leak the open socket. // which will leak the open socket.
await response.readBody(); await response.readBody();
// strip authorization header if redirected to a different hostname
if (parsedRedirectUrl.hostname !== parsedUrl.hostname) {
for (let header in headers) {
// header names are case insensitive
if (header.toLowerCase() === 'authorization') {
delete headers[header];
}
}
}
// let's make the request with the new redirectUrl // let's make the request with the new redirectUrl
info = this._prepareRequest(verb, parsedRedirectUrl, headers); info = this._prepareRequest(verb, parsedRedirectUrl, headers);
response = await this.requestRaw(info, data); response = await this.requestRaw(info, data);
@@ -14399,8 +14482,8 @@ class HttpClient {
*/ */
requestRawWithCallback(info, data, onResult) { requestRawWithCallback(info, data, onResult) {
let socket; let socket;
if (typeof (data) === 'string') { if (typeof data === 'string') {
info.options.headers["Content-Length"] = Buffer.byteLength(data, 'utf8'); info.options.headers['Content-Length'] = Buffer.byteLength(data, 'utf8');
} }
let callbackCalled = false; let callbackCalled = false;
let handleResult = (err, res) => { let handleResult = (err, res) => {
@@ -14413,7 +14496,7 @@ class HttpClient {
let res = new HttpClientResponse(msg); let res = new HttpClientResponse(msg);
handleResult(null, res); handleResult(null, res);
}); });
req.on('socket', (sock) => { req.on('socket', sock => {
socket = sock; socket = sock;
}); });
// If we ever get disconnected, we want the socket to timeout eventually // If we ever get disconnected, we want the socket to timeout eventually
@@ -14428,10 +14511,10 @@ class HttpClient {
// res should have headers // res should have headers
handleResult(err, null); handleResult(err, null);
}); });
if (data && typeof (data) === 'string') { if (data && typeof data === 'string') {
req.write(data, 'utf8'); req.write(data, 'utf8');
} }
if (data && typeof (data) !== 'string') { if (data && typeof data !== 'string') {
data.on('close', function () { data.on('close', function () {
req.end(); req.end();
}); });
@@ -14458,31 +14541,34 @@ class HttpClient {
const defaultPort = usingSsl ? 443 : 80; const defaultPort = usingSsl ? 443 : 80;
info.options = {}; info.options = {};
info.options.host = info.parsedUrl.hostname; info.options.host = info.parsedUrl.hostname;
info.options.port = info.parsedUrl.port ? parseInt(info.parsedUrl.port) : defaultPort; info.options.port = info.parsedUrl.port
info.options.path = (info.parsedUrl.pathname || '') + (info.parsedUrl.search || ''); ? parseInt(info.parsedUrl.port)
: defaultPort;
info.options.path =
(info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');
info.options.method = method; info.options.method = method;
info.options.headers = this._mergeHeaders(headers); info.options.headers = this._mergeHeaders(headers);
if (this.userAgent != null) { if (this.userAgent != null) {
info.options.headers["user-agent"] = this.userAgent; info.options.headers['user-agent'] = this.userAgent;
} }
info.options.agent = this._getAgent(info.parsedUrl); info.options.agent = this._getAgent(info.parsedUrl);
// gives handlers an opportunity to participate // gives handlers an opportunity to participate
if (this.handlers) { if (this.handlers) {
this.handlers.forEach((handler) => { this.handlers.forEach(handler => {
handler.prepareRequest(info.options); handler.prepareRequest(info.options);
}); });
} }
return info; return info;
} }
_mergeHeaders(headers) { _mergeHeaders(headers) {
const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {}); const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {});
if (this.requestOptions && this.requestOptions.headers) { if (this.requestOptions && this.requestOptions.headers) {
return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers)); return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers));
} }
return lowercaseKeys(headers || {}); return lowercaseKeys(headers || {});
} }
_getExistingOrDefaultHeader(additionalHeaders, header, _default) { _getExistingOrDefaultHeader(additionalHeaders, header, _default) {
const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {}); const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {});
let clientHeader; let clientHeader;
if (this.requestOptions && this.requestOptions.headers) { if (this.requestOptions && this.requestOptions.headers) {
clientHeader = lowercaseKeys(this.requestOptions.headers)[header]; clientHeader = lowercaseKeys(this.requestOptions.headers)[header];
@@ -14520,7 +14606,7 @@ class HttpClient {
proxyAuth: proxyUrl.auth, proxyAuth: proxyUrl.auth,
host: proxyUrl.hostname, host: proxyUrl.hostname,
port: proxyUrl.port port: proxyUrl.port
}, }
}; };
let tunnelAgent; let tunnelAgent;
const overHttps = proxyUrl.protocol === 'https:'; const overHttps = proxyUrl.protocol === 'https:';
@@ -14547,7 +14633,9 @@ class HttpClient {
// we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process
// http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options
// we have to cast it to any and change it directly // we have to cast it to any and change it directly
agent.options = Object.assign(agent.options || {}, { rejectUnauthorized: false }); agent.options = Object.assign(agent.options || {}, {
rejectUnauthorized: false
});
} }
return agent; return agent;
} }
@@ -14608,7 +14696,7 @@ class HttpClient {
msg = contents; msg = contents;
} }
else { else {
msg = "Failed request: (" + statusCode + ")"; msg = 'Failed request: (' + statusCode + ')';
} }
let err = new Error(msg); let err = new Error(msg);
// attach statusCode and body obj (if available) to the error object // attach statusCode and body obj (if available) to the error object
@@ -15115,35 +15203,7 @@ function defaultErrorFactory() {
/***/ }), /***/ }),
/* 560 */, /* 560 */,
/* 561 */, /* 561 */,
/* 562 */ /* 562 */,
/***/ (function(__unusedmodule, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, '__esModule', { value: true });
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
var osName = _interopDefault(__webpack_require__(2));
function getUserAgent() {
try {
return `Node.js/${process.version.substr(1)} (${osName()}; ${process.arch})`;
} catch (error) {
if (/wmic os get Caption/.test(error.message)) {
return "Windows <version undetectable>";
}
return "<environment undetectable>";
}
}
exports.getUserAgent = getUserAgent;
//# sourceMappingURL=index.js.map
/***/ }),
/* 563 */ /* 563 */
/***/ (function(module, __unusedexports, __webpack_require__) { /***/ (function(module, __unusedexports, __webpack_require__) {
@@ -16100,9 +16160,9 @@ exports.zip = zip;
"use strict"; "use strict";
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
const graphql_1 = __webpack_require__(898);
const rxjs_1 = __webpack_require__(931); const rxjs_1 = __webpack_require__(931);
const operators_1 = __webpack_require__(43); const operators_1 = __webpack_require__(43);
const graphql_1 = __webpack_require__(767);
const query = ` const query = `
query getVersions($owner: String!, $repo: String!, $package: String!, $last: Int!) { query getVersions($owner: String!, $repo: String!, $package: String!, $last: Int!) {
repository(owner: $owner, name: $repo) { repository(owner: $owner, name: $repo) {
@@ -16124,13 +16184,12 @@ const query = `
} }
}`; }`;
function queryForOldestVersions(owner, repo, packageName, numVersions, token) { function queryForOldestVersions(owner, repo, packageName, numVersions, token) {
return rxjs_1.from(graphql_1.graphql(query, { return rxjs_1.from(graphql_1.graphql(token, query, {
owner, owner,
repo, repo,
package: packageName, package: packageName,
last: numVersions, last: numVersions,
headers: { headers: {
authorization: `token ${token}`,
Accept: 'application/vnd.github.packages-preview+json' Accept: 'application/vnd.github.packages-preview+json'
} }
})).pipe(operators_1.catchError((err) => { })).pipe(operators_1.catchError((err) => {
@@ -16394,7 +16453,35 @@ exports.EmptyError = EmptyErrorImpl;
//# sourceMappingURL=EmptyError.js.map //# sourceMappingURL=EmptyError.js.map
/***/ }), /***/ }),
/* 619 */, /* 619 */
/***/ (function(__unusedmodule, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, '__esModule', { value: true });
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
var osName = _interopDefault(__webpack_require__(2));
function getUserAgent() {
try {
return `Node.js/${process.version.substr(1)} (${osName()}; ${process.arch})`;
} catch (error) {
if (/wmic os get Caption/.test(error.message)) {
return "Windows <version undetectable>";
}
throw error;
}
}
exports.getUserAgent = getUserAgent;
//# sourceMappingURL=index.js.map
/***/ }),
/* 620 */ /* 620 */
/***/ (function(__unusedmodule, exports, __webpack_require__) { /***/ (function(__unusedmodule, exports, __webpack_require__) {
@@ -18341,12 +18428,12 @@ Object.defineProperty(exports, '__esModule', { value: true });
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
var endpoint = __webpack_require__(385); var endpoint = __webpack_require__(385);
var universalUserAgent = __webpack_require__(211); var universalUserAgent = __webpack_require__(796);
var isPlainObject = _interopDefault(__webpack_require__(548)); var isPlainObject = _interopDefault(__webpack_require__(548));
var nodeFetch = _interopDefault(__webpack_require__(369)); var nodeFetch = _interopDefault(__webpack_require__(369));
var requestError = __webpack_require__(463); var requestError = __webpack_require__(463);
const VERSION = "5.3.2"; const VERSION = "5.4.2";
function getBufferResponse(response) { function getBufferResponse(response) {
return response.arrayBuffer(); return response.arrayBuffer();
@@ -18646,7 +18733,39 @@ exports.AsapScheduler = AsapScheduler;
//# sourceMappingURL=AsapScheduler.js.map //# sourceMappingURL=AsapScheduler.js.map
/***/ }), /***/ }),
/* 767 */, /* 767 */
/***/ (function(__unusedmodule, exports, __webpack_require__) {
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
const github_1 = __webpack_require__(469);
/**
* Sends a GraphQL query request based on endpoint options
*
* @param {string} token Auth token
* @param {string} query GraphQL query. Example: `'query { viewer { login } }'`.
* @param {object} parameters URL, query or body parameters, as well as `headers`, `mediaType.{format|previews}`, `request`, or `baseUrl`.
*/
function graphql(token, query, parameters) {
return __awaiter(this, void 0, void 0, function* () {
const github = new github_1.GitHub(token);
return yield github.graphql(query, parameters);
});
}
exports.graphql = graphql;
/***/ }),
/* 768 */ /* 768 */
/***/ (function(module) { /***/ (function(module) {
@@ -18993,7 +19112,7 @@ function getUserAgent() {
return "Windows <version undetectable>"; return "Windows <version undetectable>";
} }
throw error; return "<environment undetectable>";
} }
} }
@@ -35615,7 +35734,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
var request = __webpack_require__(753); var request = __webpack_require__(753);
var universalUserAgent = __webpack_require__(796); var universalUserAgent = __webpack_require__(796);
const VERSION = "4.3.1"; const VERSION = "4.4.0";
class GraphqlError extends Error { class GraphqlError extends Error {
constructor(request, response) { constructor(request, response) {
@@ -35634,7 +35753,7 @@ class GraphqlError extends Error {
} }
const NON_VARIABLE_OPTIONS = ["method", "baseUrl", "url", "headers", "request", "query"]; const NON_VARIABLE_OPTIONS = ["method", "baseUrl", "url", "headers", "request", "query", "mediaType"];
function graphql(request, query, options) { function graphql(request, query, options) {
options = typeof query === "string" ? options = Object.assign({ options = typeof query === "string" ? options = Object.assign({
query query
@@ -36266,12 +36385,10 @@ function getProxyUrl(reqUrl) {
} }
let proxyVar; let proxyVar;
if (usingSsl) { if (usingSsl) {
proxyVar = process.env["https_proxy"] || proxyVar = process.env['https_proxy'] || process.env['HTTPS_PROXY'];
process.env["HTTPS_PROXY"];
} }
else { else {
proxyVar = process.env["http_proxy"] || proxyVar = process.env['http_proxy'] || process.env['HTTP_PROXY'];
process.env["HTTP_PROXY"];
} }
if (proxyVar) { if (proxyVar) {
proxyUrl = url.parse(proxyVar); proxyUrl = url.parse(proxyVar);
@@ -36283,7 +36400,7 @@ function checkBypass(reqUrl) {
if (!reqUrl.hostname) { if (!reqUrl.hostname) {
return false; return false;
} }
let noProxy = process.env["no_proxy"] || process.env["NO_PROXY"] || ''; let noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || '';
if (!noProxy) { if (!noProxy) {
return false; return false;
} }
@@ -36304,7 +36421,10 @@ function checkBypass(reqUrl) {
upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`); upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`);
} }
// Compare request host against noproxy // Compare request host against noproxy
for (let upperNoProxyItem of noProxy.split(',').map(x => x.trim().toUpperCase()).filter(x => x)) { for (let upperNoProxyItem of noProxy
.split(',')
.map(x => x.trim().toUpperCase())
.filter(x => x)) {
if (upperReqHosts.some(x => x === upperNoProxyItem)) { if (upperReqHosts.some(x => x === upperNoProxyItem)) {
return true; return true;
} }