Compare commits
85 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 501cbb7cfb | |||
| b488baef0d | |||
| 27fa13ebc8 | |||
| 84f259d626 | |||
| f4a606f9ac | |||
| 9bf8ee6742 | |||
| 8c77cbb4f6 | |||
| d5af907521 | |||
| 2c9db061ca | |||
| 6194df3be9 | |||
| e72c4f419a | |||
| 6eb0ecceb6 | |||
| 7ea5df3c82 | |||
| 4063f1efb4 | |||
| e748b1abda | |||
| 457f525ea5 | |||
| fb974a4852 | |||
| 9e57a99ae1 | |||
| 16b2685969 | |||
| 1a0ab95368 | |||
| abfb577aff | |||
| b95a4524b1 | |||
| 0408e417a7 | |||
| ae7c18cadc | |||
| ee2f64b81c | |||
| 29ce9916e9 | |||
| 70fbdc473e | |||
| f8ba3d6cf1 | |||
| b389d7e74f | |||
| 5baa794111 | |||
| afc26f3ddf | |||
| 744187c67e | |||
| 30a70d3d0c | |||
| 00b6330ec7 | |||
| e7f13a59ae | |||
| 388aa443d3 | |||
| 0ed5f228f0 | |||
| 7fffd15783 | |||
| c632014a56 | |||
| 27202baee1 | |||
| bb7eba695a | |||
| 28729af438 | |||
| 5a6debbcdd | |||
| edf5b5d8e4 | |||
| 0eb9b10a55 | |||
| 88b9ac7698 | |||
| f6e4bbc53a | |||
| 9430d878c2 | |||
| 685bc3493f | |||
| 0ecd0be4ae | |||
| 28c93d0c78 | |||
| e55adba2c6 | |||
| 69feaae867 | |||
| c97e740fe9 | |||
| 6cf22caa9a | |||
| bcb5cecde2 | |||
| fbc874e360 | |||
| 9c544d0a68 | |||
| 6b981bfadb | |||
| f249cc20c7 | |||
| 1ef35ee24a | |||
| 0019c62465 | |||
| 092d66c080 | |||
| bc2bb9497f | |||
| e8046ba930 | |||
| ba9c18eeeb | |||
| c305af0360 | |||
| fe861955dd | |||
| 78a314e72c | |||
| 8044eff2eb | |||
| da04bb6bfb | |||
| b545ae5120 | |||
| 490022b056 | |||
| ff55b2a44d | |||
| e4b4ccfa46 | |||
| 297ae5fc8b | |||
| 822eb5f632 | |||
| 3692b9b73d | |||
| 56f4c0e28d | |||
| f52e3ae7a4 | |||
| 452b50c500 | |||
| 9625970c51 | |||
| 933feb0fd6 | |||
| 64d3415e33 | |||
| 4e192c30d8 |
@@ -3,18 +3,9 @@ import {
|
||||
RequestParameters
|
||||
} from '@octokit/graphql/dist-types/types'
|
||||
|
||||
import * as Graphql from '@octokit/graphql'
|
||||
import * as Graphql from '../../src/version/graphql'
|
||||
import {GetVersionsQueryResponse} from '../../src/version'
|
||||
|
||||
import SpyInstance = jest.SpyInstance
|
||||
|
||||
export function mockGraphql(): SpyInstance<
|
||||
Promise<GraphQlQueryResponseData>,
|
||||
[string, (RequestParameters | undefined)?]
|
||||
> {
|
||||
return jest.spyOn(Graphql, 'graphql')
|
||||
}
|
||||
|
||||
export function getMockedOldestQueryResponse(
|
||||
numVersions: number
|
||||
): GetVersionsQueryResponse {
|
||||
@@ -49,8 +40,10 @@ export function getMockedOldestQueryResponse(
|
||||
|
||||
export function mockOldestQueryResponse(
|
||||
numVersions: number
|
||||
): ReturnType<typeof mockGraphql> {
|
||||
return mockGraphql().mockResolvedValue(
|
||||
getMockedOldestQueryResponse(numVersions)
|
||||
)
|
||||
) {
|
||||
const response = new Promise((resolve) => {
|
||||
resolve(getMockedOldestQueryResponse(numVersions))
|
||||
}) as Promise<GraphQlQueryResponseData>
|
||||
jest.spyOn(Graphql, 'graphql').mockImplementation(
|
||||
(token: string, query: string, parameters: RequestParameters) => response)
|
||||
}
|
||||
|
||||
Vendored
+304
-184
@@ -704,12 +704,7 @@ function getPromiseCtor(promiseCtor) {
|
||||
//# sourceMappingURL=Observable.js.map
|
||||
|
||||
/***/ }),
|
||||
/* 34 */
|
||||
/***/ (function(module) {
|
||||
|
||||
module.exports = require("https");
|
||||
|
||||
/***/ }),
|
||||
/* 34 */,
|
||||
/* 35 */,
|
||||
/* 36 */,
|
||||
/* 37 */,
|
||||
@@ -921,7 +916,7 @@ var skip_1 = __webpack_require__(230);
|
||||
exports.skip = skip_1.skip;
|
||||
var skipLast_1 = __webpack_require__(744);
|
||||
exports.skipLast = skipLast_1.skipLast;
|
||||
var skipUntil_1 = __webpack_require__(497);
|
||||
var skipUntil_1 = __webpack_require__(120);
|
||||
exports.skipUntil = skipUntil_1.skipUntil;
|
||||
var skipWhile_1 = __webpack_require__(101);
|
||||
exports.skipWhile = skipWhile_1.skipWhile;
|
||||
@@ -2520,13 +2515,21 @@ const windowsRelease = release => {
|
||||
|
||||
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
|
||||
// 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)) {
|
||||
const stdout = execa.sync('wmic', ['os', 'get', 'Caption']).stdout || '';
|
||||
const year = (stdout.match(/2008|2012|2016/) || [])[0];
|
||||
let stdout;
|
||||
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) {
|
||||
return `Server ${year}`;
|
||||
}
|
||||
@@ -3801,7 +3804,74 @@ module.exports.default = macosRelease;
|
||||
|
||||
/***/ }),
|
||||
/* 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 */,
|
||||
/* 122 */,
|
||||
/* 123 */,
|
||||
@@ -4829,7 +4899,7 @@ var EverySubscriber = (function (_super) {
|
||||
var net = __webpack_require__(631);
|
||||
var tls = __webpack_require__(16);
|
||||
var http = __webpack_require__(605);
|
||||
var https = __webpack_require__(34);
|
||||
var https = __webpack_require__(211);
|
||||
var events = __webpack_require__(614);
|
||||
var assert = __webpack_require__(357);
|
||||
var util = __webpack_require__(669);
|
||||
@@ -6225,32 +6295,9 @@ exports.toArray = toArray;
|
||||
/* 209 */,
|
||||
/* 210 */,
|
||||
/* 211 */
|
||||
/***/ (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
|
||||
/***/ (function(module) {
|
||||
|
||||
module.exports = require("https");
|
||||
|
||||
/***/ }),
|
||||
/* 212 */,
|
||||
@@ -6437,8 +6484,8 @@ exports.QueueAction = QueueAction;
|
||||
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const rxjs_1 = __webpack_require__(931);
|
||||
const graphql_1 = __webpack_require__(898);
|
||||
const operators_1 = __webpack_require__(43);
|
||||
const graphql_1 = __webpack_require__(767);
|
||||
const mutation = `
|
||||
mutation deletePackageVersion($packageVersionId: String!) {
|
||||
deletePackageVersion(input: {packageVersionId: $packageVersionId}) {
|
||||
@@ -6446,10 +6493,9 @@ const mutation = `
|
||||
}
|
||||
}`;
|
||||
function deletePackageVersion(packageVersionId, token) {
|
||||
return rxjs_1.from(graphql_1.graphql(mutation, {
|
||||
return rxjs_1.from(graphql_1.graphql(token, mutation, {
|
||||
packageVersionId,
|
||||
headers: {
|
||||
authorization: `token ${token}`,
|
||||
Accept: 'application/vnd.github.package-deletes-preview+json'
|
||||
}
|
||||
})).pipe(operators_1.catchError((err) => {
|
||||
@@ -7500,7 +7546,7 @@ var AuditSubscriber = (function (_super) {
|
||||
|
||||
module.exports = authenticationRequestError;
|
||||
|
||||
const { RequestError } = __webpack_require__(463);
|
||||
const { RequestError } = __webpack_require__(497);
|
||||
|
||||
function authenticationRequestError(state, error, options) {
|
||||
if (!error.headers) throw error;
|
||||
@@ -7568,7 +7614,7 @@ function authenticationRequestError(state, error, options) {
|
||||
module.exports = parseOptions;
|
||||
|
||||
const { Deprecation } = __webpack_require__(692);
|
||||
const { getUserAgent } = __webpack_require__(796);
|
||||
const { getUserAgent } = __webpack_require__(619);
|
||||
const once = __webpack_require__(969);
|
||||
|
||||
const pkg = __webpack_require__(215);
|
||||
@@ -8485,7 +8531,7 @@ exports.Notification = Notification;
|
||||
|
||||
module.exports = validate;
|
||||
|
||||
const { RequestError } = __webpack_require__(463);
|
||||
const { RequestError } = __webpack_require__(497);
|
||||
const get = __webpack_require__(854);
|
||||
const set = __webpack_require__(883);
|
||||
|
||||
@@ -8640,7 +8686,7 @@ function validate(octokit, options) {
|
||||
|
||||
module.exports = authenticationRequestError;
|
||||
|
||||
const { RequestError } = __webpack_require__(463);
|
||||
const { RequestError } = __webpack_require__(497);
|
||||
|
||||
function authenticationRequestError(state, error, options) {
|
||||
/* istanbul ignore next */
|
||||
@@ -8816,7 +8862,7 @@ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'defau
|
||||
var Stream = _interopDefault(__webpack_require__(413));
|
||||
var http = _interopDefault(__webpack_require__(605));
|
||||
var Url = _interopDefault(__webpack_require__(835));
|
||||
var https = _interopDefault(__webpack_require__(34));
|
||||
var https = _interopDefault(__webpack_require__(211));
|
||||
var zlib = _interopDefault(__webpack_require__(761));
|
||||
|
||||
// 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; }
|
||||
|
||||
var isPlainObject = _interopDefault(__webpack_require__(626));
|
||||
var universalUserAgent = __webpack_require__(562);
|
||||
var universalUserAgent = __webpack_require__(796);
|
||||
|
||||
function lowercaseKeys(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.
|
||||
// So we use RequestParameters and add method as additional required property.
|
||||
@@ -12733,13 +12779,15 @@ class GitHub extends rest_1.Octokit {
|
||||
static getOctokitOptions(args) {
|
||||
const token = args[0];
|
||||
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
|
||||
const auth = GitHub.getAuthString(token, options);
|
||||
if (auth) {
|
||||
options.auth = auth;
|
||||
}
|
||||
// Proxy
|
||||
const agent = GitHub.getProxyAgent(options);
|
||||
const agent = GitHub.getProxyAgent(options.baseUrl, options);
|
||||
if (agent) {
|
||||
// Shallow clone - don't mutate the object provided by the caller
|
||||
options.request = options.request ? Object.assign({}, options.request) : {};
|
||||
@@ -12750,6 +12798,7 @@ class GitHub extends rest_1.Octokit {
|
||||
}
|
||||
static getGraphQL(args) {
|
||||
const defaults = {};
|
||||
defaults.baseUrl = this.getGraphQLBaseUrl();
|
||||
const token = args[0];
|
||||
const options = args[1];
|
||||
// Authorization
|
||||
@@ -12760,7 +12809,7 @@ class GitHub extends rest_1.Octokit {
|
||||
};
|
||||
}
|
||||
// Proxy
|
||||
const agent = GitHub.getProxyAgent(options);
|
||||
const agent = GitHub.getProxyAgent(defaults.baseUrl, options);
|
||||
if (agent) {
|
||||
defaults.request = { agent };
|
||||
}
|
||||
@@ -12776,17 +12825,31 @@ class GitHub extends rest_1.Octokit {
|
||||
}
|
||||
return typeof options.auth === 'string' ? options.auth : `token ${token}`;
|
||||
}
|
||||
static getProxyAgent(options) {
|
||||
static getProxyAgent(destinationUrl, options) {
|
||||
var _a;
|
||||
if (!((_a = options.request) === null || _a === void 0 ? void 0 : _a.agent)) {
|
||||
const serverUrl = 'https://api.github.com';
|
||||
if (httpClient.getProxyUrl(serverUrl)) {
|
||||
if (httpClient.getProxyUrl(destinationUrl)) {
|
||||
const hc = new httpClient.HttpClient();
|
||||
return hc.getAgent(serverUrl);
|
||||
return hc.getAgent(destinationUrl);
|
||||
}
|
||||
}
|
||||
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;
|
||||
//# sourceMappingURL=github.js.map
|
||||
@@ -13299,67 +13362,61 @@ exports.isArray = (function () { return Array.isArray || (function (x) { return
|
||||
|
||||
"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);
|
||||
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
|
||||
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
|
||||
|
||||
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);
|
||||
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)); };
|
||||
|
||||
this.name = "HttpError";
|
||||
this.status = statusCode;
|
||||
Object.defineProperty(this, "code", {
|
||||
get() {
|
||||
logOnce(new deprecation.Deprecation("[@octokit/request-error] `error.code` is deprecated, use `error.status`."));
|
||||
return statusCode;
|
||||
}
|
||||
|
||||
});
|
||||
this.headers = options.headers || {}; // redact request credentials without mutating original request options
|
||||
|
||||
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 () {
|
||||
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
|
||||
|
||||
exports.RequestError = RequestError;
|
||||
//# sourceMappingURL=index.js.map
|
||||
|
||||
|
||||
/***/ }),
|
||||
/* 498 */,
|
||||
@@ -14129,7 +14186,7 @@ exports.publishReplay = publishReplay;
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const url = __webpack_require__(835);
|
||||
const http = __webpack_require__(605);
|
||||
const https = __webpack_require__(34);
|
||||
const https = __webpack_require__(211);
|
||||
const pm = __webpack_require__(950);
|
||||
let tunnel;
|
||||
var HttpCodes;
|
||||
@@ -14155,6 +14212,7 @@ var HttpCodes;
|
||||
HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout";
|
||||
HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict";
|
||||
HttpCodes[HttpCodes["Gone"] = 410] = "Gone";
|
||||
HttpCodes[HttpCodes["TooManyRequests"] = 429] = "TooManyRequests";
|
||||
HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError";
|
||||
HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented";
|
||||
HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway";
|
||||
@@ -14179,8 +14237,18 @@ function getProxyUrl(serverUrl) {
|
||||
return proxyUrl ? proxyUrl.href : '';
|
||||
}
|
||||
exports.getProxyUrl = getProxyUrl;
|
||||
const HttpRedirectCodes = [HttpCodes.MovedPermanently, HttpCodes.ResourceMoved, HttpCodes.SeeOther, HttpCodes.TemporaryRedirect, HttpCodes.PermanentRedirect];
|
||||
const HttpResponseRetryCodes = [HttpCodes.BadGateway, HttpCodes.ServiceUnavailable, HttpCodes.GatewayTimeout];
|
||||
const HttpRedirectCodes = [
|
||||
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 ExponentialBackoffCeiling = 10;
|
||||
const ExponentialBackoffTimeSlice = 5;
|
||||
@@ -14305,18 +14373,22 @@ class HttpClient {
|
||||
*/
|
||||
async request(verb, requestUrl, data, headers) {
|
||||
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 info = this._prepareRequest(verb, parsedUrl, headers);
|
||||
// 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 response;
|
||||
while (numTries < maxTries) {
|
||||
response = await this.requestRaw(info, data);
|
||||
// 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;
|
||||
for (let i = 0; i < this.handlers.length; i++) {
|
||||
if (this.handlers[i].canHandleAuthentication(response)) {
|
||||
@@ -14334,21 +14406,32 @@ class HttpClient {
|
||||
}
|
||||
}
|
||||
let redirectsRemaining = this._maxRedirects;
|
||||
while (HttpRedirectCodes.indexOf(response.message.statusCode) != -1
|
||||
&& this._allowRedirects
|
||||
&& redirectsRemaining > 0) {
|
||||
const redirectUrl = response.message.headers["location"];
|
||||
while (HttpRedirectCodes.indexOf(response.message.statusCode) != -1 &&
|
||||
this._allowRedirects &&
|
||||
redirectsRemaining > 0) {
|
||||
const redirectUrl = response.message.headers['location'];
|
||||
if (!redirectUrl) {
|
||||
// if there's no location to redirect to, we won't
|
||||
break;
|
||||
}
|
||||
let parsedRedirectUrl = url.parse(redirectUrl);
|
||||
if (parsedUrl.protocol == 'https:' && 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.");
|
||||
if (parsedUrl.protocol == 'https:' &&
|
||||
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
|
||||
// which will leak the open socket.
|
||||
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
|
||||
info = this._prepareRequest(verb, parsedRedirectUrl, headers);
|
||||
response = await this.requestRaw(info, data);
|
||||
@@ -14399,8 +14482,8 @@ class HttpClient {
|
||||
*/
|
||||
requestRawWithCallback(info, data, onResult) {
|
||||
let socket;
|
||||
if (typeof (data) === 'string') {
|
||||
info.options.headers["Content-Length"] = Buffer.byteLength(data, 'utf8');
|
||||
if (typeof data === 'string') {
|
||||
info.options.headers['Content-Length'] = Buffer.byteLength(data, 'utf8');
|
||||
}
|
||||
let callbackCalled = false;
|
||||
let handleResult = (err, res) => {
|
||||
@@ -14413,7 +14496,7 @@ class HttpClient {
|
||||
let res = new HttpClientResponse(msg);
|
||||
handleResult(null, res);
|
||||
});
|
||||
req.on('socket', (sock) => {
|
||||
req.on('socket', sock => {
|
||||
socket = sock;
|
||||
});
|
||||
// If we ever get disconnected, we want the socket to timeout eventually
|
||||
@@ -14428,10 +14511,10 @@ class HttpClient {
|
||||
// res should have headers
|
||||
handleResult(err, null);
|
||||
});
|
||||
if (data && typeof (data) === 'string') {
|
||||
if (data && typeof data === 'string') {
|
||||
req.write(data, 'utf8');
|
||||
}
|
||||
if (data && typeof (data) !== 'string') {
|
||||
if (data && typeof data !== 'string') {
|
||||
data.on('close', function () {
|
||||
req.end();
|
||||
});
|
||||
@@ -14458,31 +14541,34 @@ class HttpClient {
|
||||
const defaultPort = usingSsl ? 443 : 80;
|
||||
info.options = {};
|
||||
info.options.host = info.parsedUrl.hostname;
|
||||
info.options.port = info.parsedUrl.port ? parseInt(info.parsedUrl.port) : defaultPort;
|
||||
info.options.path = (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');
|
||||
info.options.port = info.parsedUrl.port
|
||||
? parseInt(info.parsedUrl.port)
|
||||
: defaultPort;
|
||||
info.options.path =
|
||||
(info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');
|
||||
info.options.method = method;
|
||||
info.options.headers = this._mergeHeaders(headers);
|
||||
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);
|
||||
// gives handlers an opportunity to participate
|
||||
if (this.handlers) {
|
||||
this.handlers.forEach((handler) => {
|
||||
this.handlers.forEach(handler => {
|
||||
handler.prepareRequest(info.options);
|
||||
});
|
||||
}
|
||||
return info;
|
||||
}
|
||||
_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) {
|
||||
return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers));
|
||||
}
|
||||
return lowercaseKeys(headers || {});
|
||||
}
|
||||
_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;
|
||||
if (this.requestOptions && this.requestOptions.headers) {
|
||||
clientHeader = lowercaseKeys(this.requestOptions.headers)[header];
|
||||
@@ -14520,7 +14606,7 @@ class HttpClient {
|
||||
proxyAuth: proxyUrl.auth,
|
||||
host: proxyUrl.hostname,
|
||||
port: proxyUrl.port
|
||||
},
|
||||
}
|
||||
};
|
||||
let tunnelAgent;
|
||||
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
|
||||
// http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options
|
||||
// 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;
|
||||
}
|
||||
@@ -14608,7 +14696,7 @@ class HttpClient {
|
||||
msg = contents;
|
||||
}
|
||||
else {
|
||||
msg = "Failed request: (" + statusCode + ")";
|
||||
msg = 'Failed request: (' + statusCode + ')';
|
||||
}
|
||||
let err = new Error(msg);
|
||||
// attach statusCode and body obj (if available) to the error object
|
||||
@@ -15115,35 +15203,7 @@ function defaultErrorFactory() {
|
||||
/***/ }),
|
||||
/* 560 */,
|
||||
/* 561 */,
|
||||
/* 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
|
||||
|
||||
|
||||
/***/ }),
|
||||
/* 562 */,
|
||||
/* 563 */
|
||||
/***/ (function(module, __unusedexports, __webpack_require__) {
|
||||
|
||||
@@ -16100,9 +16160,9 @@ exports.zip = zip;
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const graphql_1 = __webpack_require__(898);
|
||||
const rxjs_1 = __webpack_require__(931);
|
||||
const operators_1 = __webpack_require__(43);
|
||||
const graphql_1 = __webpack_require__(767);
|
||||
const query = `
|
||||
query getVersions($owner: String!, $repo: String!, $package: String!, $last: Int!) {
|
||||
repository(owner: $owner, name: $repo) {
|
||||
@@ -16124,13 +16184,12 @@ const query = `
|
||||
}
|
||||
}`;
|
||||
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,
|
||||
repo,
|
||||
package: packageName,
|
||||
last: numVersions,
|
||||
headers: {
|
||||
authorization: `token ${token}`,
|
||||
Accept: 'application/vnd.github.packages-preview+json'
|
||||
}
|
||||
})).pipe(operators_1.catchError((err) => {
|
||||
@@ -16394,7 +16453,35 @@ exports.EmptyError = EmptyErrorImpl;
|
||||
//# 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 */
|
||||
/***/ (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; }
|
||||
|
||||
var endpoint = __webpack_require__(385);
|
||||
var universalUserAgent = __webpack_require__(211);
|
||||
var universalUserAgent = __webpack_require__(796);
|
||||
var isPlainObject = _interopDefault(__webpack_require__(548));
|
||||
var nodeFetch = _interopDefault(__webpack_require__(369));
|
||||
var requestError = __webpack_require__(463);
|
||||
|
||||
const VERSION = "5.3.2";
|
||||
const VERSION = "5.4.2";
|
||||
|
||||
function getBufferResponse(response) {
|
||||
return response.arrayBuffer();
|
||||
@@ -18646,7 +18733,39 @@ exports.AsapScheduler = AsapScheduler;
|
||||
//# 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 */
|
||||
/***/ (function(module) {
|
||||
|
||||
@@ -18993,7 +19112,7 @@ function getUserAgent() {
|
||||
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 universalUserAgent = __webpack_require__(796);
|
||||
|
||||
const VERSION = "4.3.1";
|
||||
const VERSION = "4.4.0";
|
||||
|
||||
class GraphqlError extends Error {
|
||||
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) {
|
||||
options = typeof query === "string" ? options = Object.assign({
|
||||
query
|
||||
@@ -36266,12 +36385,10 @@ function getProxyUrl(reqUrl) {
|
||||
}
|
||||
let proxyVar;
|
||||
if (usingSsl) {
|
||||
proxyVar = process.env["https_proxy"] ||
|
||||
process.env["HTTPS_PROXY"];
|
||||
proxyVar = process.env['https_proxy'] || process.env['HTTPS_PROXY'];
|
||||
}
|
||||
else {
|
||||
proxyVar = process.env["http_proxy"] ||
|
||||
process.env["HTTP_PROXY"];
|
||||
proxyVar = process.env['http_proxy'] || process.env['HTTP_PROXY'];
|
||||
}
|
||||
if (proxyVar) {
|
||||
proxyUrl = url.parse(proxyVar);
|
||||
@@ -36283,7 +36400,7 @@ function checkBypass(reqUrl) {
|
||||
if (!reqUrl.hostname) {
|
||||
return false;
|
||||
}
|
||||
let noProxy = process.env["no_proxy"] || process.env["NO_PROXY"] || '';
|
||||
let noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || '';
|
||||
if (!noProxy) {
|
||||
return false;
|
||||
}
|
||||
@@ -36304,7 +36421,10 @@ function checkBypass(reqUrl) {
|
||||
upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`);
|
||||
}
|
||||
// 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)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
Vendored
+1448
File diff suppressed because it is too large
Load Diff
Generated
+52
-48
@@ -10,9 +10,9 @@
|
||||
"integrity": "sha512-ZKdyhlSlyz38S6YFfPnyNgCDZuAF2T0Qv5eHflNWytPS8Qjvz39bZFMry9Bb/dpSnqWcNeav5yM2CTYpJeY+Dw=="
|
||||
},
|
||||
"@actions/github": {
|
||||
"version": "2.1.1",
|
||||
"resolved": "https://registry.npmjs.org/@actions/github/-/github-2.1.1.tgz",
|
||||
"integrity": "sha512-kAgTGUx7yf5KQCndVeHSwCNZuDBvPyxm5xKTswW2lofugeuC1AZX73nUUVDNaysnM9aKFMHv9YCdVJbg7syEyA==",
|
||||
"version": "2.2.0",
|
||||
"resolved": "https://registry.npmjs.org/@actions/github/-/github-2.2.0.tgz",
|
||||
"integrity": "sha512-9UAZqn8ywdR70n3GwVle4N8ALosQs4z50N7XMXrSTUVOmVpaBC5kE3TRTT7qQdi3OaQV24mjGuJZsHUmhD+ZXw==",
|
||||
"requires": {
|
||||
"@actions/http-client": "^1.0.3",
|
||||
"@octokit/graphql": "^4.3.1",
|
||||
@@ -20,9 +20,9 @@
|
||||
}
|
||||
},
|
||||
"@actions/http-client": {
|
||||
"version": "1.0.6",
|
||||
"resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-1.0.6.tgz",
|
||||
"integrity": "sha512-LGmio4w98UyGX33b/W6V6Nx/sQHRXZ859YlMkn36wPsXPB82u8xTVlA/Dq2DXrm6lEq9RVmisRJa1c+HETAIJA==",
|
||||
"version": "1.0.8",
|
||||
"resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-1.0.8.tgz",
|
||||
"integrity": "sha512-G4JjJ6f9Hb3Zvejj+ewLLKLf99ZC+9v+yCxoYf9vSyH+WkzPLB2LuUtRMGNkooMqdugGBFStIKXOuvH1W+EctA==",
|
||||
"requires": {
|
||||
"tunnel": "0.0.6"
|
||||
}
|
||||
@@ -438,11 +438,11 @@
|
||||
}
|
||||
},
|
||||
"@octokit/endpoint": {
|
||||
"version": "5.5.3",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-5.5.3.tgz",
|
||||
"integrity": "sha512-EzKwkwcxeegYYah5ukEeAI/gYRLv2Y9U5PpIsseGSFDk+G3RbipQGBs8GuYS1TLCtQaqoO66+aQGtITPalxsNQ==",
|
||||
"version": "6.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-6.0.1.tgz",
|
||||
"integrity": "sha512-pOPHaSz57SFT/m3R5P8MUu4wLPszokn5pXcB/pzavLTQf2jbU+6iayTvzaY6/BiotuRS0qyEUkx3QglT4U958A==",
|
||||
"requires": {
|
||||
"@octokit/types": "^2.0.0",
|
||||
"@octokit/types": "^2.11.1",
|
||||
"is-plain-object": "^3.0.0",
|
||||
"universal-user-agent": "^5.0.0"
|
||||
},
|
||||
@@ -459,25 +459,17 @@
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/isobject/-/isobject-4.0.0.tgz",
|
||||
"integrity": "sha512-S/2fF5wH8SJA/kmwr6HYhK/RI/OkhD84k8ntalo0iJjZikgq1XFvR5M8NPT1x5F7fBwCG3qHfnzeP/Vh/ZxCUA=="
|
||||
},
|
||||
"universal-user-agent": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-5.0.0.tgz",
|
||||
"integrity": "sha512-B5TPtzZleXyPrUMKCpEHFmVhMN6EhmJYjG5PQna9s7mXeSqGTLap4OpqLl5FCEFUI3UBmllkETwKf/db66Y54Q==",
|
||||
"requires": {
|
||||
"os-name": "^3.1.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"@octokit/graphql": {
|
||||
"version": "4.3.1",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-4.3.1.tgz",
|
||||
"integrity": "sha512-hCdTjfvrK+ilU2keAdqNBWOk+gm1kai1ZcdjRfB30oA3/T6n53UVJb7w0L5cR3/rhU91xT3HSqCd+qbvH06yxA==",
|
||||
"version": "4.4.0",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-4.4.0.tgz",
|
||||
"integrity": "sha512-Du3hAaSROQ8EatmYoSAJjzAz3t79t9Opj/WY1zUgxVUGfIKn0AEjg+hlOLscF6fv6i/4y/CeUvsWgIfwMkTccw==",
|
||||
"requires": {
|
||||
"@octokit/request": "^5.3.0",
|
||||
"@octokit/types": "^2.0.0",
|
||||
"universal-user-agent": "^4.0.0"
|
||||
"universal-user-agent": "^5.0.0"
|
||||
}
|
||||
},
|
||||
"@octokit/plugin-paginate-rest": {
|
||||
@@ -503,13 +495,13 @@
|
||||
}
|
||||
},
|
||||
"@octokit/request": {
|
||||
"version": "5.3.2",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/request/-/request-5.3.2.tgz",
|
||||
"integrity": "sha512-7NPJpg19wVQy1cs2xqXjjRq/RmtSomja/VSWnptfYwuBxLdbYh2UjhGi0Wx7B1v5Iw5GKhfFDQL7jM7SSp7K2g==",
|
||||
"version": "5.4.2",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/request/-/request-5.4.2.tgz",
|
||||
"integrity": "sha512-zKdnGuQ2TQ2vFk9VU8awFT4+EYf92Z/v3OlzRaSh4RIP0H6cvW1BFPXq4XYvNez+TPQjqN+0uSkCYnMFFhcFrw==",
|
||||
"requires": {
|
||||
"@octokit/endpoint": "^5.5.0",
|
||||
"@octokit/request-error": "^1.0.1",
|
||||
"@octokit/types": "^2.0.0",
|
||||
"@octokit/endpoint": "^6.0.1",
|
||||
"@octokit/request-error": "^2.0.0",
|
||||
"@octokit/types": "^2.11.1",
|
||||
"deprecation": "^2.0.0",
|
||||
"is-plain-object": "^3.0.0",
|
||||
"node-fetch": "^2.3.0",
|
||||
@@ -534,21 +526,13 @@
|
||||
"version": "2.6.0",
|
||||
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.0.tgz",
|
||||
"integrity": "sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA=="
|
||||
},
|
||||
"universal-user-agent": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-5.0.0.tgz",
|
||||
"integrity": "sha512-B5TPtzZleXyPrUMKCpEHFmVhMN6EhmJYjG5PQna9s7mXeSqGTLap4OpqLl5FCEFUI3UBmllkETwKf/db66Y54Q==",
|
||||
"requires": {
|
||||
"os-name": "^3.1.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"@octokit/request-error": {
|
||||
"version": "1.2.1",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-1.2.1.tgz",
|
||||
"integrity": "sha512-+6yDyk1EES6WK+l3viRDElw96MvwfJxCt45GvmjDUKWjYIb3PJZQkq3i46TwGwoPD4h8NmTrENmtyA1FwbmhRA==",
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-2.0.0.tgz",
|
||||
"integrity": "sha512-rtYicB4Absc60rUv74Rjpzek84UbVHGHJRu4fNVlZ1mCcyUPPuzFfG9Rn6sjHrd95DEsmjSt1Axlc699ZlbDkw==",
|
||||
"requires": {
|
||||
"@octokit/types": "^2.0.0",
|
||||
"deprecation": "^2.0.0",
|
||||
@@ -576,12 +560,32 @@
|
||||
"octokit-pagination-methods": "^1.1.0",
|
||||
"once": "^1.4.0",
|
||||
"universal-user-agent": "^4.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@octokit/request-error": {
|
||||
"version": "1.2.1",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-1.2.1.tgz",
|
||||
"integrity": "sha512-+6yDyk1EES6WK+l3viRDElw96MvwfJxCt45GvmjDUKWjYIb3PJZQkq3i46TwGwoPD4h8NmTrENmtyA1FwbmhRA==",
|
||||
"requires": {
|
||||
"@octokit/types": "^2.0.0",
|
||||
"deprecation": "^2.0.0",
|
||||
"once": "^1.4.0"
|
||||
}
|
||||
},
|
||||
"universal-user-agent": {
|
||||
"version": "4.0.1",
|
||||
"resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-4.0.1.tgz",
|
||||
"integrity": "sha512-LnST3ebHwVL2aNe4mejI9IQh2HfZ1RLo8Io2HugSif8ekzD1TlWpHpColOB/eh8JHMLkGH3Akqf040I+4ylNxg==",
|
||||
"requires": {
|
||||
"os-name": "^3.1.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"@octokit/types": {
|
||||
"version": "2.3.1",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/types/-/types-2.3.1.tgz",
|
||||
"integrity": "sha512-rvJP1Y9A/+Cky2C3var1vsw3Lf5Rjn/0sojNl2AjCX+WbpIHYccaJ46abrZoIxMYnOToul6S9tPytUVkFI7CXQ==",
|
||||
"version": "2.16.2",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/types/-/types-2.16.2.tgz",
|
||||
"integrity": "sha512-O75k56TYvJ8WpAakWwYRN8Bgu60KrmX0z1KqFp1kNiFNkgW+JW+9EBKZ+S33PU6SLvbihqd+3drvPxKK68Ee8Q==",
|
||||
"requires": {
|
||||
"@types/node": ">= 8"
|
||||
}
|
||||
@@ -6380,9 +6384,9 @@
|
||||
}
|
||||
},
|
||||
"universal-user-agent": {
|
||||
"version": "4.0.1",
|
||||
"resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-4.0.1.tgz",
|
||||
"integrity": "sha512-LnST3ebHwVL2aNe4mejI9IQh2HfZ1RLo8Io2HugSif8ekzD1TlWpHpColOB/eh8JHMLkGH3Akqf040I+4ylNxg==",
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-5.0.0.tgz",
|
||||
"integrity": "sha512-B5TPtzZleXyPrUMKCpEHFmVhMN6EhmJYjG5PQna9s7mXeSqGTLap4OpqLl5FCEFUI3UBmllkETwKf/db66Y54Q==",
|
||||
"requires": {
|
||||
"os-name": "^3.1.0"
|
||||
}
|
||||
@@ -6556,9 +6560,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"windows-release": {
|
||||
"version": "3.2.0",
|
||||
"resolved": "https://registry.npmjs.org/windows-release/-/windows-release-3.2.0.tgz",
|
||||
"integrity": "sha512-QTlz2hKLrdqukrsapKsINzqMgOUpQW268eJ0OaOpJN32h272waxR9fkB9VoWRtK7uKHG5EHJcTXQBD8XZVJkFA==",
|
||||
"version": "3.3.0",
|
||||
"resolved": "https://registry.npmjs.org/windows-release/-/windows-release-3.3.0.tgz",
|
||||
"integrity": "sha512-2HetyTg1Y+R+rUgrKeUEhAG/ZuOmTrI1NBb3ZyAGQMYmOJjBBPe4MTodghRkmLJZHwkuPi02anbeGP+Zf401LQ==",
|
||||
"requires": {
|
||||
"execa": "^1.0.0"
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import {from, Observable, merge, throwError, of} from 'rxjs'
|
||||
import {graphql} from '@octokit/graphql'
|
||||
import {catchError, map, tap} from 'rxjs/operators'
|
||||
import {GraphQlQueryResponse} from '@octokit/graphql/dist-types/types'
|
||||
import {graphql} from './graphql'
|
||||
|
||||
export interface DeletePackageVersionMutationResponse {
|
||||
deletePackageVersion: {
|
||||
@@ -21,10 +21,9 @@ export function deletePackageVersion(
|
||||
token: string
|
||||
): Observable<boolean> {
|
||||
return from(
|
||||
graphql(mutation, {
|
||||
graphql(token, mutation, {
|
||||
packageVersionId,
|
||||
headers: {
|
||||
authorization: `token ${token}`,
|
||||
Accept: 'application/vnd.github.package-deletes-preview+json'
|
||||
}
|
||||
}) as Promise<DeletePackageVersionMutationResponse>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import {graphql} from '@octokit/graphql'
|
||||
import {GraphQlQueryResponse} from '@octokit/graphql/dist-types/types'
|
||||
import {Observable, from, throwError} from 'rxjs'
|
||||
import {catchError, map} from 'rxjs/operators'
|
||||
import {graphql} from './graphql'
|
||||
|
||||
export interface VersionInfo {
|
||||
id: string
|
||||
@@ -52,13 +52,12 @@ export function queryForOldestVersions(
|
||||
token: string
|
||||
): Observable<GetVersionsQueryResponse> {
|
||||
return from(
|
||||
graphql(query, {
|
||||
graphql(token, query, {
|
||||
owner,
|
||||
repo,
|
||||
package: packageName,
|
||||
last: numVersions,
|
||||
headers: {
|
||||
authorization: `token ${token}`,
|
||||
Accept: 'application/vnd.github.packages-preview+json'
|
||||
}
|
||||
}) as Promise<GetVersionsQueryResponse>
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
import {GitHub} from '@actions/github'
|
||||
import {GraphQlQueryResponseData} from '@octokit/graphql/dist-types/types'
|
||||
import {RequestParameters} from '@octokit/types/dist-types/RequestParameters'
|
||||
|
||||
/**
|
||||
* 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`.
|
||||
*/
|
||||
export async function graphql(
|
||||
token: string,
|
||||
query: string,
|
||||
parameters: RequestParameters
|
||||
): Promise<GraphQlQueryResponseData> {
|
||||
const github = new GitHub(token)
|
||||
return await github.graphql(query, parameters)
|
||||
}
|
||||
Reference in New Issue
Block a user