Merge pull request #24 from gradle/eskatos/upgrade-deps

Upgrade dependencies
This commit is contained in:
Paul Merlin 2020-04-07 15:59:37 +02:00 committed by GitHub
commit 5b4f0d05a6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 2390 additions and 2456 deletions

View file

@ -32,7 +32,6 @@
"@typescript-eslint/no-misused-new": "error", "@typescript-eslint/no-misused-new": "error",
"@typescript-eslint/no-namespace": "error", "@typescript-eslint/no-namespace": "error",
"@typescript-eslint/no-non-null-assertion": "warn", "@typescript-eslint/no-non-null-assertion": "warn",
"@typescript-eslint/no-object-literal-type-assertion": "error",
"@typescript-eslint/no-unnecessary-qualifier": "error", "@typescript-eslint/no-unnecessary-qualifier": "error",
"@typescript-eslint/no-unnecessary-type-assertion": "error", "@typescript-eslint/no-unnecessary-type-assertion": "error",
"@typescript-eslint/no-useless-constructor": "error", "@typescript-eslint/no-useless-constructor": "error",
@ -40,7 +39,6 @@
"@typescript-eslint/prefer-for-of": "warn", "@typescript-eslint/prefer-for-of": "warn",
"@typescript-eslint/prefer-function-type": "warn", "@typescript-eslint/prefer-function-type": "warn",
"@typescript-eslint/prefer-includes": "error", "@typescript-eslint/prefer-includes": "error",
"@typescript-eslint/prefer-interface": "error",
"@typescript-eslint/prefer-string-starts-ends-with": "error", "@typescript-eslint/prefer-string-starts-ends-with": "error",
"@typescript-eslint/promise-function-async": "error", "@typescript-eslint/promise-function-async": "error",
"@typescript-eslint/require-array-sort-compare": "error", "@typescript-eslint/require-array-sort-compare": "error",

153
dist/index.js vendored
View file

@ -88,6 +88,7 @@ function httpsOverHttp(options) {
var agent = new TunnelingAgent(options); var agent = new TunnelingAgent(options);
agent.request = http.request; agent.request = http.request;
agent.createSocket = createSecureSocket; agent.createSocket = createSecureSocket;
agent.defaultPort = 443;
return agent; return agent;
} }
@ -101,6 +102,7 @@ function httpsOverHttps(options) {
var agent = new TunnelingAgent(options); var agent = new TunnelingAgent(options);
agent.request = https.request; agent.request = https.request;
agent.createSocket = createSecureSocket; agent.createSocket = createSecureSocket;
agent.defaultPort = 443;
return agent; return agent;
} }
@ -169,8 +171,14 @@ TunnelingAgent.prototype.createSocket = function createSocket(options, cb) {
var connectOptions = mergeOptions({}, self.proxyOptions, { var connectOptions = mergeOptions({}, self.proxyOptions, {
method: 'CONNECT', method: 'CONNECT',
path: options.host + ':' + options.port, path: options.host + ':' + options.port,
agent: false agent: false,
headers: {
host: options.host + ':' + options.port
}
}); });
if (options.localAddress) {
connectOptions.localAddress = options.localAddress;
}
if (connectOptions.proxyAuth) { if (connectOptions.proxyAuth) {
connectOptions.headers = connectOptions.headers || {}; connectOptions.headers = connectOptions.headers || {};
connectOptions.headers['Proxy-Authorization'] = 'Basic ' + connectOptions.headers['Proxy-Authorization'] = 'Basic ' +
@ -202,20 +210,29 @@ TunnelingAgent.prototype.createSocket = function createSocket(options, cb) {
connectReq.removeAllListeners(); connectReq.removeAllListeners();
socket.removeAllListeners(); socket.removeAllListeners();
if (res.statusCode === 200) { if (res.statusCode !== 200) {
assert.equal(head.length, 0);
debug('tunneling connection has established');
self.sockets[self.sockets.indexOf(placeholder)] = socket;
cb(socket);
} else {
debug('tunneling socket could not be established, statusCode=%d', debug('tunneling socket could not be established, statusCode=%d',
res.statusCode); res.statusCode);
socket.destroy();
var error = new Error('tunneling socket could not be established, ' + var error = new Error('tunneling socket could not be established, ' +
'statusCode=' + res.statusCode); 'statusCode=' + res.statusCode);
error.code = 'ECONNRESET'; error.code = 'ECONNRESET';
options.request.emit('error', error); options.request.emit('error', error);
self.removeSocket(placeholder); self.removeSocket(placeholder);
return;
} }
if (head.length > 0) {
debug('got illegal response body from proxy');
socket.destroy();
var error = new Error('got illegal response body from proxy');
error.code = 'ECONNRESET';
options.request.emit('error', error);
self.removeSocket(placeholder);
return;
}
debug('tunneling connection has established');
self.sockets[self.sockets.indexOf(placeholder)] = socket;
return cb(socket);
} }
function onError(cause) { function onError(cause) {
@ -429,6 +446,25 @@ var interpretNumericEntities = function (str) {
}); });
}; };
var parseArrayValue = function (val, options) {
if (val && typeof val === 'string' && options.comma && val.indexOf(',') > -1) {
return val.split(',');
}
return val;
};
var maybeMap = function maybeMap(val, fn) {
if (isArray(val)) {
var mapped = [];
for (var i = 0; i < val.length; i += 1) {
mapped.push(fn(val[i]));
}
return mapped;
}
return fn(val);
};
// This is what browsers will submit when the ✓ character occurs in an // This is what browsers will submit when the ✓ character occurs in an
// application/x-www-form-urlencoded body and the encoding of the page containing // application/x-www-form-urlencoded body and the encoding of the page containing
// the form is iso-8859-1, or when the submitted form has an accept-charset // the form is iso-8859-1, or when the submitted form has an accept-charset
@ -477,17 +513,18 @@ var parseValues = function parseQueryStringValues(str, options) {
val = options.strictNullHandling ? null : ''; val = options.strictNullHandling ? null : '';
} else { } else {
key = options.decoder(part.slice(0, pos), defaults.decoder, charset, 'key'); key = options.decoder(part.slice(0, pos), defaults.decoder, charset, 'key');
val = options.decoder(part.slice(pos + 1), defaults.decoder, charset, 'value'); val = maybeMap(
parseArrayValue(part.slice(pos + 1), options),
function (encodedVal) {
return options.decoder(encodedVal, defaults.decoder, charset, 'value');
}
);
} }
if (val && options.interpretNumericEntities && charset === 'iso-8859-1') { if (val && options.interpretNumericEntities && charset === 'iso-8859-1') {
val = interpretNumericEntities(val); val = interpretNumericEntities(val);
} }
if (val && typeof val === 'string' && options.comma && val.indexOf(',') > -1) {
val = val.split(',');
}
if (part.indexOf('[]=') > -1) { if (part.indexOf('[]=') > -1) {
val = isArray(val) ? [val] : val; val = isArray(val) ? [val] : val;
} }
@ -502,8 +539,8 @@ var parseValues = function parseQueryStringValues(str, options) {
return obj; return obj;
}; };
var parseObject = function (chain, val, options) { var parseObject = function (chain, val, options, valuesParsed) {
var leaf = val; var leaf = valuesParsed ? val : parseArrayValue(val, options);
for (var i = chain.length - 1; i >= 0; --i) { for (var i = chain.length - 1; i >= 0; --i) {
var obj; var obj;
@ -531,13 +568,13 @@ var parseObject = function (chain, val, options) {
} }
} }
leaf = obj; leaf = obj; // eslint-disable-line no-param-reassign
} }
return leaf; return leaf;
}; };
var parseKeys = function parseQueryStringKeys(givenKey, val, options) { var parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesParsed) {
if (!givenKey) { if (!givenKey) {
return; return;
} }
@ -588,7 +625,7 @@ var parseKeys = function parseQueryStringKeys(givenKey, val, options) {
keys.push('[' + key.slice(segment.index) + ']'); keys.push('[' + key.slice(segment.index) + ']');
} }
return parseObject(keys, val, options); return parseObject(keys, val, options, valuesParsed);
}; };
var normalizeParseOptions = function normalizeParseOptions(opts) { var normalizeParseOptions = function normalizeParseOptions(opts) {
@ -601,7 +638,7 @@ var normalizeParseOptions = function normalizeParseOptions(opts) {
} }
if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') { if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {
throw new Error('The charset option must be either utf-8, iso-8859-1, or undefined'); throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');
} }
var charset = typeof opts.charset === 'undefined' ? defaults.charset : opts.charset; var charset = typeof opts.charset === 'undefined' ? defaults.charset : opts.charset;
@ -640,7 +677,7 @@ module.exports = function (str, opts) {
var keys = Object.keys(tempObj); var keys = Object.keys(tempObj);
for (var i = 0; i < keys.length; ++i) { for (var i = 0; i < keys.length; ++i) {
var key = keys[i]; var key = keys[i];
var newObj = parseKeys(key, tempObj[key], options); var newObj = parseKeys(key, tempObj[key], options, typeof str === 'string');
obj = utils.merge(obj, newObj, options); obj = utils.merge(obj, newObj, options);
} }
@ -677,17 +714,24 @@ module.exports = require("crypto");
"use strict"; "use strict";
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
return result;
};
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
const os = __webpack_require__(87); const os = __importStar(__webpack_require__(87));
/** /**
* Commands * Commands
* *
* Command Format: * Command Format:
* ##[name key=value;key=value]message * ::name key=value,key=value::message
* *
* Examples: * Examples:
* ##[warning]This is the user warning message * ::warning::This is the message
* ##[set-secret name=mypassword]definitelyNotAPassword! * ::set-env name=MY_VAR::some value
*/ */
function issueCommand(command, properties, message) { function issueCommand(command, properties, message) {
const cmd = new Command(command, properties, message); const cmd = new Command(command, properties, message);
@ -712,34 +756,39 @@ class Command {
let cmdStr = CMD_STRING + this.command; let cmdStr = CMD_STRING + this.command;
if (this.properties && Object.keys(this.properties).length > 0) { if (this.properties && Object.keys(this.properties).length > 0) {
cmdStr += ' '; cmdStr += ' ';
let first = true;
for (const key in this.properties) { for (const key in this.properties) {
if (this.properties.hasOwnProperty(key)) { if (this.properties.hasOwnProperty(key)) {
const val = this.properties[key]; const val = this.properties[key];
if (val) { if (val) {
// safely append the val - avoid blowing up when attempting to if (first) {
// call .replace() if message is not a string for some reason first = false;
cmdStr += `${key}=${escape(`${val || ''}`)},`; }
else {
cmdStr += ',';
}
cmdStr += `${key}=${escapeProperty(val)}`;
} }
} }
} }
} }
cmdStr += CMD_STRING; cmdStr += `${CMD_STRING}${escapeData(this.message)}`;
// safely append the message - avoid blowing up when attempting to
// call .replace() if message is not a string for some reason
const message = `${this.message || ''}`;
cmdStr += escapeData(message);
return cmdStr; return cmdStr;
} }
} }
function escapeData(s) { function escapeData(s) {
return s.replace(/\r/g, '%0D').replace(/\n/g, '%0A'); return (s || '')
.replace(/%/g, '%25')
.replace(/\r/g, '%0D')
.replace(/\n/g, '%0A');
} }
function escape(s) { function escapeProperty(s) {
return s return (s || '')
.replace(/%/g, '%25')
.replace(/\r/g, '%0D') .replace(/\r/g, '%0D')
.replace(/\n/g, '%0A') .replace(/\n/g, '%0A')
.replace(/]/g, '%5D') .replace(/:/g, '%3A')
.replace(/;/g, '%3B'); .replace(/,/g, '%2C');
} }
//# sourceMappingURL=command.js.map //# sourceMappingURL=command.js.map
@ -759,10 +808,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
step((generator = generator.apply(thisArg, _arguments || [])).next()); step((generator = generator.apply(thisArg, _arguments || [])).next());
}); });
}; };
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
return result;
};
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
const command_1 = __webpack_require__(431); const command_1 = __webpack_require__(431);
const os = __webpack_require__(87); const os = __importStar(__webpack_require__(87));
const path = __webpack_require__(622); const path = __importStar(__webpack_require__(622));
/** /**
* The code to exit an action * The code to exit an action
*/ */
@ -848,6 +904,13 @@ exports.setFailed = setFailed;
//----------------------------------------------------------------------- //-----------------------------------------------------------------------
// Logging Commands // Logging Commands
//----------------------------------------------------------------------- //-----------------------------------------------------------------------
/**
* Gets whether Actions Step Debug is on or not
*/
function isDebug() {
return process.env['RUNNER_DEBUG'] === '1';
}
exports.isDebug = isDebug;
/** /**
* Writes debug message to user log * Writes debug message to user log
* @param message debug message * @param message debug message
@ -1565,9 +1628,10 @@ function obtainContentCharset(response) {
// |__ matches would be ['charset=utf-8', 'utf-8', index: 18, input: 'application/json; charset=utf-8'] // |__ matches would be ['charset=utf-8', 'utf-8', index: 18, input: 'application/json; charset=utf-8']
// |_____ matches[1] would have the charset :tada: , in our example it's utf-8 // |_____ matches[1] would have the charset :tada: , in our example it's utf-8
// However, if the matches Array was empty or no charset found, 'utf-8' would be returned by default. // However, if the matches Array was empty or no charset found, 'utf-8' would be returned by default.
const nodeSupportedEncodings = ['ascii', 'utf8', 'utf16le', 'ucs2', 'base64', 'binary', 'hex'];
const contentType = response.message.headers['content-type'] || ''; const contentType = response.message.headers['content-type'] || '';
const matches = contentType.match(/charset=([^;,\r\n]+)/i); const matches = contentType.match(/charset=([^;,\r\n]+)/i);
return (matches && matches[1]) ? matches[1] : 'utf-8'; return (matches && matches[1] && nodeSupportedEncodings.indexOf(matches[1]) != -1) ? matches[1] : 'utf-8';
} }
exports.obtainContentCharset = obtainContentCharset; exports.obtainContentCharset = obtainContentCharset;
@ -2048,7 +2112,9 @@ class HttpClientResponse {
const gunzippedBody = yield util.decompressGzippedContent(buffer, encodingCharset); const gunzippedBody = yield util.decompressGzippedContent(buffer, encodingCharset);
resolve(gunzippedBody); resolve(gunzippedBody);
} }
resolve(buffer.toString(encodingCharset)); else {
resolve(buffer.toString(encodingCharset));
}
}); });
}).on('error', function (err) { }).on('error', function (err) {
reject(err); reject(err);
@ -2262,7 +2328,6 @@ class HttpClient {
*/ */
requestRawWithCallback(info, data, onResult) { requestRawWithCallback(info, data, onResult) {
let socket; let socket;
let isDataString = typeof (data) === 'string';
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');
} }
@ -2283,7 +2348,7 @@ class HttpClient {
// If we ever get disconnected, we want the socket to timeout eventually // If we ever get disconnected, we want the socket to timeout eventually
req.setTimeout(this._socketTimeout || 3 * 60000, () => { req.setTimeout(this._socketTimeout || 3 * 60000, () => {
if (socket) { if (socket) {
socket.end(); socket.destroy();
} }
handleResult(new Error('Request timeout: ' + info.options.path), null); handleResult(new Error('Request timeout: ' + info.options.path), null);
}); });

4657
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -25,23 +25,23 @@
"author": "YourNameOrOrganization", "author": "YourNameOrOrganization",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@actions/core": "^1.2.0", "@actions/core": "^1.2.3",
"typed-rest-client": "^1.7.1", "typed-rest-client": "^1.7.3",
"unhomoglyph": "^1.0.3" "unhomoglyph": "^1.0.5"
}, },
"devDependencies": { "devDependencies": {
"@types/jest": "^24.0.23", "@types/jest": "^25.2.1",
"@types/node": "^12.12.24", "@types/node": "^12.12.34",
"@typescript-eslint/parser": "^2.8.0", "@typescript-eslint/parser": "^2.27.0",
"@zeit/ncc": "^0.20.5", "@zeit/ncc": "^0.22.1",
"eslint": "^5.16.0", "eslint": "^6.8.0",
"eslint-plugin-github": "^2.0.0", "eslint-plugin-github": "^3.4.1",
"eslint-plugin-jest": "^22.21.0", "eslint-plugin-jest": "^23.8.2",
"jest": "^24.9.0", "jest": "^25.2.7",
"jest-circus": "^24.9.0", "jest-circus": "^25.2.7",
"js-yaml": "^3.13.1", "js-yaml": "^3.13.1",
"prettier": "^1.19.1", "prettier": "^2.0.4",
"ts-jest": "^24.2.0", "ts-jest": "^25.3.1",
"typescript": "^3.6.4" "typescript": "^3.8.3"
} }
} }

View file

@ -1,4 +0,0 @@
declare module 'unhomoglyph' {
function unhomoglyph(input: string): string
export = unhomoglyph
}