From fdbd91be5d4de259aeb9a109d8fe94e528b7523a Mon Sep 17 00:00:00 2001 From: jaywcjlove <398188662@qq.com> Date: Fri, 4 Oct 2024 19:45:07 +0800 Subject: [PATCH] feat: add labelColor option. #35 --- .github/workflows/ci.yml | 2 +- README.md | 8 +- action.yml | 10 + dist/action.js | 4601 ++++++++++++++++++++++++++------------ package.json | 2 +- src/action.ts | 6 +- src/badges.ts | 24 +- src/index.ts | 4 + test/index.test.ts | 8 + 9 files changed, 3197 insertions(+), 1468 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 87fb859..4830718 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -99,7 +99,7 @@ jobs: uses: jaywcjlove/changelog-generator@main - name: Deploy - uses: peaceiris/actions-gh-pages@v3 + uses: peaceiris/actions-gh-pages@v4 if: github.ref == 'refs/heads/main' with: commit_message: ${{steps.tag_version.outputs.tag}} ${{ github.event.head_commit.message }} diff --git a/README.md b/README.md index 730facd..f5cf639 100644 --- a/README.md +++ b/README.md @@ -53,6 +53,8 @@ You can add `![Coverage](./coverage/badges.svg)` to your README.md after the bad - `source` - The path of the target file "coverage-summary.json". - `output` - Output image path. - `label` - The left label of the badge, usually static (default `coverage`). +- `labelColor` - \ or \ (default: `555`). +- `scale` - Set badge scale (default: `1`). - `style` - Badges style: `flat`, `classic` (default `classic`). - ~~`type`~~ - (No longer supported after v1.2.0) Coverage report type: `lines`, `statements`, `functions`, `branches` (default `statements`) - `jsonPath` - Path to the coverage percentage number to be used in the badge (default `total.statements.pct`) @@ -123,16 +125,18 @@ Options: --source, -s The path of the target file "coverage-summary.json". --style Badges style: flat, flat-square. --type Coverage type: lines, statements, functions, branches. + --scale Set badge scale (default: 1) --icon Path to icon file + --iconWidth Set this if icon is not square (default: 13) --label The left label of the badge, usually static (default `coverage`). + --labelColor or (default: '555') Example: npm coverage-badges-cli --output coverage/badges.svg npm coverage-badges-cli --style plastic npm coverage-badges-cli --source coverage/coverage-summary.json - npm coverage-badges-cli --type lines - npm coverage-badges-cli --icon my-icon.svg + npm coverage-badges-cli --labelColor ADF ``` ## Development diff --git a/action.yml b/action.yml index cfeb2ed..a7ceb57 100644 --- a/action.yml +++ b/action.yml @@ -22,6 +22,16 @@ inputs: default: classic required: false + scale: + description: 'Set badge scale (default: 1)' + default: "1" + required: false + + labelColor: + description: ' or (default: '555')' + default: "555" + required: false + jsonPath: description: 'Path to the coverage percentage number to be used in the badge' default: total.lines.pct diff --git a/dist/action.js b/dist/action.js index 6bedcb4..924dc91 100644 --- a/dist/action.js +++ b/dist/action.js @@ -11,12 +11,16 @@ var _classCallCheck = (__webpack_require__(7383)["default"]); var _createClass = (__webpack_require__(4579)["default"]); var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) { if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { - enumerable: true, - get: function get() { - return m[k]; - } - }); + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { + enumerable: true, + get: function get() { + return m[k]; + } + }; + } + Object.defineProperty(o, k2, desc); } : function (o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; @@ -32,7 +36,7 @@ var __setModuleDefault = this && this.__setModuleDefault || (Object.create ? fun var __importStar = this && this.__importStar || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; @@ -73,7 +77,7 @@ var Command = /*#__PURE__*/function () { this.properties = properties; this.message = message; } - _createClass(Command, [{ + return _createClass(Command, [{ key: "toString", value: function toString() { var cmdStr = CMD_STRING + this.command; @@ -98,13 +102,12 @@ var Command = /*#__PURE__*/function () { return cmdStr; } }]); - return Command; }(); function escapeData(s) { - return utils_1.toCommandValue(s).replace(/%/g, '%25').replace(/\r/g, '%0D').replace(/\n/g, '%0A'); + return (0, utils_1.toCommandValue)(s).replace(/%/g, '%25').replace(/\r/g, '%0D').replace(/\n/g, '%0A'); } function escapeProperty(s) { - return utils_1.toCommandValue(s).replace(/%/g, '%25').replace(/\r/g, '%0D').replace(/\n/g, '%0A').replace(/:/g, '%3A').replace(/,/g, '%2C'); + return (0, utils_1.toCommandValue)(s).replace(/%/g, '%25').replace(/\r/g, '%0D').replace(/\n/g, '%0A').replace(/:/g, '%3A').replace(/,/g, '%2C'); } //# sourceMappingURL=command.js.map @@ -119,12 +122,16 @@ function escapeProperty(s) { var _regeneratorRuntime = (__webpack_require__(4633)["default"]); var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) { if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { - enumerable: true, - get: function get() { - return m[k]; - } - }); + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { + enumerable: true, + get: function get() { + return m[k]; + } + }; + } + Object.defineProperty(o, k2, desc); } : function (o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; @@ -140,7 +147,7 @@ var __setModuleDefault = this && this.__setModuleDefault || (Object.create ? fun var __importStar = this && this.__importStar || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; @@ -174,7 +181,7 @@ var __awaiter = this && this.__awaiter || function (thisArg, _arguments, P, gene Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getIDToken = exports.getState = exports.saveState = exports.group = exports.endGroup = exports.startGroup = exports.info = exports.notice = exports.warning = exports.error = exports.debug = exports.isDebug = exports.setFailed = exports.setCommandEcho = exports.setOutput = exports.getBooleanInput = exports.getMultilineInput = exports.getInput = exports.addPath = exports.setSecret = exports.exportVariable = exports.ExitCode = void 0; +exports.platform = exports.toPlatformPath = exports.toWin32Path = exports.toPosixPath = exports.markdownSummary = exports.summary = exports.getIDToken = exports.getState = exports.saveState = exports.group = exports.endGroup = exports.startGroup = exports.info = exports.notice = exports.warning = exports.error = exports.debug = exports.isDebug = exports.setFailed = exports.setCommandEcho = exports.setOutput = exports.getBooleanInput = exports.getMultilineInput = exports.getInput = exports.addPath = exports.setSecret = exports.exportVariable = exports.ExitCode = void 0; var command_1 = __webpack_require__(1818); var file_command_1 = __webpack_require__(7369); var utils_1 = __webpack_require__(6230); @@ -194,7 +201,7 @@ var ExitCode; * A code indicating that the action was a failure */ ExitCode[ExitCode["Failure"] = 1] = "Failure"; -})(ExitCode = exports.ExitCode || (exports.ExitCode = {})); +})(ExitCode || (exports.ExitCode = ExitCode = {})); //----------------------------------------------------------------------- // Variables //----------------------------------------------------------------------- @@ -205,13 +212,13 @@ var ExitCode; */ // eslint-disable-next-line @typescript-eslint/no-explicit-any function exportVariable(name, val) { - var convertedVal = utils_1.toCommandValue(val); + var convertedVal = (0, utils_1.toCommandValue)(val); process.env[name] = convertedVal; var filePath = process.env['GITHUB_ENV'] || ''; if (filePath) { - return file_command_1.issueFileCommand('ENV', file_command_1.prepareKeyValueMessage(name, val)); + return (0, file_command_1.issueFileCommand)('ENV', (0, file_command_1.prepareKeyValueMessage)(name, val)); } - command_1.issueCommand('set-env', { + (0, command_1.issueCommand)('set-env', { name: name }, convertedVal); } @@ -221,7 +228,7 @@ exports.exportVariable = exportVariable; * @param secret value of the secret */ function setSecret(secret) { - command_1.issueCommand('add-mask', {}, secret); + (0, command_1.issueCommand)('add-mask', {}, secret); } exports.setSecret = setSecret; /** @@ -231,9 +238,9 @@ exports.setSecret = setSecret; function addPath(inputPath) { var filePath = process.env['GITHUB_PATH'] || ''; if (filePath) { - file_command_1.issueFileCommand('PATH', inputPath); + (0, file_command_1.issueFileCommand)('PATH', inputPath); } else { - command_1.issueCommand('add-path', {}, inputPath); + (0, command_1.issueCommand)('add-path', {}, inputPath); } process.env['PATH'] = "".concat(inputPath).concat(path.delimiter).concat(process.env['PATH']); } @@ -307,12 +314,12 @@ exports.getBooleanInput = getBooleanInput; function setOutput(name, value) { var filePath = process.env['GITHUB_OUTPUT'] || ''; if (filePath) { - return file_command_1.issueFileCommand('OUTPUT', file_command_1.prepareKeyValueMessage(name, value)); + return (0, file_command_1.issueFileCommand)('OUTPUT', (0, file_command_1.prepareKeyValueMessage)(name, value)); } process.stdout.write(os.EOL); - command_1.issueCommand('set-output', { + (0, command_1.issueCommand)('set-output', { name: name - }, utils_1.toCommandValue(value)); + }, (0, utils_1.toCommandValue)(value)); } exports.setOutput = setOutput; /** @@ -321,7 +328,7 @@ exports.setOutput = setOutput; * */ function setCommandEcho(enabled) { - command_1.issue('echo', enabled ? 'on' : 'off'); + (0, command_1.issue)('echo', enabled ? 'on' : 'off'); } exports.setCommandEcho = setCommandEcho; //----------------------------------------------------------------------- @@ -352,7 +359,7 @@ exports.isDebug = isDebug; * @param message debug message */ function debug(message) { - command_1.issueCommand('debug', {}, message); + (0, command_1.issueCommand)('debug', {}, message); } exports.debug = debug; /** @@ -362,7 +369,7 @@ exports.debug = debug; */ function error(message) { var properties = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - command_1.issueCommand('error', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message); + (0, command_1.issueCommand)('error', (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); } exports.error = error; /** @@ -372,7 +379,7 @@ exports.error = error; */ function warning(message) { var properties = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - command_1.issueCommand('warning', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message); + (0, command_1.issueCommand)('warning', (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); } exports.warning = warning; /** @@ -382,7 +389,7 @@ exports.warning = warning; */ function notice(message) { var properties = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - command_1.issueCommand('notice', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message); + (0, command_1.issueCommand)('notice', (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); } exports.notice = notice; /** @@ -401,14 +408,14 @@ exports.info = info; * @param name The name of the output group */ function startGroup(name) { - command_1.issue('group', name); + (0, command_1.issue)('group', name); } exports.startGroup = startGroup; /** * End an output group. */ function endGroup() { - command_1.issue('endgroup'); + (0, command_1.issue)('endgroup'); } exports.endGroup = endGroup; /** @@ -458,11 +465,11 @@ exports.group = group; function saveState(name, value) { var filePath = process.env['GITHUB_STATE'] || ''; if (filePath) { - return file_command_1.issueFileCommand('STATE', file_command_1.prepareKeyValueMessage(name, value)); + return (0, file_command_1.issueFileCommand)('STATE', (0, file_command_1.prepareKeyValueMessage)(name, value)); } - command_1.issueCommand('save-state', { + (0, command_1.issueCommand)('save-state', { name: name - }, utils_1.toCommandValue(value)); + }, (0, utils_1.toCommandValue)(value)); } exports.saveState = saveState; /** @@ -534,6 +541,10 @@ Object.defineProperty(exports, "toPlatformPath", ({ return path_utils_1.toPlatformPath; } })); +/** + * Platform utilities exports + */ +exports.platform = __importStar(__webpack_require__(1056)); //# sourceMappingURL=core.js.map /***/ }), @@ -547,12 +558,16 @@ Object.defineProperty(exports, "toPlatformPath", ({ // For internal use, subject to change. var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) { if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { - enumerable: true, - get: function get() { - return m[k]; - } - }); + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { + enumerable: true, + get: function get() { + return m[k]; + } + }; + } + Object.defineProperty(o, k2, desc); } : function (o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; @@ -568,7 +583,7 @@ var __setModuleDefault = this && this.__setModuleDefault || (Object.create ? fun var __importStar = this && this.__importStar || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; @@ -580,7 +595,6 @@ exports.prepareKeyValueMessage = exports.issueFileCommand = void 0; /* eslint-disable @typescript-eslint/no-explicit-any */ var fs = __importStar(__webpack_require__(9896)); var os = __importStar(__webpack_require__(857)); -var uuid_1 = __webpack_require__(3730); var utils_1 = __webpack_require__(6230); function issueFileCommand(command, message) { var filePath = process.env["GITHUB_".concat(command)]; @@ -590,14 +604,14 @@ function issueFileCommand(command, message) { if (!fs.existsSync(filePath)) { throw new Error("Missing file at path: ".concat(filePath)); } - fs.appendFileSync(filePath, "".concat(utils_1.toCommandValue(message)).concat(os.EOL), { + fs.appendFileSync(filePath, "".concat((0, utils_1.toCommandValue)(message)).concat(os.EOL), { encoding: 'utf8' }); } exports.issueFileCommand = issueFileCommand; function prepareKeyValueMessage(key, value) { - var delimiter = "ghadelimiter_".concat(uuid_1.v4()); - var convertedValue = utils_1.toCommandValue(value); + var delimiter = "ghadelimiter_".concat(crypto.randomUUID()); + var convertedValue = (0, utils_1.toCommandValue)(value); // These should realistically never happen, but just in case someone finds a // way to exploit uuid generation let's not allow keys or values that contain // the delimiter. @@ -661,7 +675,7 @@ var OidcClient = /*#__PURE__*/function () { function OidcClient() { _classCallCheck(this, OidcClient); } - _createClass(OidcClient, null, [{ + return _createClass(OidcClient, null, [{ key: "createHttpClient", value: function createHttpClient() { var allowRetry = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true; @@ -736,12 +750,12 @@ var OidcClient = /*#__PURE__*/function () { encodedAudience = encodeURIComponent(audience); id_token_url = "".concat(id_token_url, "&audience=").concat(encodedAudience); } - core_1.debug("ID token url is ".concat(id_token_url)); + (0, core_1.debug)("ID token url is ".concat(id_token_url)); _context2.next = 6; return OidcClient.getCall(id_token_url); case 6: id_token = _context2.sent; - core_1.setSecret(id_token); + (0, core_1.setSecret)(id_token); return _context2.abrupt("return", id_token); case 11: _context2.prev = 11; @@ -755,7 +769,6 @@ var OidcClient = /*#__PURE__*/function () { })); } }]); - return OidcClient; }(); exports.OidcClient = OidcClient; //# sourceMappingURL=oidc-utils.js.map @@ -770,12 +783,16 @@ exports.OidcClient = OidcClient; var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) { if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { - enumerable: true, - get: function get() { - return m[k]; - } - }); + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { + enumerable: true, + get: function get() { + return m[k]; + } + }; + } + Object.defineProperty(o, k2, desc); } : function (o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; @@ -791,7 +808,7 @@ var __setModuleDefault = this && this.__setModuleDefault || (Object.create ? fun var __importStar = this && this.__importStar || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; @@ -838,6 +855,203 @@ exports.toPlatformPath = toPlatformPath; /***/ }), +/***/ 1056: +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +var _slicedToArray = (__webpack_require__(5715)["default"]); +var _regeneratorRuntime = (__webpack_require__(4633)["default"]); +var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { + enumerable: true, + get: function get() { + return m[k]; + } + }; + } + Object.defineProperty(o, k2, desc); +} : function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +}); +var __setModuleDefault = this && this.__setModuleDefault || (Object.create ? function (o, v) { + Object.defineProperty(o, "default", { + enumerable: true, + value: v + }); +} : function (o, v) { + o["default"] = v; +}); +var __importStar = this && this.__importStar || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +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()); + }); +}; +var __importDefault = this && this.__importDefault || function (mod) { + return mod && mod.__esModule ? mod : { + "default": mod + }; +}; +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.getDetails = exports.isLinux = exports.isMacOS = exports.isWindows = exports.arch = exports.platform = void 0; +var os_1 = __importDefault(__webpack_require__(857)); +var exec = __importStar(__webpack_require__(332)); +var getWindowsInfo = function getWindowsInfo() { + return __awaiter(void 0, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee() { + var _yield$exec$getExecOu, version, _yield$exec$getExecOu2, name; + return _regeneratorRuntime().wrap(function _callee$(_context) { + while (1) switch (_context.prev = _context.next) { + case 0: + _context.next = 2; + return exec.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Version"', undefined, { + silent: true + }); + case 2: + _yield$exec$getExecOu = _context.sent; + version = _yield$exec$getExecOu.stdout; + _context.next = 6; + return exec.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Caption"', undefined, { + silent: true + }); + case 6: + _yield$exec$getExecOu2 = _context.sent; + name = _yield$exec$getExecOu2.stdout; + return _context.abrupt("return", { + name: name.trim(), + version: version.trim() + }); + case 9: + case "end": + return _context.stop(); + } + }, _callee); + })); +}; +var getMacOsInfo = function getMacOsInfo() { + return __awaiter(void 0, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() { + var _a, _b, _c, _d, _yield$exec$getExecOu3, stdout, version, name; + return _regeneratorRuntime().wrap(function _callee2$(_context2) { + while (1) switch (_context2.prev = _context2.next) { + case 0: + _context2.next = 2; + return exec.getExecOutput('sw_vers', undefined, { + silent: true + }); + case 2: + _yield$exec$getExecOu3 = _context2.sent; + stdout = _yield$exec$getExecOu3.stdout; + version = (_b = (_a = stdout.match(/ProductVersion:\s*(.+)/)) === null || _a === void 0 ? void 0 : _a[1]) !== null && _b !== void 0 ? _b : ''; + name = (_d = (_c = stdout.match(/ProductName:\s*(.+)/)) === null || _c === void 0 ? void 0 : _c[1]) !== null && _d !== void 0 ? _d : ''; + return _context2.abrupt("return", { + name: name, + version: version + }); + case 7: + case "end": + return _context2.stop(); + } + }, _callee2); + })); +}; +var getLinuxInfo = function getLinuxInfo() { + return __awaiter(void 0, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() { + var _yield$exec$getExecOu4, stdout, _stdout$trim$split, _stdout$trim$split2, name, version; + return _regeneratorRuntime().wrap(function _callee3$(_context3) { + while (1) switch (_context3.prev = _context3.next) { + case 0: + _context3.next = 2; + return exec.getExecOutput('lsb_release', ['-i', '-r', '-s'], { + silent: true + }); + case 2: + _yield$exec$getExecOu4 = _context3.sent; + stdout = _yield$exec$getExecOu4.stdout; + _stdout$trim$split = stdout.trim().split('\n'), _stdout$trim$split2 = _slicedToArray(_stdout$trim$split, 2), name = _stdout$trim$split2[0], version = _stdout$trim$split2[1]; + return _context3.abrupt("return", { + name: name, + version: version + }); + case 6: + case "end": + return _context3.stop(); + } + }, _callee3); + })); +}; +exports.platform = os_1["default"].platform(); +exports.arch = os_1["default"].arch(); +exports.isWindows = exports.platform === 'win32'; +exports.isMacOS = exports.platform === 'darwin'; +exports.isLinux = exports.platform === 'linux'; +function getDetails() { + return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() { + return _regeneratorRuntime().wrap(function _callee4$(_context4) { + while (1) switch (_context4.prev = _context4.next) { + case 0: + _context4.t0 = Object; + _context4.t1 = Object; + _context4.t2 = {}; + _context4.next = 5; + return exports.isWindows ? getWindowsInfo() : exports.isMacOS ? getMacOsInfo() : getLinuxInfo(); + case 5: + _context4.t3 = _context4.sent; + _context4.t4 = _context4.t1.assign.call(_context4.t1, _context4.t2, _context4.t3); + _context4.t5 = { + platform: exports.platform, + arch: exports.arch, + isWindows: exports.isWindows, + isMacOS: exports.isMacOS, + isLinux: exports.isLinux + }; + return _context4.abrupt("return", _context4.t0.assign.call(_context4.t0, _context4.t4, _context4.t5)); + case 9: + case "end": + return _context4.stop(); + } + }, _callee4); + })); +} +exports.getDetails = getDetails; +//# sourceMappingURL=platform.js.map + +/***/ }), + /***/ 6511: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { @@ -898,7 +1112,7 @@ var Summary = /*#__PURE__*/function () { * * @returns step summary file path */ - _createClass(Summary, [{ + return _createClass(Summary, [{ key: "filePath", value: function filePath() { return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee() { @@ -1257,7 +1471,6 @@ var Summary = /*#__PURE__*/function () { return this.addRaw(element).addEOL(); } }]); - return Summary; }(); var _summary = new Summary(); /** @@ -1318,7 +1531,934 @@ exports.toCommandProperties = toCommandProperties; /***/ }), -/***/ 7312: +/***/ 332: +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +var _regeneratorRuntime = (__webpack_require__(4633)["default"]); +var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { + enumerable: true, + get: function get() { + return m[k]; + } + }); +} : function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +}); +var __setModuleDefault = this && this.__setModuleDefault || (Object.create ? function (o, v) { + Object.defineProperty(o, "default", { + enumerable: true, + value: v + }); +} : function (o, v) { + o["default"] = v; +}); +var __importStar = this && this.__importStar || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +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 +})); +exports.getExecOutput = exports.exec = void 0; +var string_decoder_1 = __webpack_require__(3193); +var tr = __importStar(__webpack_require__(6865)); +/** + * Exec a command. + * Output will be streamed to the live console. + * Returns promise with return code + * + * @param commandLine command to execute (can include additional args). Must be correctly escaped. + * @param args optional arguments for tool. Escaping is handled by the lib. + * @param options optional exec options. See ExecOptions + * @returns Promise exit code + */ +function exec(commandLine, args, options) { + return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee() { + var commandArgs, toolPath, runner; + return _regeneratorRuntime().wrap(function _callee$(_context) { + while (1) switch (_context.prev = _context.next) { + case 0: + commandArgs = tr.argStringToArray(commandLine); + if (!(commandArgs.length === 0)) { + _context.next = 3; + break; + } + throw new Error("Parameter 'commandLine' cannot be null or empty."); + case 3: + // Path to tool to execute should be first arg + toolPath = commandArgs[0]; + args = commandArgs.slice(1).concat(args || []); + runner = new tr.ToolRunner(toolPath, args, options); + return _context.abrupt("return", runner.exec()); + case 7: + case "end": + return _context.stop(); + } + }, _callee); + })); +} +exports.exec = exec; +/** + * Exec a command and get the output. + * Output will be streamed to the live console. + * Returns promise with the exit code and collected stdout and stderr + * + * @param commandLine command to execute (can include additional args). Must be correctly escaped. + * @param args optional arguments for tool. Escaping is handled by the lib. + * @param options optional exec options. See ExecOptions + * @returns Promise exit code, stdout, and stderr + */ +function getExecOutput(commandLine, args, options) { + var _a, _b; + return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() { + var stdout, stderr, stdoutDecoder, stderrDecoder, originalStdoutListener, originalStdErrListener, stdErrListener, stdOutListener, listeners, exitCode; + return _regeneratorRuntime().wrap(function _callee2$(_context2) { + while (1) switch (_context2.prev = _context2.next) { + case 0: + stdout = ''; + stderr = ''; //Using string decoder covers the case where a mult-byte character is split + stdoutDecoder = new string_decoder_1.StringDecoder('utf8'); + stderrDecoder = new string_decoder_1.StringDecoder('utf8'); + originalStdoutListener = (_a = options === null || options === void 0 ? void 0 : options.listeners) === null || _a === void 0 ? void 0 : _a.stdout; + originalStdErrListener = (_b = options === null || options === void 0 ? void 0 : options.listeners) === null || _b === void 0 ? void 0 : _b.stderr; + stdErrListener = function stdErrListener(data) { + stderr += stderrDecoder.write(data); + if (originalStdErrListener) { + originalStdErrListener(data); + } + }; + stdOutListener = function stdOutListener(data) { + stdout += stdoutDecoder.write(data); + if (originalStdoutListener) { + originalStdoutListener(data); + } + }; + listeners = Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.listeners), { + stdout: stdOutListener, + stderr: stdErrListener + }); + _context2.next = 11; + return exec(commandLine, args, Object.assign(Object.assign({}, options), { + listeners: listeners + })); + case 11: + exitCode = _context2.sent; + //flush any remaining characters + stdout += stdoutDecoder.end(); + stderr += stderrDecoder.end(); + return _context2.abrupt("return", { + exitCode: exitCode, + stdout: stdout, + stderr: stderr + }); + case 15: + case "end": + return _context2.stop(); + } + }, _callee2); + })); +} +exports.getExecOutput = getExecOutput; +//# sourceMappingURL=exec.js.map + +/***/ }), + +/***/ 6865: +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +var _regeneratorRuntime = (__webpack_require__(4633)["default"]); +var _createForOfIteratorHelper = (__webpack_require__(883)["default"]); +var _classCallCheck = (__webpack_require__(7383)["default"]); +var _createClass = (__webpack_require__(4579)["default"]); +var _callSuper = (__webpack_require__(8336)["default"]); +var _inherits = (__webpack_require__(9511)["default"]); +var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { + enumerable: true, + get: function get() { + return m[k]; + } + }); +} : function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +}); +var __setModuleDefault = this && this.__setModuleDefault || (Object.create ? function (o, v) { + Object.defineProperty(o, "default", { + enumerable: true, + value: v + }); +} : function (o, v) { + o["default"] = v; +}); +var __importStar = this && this.__importStar || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +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 +})); +exports.argStringToArray = exports.ToolRunner = void 0; +var os = __importStar(__webpack_require__(857)); +var events = __importStar(__webpack_require__(4434)); +var child = __importStar(__webpack_require__(5317)); +var path = __importStar(__webpack_require__(6928)); +var io = __importStar(__webpack_require__(8090)); +var ioUtil = __importStar(__webpack_require__(2255)); +var timers_1 = __webpack_require__(3557); +/* eslint-disable @typescript-eslint/unbound-method */ +var IS_WINDOWS = process.platform === 'win32'; +/* + * Class for running command line tools. Handles quoting and arg parsing in a platform agnostic way. + */ +var ToolRunner = /*#__PURE__*/function (_events$EventEmitter) { + function ToolRunner(toolPath, args, options) { + var _this; + _classCallCheck(this, ToolRunner); + _this = _callSuper(this, ToolRunner); + if (!toolPath) { + throw new Error("Parameter 'toolPath' cannot be null or empty."); + } + _this.toolPath = toolPath; + _this.args = args || []; + _this.options = options || {}; + return _this; + } + _inherits(ToolRunner, _events$EventEmitter); + return _createClass(ToolRunner, [{ + key: "_debug", + value: function _debug(message) { + if (this.options.listeners && this.options.listeners.debug) { + this.options.listeners.debug(message); + } + } + }, { + key: "_getCommandString", + value: function _getCommandString(options, noPrefix) { + var toolPath = this._getSpawnFileName(); + var args = this._getSpawnArgs(options); + var cmd = noPrefix ? '' : '[command]'; // omit prefix when piped to a second tool + if (IS_WINDOWS) { + // Windows + cmd file + if (this._isCmdFile()) { + cmd += toolPath; + var _iterator = _createForOfIteratorHelper(args), + _step; + try { + for (_iterator.s(); !(_step = _iterator.n()).done;) { + var a = _step.value; + cmd += " ".concat(a); + } + } catch (err) { + _iterator.e(err); + } finally { + _iterator.f(); + } + } + // Windows + verbatim + else if (options.windowsVerbatimArguments) { + cmd += "\"".concat(toolPath, "\""); + var _iterator2 = _createForOfIteratorHelper(args), + _step2; + try { + for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) { + var _a = _step2.value; + cmd += " ".concat(_a); + } + } catch (err) { + _iterator2.e(err); + } finally { + _iterator2.f(); + } + } + // Windows (regular) + else { + cmd += this._windowsQuoteCmdArg(toolPath); + var _iterator3 = _createForOfIteratorHelper(args), + _step3; + try { + for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) { + var _a2 = _step3.value; + cmd += " ".concat(this._windowsQuoteCmdArg(_a2)); + } + } catch (err) { + _iterator3.e(err); + } finally { + _iterator3.f(); + } + } + } else { + // OSX/Linux - this can likely be improved with some form of quoting. + // creating processes on Unix is fundamentally different than Windows. + // on Unix, execvp() takes an arg array. + cmd += toolPath; + var _iterator4 = _createForOfIteratorHelper(args), + _step4; + try { + for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) { + var _a3 = _step4.value; + cmd += " ".concat(_a3); + } + } catch (err) { + _iterator4.e(err); + } finally { + _iterator4.f(); + } + } + return cmd; + } + }, { + key: "_processLineBuffer", + value: function _processLineBuffer(data, strBuffer, onLine) { + try { + var s = strBuffer + data.toString(); + var n = s.indexOf(os.EOL); + while (n > -1) { + var line = s.substring(0, n); + onLine(line); + // the rest of the string ... + s = s.substring(n + os.EOL.length); + n = s.indexOf(os.EOL); + } + return s; + } catch (err) { + // streaming lines to console is best effort. Don't fail a build. + this._debug("error processing line. Failed with error ".concat(err)); + return ''; + } + } + }, { + key: "_getSpawnFileName", + value: function _getSpawnFileName() { + if (IS_WINDOWS) { + if (this._isCmdFile()) { + return process.env['COMSPEC'] || 'cmd.exe'; + } + } + return this.toolPath; + } + }, { + key: "_getSpawnArgs", + value: function _getSpawnArgs(options) { + if (IS_WINDOWS) { + if (this._isCmdFile()) { + var argline = "/D /S /C \"".concat(this._windowsQuoteCmdArg(this.toolPath)); + var _iterator5 = _createForOfIteratorHelper(this.args), + _step5; + try { + for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) { + var a = _step5.value; + argline += ' '; + argline += options.windowsVerbatimArguments ? a : this._windowsQuoteCmdArg(a); + } + } catch (err) { + _iterator5.e(err); + } finally { + _iterator5.f(); + } + argline += '"'; + return [argline]; + } + } + return this.args; + } + }, { + key: "_endsWith", + value: function _endsWith(str, end) { + return str.endsWith(end); + } + }, { + key: "_isCmdFile", + value: function _isCmdFile() { + var upperToolPath = this.toolPath.toUpperCase(); + return this._endsWith(upperToolPath, '.CMD') || this._endsWith(upperToolPath, '.BAT'); + } + }, { + key: "_windowsQuoteCmdArg", + value: function _windowsQuoteCmdArg(arg) { + // for .exe, apply the normal quoting rules that libuv applies + if (!this._isCmdFile()) { + return this._uvQuoteCmdArg(arg); + } + // otherwise apply quoting rules specific to the cmd.exe command line parser. + // the libuv rules are generic and are not designed specifically for cmd.exe + // command line parser. + // + // for a detailed description of the cmd.exe command line parser, refer to + // http://stackoverflow.com/questions/4094699/how-does-the-windows-command-interpreter-cmd-exe-parse-scripts/7970912#7970912 + // need quotes for empty arg + if (!arg) { + return '""'; + } + // determine whether the arg needs to be quoted + var cmdSpecialChars = [' ', '\t', '&', '(', ')', '[', ']', '{', '}', '^', '=', ';', '!', "'", '+', ',', '`', '~', '|', '<', '>', '"']; + var needsQuotes = false; + var _iterator6 = _createForOfIteratorHelper(arg), + _step6; + try { + var _loop = function _loop() { + var _char = _step6.value; + if (cmdSpecialChars.some(function (x) { + return x === _char; + })) { + needsQuotes = true; + return 1; // break + } + }; + for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) { + if (_loop()) break; + } + // short-circuit if quotes not needed + } catch (err) { + _iterator6.e(err); + } finally { + _iterator6.f(); + } + if (!needsQuotes) { + return arg; + } + // the following quoting rules are very similar to the rules that by libuv applies. + // + // 1) wrap the string in quotes + // + // 2) double-up quotes - i.e. " => "" + // + // this is different from the libuv quoting rules. libuv replaces " with \", which unfortunately + // doesn't work well with a cmd.exe command line. + // + // note, replacing " with "" also works well if the arg is passed to a downstream .NET console app. + // for example, the command line: + // foo.exe "myarg:""my val""" + // is parsed by a .NET console app into an arg array: + // [ "myarg:\"my val\"" ] + // which is the same end result when applying libuv quoting rules. although the actual + // command line from libuv quoting rules would look like: + // foo.exe "myarg:\"my val\"" + // + // 3) double-up slashes that precede a quote, + // e.g. hello \world => "hello \world" + // hello\"world => "hello\\""world" + // hello\\"world => "hello\\\\""world" + // hello world\ => "hello world\\" + // + // technically this is not required for a cmd.exe command line, or the batch argument parser. + // the reasons for including this as a .cmd quoting rule are: + // + // a) this is optimized for the scenario where the argument is passed from the .cmd file to an + // external program. many programs (e.g. .NET console apps) rely on the slash-doubling rule. + // + // b) it's what we've been doing previously (by deferring to node default behavior) and we + // haven't heard any complaints about that aspect. + // + // note, a weakness of the quoting rules chosen here, is that % is not escaped. in fact, % cannot be + // escaped when used on the command line directly - even though within a .cmd file % can be escaped + // by using %%. + // + // the saving grace is, on the command line, %var% is left as-is if var is not defined. this contrasts + // the line parsing rules within a .cmd file, where if var is not defined it is replaced with nothing. + // + // one option that was explored was replacing % with ^% - i.e. %var% => ^%var^%. this hack would + // often work, since it is unlikely that var^ would exist, and the ^ character is removed when the + // variable is used. the problem, however, is that ^ is not removed when %* is used to pass the args + // to an external program. + // + // an unexplored potential solution for the % escaping problem, is to create a wrapper .cmd file. + // % can be escaped within a .cmd file. + var reverse = '"'; + var quoteHit = true; + for (var i = arg.length; i > 0; i--) { + // walk the string in reverse + reverse += arg[i - 1]; + if (quoteHit && arg[i - 1] === '\\') { + reverse += '\\'; // double the slash + } else if (arg[i - 1] === '"') { + quoteHit = true; + reverse += '"'; // double the quote + } else { + quoteHit = false; + } + } + reverse += '"'; + return reverse.split('').reverse().join(''); + } + }, { + key: "_uvQuoteCmdArg", + value: function _uvQuoteCmdArg(arg) { + // Tool runner wraps child_process.spawn() and needs to apply the same quoting as + // Node in certain cases where the undocumented spawn option windowsVerbatimArguments + // is used. + // + // Since this function is a port of quote_cmd_arg from Node 4.x (technically, lib UV, + // see https://github.com/nodejs/node/blob/v4.x/deps/uv/src/win/process.c for details), + // pasting copyright notice from Node within this function: + // + // Copyright Joyent, Inc. and other Node contributors. All rights reserved. + // + // Permission is hereby granted, free of charge, to any person obtaining a copy + // of this software and associated documentation files (the "Software"), to + // deal in the Software without restriction, including without limitation the + // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + // sell copies of the Software, and to permit persons to whom the Software is + // furnished to do so, subject to the following conditions: + // + // The above copyright notice and this permission notice shall be included in + // all copies or substantial portions of the Software. + // + // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + // IN THE SOFTWARE. + if (!arg) { + // Need double quotation for empty argument + return '""'; + } + if (!arg.includes(' ') && !arg.includes('\t') && !arg.includes('"')) { + // No quotation needed + return arg; + } + if (!arg.includes('"') && !arg.includes('\\')) { + // No embedded double quotes or backslashes, so I can just wrap + // quote marks around the whole thing. + return "\"".concat(arg, "\""); + } + // Expected input/output: + // input : hello"world + // output: "hello\"world" + // input : hello""world + // output: "hello\"\"world" + // input : hello\world + // output: hello\world + // input : hello\\world + // output: hello\\world + // input : hello\"world + // output: "hello\\\"world" + // input : hello\\"world + // output: "hello\\\\\"world" + // input : hello world\ + // output: "hello world\\" - note the comment in libuv actually reads "hello world\" + // but it appears the comment is wrong, it should be "hello world\\" + var reverse = '"'; + var quoteHit = true; + for (var i = arg.length; i > 0; i--) { + // walk the string in reverse + reverse += arg[i - 1]; + if (quoteHit && arg[i - 1] === '\\') { + reverse += '\\'; + } else if (arg[i - 1] === '"') { + quoteHit = true; + reverse += '\\'; + } else { + quoteHit = false; + } + } + reverse += '"'; + return reverse.split('').reverse().join(''); + } + }, { + key: "_cloneExecOptions", + value: function _cloneExecOptions(options) { + options = options || {}; + var result = { + cwd: options.cwd || process.cwd(), + env: options.env || process.env, + silent: options.silent || false, + windowsVerbatimArguments: options.windowsVerbatimArguments || false, + failOnStdErr: options.failOnStdErr || false, + ignoreReturnCode: options.ignoreReturnCode || false, + delay: options.delay || 10000 + }; + result.outStream = options.outStream || process.stdout; + result.errStream = options.errStream || process.stderr; + return result; + } + }, { + key: "_getSpawnOptions", + value: function _getSpawnOptions(options, toolPath) { + options = options || {}; + var result = {}; + result.cwd = options.cwd; + result.env = options.env; + result['windowsVerbatimArguments'] = options.windowsVerbatimArguments || this._isCmdFile(); + if (options.windowsVerbatimArguments) { + result.argv0 = "\"".concat(toolPath, "\""); + } + return result; + } + /** + * Exec a tool. + * Output will be streamed to the live console. + * Returns promise with return code + * + * @param tool path to tool to exec + * @param options optional exec options. See ExecOptions + * @returns number + */ + }, { + key: "exec", + value: function exec() { + return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() { + var _this2 = this; + return _regeneratorRuntime().wrap(function _callee2$(_context2) { + while (1) switch (_context2.prev = _context2.next) { + case 0: + // root the tool path if it is unrooted and contains relative pathing + if (!ioUtil.isRooted(this.toolPath) && (this.toolPath.includes('/') || IS_WINDOWS && this.toolPath.includes('\\'))) { + // prefer options.cwd if it is specified, however options.cwd may also need to be rooted + this.toolPath = path.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath); + } + // if the tool is only a file name, then resolve it from the PATH + // otherwise verify it exists (add extension on Windows if necessary) + _context2.next = 3; + return io.which(this.toolPath, true); + case 3: + this.toolPath = _context2.sent; + return _context2.abrupt("return", new Promise(function (resolve, reject) { + return __awaiter(_this2, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee() { + var _this3 = this; + var _iterator7, _step7, arg, optionsNonNull, state, fileName, cp, stdbuffer, errbuffer; + return _regeneratorRuntime().wrap(function _callee$(_context) { + while (1) switch (_context.prev = _context.next) { + case 0: + this._debug("exec tool: ".concat(this.toolPath)); + this._debug('arguments:'); + _iterator7 = _createForOfIteratorHelper(this.args); + try { + for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) { + arg = _step7.value; + this._debug(" ".concat(arg)); + } + } catch (err) { + _iterator7.e(err); + } finally { + _iterator7.f(); + } + optionsNonNull = this._cloneExecOptions(this.options); + if (!optionsNonNull.silent && optionsNonNull.outStream) { + optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os.EOL); + } + state = new ExecState(optionsNonNull, this.toolPath); + state.on('debug', function (message) { + _this3._debug(message); + }); + _context.t0 = this.options.cwd; + if (!_context.t0) { + _context.next = 13; + break; + } + _context.next = 12; + return ioUtil.exists(this.options.cwd); + case 12: + _context.t0 = !_context.sent; + case 13: + if (!_context.t0) { + _context.next = 15; + break; + } + return _context.abrupt("return", reject(new Error("The cwd: ".concat(this.options.cwd, " does not exist!")))); + case 15: + fileName = this._getSpawnFileName(); + cp = child.spawn(fileName, this._getSpawnArgs(optionsNonNull), this._getSpawnOptions(this.options, fileName)); + stdbuffer = ''; + if (cp.stdout) { + cp.stdout.on('data', function (data) { + if (_this3.options.listeners && _this3.options.listeners.stdout) { + _this3.options.listeners.stdout(data); + } + if (!optionsNonNull.silent && optionsNonNull.outStream) { + optionsNonNull.outStream.write(data); + } + stdbuffer = _this3._processLineBuffer(data, stdbuffer, function (line) { + if (_this3.options.listeners && _this3.options.listeners.stdline) { + _this3.options.listeners.stdline(line); + } + }); + }); + } + errbuffer = ''; + if (cp.stderr) { + cp.stderr.on('data', function (data) { + state.processStderr = true; + if (_this3.options.listeners && _this3.options.listeners.stderr) { + _this3.options.listeners.stderr(data); + } + if (!optionsNonNull.silent && optionsNonNull.errStream && optionsNonNull.outStream) { + var s = optionsNonNull.failOnStdErr ? optionsNonNull.errStream : optionsNonNull.outStream; + s.write(data); + } + errbuffer = _this3._processLineBuffer(data, errbuffer, function (line) { + if (_this3.options.listeners && _this3.options.listeners.errline) { + _this3.options.listeners.errline(line); + } + }); + }); + } + cp.on('error', function (err) { + state.processError = err.message; + state.processExited = true; + state.processClosed = true; + state.CheckComplete(); + }); + cp.on('exit', function (code) { + state.processExitCode = code; + state.processExited = true; + _this3._debug("Exit code ".concat(code, " received from tool '").concat(_this3.toolPath, "'")); + state.CheckComplete(); + }); + cp.on('close', function (code) { + state.processExitCode = code; + state.processExited = true; + state.processClosed = true; + _this3._debug("STDIO streams have closed for tool '".concat(_this3.toolPath, "'")); + state.CheckComplete(); + }); + state.on('done', function (error, exitCode) { + if (stdbuffer.length > 0) { + _this3.emit('stdline', stdbuffer); + } + if (errbuffer.length > 0) { + _this3.emit('errline', errbuffer); + } + cp.removeAllListeners(); + if (error) { + reject(error); + } else { + resolve(exitCode); + } + }); + if (!this.options.input) { + _context.next = 29; + break; + } + if (cp.stdin) { + _context.next = 28; + break; + } + throw new Error('child process missing stdin'); + case 28: + cp.stdin.end(this.options.input); + case 29: + case "end": + return _context.stop(); + } + }, _callee, this); + })); + })); + case 5: + case "end": + return _context2.stop(); + } + }, _callee2, this); + })); + } + }]); +}(events.EventEmitter); +exports.ToolRunner = ToolRunner; +/** + * Convert an arg string to an array of args. Handles escaping + * + * @param argString string of arguments + * @returns string[] array of arguments + */ +function argStringToArray(argString) { + var args = []; + var inQuotes = false; + var escaped = false; + var arg = ''; + function append(c) { + // we only escape double quotes. + if (escaped && c !== '"') { + arg += '\\'; + } + arg += c; + escaped = false; + } + for (var i = 0; i < argString.length; i++) { + var c = argString.charAt(i); + if (c === '"') { + if (!escaped) { + inQuotes = !inQuotes; + } else { + append(c); + } + continue; + } + if (c === '\\' && escaped) { + append(c); + continue; + } + if (c === '\\' && inQuotes) { + escaped = true; + continue; + } + if (c === ' ' && !inQuotes) { + if (arg.length > 0) { + args.push(arg); + arg = ''; + } + continue; + } + append(c); + } + if (arg.length > 0) { + args.push(arg.trim()); + } + return args; +} +exports.argStringToArray = argStringToArray; +var ExecState = /*#__PURE__*/function (_events$EventEmitter2) { + function ExecState(options, toolPath) { + var _this4; + _classCallCheck(this, ExecState); + _this4 = _callSuper(this, ExecState); + _this4.processClosed = false; // tracks whether the process has exited and stdio is closed + _this4.processError = ''; + _this4.processExitCode = 0; + _this4.processExited = false; // tracks whether the process has exited + _this4.processStderr = false; // tracks whether stderr was written to + _this4.delay = 10000; // 10 seconds + _this4.done = false; + _this4.timeout = null; + if (!toolPath) { + throw new Error('toolPath must not be empty'); + } + _this4.options = options; + _this4.toolPath = toolPath; + if (options.delay) { + _this4.delay = options.delay; + } + return _this4; + } + _inherits(ExecState, _events$EventEmitter2); + return _createClass(ExecState, [{ + key: "CheckComplete", + value: function CheckComplete() { + if (this.done) { + return; + } + if (this.processClosed) { + this._setResult(); + } else if (this.processExited) { + this.timeout = timers_1.setTimeout(ExecState.HandleTimeout, this.delay, this); + } + } + }, { + key: "_debug", + value: function _debug(message) { + this.emit('debug', message); + } + }, { + key: "_setResult", + value: function _setResult() { + // determine whether there is an error + var error; + if (this.processExited) { + if (this.processError) { + error = new Error("There was an error when attempting to execute the process '".concat(this.toolPath, "'. This may indicate the process failed to start. Error: ").concat(this.processError)); + } else if (this.processExitCode !== 0 && !this.options.ignoreReturnCode) { + error = new Error("The process '".concat(this.toolPath, "' failed with exit code ").concat(this.processExitCode)); + } else if (this.processStderr && this.options.failOnStdErr) { + error = new Error("The process '".concat(this.toolPath, "' failed because one or more lines were written to the STDERR stream")); + } + } + // clear the timeout + if (this.timeout) { + clearTimeout(this.timeout); + this.timeout = null; + } + this.done = true; + this.emit('done', error, this.processExitCode); + } + }], [{ + key: "HandleTimeout", + value: function HandleTimeout(state) { + if (state.done) { + return; + } + if (!state.processClosed && state.processExited) { + var message = "The STDIO streams did not close within ".concat(state.delay / 1000, " seconds of the exit event from process '").concat(state.toolPath, "'. This may indicate a child process inherited the STDIO streams and has not yet exited."); + state._debug(message); + } + state._setResult(); + } + }]); +}(events.EventEmitter); //# sourceMappingURL=toolrunner.js.map + +/***/ }), + +/***/ 7312: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; @@ -1364,7 +2504,7 @@ var BasicCredentialHandler = /*#__PURE__*/function () { this.username = username; this.password = password; } - _createClass(BasicCredentialHandler, [{ + return _createClass(BasicCredentialHandler, [{ key: "prepareRequest", value: function prepareRequest(options) { if (!options.headers) { @@ -1394,7 +2534,6 @@ var BasicCredentialHandler = /*#__PURE__*/function () { })); } }]); - return BasicCredentialHandler; }(); exports.BasicCredentialHandler = BasicCredentialHandler; var BearerCredentialHandler = /*#__PURE__*/function () { @@ -1404,7 +2543,7 @@ var BearerCredentialHandler = /*#__PURE__*/function () { } // currently implements pre-authorization // TODO: support preAuth = false where it hooks on 401 - _createClass(BearerCredentialHandler, [{ + return _createClass(BearerCredentialHandler, [{ key: "prepareRequest", value: function prepareRequest(options) { if (!options.headers) { @@ -1434,7 +2573,6 @@ var BearerCredentialHandler = /*#__PURE__*/function () { })); } }]); - return BearerCredentialHandler; }(); exports.BearerCredentialHandler = BearerCredentialHandler; var PersonalAccessTokenCredentialHandler = /*#__PURE__*/function () { @@ -1444,7 +2582,7 @@ var PersonalAccessTokenCredentialHandler = /*#__PURE__*/function () { } // currently implements pre-authorization // TODO: support preAuth = false where it hooks on 401 - _createClass(PersonalAccessTokenCredentialHandler, [{ + return _createClass(PersonalAccessTokenCredentialHandler, [{ key: "prepareRequest", value: function prepareRequest(options) { if (!options.headers) { @@ -1474,7 +2612,6 @@ var PersonalAccessTokenCredentialHandler = /*#__PURE__*/function () { })); } }]); - return PersonalAccessTokenCredentialHandler; }(); exports.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler; //# sourceMappingURL=auth.js.map @@ -1493,7 +2630,6 @@ var _regeneratorRuntime = (__webpack_require__(4633)["default"]); var _createClass = (__webpack_require__(4579)["default"]); var _classCallCheck = (__webpack_require__(7383)["default"]); var _callSuper = (__webpack_require__(8336)["default"]); -var _assertThisInitialized = (__webpack_require__(2475)["default"]); var _inherits = (__webpack_require__(9511)["default"]); var _wrapNativeSuper = (__webpack_require__(1837)["default"]); var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) { @@ -1617,25 +2753,25 @@ var RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD']; var ExponentialBackoffCeiling = 10; var ExponentialBackoffTimeSlice = 5; var HttpClientError = /*#__PURE__*/function (_Error) { - _inherits(HttpClientError, _Error); function HttpClientError(message, statusCode) { var _this; _classCallCheck(this, HttpClientError); _this = _callSuper(this, HttpClientError, [message]); _this.name = 'HttpClientError'; _this.statusCode = statusCode; - Object.setPrototypeOf(_assertThisInitialized(_this), HttpClientError.prototype); + Object.setPrototypeOf(_this, HttpClientError.prototype); return _this; } + _inherits(HttpClientError, _Error); return _createClass(HttpClientError); -}( /*#__PURE__*/_wrapNativeSuper(Error)); +}(/*#__PURE__*/_wrapNativeSuper(Error)); exports.HttpClientError = HttpClientError; var HttpClientResponse = /*#__PURE__*/function () { function HttpClientResponse(message) { _classCallCheck(this, HttpClientResponse); this.message = message; } - _createClass(HttpClientResponse, [{ + return _createClass(HttpClientResponse, [{ key: "readBody", value: function readBody() { return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() { @@ -1706,7 +2842,6 @@ var HttpClientResponse = /*#__PURE__*/function () { })); } }]); - return HttpClientResponse; }(); exports.HttpClientResponse = HttpClientResponse; function isHttps(requestUrl) { @@ -1753,7 +2888,7 @@ var HttpClient = /*#__PURE__*/function () { } } } - _createClass(HttpClient, [{ + return _createClass(HttpClient, [{ key: "options", value: function options(requestUrl, additionalHeaders) { return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() { @@ -2295,7 +3430,7 @@ var HttpClient = /*#__PURE__*/function () { if (this._keepAlive && useProxy) { agent = this._proxyAgent; } - if (this._keepAlive && !useProxy) { + if (!useProxy) { agent = this._agent; } // if agent is already assigned use that agent. @@ -2329,8 +3464,8 @@ var HttpClient = /*#__PURE__*/function () { agent = tunnelAgent(agentOptions); this._proxyAgent = agent; } - // if reusing agent across request and tunneling agent isn't assigned create a new agent - if (this._keepAlive && !agent) { + // if tunneling agent isn't assigned create a new agent + if (!agent) { var options = { keepAlive: this._keepAlive, maxSockets: maxSockets @@ -2338,10 +3473,6 @@ var HttpClient = /*#__PURE__*/function () { agent = usingSsl ? new https.Agent(options) : new http.Agent(options); this._agent = agent; } - // if not using private agent and tunnel agent isn't setup then use global agent - if (!agent) { - agent = usingSsl ? https.globalAgent : http.globalAgent; - } if (usingSsl && this._ignoreSslError) { // 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 @@ -2368,7 +3499,7 @@ var HttpClient = /*#__PURE__*/function () { uri: proxyUrl.href, pipelining: !this._keepAlive ? 0 : 1 }, (proxyUrl.username || proxyUrl.password) && { - token: "".concat(proxyUrl.username, ":").concat(proxyUrl.password) + token: "Basic ".concat(Buffer.from("".concat(proxyUrl.username, ":").concat(proxyUrl.password)).toString('base64')) })); this._proxyAgentDispatcher = proxyAgent; if (usingSsl && this._ignoreSslError) { @@ -2488,7 +3619,6 @@ var HttpClient = /*#__PURE__*/function () { })); } }]); - return HttpClient; }(); exports.HttpClient = HttpClient; var lowercaseKeys = function lowercaseKeys(obj) { @@ -2506,6 +3636,12 @@ var lowercaseKeys = function lowercaseKeys(obj) { "use strict"; +var _classCallCheck = (__webpack_require__(7383)["default"]); +var _createClass = (__webpack_require__(4579)["default"]); +var _callSuper = (__webpack_require__(8336)["default"]); +var _inherits = (__webpack_require__(9511)["default"]); +var _superPropGet = (__webpack_require__(9901)["default"]); +var _wrapNativeSuper = (__webpack_require__(1837)["default"]); var _createForOfIteratorHelper = (__webpack_require__(883)["default"]); Object.defineProperty(exports, "__esModule", ({ value: true @@ -2525,9 +3661,9 @@ function getProxyUrl(reqUrl) { }(); if (proxyVar) { try { - return new URL(proxyVar); + return new DecodedURL(proxyVar); } catch (_a) { - if (!proxyVar.startsWith('http://') && !proxyVar.startsWith('https://')) return new URL("http://".concat(proxyVar)); + if (!proxyVar.startsWith('http://') && !proxyVar.startsWith('https://')) return new DecodedURL("http://".concat(proxyVar)); } } else { return undefined; @@ -2595,7 +3731,998 @@ function isLoopbackAddress(host) { var hostLower = host.toLowerCase(); return hostLower === 'localhost' || hostLower.startsWith('127.') || hostLower.startsWith('[::1]') || hostLower.startsWith('[0:0:0:0:0:0:0:1]'); } -//# sourceMappingURL=proxy.js.map +var DecodedURL = /*#__PURE__*/function (_URL) { + function DecodedURL(url, base) { + var _this; + _classCallCheck(this, DecodedURL); + _this = _callSuper(this, DecodedURL, [url, base]); + _this._decodedUsername = decodeURIComponent(_superPropGet((_this, DecodedURL), "username", _this, 1)); + _this._decodedPassword = decodeURIComponent(_superPropGet((_this, DecodedURL), "password", _this, 1)); + return _this; + } + _inherits(DecodedURL, _URL); + return _createClass(DecodedURL, [{ + key: "username", + get: function get() { + return this._decodedUsername; + } + }, { + key: "password", + get: function get() { + return this._decodedPassword; + } + }]); +}(/*#__PURE__*/_wrapNativeSuper(URL)); //# sourceMappingURL=proxy.js.map + +/***/ }), + +/***/ 2255: +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +var _createForOfIteratorHelper = (__webpack_require__(883)["default"]); +var _regeneratorRuntime = (__webpack_require__(4633)["default"]); +var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { + enumerable: true, + get: function get() { + return m[k]; + } + }); +} : function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +}); +var __setModuleDefault = this && this.__setModuleDefault || (Object.create ? function (o, v) { + Object.defineProperty(o, "default", { + enumerable: true, + value: v + }); +} : function (o, v) { + o["default"] = v; +}); +var __importStar = this && this.__importStar || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +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()); + }); +}; +var _a; +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.getCmdPath = exports.tryGetExecutablePath = exports.isRooted = exports.isDirectory = exports.exists = exports.READONLY = exports.UV_FS_O_EXLOCK = exports.IS_WINDOWS = exports.unlink = exports.symlink = exports.stat = exports.rmdir = exports.rm = exports.rename = exports.readlink = exports.readdir = exports.open = exports.mkdir = exports.lstat = exports.copyFile = exports.chmod = void 0; +var fs = __importStar(__webpack_require__(9896)); +var path = __importStar(__webpack_require__(6928)); +_a = fs.promises +// export const {open} = 'fs' +, exports.chmod = _a.chmod, exports.copyFile = _a.copyFile, exports.lstat = _a.lstat, exports.mkdir = _a.mkdir, exports.open = _a.open, exports.readdir = _a.readdir, exports.readlink = _a.readlink, exports.rename = _a.rename, exports.rm = _a.rm, exports.rmdir = _a.rmdir, exports.stat = _a.stat, exports.symlink = _a.symlink, exports.unlink = _a.unlink; +// export const {open} = 'fs' +exports.IS_WINDOWS = process.platform === 'win32'; +// See https://github.com/nodejs/node/blob/d0153aee367422d0858105abec186da4dff0a0c5/deps/uv/include/uv/win.h#L691 +exports.UV_FS_O_EXLOCK = 0x10000000; +exports.READONLY = fs.constants.O_RDONLY; +function exists(fsPath) { + return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee() { + return _regeneratorRuntime().wrap(function _callee$(_context) { + while (1) switch (_context.prev = _context.next) { + case 0: + _context.prev = 0; + _context.next = 3; + return exports.stat(fsPath); + case 3: + _context.next = 10; + break; + case 5: + _context.prev = 5; + _context.t0 = _context["catch"](0); + if (!(_context.t0.code === 'ENOENT')) { + _context.next = 9; + break; + } + return _context.abrupt("return", false); + case 9: + throw _context.t0; + case 10: + return _context.abrupt("return", true); + case 11: + case "end": + return _context.stop(); + } + }, _callee, null, [[0, 5]]); + })); +} +exports.exists = exists; +function isDirectory(fsPath) { + var useStat = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() { + var stats; + return _regeneratorRuntime().wrap(function _callee2$(_context2) { + while (1) switch (_context2.prev = _context2.next) { + case 0: + if (!useStat) { + _context2.next = 6; + break; + } + _context2.next = 3; + return exports.stat(fsPath); + case 3: + _context2.t0 = _context2.sent; + _context2.next = 9; + break; + case 6: + _context2.next = 8; + return exports.lstat(fsPath); + case 8: + _context2.t0 = _context2.sent; + case 9: + stats = _context2.t0; + return _context2.abrupt("return", stats.isDirectory()); + case 11: + case "end": + return _context2.stop(); + } + }, _callee2); + })); +} +exports.isDirectory = isDirectory; +/** + * On OSX/Linux, true if path starts with '/'. On Windows, true for paths like: + * \, \hello, \\hello\share, C:, and C:\hello (and corresponding alternate separator cases). + */ +function isRooted(p) { + p = normalizeSeparators(p); + if (!p) { + throw new Error('isRooted() parameter "p" cannot be empty'); + } + if (exports.IS_WINDOWS) { + return p.startsWith('\\') || /^[A-Z]:/i.test(p) // e.g. \ or \hello or \\hello + ; // e.g. C: or C:\hello + } + return p.startsWith('/'); +} +exports.isRooted = isRooted; +/** + * Best effort attempt to determine whether a file exists and is executable. + * @param filePath file path to check + * @param extensions additional file extensions to try + * @return if file exists and is executable, returns the file path. otherwise empty string. + */ +function tryGetExecutablePath(filePath, extensions) { + return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() { + var stats, upperExt, originalFilePath, _iterator, _step, extension, directory, upperName, _iterator2, _step2, actualName; + return _regeneratorRuntime().wrap(function _callee3$(_context3) { + while (1) switch (_context3.prev = _context3.next) { + case 0: + stats = undefined; + _context3.prev = 1; + _context3.next = 4; + return exports.stat(filePath); + case 4: + stats = _context3.sent; + _context3.next = 10; + break; + case 7: + _context3.prev = 7; + _context3.t0 = _context3["catch"](1); + if (_context3.t0.code !== 'ENOENT') { + // eslint-disable-next-line no-console + console.log("Unexpected error attempting to determine if executable file exists '".concat(filePath, "': ").concat(_context3.t0)); + } + case 10: + if (!(stats && stats.isFile())) { + _context3.next = 19; + break; + } + if (!exports.IS_WINDOWS) { + _context3.next = 17; + break; + } + // on Windows, test for valid extension + upperExt = path.extname(filePath).toUpperCase(); + if (!extensions.some(function (validExt) { + return validExt.toUpperCase() === upperExt; + })) { + _context3.next = 15; + break; + } + return _context3.abrupt("return", filePath); + case 15: + _context3.next = 19; + break; + case 17: + if (!isUnixExecutable(stats)) { + _context3.next = 19; + break; + } + return _context3.abrupt("return", filePath); + case 19: + // try each extension + originalFilePath = filePath; + _iterator = _createForOfIteratorHelper(extensions); + _context3.prev = 21; + _iterator.s(); + case 23: + if ((_step = _iterator.n()).done) { + _context3.next = 75; + break; + } + extension = _step.value; + filePath = originalFilePath + extension; + stats = undefined; + _context3.prev = 27; + _context3.next = 30; + return exports.stat(filePath); + case 30: + stats = _context3.sent; + _context3.next = 36; + break; + case 33: + _context3.prev = 33; + _context3.t1 = _context3["catch"](27); + if (_context3.t1.code !== 'ENOENT') { + // eslint-disable-next-line no-console + console.log("Unexpected error attempting to determine if executable file exists '".concat(filePath, "': ").concat(_context3.t1)); + } + case 36: + if (!(stats && stats.isFile())) { + _context3.next = 73; + break; + } + if (!exports.IS_WINDOWS) { + _context3.next = 71; + break; + } + _context3.prev = 38; + directory = path.dirname(filePath); + upperName = path.basename(filePath).toUpperCase(); + _context3.t2 = _createForOfIteratorHelper; + _context3.next = 44; + return exports.readdir(directory); + case 44: + _context3.t3 = _context3.sent; + _iterator2 = (0, _context3.t2)(_context3.t3); + _context3.prev = 46; + _iterator2.s(); + case 48: + if ((_step2 = _iterator2.n()).done) { + _context3.next = 55; + break; + } + actualName = _step2.value; + if (!(upperName === actualName.toUpperCase())) { + _context3.next = 53; + break; + } + filePath = path.join(directory, actualName); + return _context3.abrupt("break", 55); + case 53: + _context3.next = 48; + break; + case 55: + _context3.next = 60; + break; + case 57: + _context3.prev = 57; + _context3.t4 = _context3["catch"](46); + _iterator2.e(_context3.t4); + case 60: + _context3.prev = 60; + _iterator2.f(); + return _context3.finish(60); + case 63: + _context3.next = 68; + break; + case 65: + _context3.prev = 65; + _context3.t5 = _context3["catch"](38); + // eslint-disable-next-line no-console + console.log("Unexpected error attempting to determine the actual case of the file '".concat(filePath, "': ").concat(_context3.t5)); + case 68: + return _context3.abrupt("return", filePath); + case 71: + if (!isUnixExecutable(stats)) { + _context3.next = 73; + break; + } + return _context3.abrupt("return", filePath); + case 73: + _context3.next = 23; + break; + case 75: + _context3.next = 80; + break; + case 77: + _context3.prev = 77; + _context3.t6 = _context3["catch"](21); + _iterator.e(_context3.t6); + case 80: + _context3.prev = 80; + _iterator.f(); + return _context3.finish(80); + case 83: + return _context3.abrupt("return", ''); + case 84: + case "end": + return _context3.stop(); + } + }, _callee3, null, [[1, 7], [21, 77, 80, 83], [27, 33], [38, 65], [46, 57, 60, 63]]); + })); +} +exports.tryGetExecutablePath = tryGetExecutablePath; +function normalizeSeparators(p) { + p = p || ''; + if (exports.IS_WINDOWS) { + // convert slashes on Windows + p = p.replace(/\//g, '\\'); + // remove redundant slashes + return p.replace(/\\\\+/g, '\\'); + } + // remove redundant slashes + return p.replace(/\/\/+/g, '/'); +} +// on Mac/Linux, test the execute bit +// R W X R W X R W X +// 256 128 64 32 16 8 4 2 1 +function isUnixExecutable(stats) { + return (stats.mode & 1) > 0 || (stats.mode & 8) > 0 && stats.gid === process.getgid() || (stats.mode & 64) > 0 && stats.uid === process.getuid(); +} +// Get the path of cmd.exe in windows +function getCmdPath() { + var _a; + return (_a = process.env['COMSPEC']) !== null && _a !== void 0 ? _a : "cmd.exe"; +} +exports.getCmdPath = getCmdPath; +//# sourceMappingURL=io-util.js.map + +/***/ }), + +/***/ 8090: +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +var _createForOfIteratorHelper = (__webpack_require__(883)["default"]); +var _regeneratorRuntime = (__webpack_require__(4633)["default"]); +var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { + enumerable: true, + get: function get() { + return m[k]; + } + }); +} : function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +}); +var __setModuleDefault = this && this.__setModuleDefault || (Object.create ? function (o, v) { + Object.defineProperty(o, "default", { + enumerable: true, + value: v + }); +} : function (o, v) { + o["default"] = v; +}); +var __importStar = this && this.__importStar || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +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 +})); +exports.findInPath = exports.which = exports.mkdirP = exports.rmRF = exports.mv = exports.cp = void 0; +var assert_1 = __webpack_require__(2613); +var path = __importStar(__webpack_require__(6928)); +var ioUtil = __importStar(__webpack_require__(2255)); +/** + * Copies a file or folder. + * Based off of shelljs - https://github.com/shelljs/shelljs/blob/9237f66c52e5daa40458f94f9565e18e8132f5a6/src/cp.js + * + * @param source source path + * @param dest destination path + * @param options optional. See CopyOptions. + */ +function cp(source, dest) { + var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee() { + var _readCopyOptions, force, recursive, copySourceDirectory, destStat, newDest, sourceStat; + return _regeneratorRuntime().wrap(function _callee$(_context) { + while (1) switch (_context.prev = _context.next) { + case 0: + _readCopyOptions = readCopyOptions(options), force = _readCopyOptions.force, recursive = _readCopyOptions.recursive, copySourceDirectory = _readCopyOptions.copySourceDirectory; + _context.next = 3; + return ioUtil.exists(dest); + case 3: + if (!_context.sent) { + _context.next = 9; + break; + } + _context.next = 6; + return ioUtil.stat(dest); + case 6: + _context.t0 = _context.sent; + _context.next = 10; + break; + case 9: + _context.t0 = null; + case 10: + destStat = _context.t0; + if (!(destStat && destStat.isFile() && !force)) { + _context.next = 13; + break; + } + return _context.abrupt("return"); + case 13: + // If dest is an existing directory, should copy inside. + newDest = destStat && destStat.isDirectory() && copySourceDirectory ? path.join(dest, path.basename(source)) : dest; + _context.next = 16; + return ioUtil.exists(source); + case 16: + if (_context.sent) { + _context.next = 18; + break; + } + throw new Error("no such file or directory: ".concat(source)); + case 18: + _context.next = 20; + return ioUtil.stat(source); + case 20: + sourceStat = _context.sent; + if (!sourceStat.isDirectory()) { + _context.next = 30; + break; + } + if (recursive) { + _context.next = 26; + break; + } + throw new Error("Failed to copy. ".concat(source, " is a directory, but tried to copy without recursive flag.")); + case 26: + _context.next = 28; + return cpDirRecursive(source, newDest, 0, force); + case 28: + _context.next = 34; + break; + case 30: + if (!(path.relative(source, newDest) === '')) { + _context.next = 32; + break; + } + throw new Error("'".concat(newDest, "' and '").concat(source, "' are the same file")); + case 32: + _context.next = 34; + return copyFile(source, newDest, force); + case 34: + case "end": + return _context.stop(); + } + }, _callee); + })); +} +exports.cp = cp; +/** + * Moves a path. + * + * @param source source path + * @param dest destination path + * @param options optional. See MoveOptions. + */ +function mv(source, dest) { + var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() { + var destExists; + return _regeneratorRuntime().wrap(function _callee2$(_context2) { + while (1) switch (_context2.prev = _context2.next) { + case 0: + _context2.next = 2; + return ioUtil.exists(dest); + case 2: + if (!_context2.sent) { + _context2.next = 18; + break; + } + destExists = true; + _context2.next = 6; + return ioUtil.isDirectory(dest); + case 6: + if (!_context2.sent) { + _context2.next = 11; + break; + } + // If dest is directory copy src into dest + dest = path.join(dest, path.basename(source)); + _context2.next = 10; + return ioUtil.exists(dest); + case 10: + destExists = _context2.sent; + case 11: + if (!destExists) { + _context2.next = 18; + break; + } + if (!(options.force == null || options.force)) { + _context2.next = 17; + break; + } + _context2.next = 15; + return rmRF(dest); + case 15: + _context2.next = 18; + break; + case 17: + throw new Error('Destination already exists'); + case 18: + _context2.next = 20; + return mkdirP(path.dirname(dest)); + case 20: + _context2.next = 22; + return ioUtil.rename(source, dest); + case 22: + case "end": + return _context2.stop(); + } + }, _callee2); + })); +} +exports.mv = mv; +/** + * Remove a path recursively with force + * + * @param inputPath path to remove + */ +function rmRF(inputPath) { + return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() { + return _regeneratorRuntime().wrap(function _callee3$(_context3) { + while (1) switch (_context3.prev = _context3.next) { + case 0: + if (!ioUtil.IS_WINDOWS) { + _context3.next = 3; + break; + } + if (!/[*"<>|]/.test(inputPath)) { + _context3.next = 3; + break; + } + throw new Error('File path must not contain `*`, `"`, `<`, `>` or `|` on Windows'); + case 3: + _context3.prev = 3; + _context3.next = 6; + return ioUtil.rm(inputPath, { + force: true, + maxRetries: 3, + recursive: true, + retryDelay: 300 + }); + case 6: + _context3.next = 11; + break; + case 8: + _context3.prev = 8; + _context3.t0 = _context3["catch"](3); + throw new Error("File was unable to be removed ".concat(_context3.t0)); + case 11: + case "end": + return _context3.stop(); + } + }, _callee3, null, [[3, 8]]); + })); +} +exports.rmRF = rmRF; +/** + * Make a directory. Creates the full path with folders in between + * Will throw if it fails + * + * @param fsPath path to create + * @returns Promise + */ +function mkdirP(fsPath) { + return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() { + return _regeneratorRuntime().wrap(function _callee4$(_context4) { + while (1) switch (_context4.prev = _context4.next) { + case 0: + assert_1.ok(fsPath, 'a path argument must be provided'); + _context4.next = 3; + return ioUtil.mkdir(fsPath, { + recursive: true + }); + case 3: + case "end": + return _context4.stop(); + } + }, _callee4); + })); +} +exports.mkdirP = mkdirP; +/** + * Returns path of a tool had the tool actually been invoked. Resolves via paths. + * If you check and the tool does not exist, it will throw. + * + * @param tool name of the tool + * @param check whether to check if tool exists + * @returns Promise path to tool + */ +function which(tool, check) { + return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() { + var result, matches; + return _regeneratorRuntime().wrap(function _callee5$(_context5) { + while (1) switch (_context5.prev = _context5.next) { + case 0: + if (tool) { + _context5.next = 2; + break; + } + throw new Error("parameter 'tool' is required"); + case 2: + if (!check) { + _context5.next = 13; + break; + } + _context5.next = 5; + return which(tool, false); + case 5: + result = _context5.sent; + if (result) { + _context5.next = 12; + break; + } + if (!ioUtil.IS_WINDOWS) { + _context5.next = 11; + break; + } + throw new Error("Unable to locate executable file: ".concat(tool, ". Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.")); + case 11: + throw new Error("Unable to locate executable file: ".concat(tool, ". Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.")); + case 12: + return _context5.abrupt("return", result); + case 13: + _context5.next = 15; + return findInPath(tool); + case 15: + matches = _context5.sent; + if (!(matches && matches.length > 0)) { + _context5.next = 18; + break; + } + return _context5.abrupt("return", matches[0]); + case 18: + return _context5.abrupt("return", ''); + case 19: + case "end": + return _context5.stop(); + } + }, _callee5); + })); +} +exports.which = which; +/** + * Returns a list of all occurrences of the given tool on the system path. + * + * @returns Promise the paths of the tool + */ +function findInPath(tool) { + return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() { + var extensions, _iterator, _step, extension, filePath, directories, _iterator2, _step2, p, matches, _i, _directories, directory, _filePath; + return _regeneratorRuntime().wrap(function _callee6$(_context6) { + while (1) switch (_context6.prev = _context6.next) { + case 0: + if (tool) { + _context6.next = 2; + break; + } + throw new Error("parameter 'tool' is required"); + case 2: + // build the list of extensions to try + extensions = []; + if (ioUtil.IS_WINDOWS && process.env['PATHEXT']) { + _iterator = _createForOfIteratorHelper(process.env['PATHEXT'].split(path.delimiter)); + try { + for (_iterator.s(); !(_step = _iterator.n()).done;) { + extension = _step.value; + if (extension) { + extensions.push(extension); + } + } + } catch (err) { + _iterator.e(err); + } finally { + _iterator.f(); + } + } + // if it's rooted, return it if exists. otherwise return empty. + if (!ioUtil.isRooted(tool)) { + _context6.next = 11; + break; + } + _context6.next = 7; + return ioUtil.tryGetExecutablePath(tool, extensions); + case 7: + filePath = _context6.sent; + if (!filePath) { + _context6.next = 10; + break; + } + return _context6.abrupt("return", [filePath]); + case 10: + return _context6.abrupt("return", []); + case 11: + if (!tool.includes(path.sep)) { + _context6.next = 13; + break; + } + return _context6.abrupt("return", []); + case 13: + // build the list of directories + // + // Note, technically "where" checks the current directory on Windows. From a toolkit perspective, + // it feels like we should not do this. Checking the current directory seems like more of a use + // case of a shell, and the which() function exposed by the toolkit should strive for consistency + // across platforms. + directories = []; + if (process.env.PATH) { + _iterator2 = _createForOfIteratorHelper(process.env.PATH.split(path.delimiter)); + try { + for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) { + p = _step2.value; + if (p) { + directories.push(p); + } + } + } catch (err) { + _iterator2.e(err); + } finally { + _iterator2.f(); + } + } + // find all matches + matches = []; + _i = 0, _directories = directories; + case 17: + if (!(_i < _directories.length)) { + _context6.next = 26; + break; + } + directory = _directories[_i]; + _context6.next = 21; + return ioUtil.tryGetExecutablePath(path.join(directory, tool), extensions); + case 21: + _filePath = _context6.sent; + if (_filePath) { + matches.push(_filePath); + } + case 23: + _i++; + _context6.next = 17; + break; + case 26: + return _context6.abrupt("return", matches); + case 27: + case "end": + return _context6.stop(); + } + }, _callee6); + })); +} +exports.findInPath = findInPath; +function readCopyOptions(options) { + var force = options.force == null ? true : options.force; + var recursive = Boolean(options.recursive); + var copySourceDirectory = options.copySourceDirectory == null ? true : Boolean(options.copySourceDirectory); + return { + force: force, + recursive: recursive, + copySourceDirectory: copySourceDirectory + }; +} +function cpDirRecursive(sourceDir, destDir, currentDepth, force) { + return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() { + var files, _iterator3, _step3, fileName, srcFile, destFile, srcFileStat; + return _regeneratorRuntime().wrap(function _callee7$(_context7) { + while (1) switch (_context7.prev = _context7.next) { + case 0: + if (!(currentDepth >= 255)) { + _context7.next = 2; + break; + } + return _context7.abrupt("return"); + case 2: + currentDepth++; + _context7.next = 5; + return mkdirP(destDir); + case 5: + _context7.next = 7; + return ioUtil.readdir(sourceDir); + case 7: + files = _context7.sent; + _iterator3 = _createForOfIteratorHelper(files); + _context7.prev = 9; + _iterator3.s(); + case 11: + if ((_step3 = _iterator3.n()).done) { + _context7.next = 27; + break; + } + fileName = _step3.value; + srcFile = "".concat(sourceDir, "/").concat(fileName); + destFile = "".concat(destDir, "/").concat(fileName); + _context7.next = 17; + return ioUtil.lstat(srcFile); + case 17: + srcFileStat = _context7.sent; + if (!srcFileStat.isDirectory()) { + _context7.next = 23; + break; + } + _context7.next = 21; + return cpDirRecursive(srcFile, destFile, currentDepth, force); + case 21: + _context7.next = 25; + break; + case 23: + _context7.next = 25; + return copyFile(srcFile, destFile, force); + case 25: + _context7.next = 11; + break; + case 27: + _context7.next = 32; + break; + case 29: + _context7.prev = 29; + _context7.t0 = _context7["catch"](9); + _iterator3.e(_context7.t0); + case 32: + _context7.prev = 32; + _iterator3.f(); + return _context7.finish(32); + case 35: + _context7.t1 = ioUtil; + _context7.t2 = destDir; + _context7.next = 39; + return ioUtil.stat(sourceDir); + case 39: + _context7.t3 = _context7.sent.mode; + _context7.next = 42; + return _context7.t1.chmod.call(_context7.t1, _context7.t2, _context7.t3); + case 42: + case "end": + return _context7.stop(); + } + }, _callee7, null, [[9, 29, 32, 35]]); + })); +} +// Buffered file copy +function copyFile(srcFile, destFile, force) { + return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() { + var symlinkFull; + return _regeneratorRuntime().wrap(function _callee8$(_context8) { + while (1) switch (_context8.prev = _context8.next) { + case 0: + _context8.next = 2; + return ioUtil.lstat(srcFile); + case 2: + if (!_context8.sent.isSymbolicLink()) { + _context8.next = 24; + break; + } + _context8.prev = 3; + _context8.next = 6; + return ioUtil.lstat(destFile); + case 6: + _context8.next = 8; + return ioUtil.unlink(destFile); + case 8: + _context8.next = 17; + break; + case 10: + _context8.prev = 10; + _context8.t0 = _context8["catch"](3); + if (!(_context8.t0.code === 'EPERM')) { + _context8.next = 17; + break; + } + _context8.next = 15; + return ioUtil.chmod(destFile, '0666'); + case 15: + _context8.next = 17; + return ioUtil.unlink(destFile); + case 17: + _context8.next = 19; + return ioUtil.readlink(srcFile); + case 19: + symlinkFull = _context8.sent; + _context8.next = 22; + return ioUtil.symlink(symlinkFull, destFile, ioUtil.IS_WINDOWS ? 'junction' : null); + case 22: + _context8.next = 32; + break; + case 24: + _context8.next = 26; + return ioUtil.exists(destFile); + case 26: + _context8.t1 = !_context8.sent; + if (_context8.t1) { + _context8.next = 29; + break; + } + _context8.t1 = force; + case 29: + if (!_context8.t1) { + _context8.next = 32; + break; + } + _context8.next = 32; + return ioUtil.copyFile(srcFile, destFile); + case 32: + case "end": + return _context8.stop(); + } + }, _callee8, null, [[3, 10]]); + })); +} +//# sourceMappingURL=io.js.map /***/ }), @@ -2931,7 +5058,7 @@ function copy(_x, _x2) { return _copy.apply(this, arguments); } function _copy() { - _copy = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(src, dest) { + _copy = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(src, dest) { var opts, _yield$stat$checkPath, srcStat, @@ -3002,7 +5129,7 @@ function runFilter(_x3, _x4, _x5) { return _runFilter.apply(this, arguments); } function _runFilter() { - _runFilter = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(src, dest, opts) { + _runFilter = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(src, dest, opts) { return _regeneratorRuntime().wrap(function _callee2$(_context2) { while (1) switch (_context2.prev = _context2.next) { case 0: @@ -3025,7 +5152,7 @@ function getStatsAndPerformCopy(_x6, _x7, _x8, _x9) { return _getStatsAndPerformCopy.apply(this, arguments); } function _getStatsAndPerformCopy() { - _getStatsAndPerformCopy = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(destStat, src, dest, opts) { + _getStatsAndPerformCopy = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(destStat, src, dest, opts) { var statFn, srcStat; return _regeneratorRuntime().wrap(function _callee3$(_context3) { while (1) switch (_context3.prev = _context3.next) { @@ -3078,7 +5205,7 @@ function onFile(_x10, _x11, _x12, _x13, _x14) { return _onFile.apply(this, arguments); } function _onFile() { - _onFile = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(srcStat, destStat, src, dest, opts) { + _onFile = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(srcStat, destStat, src, dest, opts) { return _regeneratorRuntime().wrap(function _callee4$(_context4) { while (1) switch (_context4.prev = _context4.next) { case 0: @@ -3114,7 +5241,7 @@ function copyFile(_x15, _x16, _x17, _x18) { return _copyFile.apply(this, arguments); } function _copyFile() { - _copyFile = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(srcStat, src, dest, opts) { + _copyFile = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5(srcStat, src, dest, opts) { var updatedSrcStat; return _regeneratorRuntime().wrap(function _callee5$(_context5) { while (1) switch (_context5.prev = _context5.next) { @@ -3159,7 +5286,7 @@ function onDir(_x19, _x20, _x21, _x22, _x23) { return _onDir.apply(this, arguments); } function _onDir() { - _onDir = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(srcStat, destStat, src, dest, opts) { + _onDir = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee7(srcStat, destStat, src, dest, opts) { var items; return _regeneratorRuntime().wrap(function _callee7$(_context7) { while (1) switch (_context7.prev = _context7.next) { @@ -3176,8 +5303,8 @@ function _onDir() { case 5: items = _context7.sent; _context7.next = 8; - return Promise.all(items.map( /*#__PURE__*/function () { - var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(item) { + return Promise.all(items.map(/*#__PURE__*/function () { + var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6(item) { var srcItem, destItem, include, _yield$stat$checkPath2, destStat; return _regeneratorRuntime().wrap(function _callee6$(_context6) { while (1) switch (_context6.prev = _context6.next) { @@ -3229,7 +5356,7 @@ function onLink(_x24, _x25, _x26, _x27) { return _onLink.apply(this, arguments); } function _onLink() { - _onLink = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(destStat, src, dest, opts) { + _onLink = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee8(destStat, src, dest, opts) { var resolvedSrc, resolvedDest; return _regeneratorRuntime().wrap(function _callee8$(_context8) { while (1) switch (_context8.prev = _context8.next) { @@ -3324,8 +5451,8 @@ var fs = __webpack_require__(554); var path = __webpack_require__(6928); var mkdir = __webpack_require__(169); var remove = __webpack_require__(3957); -var emptyDir = u( /*#__PURE__*/function () { - var _emptyDir = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(dir) { +var emptyDir = u(/*#__PURE__*/function () { + var _emptyDir = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(dir) { var items; return _regeneratorRuntime().wrap(function _callee$(_context) { while (1) switch (_context.prev = _context.next) { @@ -3393,7 +5520,7 @@ function createFile(_x) { return _createFile.apply(this, arguments); } function _createFile() { - _createFile = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(file) { + _createFile = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(file) { var stats, dir, dirStats; return _regeneratorRuntime().wrap(function _callee$(_context) { while (1) switch (_context.prev = _context.next) { @@ -3542,7 +5669,7 @@ function createLink(_x, _x2) { return _createLink.apply(this, arguments); } function _createLink() { - _createLink = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(srcpath, dstpath) { + _createLink = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(srcpath, dstpath) { var dstStat, srcStat, dir, dirExists; return _regeneratorRuntime().wrap(function _callee$(_context) { while (1) switch (_context.prev = _context.next) { @@ -3663,7 +5790,7 @@ function symlinkPaths(_x, _x2) { return _symlinkPaths.apply(this, arguments); } function _symlinkPaths() { - _symlinkPaths = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(srcpath, dstpath) { + _symlinkPaths = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(srcpath, dstpath) { var dstdir, relativeToDst, exists; return _regeneratorRuntime().wrap(function _callee$(_context) { while (1) switch (_context.prev = _context.next) { @@ -3774,7 +5901,7 @@ function symlinkType(_x, _x2) { return _symlinkType.apply(this, arguments); } function _symlinkType() { - _symlinkType = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(srcpath, type) { + _symlinkType = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(srcpath, type) { var stats; return _regeneratorRuntime().wrap(function _callee$(_context) { while (1) switch (_context.prev = _context.next) { @@ -3852,7 +5979,7 @@ function createSymlink(_x, _x2, _x3) { return _createSymlink.apply(this, arguments); } function _createSymlink() { - _createSymlink = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(srcpath, dstpath, type) { + _createSymlink = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(srcpath, dstpath, type) { var stats, _yield$Promise$all, _yield$Promise$all2, srcStat, dstStat, relative, toType, dir; return _regeneratorRuntime().wrap(function _callee$(_context) { while (1) switch (_context.prev = _context.next) { @@ -4150,7 +6277,7 @@ function outputJson(_x, _x2) { return _outputJson.apply(this, arguments); } function _outputJson() { - _outputJson = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(file, data) { + _outputJson = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(file, data) { var options, str, _args = arguments; @@ -4216,7 +6343,7 @@ var getMode = function getMode(options) { return _objectSpread(_objectSpread({}, defaults), options).mode; }; module.exports.makeDir = /*#__PURE__*/function () { - var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(dir, options) { + var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(dir, options) { return _regeneratorRuntime().wrap(function _callee$(_context) { while (1) switch (_context.prev = _context.next) { case 0: @@ -4368,7 +6495,7 @@ function move(_x, _x2) { return _move.apply(this, arguments); } function _move() { - _move = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(src, dest) { + _move = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(src, dest) { var opts, overwrite, _yield$stat$checkPath, @@ -4416,7 +6543,7 @@ function doRename(_x3, _x4, _x5, _x6) { return _doRename.apply(this, arguments); } function _doRename() { - _doRename = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(src, dest, overwrite, isChangingCase) { + _doRename = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(src, dest, overwrite, isChangingCase) { return _regeneratorRuntime().wrap(function _callee2$(_context2) { while (1) switch (_context2.prev = _context2.next) { case 0: @@ -4472,7 +6599,7 @@ function moveAcrossDevice(_x7, _x8, _x9) { return _moveAcrossDevice.apply(this, arguments); } function _moveAcrossDevice() { - _moveAcrossDevice = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(src, dest, overwrite) { + _moveAcrossDevice = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(src, dest, overwrite) { var opts; return _regeneratorRuntime().wrap(function _callee3$(_context3) { while (1) switch (_context3.prev = _context3.next) { @@ -4515,7 +6642,7 @@ function outputFile(_x, _x2) { return _outputFile.apply(this, arguments); } function _outputFile() { - _outputFile = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(file, data) { + _outputFile = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(file, data) { var encoding, dir, _args = arguments; @@ -4674,7 +6801,7 @@ function checkPaths(_x, _x2, _x3, _x4) { return _checkPaths.apply(this, arguments); } function _checkPaths() { - _checkPaths = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(src, dest, funcName, opts) { + _checkPaths = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(src, dest, funcName, opts) { var _yield$getStats, srcStat, destStat, srcBaseName, destBaseName; return _regeneratorRuntime().wrap(function _callee$(_context) { while (1) switch (_context.prev = _context.next) { @@ -4778,7 +6905,7 @@ function checkParentPaths(_x5, _x6, _x7, _x8) { return _checkParentPaths.apply(this, arguments); } function _checkParentPaths() { - _checkParentPaths = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(src, srcStat, dest, funcName) { + _checkParentPaths = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(src, srcStat, dest, funcName) { var srcParent, destParent, destStat; return _regeneratorRuntime().wrap(function _callee2$(_context2) { while (1) switch (_context2.prev = _context2.next) { @@ -4892,7 +7019,7 @@ function utimesMillis(_x, _x2, _x3) { return _utimesMillis.apply(this, arguments); } function _utimesMillis() { - _utimesMillis = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(path, atime, mtime) { + _utimesMillis = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(path, atime, mtime) { var fd, closeErr; return _regeneratorRuntime().wrap(function _callee$(_context) { while (1) switch (_context.prev = _context.next) { @@ -5763,7 +7890,7 @@ function _readFile(_x) { return _readFile2.apply(this, arguments); } function _readFile2() { - _readFile2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(file) { + _readFile2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(file) { var options, fs, shouldThrow, @@ -5838,7 +7965,7 @@ function _writeFile(_x2, _x3) { return _writeFile2.apply(this, arguments); } function _writeFile2() { - _writeFile2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(file, obj) { + _writeFile2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(file, obj) { var options, fs, str, @@ -6581,19 +8708,19 @@ function memoize(func, resolver) { if (typeof func != 'function' || resolver && typeof resolver != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } - var memoized = function memoized() { + var _memoized = function memoized() { var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], - cache = memoized.cache; + cache = _memoized.cache; if (cache.has(key)) { return cache.get(key); } var result = func.apply(this, args); - memoized.cache = cache.set(key, result); + _memoized.cache = cache.set(key, result); return result; }; - memoized.cache = new (memoize.Cache || MapCache)(); - return memoized; + _memoized.cache = new (memoize.Cache || MapCache)(); + return _memoized; } // Assign cache to `_.memoize`. @@ -7285,7 +9412,7 @@ module.exports.getGlobalDispatcher = getGlobalDispatcher; if (util.nodeMajor > 16 || util.nodeMajor === 16 && util.nodeMinor >= 8) { var fetchImpl = null; module.exports.fetch = /*#__PURE__*/function () { - var _fetch = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(resource) { + var _fetch = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(resource) { var _args = arguments; return _regeneratorRuntime().wrap(function _callee$(_context) { while (1) switch (_context.prev = _context.next) { @@ -7384,7 +9511,6 @@ var _objectWithoutProperties = (__webpack_require__(1847)["default"]); var _classCallCheck = (__webpack_require__(7383)["default"]); var _createClass = (__webpack_require__(4579)["default"]); var _callSuper = (__webpack_require__(8336)["default"]); -var _assertThisInitialized = (__webpack_require__(2475)["default"]); var _inherits = (__webpack_require__(9511)["default"]); var _excluded = ["factory", "maxRedirections", "connect"]; var _require = __webpack_require__(3515), @@ -7416,7 +9542,6 @@ function defaultFactory(origin, opts) { return opts && opts.connections === 1 ? new Client(origin, opts) : new Pool(origin, opts); } var Agent = /*#__PURE__*/function (_DispatcherBase) { - _inherits(Agent, _DispatcherBase); function Agent() { var _this; var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, @@ -7450,13 +9575,13 @@ var Agent = /*#__PURE__*/function (_DispatcherBase) { _this[kMaxRedirections] = maxRedirections; _this[kFactory] = factory; _this[kClients] = new Map(); - _this[kFinalizer] = new FinalizationRegistry( /* istanbul ignore next: gc is undeterministic */function (key) { + _this[kFinalizer] = new FinalizationRegistry(/* istanbul ignore next: gc is undeterministic */function (key) { var ref = _this[kClients].get(key); if (ref !== undefined && ref.deref() === undefined) { _this[kClients]["delete"](key); } }); - var agent = _assertThisInitialized(_this); + var agent = _this; _this[kOnDrain] = function (origin, targets) { agent.emit('drain', origin, [agent].concat(_toConsumableArray(targets))); }; @@ -7471,7 +9596,8 @@ var Agent = /*#__PURE__*/function (_DispatcherBase) { }; return _this; } - _createClass(Agent, [{ + _inherits(Agent, _DispatcherBase); + return _createClass(Agent, [{ key: kRunning, get: function get() { var ret = 0; @@ -7514,7 +9640,7 @@ var Agent = /*#__PURE__*/function (_DispatcherBase) { }, { key: kClose, value: function () { - var _value = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() { + var _value = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() { var closePromises, _iterator2, _step2, ref, client; return _regeneratorRuntime().wrap(function _callee$(_context) { while (1) switch (_context.prev = _context.next) { @@ -7551,7 +9677,7 @@ var Agent = /*#__PURE__*/function (_DispatcherBase) { }, { key: kDestroy, value: function () { - var _value2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(err) { + var _value2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(err) { var destroyPromises, _iterator3, _step3, ref, client; return _regeneratorRuntime().wrap(function _callee2$(_context2) { while (1) switch (_context2.prev = _context2.next) { @@ -7586,7 +9712,6 @@ var Agent = /*#__PURE__*/function (_DispatcherBase) { return value; }() }]); - return Agent; }(DispatcherBase); module.exports = Agent; @@ -7653,7 +9778,6 @@ var _objectSpread = (__webpack_require__(2897)["default"]); var _classCallCheck = (__webpack_require__(7383)["default"]); var _createClass = (__webpack_require__(4579)["default"]); var _callSuper = (__webpack_require__(8336)["default"]); -var _assertThisInitialized = (__webpack_require__(2475)["default"]); var _inherits = (__webpack_require__(9511)["default"]); var _require = __webpack_require__(290), AsyncResource = _require.AsyncResource; @@ -7666,7 +9790,6 @@ var _require3 = __webpack_require__(9350), addSignal = _require3.addSignal, removeSignal = _require3.removeSignal; var ConnectHandler = /*#__PURE__*/function (_AsyncResource) { - _inherits(ConnectHandler, _AsyncResource); function ConnectHandler(opts, callback) { var _this; _classCallCheck(this, ConnectHandler); @@ -7687,10 +9810,11 @@ var ConnectHandler = /*#__PURE__*/function (_AsyncResource) { _this.responseHeaders = responseHeaders || null; _this.callback = callback; _this.abort = null; - addSignal(_assertThisInitialized(_this), signal); + addSignal(_this, signal); return _this; } - _createClass(ConnectHandler, [{ + _inherits(ConnectHandler, _AsyncResource); + return _createClass(ConnectHandler, [{ key: "onConnect", value: function onConnect(abort, context) { if (!this.callback) { @@ -7742,7 +9866,6 @@ var ConnectHandler = /*#__PURE__*/function (_AsyncResource) { } } }]); - return ConnectHandler; }(AsyncResource); function connect(opts, callback) { var _this3 = this; @@ -7781,7 +9904,6 @@ module.exports = connect; var _objectSpread = (__webpack_require__(2897)["default"]); -var _assertThisInitialized = (__webpack_require__(2475)["default"]); var _classCallCheck = (__webpack_require__(7383)["default"]); var _createClass = (__webpack_require__(4579)["default"]); var _callSuper = (__webpack_require__(8336)["default"]); @@ -7803,7 +9925,6 @@ var _require4 = __webpack_require__(9350), var assert = __webpack_require__(2613); var kResume = Symbol('resume'); var PipelineRequest = /*#__PURE__*/function (_Readable) { - _inherits(PipelineRequest, _Readable); function PipelineRequest() { var _this; _classCallCheck(this, PipelineRequest); @@ -7813,7 +9934,8 @@ var PipelineRequest = /*#__PURE__*/function (_Readable) { _this[kResume] = null; return _this; } - _createClass(PipelineRequest, [{ + _inherits(PipelineRequest, _Readable); + return _createClass(PipelineRequest, [{ key: "_read", value: function _read() { var resume = this[kResume]; @@ -7829,10 +9951,8 @@ var PipelineRequest = /*#__PURE__*/function (_Readable) { callback(err); } }]); - return PipelineRequest; }(Readable); var PipelineResponse = /*#__PURE__*/function (_Readable2) { - _inherits(PipelineResponse, _Readable2); function PipelineResponse(resume) { var _this2; _classCallCheck(this, PipelineResponse); @@ -7842,7 +9962,8 @@ var PipelineResponse = /*#__PURE__*/function (_Readable2) { _this2[kResume] = resume; return _this2; } - _createClass(PipelineResponse, [{ + _inherits(PipelineResponse, _Readable2); + return _createClass(PipelineResponse, [{ key: "_read", value: function _read() { this[kResume](); @@ -7856,10 +9977,8 @@ var PipelineResponse = /*#__PURE__*/function (_Readable2) { callback(err); } }]); - return PipelineResponse; }(Readable); var PipelineHandler = /*#__PURE__*/function (_AsyncResource) { - _inherits(PipelineHandler, _AsyncResource); function PipelineHandler(opts, handler) { var _this3; _classCallCheck(this, PipelineHandler); @@ -7895,15 +10014,15 @@ var PipelineHandler = /*#__PURE__*/function (_AsyncResource) { readableObjectMode: opts.objectMode, autoDestroy: true, read: function read() { - var _assertThisInitialize = _assertThisInitialized(_this3), - body = _assertThisInitialize.body; + var _this4 = _this3, + body = _this4.body; if (body && body.resume) { body.resume(); } }, write: function write(chunk, encoding, callback) { - var _assertThisInitialize2 = _assertThisInitialized(_this3), - req = _assertThisInitialize2.req; + var _this5 = _this3, + req = _this5.req; if (req.push(chunk, encoding) || req._readableState.destroyed) { callback(); } else { @@ -7911,12 +10030,12 @@ var PipelineHandler = /*#__PURE__*/function (_AsyncResource) { } }, destroy: function destroy(err, callback) { - var _assertThisInitialize3 = _assertThisInitialized(_this3), - body = _assertThisInitialize3.body, - req = _assertThisInitialize3.req, - res = _assertThisInitialize3.res, - ret = _assertThisInitialize3.ret, - abort = _assertThisInitialize3.abort; + var _this6 = _this3, + body = _this6.body, + req = _this6.req, + res = _this6.res, + ret = _this6.ret, + abort = _this6.abort; if (!err && !ret._readableState.endEmitted) { err = new RequestAbortedError(); } @@ -7926,21 +10045,22 @@ var PipelineHandler = /*#__PURE__*/function (_AsyncResource) { util.destroy(body, err); util.destroy(req, err); util.destroy(res, err); - removeSignal(_assertThisInitialized(_this3)); + removeSignal(_this3); callback(err); } }).on('prefinish', function () { - var _assertThisInitialize4 = _assertThisInitialized(_this3), - req = _assertThisInitialize4.req; + var _this7 = _this3, + req = _this7.req; // Node < 15 does not call _final in same tick. req.push(null); }); _this3.res = null; - addSignal(_assertThisInitialized(_this3), signal); + addSignal(_this3, signal); return _this3; } - _createClass(PipelineHandler, [{ + _inherits(PipelineHandler, _AsyncResource); + return _createClass(PipelineHandler, [{ key: "onConnect", value: function onConnect(abort, context) { var ret = this.ret, @@ -7955,7 +10075,7 @@ var PipelineHandler = /*#__PURE__*/function (_AsyncResource) { }, { key: "onHeaders", value: function onHeaders(statusCode, rawHeaders, resume) { - var _this4 = this; + var _this8 = this; var opaque = this.opaque, handler = this.handler, context = this.context; @@ -7989,19 +10109,19 @@ var PipelineHandler = /*#__PURE__*/function (_AsyncResource) { throw new InvalidReturnValueError('expected Readable'); } body.on('data', function (chunk) { - var ret = _this4.ret, - body = _this4.body; + var ret = _this8.ret, + body = _this8.body; if (!ret.push(chunk) && body.pause) { body.pause(); } }).on('error', function (err) { - var ret = _this4.ret; + var ret = _this8.ret; util.destroy(ret, err); }).on('end', function () { - var ret = _this4.ret; + var ret = _this8.ret; ret.push(null); }).on('close', function () { - var ret = _this4.ret; + var ret = _this8.ret; if (!ret._readableState.ended) { util.destroy(ret, new RequestAbortedError()); } @@ -8028,7 +10148,6 @@ var PipelineHandler = /*#__PURE__*/function (_AsyncResource) { util.destroy(ret, err); } }]); - return PipelineHandler; }(AsyncResource); function pipeline(opts, handler) { try { @@ -8053,8 +10172,8 @@ module.exports = pipeline; var _classCallCheck = (__webpack_require__(7383)["default"]); var _createClass = (__webpack_require__(4579)["default"]); -var _callSuper = (__webpack_require__(8336)["default"]); var _assertThisInitialized = (__webpack_require__(2475)["default"]); +var _callSuper = (__webpack_require__(8336)["default"]); var _inherits = (__webpack_require__(9511)["default"]); var Readable = __webpack_require__(5455); var _require = __webpack_require__(3515), @@ -8069,7 +10188,6 @@ var _require4 = __webpack_require__(9350), addSignal = _require4.addSignal, removeSignal = _require4.removeSignal; var RequestHandler = /*#__PURE__*/function (_AsyncResource) { - _inherits(RequestHandler, _AsyncResource); function RequestHandler(opts, callback) { var _this; _classCallCheck(this, RequestHandler); @@ -8124,9 +10242,10 @@ var RequestHandler = /*#__PURE__*/function (_AsyncResource) { }); } addSignal(_assertThisInitialized(_this), signal); - return _this; + return _assertThisInitialized(_this); } - _createClass(RequestHandler, [{ + _inherits(RequestHandler, _AsyncResource); + return _createClass(RequestHandler, [{ key: "onConnect", value: function onConnect(abort, context) { if (!this.callback) { @@ -8231,7 +10350,6 @@ var RequestHandler = /*#__PURE__*/function (_AsyncResource) { } } }]); - return RequestHandler; }(AsyncResource); function request(opts, callback) { var _this3 = this; @@ -8269,8 +10387,8 @@ module.exports.RequestHandler = RequestHandler; var _classCallCheck = (__webpack_require__(7383)["default"]); var _createClass = (__webpack_require__(4579)["default"]); -var _callSuper = (__webpack_require__(8336)["default"]); var _assertThisInitialized = (__webpack_require__(2475)["default"]); +var _callSuper = (__webpack_require__(8336)["default"]); var _inherits = (__webpack_require__(9511)["default"]); var _require = __webpack_require__(2203), finished = _require.finished, @@ -8288,7 +10406,6 @@ var _require5 = __webpack_require__(9350), addSignal = _require5.addSignal, removeSignal = _require5.removeSignal; var StreamHandler = /*#__PURE__*/function (_AsyncResource) { - _inherits(StreamHandler, _AsyncResource); function StreamHandler(opts, factory, callback) { var _this; _classCallCheck(this, StreamHandler); @@ -8342,9 +10459,10 @@ var StreamHandler = /*#__PURE__*/function (_AsyncResource) { }); } addSignal(_assertThisInitialized(_this), signal); - return _this; + return _assertThisInitialized(_this); } - _createClass(StreamHandler, [{ + _inherits(StreamHandler, _AsyncResource); + return _createClass(StreamHandler, [{ key: "onConnect", value: function onConnect(abort, context) { if (!this.callback) { @@ -8473,7 +10591,6 @@ var StreamHandler = /*#__PURE__*/function (_AsyncResource) { } } }]); - return StreamHandler; }(AsyncResource); function stream(opts, factory, callback) { var _this4 = this; @@ -8512,7 +10629,6 @@ var _objectSpread = (__webpack_require__(2897)["default"]); var _classCallCheck = (__webpack_require__(7383)["default"]); var _createClass = (__webpack_require__(4579)["default"]); var _callSuper = (__webpack_require__(8336)["default"]); -var _assertThisInitialized = (__webpack_require__(2475)["default"]); var _inherits = (__webpack_require__(9511)["default"]); var _require = __webpack_require__(3515), InvalidArgumentError = _require.InvalidArgumentError, @@ -8526,7 +10642,6 @@ var _require3 = __webpack_require__(9350), removeSignal = _require3.removeSignal; var assert = __webpack_require__(2613); var UpgradeHandler = /*#__PURE__*/function (_AsyncResource) { - _inherits(UpgradeHandler, _AsyncResource); function UpgradeHandler(opts, callback) { var _this; _classCallCheck(this, UpgradeHandler); @@ -8548,10 +10663,11 @@ var UpgradeHandler = /*#__PURE__*/function (_AsyncResource) { _this.callback = callback; _this.abort = null; _this.context = null; - addSignal(_assertThisInitialized(_this), signal); + addSignal(_this, signal); return _this; } - _createClass(UpgradeHandler, [{ + _inherits(UpgradeHandler, _AsyncResource); + return _createClass(UpgradeHandler, [{ key: "onConnect", value: function onConnect(abort, context) { if (!this.callback) { @@ -8599,7 +10715,6 @@ var UpgradeHandler = /*#__PURE__*/function (_AsyncResource) { } } }]); - return UpgradeHandler; }(AsyncResource); function upgrade(opts, callback) { var _this3 = this; @@ -8660,8 +10775,7 @@ var _asyncToGenerator = (__webpack_require__(9293)["default"]); var _classCallCheck = (__webpack_require__(7383)["default"]); var _createClass = (__webpack_require__(4579)["default"]); var _callSuper = (__webpack_require__(8336)["default"]); -var _get = (__webpack_require__(2395)["default"]); -var _getPrototypeOf = (__webpack_require__(3072)["default"]); +var _superPropGet = (__webpack_require__(9901)["default"]); var _inherits = (__webpack_require__(9511)["default"]); var assert = __webpack_require__(2613); var _require = __webpack_require__(2203), @@ -8682,7 +10796,6 @@ var kAbort = Symbol('abort'); var kContentType = Symbol('kContentType'); var noop = function noop() {}; module.exports = /*#__PURE__*/function (_Readable) { - _inherits(BodyReadable, _Readable); function BodyReadable(_ref) { var _this; var resume = _ref.resume, @@ -8710,7 +10823,8 @@ module.exports = /*#__PURE__*/function (_Readable) { _this[kReading] = false; return _this; } - _createClass(BodyReadable, [{ + _inherits(BodyReadable, _Readable); + return _createClass(BodyReadable, [{ key: "destroy", value: function destroy(err) { if (this.destroyed) { @@ -8723,12 +10837,11 @@ module.exports = /*#__PURE__*/function (_Readable) { if (err) { this[kAbort](); } - return _get(_getPrototypeOf(BodyReadable.prototype), "destroy", this).call(this, err); + return _superPropGet(BodyReadable, "destroy", this, 3)([err]); } }, { key: "emit", value: function emit(ev) { - var _get2; if (ev === 'data') { // Node < 16.7 this._readableState.dataEmitted = true; @@ -8739,19 +10852,18 @@ module.exports = /*#__PURE__*/function (_Readable) { for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { args[_key - 1] = arguments[_key]; } - return (_get2 = _get(_getPrototypeOf(BodyReadable.prototype), "emit", this)).call.apply(_get2, [this, ev].concat(args)); + return _superPropGet(BodyReadable, "emit", this, 3)([ev].concat(args)); } }, { key: "on", value: function on(ev) { - var _get3; if (ev === 'data' || ev === 'readable') { this[kReading] = true; } for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { args[_key2 - 1] = arguments[_key2]; } - return (_get3 = _get(_getPrototypeOf(BodyReadable.prototype), "on", this)).call.apply(_get3, [this, ev].concat(args)); + return _superPropGet(BodyReadable, "on", this, 3)([ev].concat(args)); } }, { key: "addListener", @@ -8764,11 +10876,10 @@ module.exports = /*#__PURE__*/function (_Readable) { }, { key: "off", value: function off(ev) { - var _get4; for (var _len4 = arguments.length, args = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) { args[_key4 - 1] = arguments[_key4]; } - var ret = (_get4 = _get(_getPrototypeOf(BodyReadable.prototype), "off", this)).call.apply(_get4, [this, ev].concat(args)); + var ret = _superPropGet(BodyReadable, "off", this, 3)([ev].concat(args)); if (ev === 'data' || ev === 'readable') { this[kReading] = this.listenerCount('data') > 0 || this.listenerCount('readable') > 0; } @@ -8787,16 +10898,16 @@ module.exports = /*#__PURE__*/function (_Readable) { value: function push(chunk) { if (this[kConsume] && chunk !== null && this.readableLength === 0) { consumePush(this[kConsume], chunk); - return this[kReading] ? _get(_getPrototypeOf(BodyReadable.prototype), "push", this).call(this, chunk) : true; + return this[kReading] ? _superPropGet(BodyReadable, "push", this, 3)([chunk]) : true; } - return _get(_getPrototypeOf(BodyReadable.prototype), "push", this).call(this, chunk); + return _superPropGet(BodyReadable, "push", this, 3)([chunk]); } // https://fetch.spec.whatwg.org/#dom-body-text }, { key: "text", value: function () { - var _text = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() { + var _text = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() { return _regeneratorRuntime().wrap(function _callee$(_context) { while (1) switch (_context.prev = _context.next) { case 0: @@ -8815,7 +10926,7 @@ module.exports = /*#__PURE__*/function (_Readable) { }, { key: "json", value: function () { - var _json = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() { + var _json = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2() { return _regeneratorRuntime().wrap(function _callee2$(_context2) { while (1) switch (_context2.prev = _context2.next) { case 0: @@ -8834,7 +10945,7 @@ module.exports = /*#__PURE__*/function (_Readable) { }, { key: "blob", value: function () { - var _blob = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() { + var _blob = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3() { return _regeneratorRuntime().wrap(function _callee3$(_context3) { while (1) switch (_context3.prev = _context3.next) { case 0: @@ -8853,7 +10964,7 @@ module.exports = /*#__PURE__*/function (_Readable) { }, { key: "arrayBuffer", value: function () { - var _arrayBuffer = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() { + var _arrayBuffer = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4() { return _regeneratorRuntime().wrap(function _callee4$(_context4) { while (1) switch (_context4.prev = _context4.next) { case 0: @@ -8872,7 +10983,7 @@ module.exports = /*#__PURE__*/function (_Readable) { }, { key: "formData", value: function () { - var _formData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() { + var _formData = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5() { return _regeneratorRuntime().wrap(function _callee5$(_context5) { while (1) switch (_context5.prev = _context5.next) { case 0: @@ -8949,7 +11060,6 @@ module.exports = /*#__PURE__*/function (_Readable) { }); } }]); - return BodyReadable; }(Readable); // https://streams.spec.whatwg.org/#readablestream-locked @@ -8966,7 +11076,7 @@ function consume(_x, _x2) { return _consume.apply(this, arguments); } function _consume() { - _consume = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(stream, type) { + _consume = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6(stream, type) { return _regeneratorRuntime().wrap(function _callee6$(_context6) { while (1) switch (_context6.prev = _context6.next) { case 0: @@ -9111,7 +11221,7 @@ function getResolveErrorBodyCallback(_x) { return _getResolveErrorBodyCallback.apply(this, arguments); } function _getResolveErrorBodyCallback() { - _getResolveErrorBodyCallback = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref) { + _getResolveErrorBodyCallback = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref) { var callback, body, contentType, statusCode, statusMessage, headers, chunks, limit, _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _iterator, _step, chunk, payload, _payload; return _regeneratorRuntime().wrap(function _callee$(_context) { while (1) switch (_context.prev = _context.next) { @@ -9264,7 +11374,6 @@ function defaultFactory(origin, opts) { return new Pool(origin, opts); } var BalancedPool = /*#__PURE__*/function (_PoolBase) { - _inherits(BalancedPool, _PoolBase); function BalancedPool() { var _this; var upstreams = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; @@ -9302,7 +11411,8 @@ var BalancedPool = /*#__PURE__*/function (_PoolBase) { _this._updateBalancedPoolStats(); return _this; } - _createClass(BalancedPool, [{ + _inherits(BalancedPool, _PoolBase); + return _createClass(BalancedPool, [{ key: "addUpstream", value: function addUpstream(upstream) { var _this2 = this; @@ -9425,7 +11535,6 @@ var BalancedPool = /*#__PURE__*/function (_PoolBase) { return this[kClients][maxWeightIndex]; } }]); - return BalancedPool; }(PoolBase); module.exports = BalancedPool; @@ -9447,9 +11556,9 @@ var _classCallCheck = (__webpack_require__(7383)["default"]); var _createClass = (__webpack_require__(4579)["default"]); var _classPrivateMethodInitSpec = (__webpack_require__(3312)["default"]); var _classPrivateFieldInitSpec = (__webpack_require__(2459)["default"]); -var _classPrivateMethodGet = (__webpack_require__(137)["default"]); -var _classPrivateFieldGet = (__webpack_require__(4972)["default"]); -var _classPrivateFieldSet = (__webpack_require__(2808)["default"]); +var _assertClassBrand = (__webpack_require__(1756)["default"]); +var _classPrivateFieldGet = (__webpack_require__(6668)["default"]); +var _classPrivateFieldSet = (__webpack_require__(7088)["default"]); var _require = __webpack_require__(1568), kConstruct = _require.kConstruct; var _require2 = __webpack_require__(2465), @@ -9496,52 +11605,30 @@ var _require11 = __webpack_require__(4397), * @typedef {[any, any][]} requestResponseList */ var _relevantRequestResponseList = /*#__PURE__*/new WeakMap(); -var _batchCacheOperations = /*#__PURE__*/new WeakSet(); -var _queryCache = /*#__PURE__*/new WeakSet(); -var _requestMatchesCachedItem = /*#__PURE__*/new WeakSet(); +var _Cache_brand = /*#__PURE__*/new WeakSet(); var Cache = /*#__PURE__*/function () { function Cache() { _classCallCheck(this, Cache); - /** - * @see https://w3c.github.io/ServiceWorker/#request-matches-cached-item-algorithm - * @param {any} requestQuery - * @param {any} request - * @param {any | null} response - * @param {import('../../types/cache').CacheQueryOptions | undefined} options - * @returns {boolean} - */ - _classPrivateMethodInitSpec(this, _requestMatchesCachedItem); - /** - * @see https://w3c.github.io/ServiceWorker/#query-cache - * @param {any} requestQuery - * @param {import('../../types/cache').CacheQueryOptions} options - * @param {requestResponseList} targetStorage - * @returns {requestResponseList} - */ - _classPrivateMethodInitSpec(this, _queryCache); /** * @see https://w3c.github.io/ServiceWorker/#batch-cache-operations-algorithm * @param {CacheBatchOperation[]} operations * @returns {requestResponseList} */ - _classPrivateMethodInitSpec(this, _batchCacheOperations); + _classPrivateMethodInitSpec(this, _Cache_brand); /** * @see https://w3c.github.io/ServiceWorker/#dfn-relevant-request-response-list * @type {requestResponseList} */ - _classPrivateFieldInitSpec(this, _relevantRequestResponseList, { - writable: true, - value: void 0 - }); + _classPrivateFieldInitSpec(this, _relevantRequestResponseList, void 0); if (arguments[0] !== kConstruct) { webidl.illegalConstructor(); } - _classPrivateFieldSet(this, _relevantRequestResponseList, arguments[1]); + _classPrivateFieldSet(_relevantRequestResponseList, this, arguments[1]); } - _createClass(Cache, [{ + return _createClass(Cache, [{ key: "match", value: function () { - var _match = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(request) { + var _match = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(request) { var options, p, _args = arguments; @@ -9580,7 +11667,7 @@ var Cache = /*#__PURE__*/function () { }, { key: "matchAll", value: function () { - var _matchAll = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() { + var _matchAll = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2() { var request, options, r, @@ -9643,7 +11730,7 @@ var Cache = /*#__PURE__*/function () { responses = []; // 5.2 if (request === undefined) { // 5.2.1 - _iterator = _createForOfIteratorHelper(_classPrivateFieldGet(this, _relevantRequestResponseList)); + _iterator = _createForOfIteratorHelper(_classPrivateFieldGet(_relevantRequestResponseList, this)); try { for (_iterator.s(); !(_step = _iterator.n()).done;) { requestResponse = _step.value; @@ -9657,7 +11744,7 @@ var Cache = /*#__PURE__*/function () { } else { // 5.3 // 5.3.1 - requestResponses = _classPrivateMethodGet(this, _queryCache, _queryCache2).call(this, r, options); // 5.3.2 + requestResponses = _assertClassBrand(_Cache_brand, this, _queryCache).call(this, r, options); // 5.3.2 _iterator2 = _createForOfIteratorHelper(requestResponses); try { for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) { @@ -9704,7 +11791,7 @@ var Cache = /*#__PURE__*/function () { }, { key: "add", value: function () { - var _add = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(request) { + var _add = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(request) { var requests, responseArrayPromise, _args3 = arguments; @@ -9738,7 +11825,7 @@ var Cache = /*#__PURE__*/function () { }, { key: "addAll", value: function () { - var _addAll = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(requests) { + var _addAll = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(requests) { var responsePromises, requestList, _iterator3, @@ -9962,7 +12049,7 @@ var Cache = /*#__PURE__*/function () { cacheJobPromise = createDeferredPromise(); // 7.6.1 errorData = null; // 7.6.2 try { - _classPrivateMethodGet(this, _batchCacheOperations, _batchCacheOperations2).call(this, operations); + _assertClassBrand(_Cache_brand, this, _batchCacheOperations).call(this, operations); } catch (e) { errorData = e; } @@ -9994,7 +12081,7 @@ var Cache = /*#__PURE__*/function () { }, { key: "put", value: function () { - var _put = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(request, response) { + var _put = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5(request, response) { var innerRequest, innerResponse, fieldValues, @@ -10137,7 +12224,7 @@ var Cache = /*#__PURE__*/function () { cacheJobPromise = createDeferredPromise(); // 19.2.1 errorData = null; // 19.2.2 try { - _classPrivateMethodGet(this, _batchCacheOperations, _batchCacheOperations2).call(this, operations); + _assertClassBrand(_Cache_brand, this, _batchCacheOperations).call(this, operations); } catch (e) { errorData = e; } @@ -10167,7 +12254,7 @@ var Cache = /*#__PURE__*/function () { }, { key: "delete", value: function () { - var _delete2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(request) { + var _delete2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6(request) { var options, r, operations, @@ -10220,7 +12307,7 @@ var Cache = /*#__PURE__*/function () { cacheJobPromise = createDeferredPromise(); errorData = null; try { - requestResponses = _classPrivateMethodGet(this, _batchCacheOperations, _batchCacheOperations2).call(this, operations); + requestResponses = _assertClassBrand(_Cache_brand, this, _batchCacheOperations).call(this, operations); } catch (e) { errorData = e; } @@ -10253,7 +12340,7 @@ var Cache = /*#__PURE__*/function () { }, { key: "keys", value: (function () { - var _keys = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() { + var _keys = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee7() { var request, options, r, @@ -10310,7 +12397,7 @@ var Cache = /*#__PURE__*/function () { requests = []; // 5.2 if (request === undefined) { // 5.2.1 - _iterator8 = _createForOfIteratorHelper(_classPrivateFieldGet(this, _relevantRequestResponseList)); + _iterator8 = _createForOfIteratorHelper(_classPrivateFieldGet(_relevantRequestResponseList, this)); try { for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) { requestResponse = _step8.value; @@ -10325,7 +12412,7 @@ var Cache = /*#__PURE__*/function () { } else { // 5.3 // 5.3.1 - requestResponses = _classPrivateMethodGet(this, _queryCache, _queryCache2).call(this, r, options); // 5.3.2 + requestResponses = _assertClassBrand(_Cache_brand, this, _queryCache).call(this, r, options); // 5.3.2 _iterator9 = _createForOfIteratorHelper(requestResponses); try { for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) { @@ -10374,11 +12461,10 @@ var Cache = /*#__PURE__*/function () { return keys; }()) }]); - return Cache; }(); -function _batchCacheOperations2(operations) { +function _batchCacheOperations(operations) { // 1. - var cache = _classPrivateFieldGet(this, _relevantRequestResponseList); + var cache = _classPrivateFieldGet(_relevantRequestResponseList, this); // 2. var backupCache = _toConsumableArray(cache); @@ -10412,7 +12498,7 @@ function _batchCacheOperations2(operations) { } // 4.2.3 - if (_classPrivateMethodGet(this, _queryCache, _queryCache2).call(this, operation.request, operation.options, addedItems).length) { + if (_assertClassBrand(_Cache_brand, this, _queryCache).call(this, operation.request, operation.options, addedItems).length) { throw new DOMException('???', 'InvalidStateError'); } @@ -10422,7 +12508,7 @@ function _batchCacheOperations2(operations) { // 4.2.5 if (operation.type === 'delete') { // 4.2.5.1 - requestResponses = _classPrivateMethodGet(this, _queryCache, _queryCache2).call(this, operation.request, operation.options); + requestResponses = _assertClassBrand(_Cache_brand, this, _queryCache).call(this, operation.request, operation.options); // TODO: the spec is wrong, this is needed to pass WPTs if (requestResponses.length === 0) { @@ -10484,7 +12570,7 @@ function _batchCacheOperations2(operations) { } // 4.2.6.6 - requestResponses = _classPrivateMethodGet(this, _queryCache, _queryCache2).call(this, operation.request); + requestResponses = _assertClassBrand(_Cache_brand, this, _queryCache).call(this, operation.request); // 4.2.6.7 var _iterator12 = _createForOfIteratorHelper(requestResponses), @@ -10525,19 +12611,26 @@ function _batchCacheOperations2(operations) { } catch (e) { // 5. // 5.1 - _classPrivateFieldGet(this, _relevantRequestResponseList).length = 0; + _classPrivateFieldGet(_relevantRequestResponseList, this).length = 0; // 5.2 - _classPrivateFieldSet(this, _relevantRequestResponseList, backupCache); + _classPrivateFieldSet(_relevantRequestResponseList, this, backupCache); // 5.3 throw e; } } -function _queryCache2(requestQuery, options, targetStorage) { +/** + * @see https://w3c.github.io/ServiceWorker/#query-cache + * @param {any} requestQuery + * @param {import('../../types/cache').CacheQueryOptions} options + * @param {requestResponseList} targetStorage + * @returns {requestResponseList} + */ +function _queryCache(requestQuery, options, targetStorage) { /** @type {requestResponseList} */ var resultList = []; - var storage = targetStorage !== null && targetStorage !== void 0 ? targetStorage : _classPrivateFieldGet(this, _relevantRequestResponseList); + var storage = targetStorage !== null && targetStorage !== void 0 ? targetStorage : _classPrivateFieldGet(_relevantRequestResponseList, this); var _iterator13 = _createForOfIteratorHelper(storage), _step13; try { @@ -10546,7 +12639,7 @@ function _queryCache2(requestQuery, options, targetStorage) { var _requestResponse4 = _slicedToArray(requestResponse, 2), cachedRequest = _requestResponse4[0], cachedResponse = _requestResponse4[1]; - if (_classPrivateMethodGet(this, _requestMatchesCachedItem, _requestMatchesCachedItem2).call(this, requestQuery, cachedRequest, cachedResponse, options)) { + if (_assertClassBrand(_Cache_brand, this, _requestMatchesCachedItem).call(this, requestQuery, cachedRequest, cachedResponse, options)) { resultList.push(requestResponse); } } @@ -10557,7 +12650,15 @@ function _queryCache2(requestQuery, options, targetStorage) { } return resultList; } -function _requestMatchesCachedItem2(requestQuery, request) { +/** + * @see https://w3c.github.io/ServiceWorker/#request-matches-cached-item-algorithm + * @param {any} requestQuery + * @param {any} request + * @param {any | null} response + * @param {import('../../types/cache').CacheQueryOptions | undefined} options + * @returns {boolean} + */ +function _requestMatchesCachedItem(requestQuery, request) { var response = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; var options = arguments.length > 3 ? arguments[3] : undefined; // if (options?.ignoreMethod === false && request.method === 'GET') { @@ -10645,7 +12746,7 @@ var _asyncToGenerator = (__webpack_require__(9293)["default"]); var _classCallCheck = (__webpack_require__(7383)["default"]); var _createClass = (__webpack_require__(4579)["default"]); var _classPrivateFieldInitSpec = (__webpack_require__(2459)["default"]); -var _classPrivateFieldGet = (__webpack_require__(4972)["default"]); +var _classPrivateFieldGet = (__webpack_require__(6668)["default"]); var _require = __webpack_require__(1568), kConstruct = _require.kConstruct; var _require2 = __webpack_require__(9319), @@ -10662,18 +12763,15 @@ var CacheStorage = /*#__PURE__*/function () { * @see https://w3c.github.io/ServiceWorker/#dfn-relevant-name-to-cache-map * @type {Map { + +"use strict"; + + +/** @type {Record} */ +var headerNameLowerCasedRecord = {}; + +// https://developer.mozilla.org/docs/Web/HTTP/Headers +var wellknownHeaderNames = ['Accept', 'Accept-Encoding', 'Accept-Language', 'Accept-Ranges', 'Access-Control-Allow-Credentials', 'Access-Control-Allow-Headers', 'Access-Control-Allow-Methods', 'Access-Control-Allow-Origin', 'Access-Control-Expose-Headers', 'Access-Control-Max-Age', 'Access-Control-Request-Headers', 'Access-Control-Request-Method', 'Age', 'Allow', 'Alt-Svc', 'Alt-Used', 'Authorization', 'Cache-Control', 'Clear-Site-Data', 'Connection', 'Content-Disposition', 'Content-Encoding', 'Content-Language', 'Content-Length', 'Content-Location', 'Content-Range', 'Content-Security-Policy', 'Content-Security-Policy-Report-Only', 'Content-Type', 'Cookie', 'Cross-Origin-Embedder-Policy', 'Cross-Origin-Opener-Policy', 'Cross-Origin-Resource-Policy', 'Date', 'Device-Memory', 'Downlink', 'ECT', 'ETag', 'Expect', 'Expect-CT', 'Expires', 'Forwarded', 'From', 'Host', 'If-Match', 'If-Modified-Since', 'If-None-Match', 'If-Range', 'If-Unmodified-Since', 'Keep-Alive', 'Last-Modified', 'Link', 'Location', 'Max-Forwards', 'Origin', 'Permissions-Policy', 'Pragma', 'Proxy-Authenticate', 'Proxy-Authorization', 'RTT', 'Range', 'Referer', 'Referrer-Policy', 'Refresh', 'Retry-After', 'Sec-WebSocket-Accept', 'Sec-WebSocket-Extensions', 'Sec-WebSocket-Key', 'Sec-WebSocket-Protocol', 'Sec-WebSocket-Version', 'Server', 'Server-Timing', 'Service-Worker-Allowed', 'Service-Worker-Navigation-Preload', 'Set-Cookie', 'SourceMap', 'Strict-Transport-Security', 'Supports-Loading-Mode', 'TE', 'Timing-Allow-Origin', 'Trailer', 'Transfer-Encoding', 'Upgrade', 'Upgrade-Insecure-Requests', 'User-Agent', 'Vary', 'Via', 'WWW-Authenticate', 'X-Content-Type-Options', 'X-DNS-Prefetch-Control', 'X-Frame-Options', 'X-Permitted-Cross-Domain-Policies', 'X-Powered-By', 'X-Requested-With', 'X-XSS-Protection']; +for (var i = 0; i < wellknownHeaderNames.length; ++i) { + var key = wellknownHeaderNames[i]; + var lowerCasedKey = key.toLowerCase(); + headerNameLowerCasedRecord[key] = headerNameLowerCasedRecord[lowerCasedKey] = lowerCasedKey; +} + +// Note: object prototypes should not be able to be referenced. e.g. `Object#hasOwnProperty`. +Object.setPrototypeOf(headerNameLowerCasedRecord, null); +module.exports = { + wellknownHeaderNames: wellknownHeaderNames, + headerNameLowerCasedRecord: headerNameLowerCasedRecord +}; + +/***/ }), + /***/ 3515: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; -var _assertThisInitialized = (__webpack_require__(2475)["default"]); var _createClass = (__webpack_require__(4579)["default"]); var _classCallCheck = (__webpack_require__(7383)["default"]); var _callSuper = (__webpack_require__(8336)["default"]); var _inherits = (__webpack_require__(9511)["default"]); var _wrapNativeSuper = (__webpack_require__(1837)["default"]); var UndiciError = /*#__PURE__*/function (_Error) { - _inherits(UndiciError, _Error); function UndiciError(message) { var _this; _classCallCheck(this, UndiciError); @@ -14426,71 +16540,71 @@ var UndiciError = /*#__PURE__*/function (_Error) { _this.code = 'UND_ERR'; return _this; } + _inherits(UndiciError, _Error); return _createClass(UndiciError); -}( /*#__PURE__*/_wrapNativeSuper(Error)); +}(/*#__PURE__*/_wrapNativeSuper(Error)); var ConnectTimeoutError = /*#__PURE__*/function (_UndiciError) { - _inherits(ConnectTimeoutError, _UndiciError); function ConnectTimeoutError(message) { var _this2; _classCallCheck(this, ConnectTimeoutError); _this2 = _callSuper(this, ConnectTimeoutError, [message]); - Error.captureStackTrace(_assertThisInitialized(_this2), ConnectTimeoutError); + Error.captureStackTrace(_this2, ConnectTimeoutError); _this2.name = 'ConnectTimeoutError'; _this2.message = message || 'Connect Timeout Error'; _this2.code = 'UND_ERR_CONNECT_TIMEOUT'; return _this2; } + _inherits(ConnectTimeoutError, _UndiciError); return _createClass(ConnectTimeoutError); }(UndiciError); var HeadersTimeoutError = /*#__PURE__*/function (_UndiciError2) { - _inherits(HeadersTimeoutError, _UndiciError2); function HeadersTimeoutError(message) { var _this3; _classCallCheck(this, HeadersTimeoutError); _this3 = _callSuper(this, HeadersTimeoutError, [message]); - Error.captureStackTrace(_assertThisInitialized(_this3), HeadersTimeoutError); + Error.captureStackTrace(_this3, HeadersTimeoutError); _this3.name = 'HeadersTimeoutError'; _this3.message = message || 'Headers Timeout Error'; _this3.code = 'UND_ERR_HEADERS_TIMEOUT'; return _this3; } + _inherits(HeadersTimeoutError, _UndiciError2); return _createClass(HeadersTimeoutError); }(UndiciError); var HeadersOverflowError = /*#__PURE__*/function (_UndiciError3) { - _inherits(HeadersOverflowError, _UndiciError3); function HeadersOverflowError(message) { var _this4; _classCallCheck(this, HeadersOverflowError); _this4 = _callSuper(this, HeadersOverflowError, [message]); - Error.captureStackTrace(_assertThisInitialized(_this4), HeadersOverflowError); + Error.captureStackTrace(_this4, HeadersOverflowError); _this4.name = 'HeadersOverflowError'; _this4.message = message || 'Headers Overflow Error'; _this4.code = 'UND_ERR_HEADERS_OVERFLOW'; return _this4; } + _inherits(HeadersOverflowError, _UndiciError3); return _createClass(HeadersOverflowError); }(UndiciError); var BodyTimeoutError = /*#__PURE__*/function (_UndiciError4) { - _inherits(BodyTimeoutError, _UndiciError4); function BodyTimeoutError(message) { var _this5; _classCallCheck(this, BodyTimeoutError); _this5 = _callSuper(this, BodyTimeoutError, [message]); - Error.captureStackTrace(_assertThisInitialized(_this5), BodyTimeoutError); + Error.captureStackTrace(_this5, BodyTimeoutError); _this5.name = 'BodyTimeoutError'; _this5.message = message || 'Body Timeout Error'; _this5.code = 'UND_ERR_BODY_TIMEOUT'; return _this5; } + _inherits(BodyTimeoutError, _UndiciError4); return _createClass(BodyTimeoutError); }(UndiciError); var ResponseStatusCodeError = /*#__PURE__*/function (_UndiciError5) { - _inherits(ResponseStatusCodeError, _UndiciError5); function ResponseStatusCodeError(message, statusCode, headers, body) { var _this6; _classCallCheck(this, ResponseStatusCodeError); _this6 = _callSuper(this, ResponseStatusCodeError, [message]); - Error.captureStackTrace(_assertThisInitialized(_this6), ResponseStatusCodeError); + Error.captureStackTrace(_this6, ResponseStatusCodeError); _this6.name = 'ResponseStatusCodeError'; _this6.message = message || 'Response Status Code Error'; _this6.code = 'UND_ERR_RESPONSE_STATUS_CODE'; @@ -14500,200 +16614,200 @@ var ResponseStatusCodeError = /*#__PURE__*/function (_UndiciError5) { _this6.headers = headers; return _this6; } + _inherits(ResponseStatusCodeError, _UndiciError5); return _createClass(ResponseStatusCodeError); }(UndiciError); var InvalidArgumentError = /*#__PURE__*/function (_UndiciError6) { - _inherits(InvalidArgumentError, _UndiciError6); function InvalidArgumentError(message) { var _this7; _classCallCheck(this, InvalidArgumentError); _this7 = _callSuper(this, InvalidArgumentError, [message]); - Error.captureStackTrace(_assertThisInitialized(_this7), InvalidArgumentError); + Error.captureStackTrace(_this7, InvalidArgumentError); _this7.name = 'InvalidArgumentError'; _this7.message = message || 'Invalid Argument Error'; _this7.code = 'UND_ERR_INVALID_ARG'; return _this7; } + _inherits(InvalidArgumentError, _UndiciError6); return _createClass(InvalidArgumentError); }(UndiciError); var InvalidReturnValueError = /*#__PURE__*/function (_UndiciError7) { - _inherits(InvalidReturnValueError, _UndiciError7); function InvalidReturnValueError(message) { var _this8; _classCallCheck(this, InvalidReturnValueError); _this8 = _callSuper(this, InvalidReturnValueError, [message]); - Error.captureStackTrace(_assertThisInitialized(_this8), InvalidReturnValueError); + Error.captureStackTrace(_this8, InvalidReturnValueError); _this8.name = 'InvalidReturnValueError'; _this8.message = message || 'Invalid Return Value Error'; _this8.code = 'UND_ERR_INVALID_RETURN_VALUE'; return _this8; } + _inherits(InvalidReturnValueError, _UndiciError7); return _createClass(InvalidReturnValueError); }(UndiciError); var RequestAbortedError = /*#__PURE__*/function (_UndiciError8) { - _inherits(RequestAbortedError, _UndiciError8); function RequestAbortedError(message) { var _this9; _classCallCheck(this, RequestAbortedError); _this9 = _callSuper(this, RequestAbortedError, [message]); - Error.captureStackTrace(_assertThisInitialized(_this9), RequestAbortedError); + Error.captureStackTrace(_this9, RequestAbortedError); _this9.name = 'AbortError'; _this9.message = message || 'Request aborted'; _this9.code = 'UND_ERR_ABORTED'; return _this9; } + _inherits(RequestAbortedError, _UndiciError8); return _createClass(RequestAbortedError); }(UndiciError); var InformationalError = /*#__PURE__*/function (_UndiciError9) { - _inherits(InformationalError, _UndiciError9); function InformationalError(message) { var _this10; _classCallCheck(this, InformationalError); _this10 = _callSuper(this, InformationalError, [message]); - Error.captureStackTrace(_assertThisInitialized(_this10), InformationalError); + Error.captureStackTrace(_this10, InformationalError); _this10.name = 'InformationalError'; _this10.message = message || 'Request information'; _this10.code = 'UND_ERR_INFO'; return _this10; } + _inherits(InformationalError, _UndiciError9); return _createClass(InformationalError); }(UndiciError); var RequestContentLengthMismatchError = /*#__PURE__*/function (_UndiciError10) { - _inherits(RequestContentLengthMismatchError, _UndiciError10); function RequestContentLengthMismatchError(message) { var _this11; _classCallCheck(this, RequestContentLengthMismatchError); _this11 = _callSuper(this, RequestContentLengthMismatchError, [message]); - Error.captureStackTrace(_assertThisInitialized(_this11), RequestContentLengthMismatchError); + Error.captureStackTrace(_this11, RequestContentLengthMismatchError); _this11.name = 'RequestContentLengthMismatchError'; _this11.message = message || 'Request body length does not match content-length header'; _this11.code = 'UND_ERR_REQ_CONTENT_LENGTH_MISMATCH'; return _this11; } + _inherits(RequestContentLengthMismatchError, _UndiciError10); return _createClass(RequestContentLengthMismatchError); }(UndiciError); var ResponseContentLengthMismatchError = /*#__PURE__*/function (_UndiciError11) { - _inherits(ResponseContentLengthMismatchError, _UndiciError11); function ResponseContentLengthMismatchError(message) { var _this12; _classCallCheck(this, ResponseContentLengthMismatchError); _this12 = _callSuper(this, ResponseContentLengthMismatchError, [message]); - Error.captureStackTrace(_assertThisInitialized(_this12), ResponseContentLengthMismatchError); + Error.captureStackTrace(_this12, ResponseContentLengthMismatchError); _this12.name = 'ResponseContentLengthMismatchError'; _this12.message = message || 'Response body length does not match content-length header'; _this12.code = 'UND_ERR_RES_CONTENT_LENGTH_MISMATCH'; return _this12; } + _inherits(ResponseContentLengthMismatchError, _UndiciError11); return _createClass(ResponseContentLengthMismatchError); }(UndiciError); var ClientDestroyedError = /*#__PURE__*/function (_UndiciError12) { - _inherits(ClientDestroyedError, _UndiciError12); function ClientDestroyedError(message) { var _this13; _classCallCheck(this, ClientDestroyedError); _this13 = _callSuper(this, ClientDestroyedError, [message]); - Error.captureStackTrace(_assertThisInitialized(_this13), ClientDestroyedError); + Error.captureStackTrace(_this13, ClientDestroyedError); _this13.name = 'ClientDestroyedError'; _this13.message = message || 'The client is destroyed'; _this13.code = 'UND_ERR_DESTROYED'; return _this13; } + _inherits(ClientDestroyedError, _UndiciError12); return _createClass(ClientDestroyedError); }(UndiciError); var ClientClosedError = /*#__PURE__*/function (_UndiciError13) { - _inherits(ClientClosedError, _UndiciError13); function ClientClosedError(message) { var _this14; _classCallCheck(this, ClientClosedError); _this14 = _callSuper(this, ClientClosedError, [message]); - Error.captureStackTrace(_assertThisInitialized(_this14), ClientClosedError); + Error.captureStackTrace(_this14, ClientClosedError); _this14.name = 'ClientClosedError'; _this14.message = message || 'The client is closed'; _this14.code = 'UND_ERR_CLOSED'; return _this14; } + _inherits(ClientClosedError, _UndiciError13); return _createClass(ClientClosedError); }(UndiciError); var SocketError = /*#__PURE__*/function (_UndiciError14) { - _inherits(SocketError, _UndiciError14); function SocketError(message, socket) { var _this15; _classCallCheck(this, SocketError); _this15 = _callSuper(this, SocketError, [message]); - Error.captureStackTrace(_assertThisInitialized(_this15), SocketError); + Error.captureStackTrace(_this15, SocketError); _this15.name = 'SocketError'; _this15.message = message || 'Socket error'; _this15.code = 'UND_ERR_SOCKET'; _this15.socket = socket; return _this15; } + _inherits(SocketError, _UndiciError14); return _createClass(SocketError); }(UndiciError); var NotSupportedError = /*#__PURE__*/function (_UndiciError15) { - _inherits(NotSupportedError, _UndiciError15); function NotSupportedError(message) { var _this16; _classCallCheck(this, NotSupportedError); _this16 = _callSuper(this, NotSupportedError, [message]); - Error.captureStackTrace(_assertThisInitialized(_this16), NotSupportedError); + Error.captureStackTrace(_this16, NotSupportedError); _this16.name = 'NotSupportedError'; _this16.message = message || 'Not supported error'; _this16.code = 'UND_ERR_NOT_SUPPORTED'; return _this16; } + _inherits(NotSupportedError, _UndiciError15); return _createClass(NotSupportedError); }(UndiciError); var BalancedPoolMissingUpstreamError = /*#__PURE__*/function (_UndiciError16) { - _inherits(BalancedPoolMissingUpstreamError, _UndiciError16); function BalancedPoolMissingUpstreamError(message) { var _this17; _classCallCheck(this, BalancedPoolMissingUpstreamError); _this17 = _callSuper(this, BalancedPoolMissingUpstreamError, [message]); - Error.captureStackTrace(_assertThisInitialized(_this17), NotSupportedError); + Error.captureStackTrace(_this17, NotSupportedError); _this17.name = 'MissingUpstreamError'; _this17.message = message || 'No upstream has been added to the BalancedPool'; _this17.code = 'UND_ERR_BPL_MISSING_UPSTREAM'; return _this17; } + _inherits(BalancedPoolMissingUpstreamError, _UndiciError16); return _createClass(BalancedPoolMissingUpstreamError); }(UndiciError); var HTTPParserError = /*#__PURE__*/function (_Error2) { - _inherits(HTTPParserError, _Error2); function HTTPParserError(message, code, data) { var _this18; _classCallCheck(this, HTTPParserError); _this18 = _callSuper(this, HTTPParserError, [message]); - Error.captureStackTrace(_assertThisInitialized(_this18), HTTPParserError); + Error.captureStackTrace(_this18, HTTPParserError); _this18.name = 'HTTPParserError'; _this18.code = code ? "HPE_".concat(code) : undefined; _this18.data = data ? data.toString() : undefined; return _this18; } + _inherits(HTTPParserError, _Error2); return _createClass(HTTPParserError); -}( /*#__PURE__*/_wrapNativeSuper(Error)); +}(/*#__PURE__*/_wrapNativeSuper(Error)); var ResponseExceededMaxSizeError = /*#__PURE__*/function (_UndiciError17) { - _inherits(ResponseExceededMaxSizeError, _UndiciError17); function ResponseExceededMaxSizeError(message) { var _this19; _classCallCheck(this, ResponseExceededMaxSizeError); _this19 = _callSuper(this, ResponseExceededMaxSizeError, [message]); - Error.captureStackTrace(_assertThisInitialized(_this19), ResponseExceededMaxSizeError); + Error.captureStackTrace(_this19, ResponseExceededMaxSizeError); _this19.name = 'ResponseExceededMaxSizeError'; _this19.message = message || 'Response content exceeded max size'; _this19.code = 'UND_ERR_RES_EXCEEDED_MAX_SIZE'; return _this19; } + _inherits(ResponseExceededMaxSizeError, _UndiciError17); return _createClass(ResponseExceededMaxSizeError); }(UndiciError); var RequestRetryError = /*#__PURE__*/function (_UndiciError18) { - _inherits(RequestRetryError, _UndiciError18); function RequestRetryError(message, code, _ref) { var _this20; var headers = _ref.headers, data = _ref.data; _classCallCheck(this, RequestRetryError); _this20 = _callSuper(this, RequestRetryError, [message]); - Error.captureStackTrace(_assertThisInitialized(_this20), RequestRetryError); + Error.captureStackTrace(_this20, RequestRetryError); _this20.name = 'RequestRetryError'; _this20.message = message || 'Request retry error'; _this20.code = 'UND_ERR_REQ_RETRY'; @@ -14702,6 +16816,7 @@ var RequestRetryError = /*#__PURE__*/function (_UndiciError18) { _this20.headers = headers; return _this20; } + _inherits(RequestRetryError, _UndiciError18); return _createClass(RequestRetryError); }(UndiciError); module.exports = { @@ -14939,7 +17054,7 @@ var Request = /*#__PURE__*/function () { }); } } - _createClass(Request, [{ + return _createClass(Request, [{ key: "onBodySent", value: function onBodySent(chunk) { if (this[kHandler].onBodySent) { @@ -15132,7 +17247,6 @@ var Request = /*#__PURE__*/function () { return headers; } }]); - return Request; }(); function processHeaderValue(key, val, skipAppend) { if (val && typeof val === 'object') { @@ -15296,6 +17410,8 @@ var _require4 = __webpack_require__(181), var nodeUtil = __webpack_require__(9023); var _require5 = __webpack_require__(3480), stringify = _require5.stringify; +var _require6 = __webpack_require__(5751), + headerNameLowerCasedRecord = _require6.headerNameLowerCasedRecord; var _process$versions$nod = process.versions.node.split('.').map(function (v) { return Number(v); }), @@ -15452,6 +17568,15 @@ function parseKeepAliveTimeout(val) { var m = val.toString().match(KEEPALIVE_TIMEOUT_EXPR); return m ? parseInt(m[1], 10) * 1000 : null; } + +/** + * Retrieves a header name and returns its lowercase value. + * @param {string | Buffer} value Header name + * @returns {string} + */ +function headerNameToString(value) { + return headerNameLowerCasedRecord[value] || value.toLowerCase(); +} function parseHeaders(headers) { var obj = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; // For H2 support @@ -15567,7 +17692,7 @@ function convertIterableToBuffer(_x) { return _convertIterableToBuffer.apply(this, arguments); } function _convertIterableToBuffer() { - _convertIterableToBuffer = _wrapAsyncGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(iterable) { + _convertIterableToBuffer = _wrapAsyncGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(iterable) { var _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _iterator, _step, chunk; return _regeneratorRuntime().wrap(function _callee$(_context) { while (1) switch (_context.prev = _context.next) { @@ -15638,7 +17763,7 @@ function ReadableStreamFrom(iterable) { var iterator; return new ReadableStream({ start: function start() { - return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() { + return _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2() { return _regeneratorRuntime().wrap(function _callee2$(_context2) { while (1) switch (_context2.prev = _context2.next) { case 0: @@ -15651,7 +17776,7 @@ function ReadableStreamFrom(iterable) { }))(); }, pull: function pull(controller) { - return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() { + return _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3() { var _yield$iterator$next, done, value, buf; return _regeneratorRuntime().wrap(function _callee3$(_context3) { while (1) switch (_context3.prev = _context3.next) { @@ -15679,7 +17804,7 @@ function ReadableStreamFrom(iterable) { }))(); }, cancel: function cancel(reason) { - return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() { + return _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4() { return _regeneratorRuntime().wrap(function _callee4$(_context4) { while (1) switch (_context4.prev = _context4.next) { case 0: @@ -15776,6 +17901,7 @@ module.exports = { isIterable: isIterable, isAsyncIterable: isAsyncIterable, isDestroyed: isDestroyed, + headerNameToString: headerNameToString, parseRawHeaders: parseRawHeaders, parseHeaders: parseHeaders, parseKeepAliveTimeout: parseKeepAliveTimeout, @@ -15825,7 +17951,6 @@ var kOnDestroyed = Symbol('onDestroyed'); var kOnClosed = Symbol('onClosed'); var kInterceptedDispatch = Symbol('Intercepted Dispatch'); var DispatcherBase = /*#__PURE__*/function (_Dispatcher) { - _inherits(DispatcherBase, _Dispatcher); function DispatcherBase() { var _this; _classCallCheck(this, DispatcherBase); @@ -15836,7 +17961,8 @@ var DispatcherBase = /*#__PURE__*/function (_Dispatcher) { _this[kOnClosed] = []; return _this; } - _createClass(DispatcherBase, [{ + _inherits(DispatcherBase, _Dispatcher); + return _createClass(DispatcherBase, [{ key: "destroyed", get: function get() { return this[kDestroyed]; @@ -15996,7 +18122,6 @@ var DispatcherBase = /*#__PURE__*/function (_Dispatcher) { } } }]); - return DispatcherBase; }(Dispatcher); module.exports = DispatcherBase; @@ -16014,12 +18139,12 @@ var _callSuper = (__webpack_require__(8336)["default"]); var _inherits = (__webpack_require__(9511)["default"]); var EventEmitter = __webpack_require__(4434); var Dispatcher = /*#__PURE__*/function (_EventEmitter) { - _inherits(Dispatcher, _EventEmitter); function Dispatcher() { _classCallCheck(this, Dispatcher); return _callSuper(this, Dispatcher, arguments); } - _createClass(Dispatcher, [{ + _inherits(Dispatcher, _EventEmitter); + return _createClass(Dispatcher, [{ key: "dispatch", value: function dispatch() { throw new Error('not implemented'); @@ -16035,7 +18160,6 @@ var Dispatcher = /*#__PURE__*/function (_EventEmitter) { throw new Error('not implemented'); } }]); - return Dispatcher; }(EventEmitter); module.exports = Dispatcher; @@ -16118,7 +18242,7 @@ function extractBody(object) { // up stream. stream = new ReadableStream({ pull: function pull(controller) { - return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() { + return _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() { return _regeneratorRuntime().wrap(function _callee$(_context) { while (1) switch (_context.prev = _context.next) { case 0: @@ -16242,7 +18366,7 @@ function extractBody(object) { // Set source to object. source = object; action = /*#__PURE__*/function () { - var _ref = _wrapAsyncGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() { + var _ref = _wrapAsyncGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2() { var _i, _blobParts, part; return _regeneratorRuntime().wrap(function _callee2$(_context2) { while (1) switch (_context2.prev = _context2.next) { @@ -16323,7 +18447,7 @@ function extractBody(object) { var iterator; stream = new ReadableStream({ start: function start() { - return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() { + return _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3() { return _regeneratorRuntime().wrap(function _callee3$(_context3) { while (1) switch (_context3.prev = _context3.next) { case 0: @@ -16336,7 +18460,7 @@ function extractBody(object) { }))(); }, pull: function pull(controller) { - return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() { + return _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4() { var _yield$iterator$next, value, done; return _regeneratorRuntime().wrap(function _callee4$(_context4) { while (1) switch (_context4.prev = _context4.next) { @@ -16369,7 +18493,7 @@ function extractBody(object) { }))(); }, cancel: function cancel(reason) { - return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() { + return _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5() { return _regeneratorRuntime().wrap(function _callee5$(_context5) { while (1) switch (_context5.prev = _context5.next) { case 0: @@ -16454,7 +18578,7 @@ function consumeBody(_x) { return _consumeBody.apply(this, arguments); } function _consumeBody() { - _consumeBody = _wrapAsyncGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(body) { + _consumeBody = _wrapAsyncGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6(body) { var stream; return _regeneratorRuntime().wrap(function _callee6$(_context6) { while (1) switch (_context6.prev = _context6.next) { @@ -16547,7 +18671,7 @@ function bodyMixinMethods(instance) { }, formData: function formData() { var _this2 = this; - return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() { + return _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee7() { var contentType, headers, _iterator4, _step4, _step4$value, key, value, responseFormData, busboy, busboyResolve, _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _iterator, _step, chunk, entries, text, streamingDecoder, _iteratorAbruptCompletion2, _didIteratorError2, _iteratorError2, _iterator2, _step2, _chunk3, formData, _iterator5, _step5, _step5$value, name, _value; return _regeneratorRuntime().wrap(function _callee7$(_context7) { while (1) switch (_context7.prev = _context7.next) { @@ -16803,7 +18927,7 @@ function specConsumeBody(_x2, _x3, _x4) { return _specConsumeBody.apply(this, arguments); } // https://fetch.spec.whatwg.org/#body-unusable function _specConsumeBody() { - _specConsumeBody = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(object, convertBytesToJSValue, instance) { + _specConsumeBody = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee8(object, convertBytesToJSValue, instance) { var promise, errorSteps, successSteps; return _regeneratorRuntime().wrap(function _callee8$(_context8) { while (1) switch (_context8.prev = _context8.next) { @@ -17662,7 +19786,6 @@ var _require7 = __webpack_require__(6632), kEnumerableProperty = _require7.kEnumerableProperty; var encoder = new TextEncoder(); var File = /*#__PURE__*/function (_Blob) { - _inherits(File, _Blob); function File(fileBits, fileName) { var _this; var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; @@ -17731,7 +19854,8 @@ var File = /*#__PURE__*/function (_Blob) { }; return _this; } - _createClass(File, [{ + _inherits(File, _Blob); + return _createClass(File, [{ key: "name", get: function get() { webidl.brandCheck(this, File); @@ -17750,9 +19874,8 @@ var File = /*#__PURE__*/function (_Blob) { return this[kState].type; } }]); - return File; }(Blob); -var FileLike = /*#__PURE__*/function (_Symbol$toStringTag) { +var FileLike = /*#__PURE__*/function () { function FileLike(blobLike, fileName) { var _options$lastModified; var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; @@ -17802,7 +19925,7 @@ var FileLike = /*#__PURE__*/function (_Symbol$toStringTag) { lastModified: d }; } - _createClass(FileLike, [{ + return _createClass(FileLike, [{ key: "stream", value: function stream() { var _this$kState$blobLike; @@ -17855,13 +19978,12 @@ var FileLike = /*#__PURE__*/function (_Symbol$toStringTag) { return this[kState].lastModified; } }, { - key: _Symbol$toStringTag, + key: Symbol.toStringTag, get: function get() { return 'File'; } }]); - return FileLike; -}(Symbol.toStringTag); +}(); Object.defineProperties(File.prototype, _defineProperty(_defineProperty(_defineProperty({}, Symbol.toStringTag, { value: 'File', configurable: true @@ -18038,7 +20160,7 @@ var FormData = /*#__PURE__*/function () { } this[kState] = []; } - _createClass(FormData, [{ + return _createClass(FormData, [{ key: "append", value: function append(name, value) { var filename = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined; @@ -18242,7 +20364,6 @@ var FormData = /*#__PURE__*/function () { } } }]); - return FormData; }(); FormData.prototype[Symbol.iterator] = FormData.prototype.entries; Object.defineProperties(FormData.prototype, _defineProperty({}, Symbol.toStringTag, { @@ -18360,7 +20481,6 @@ var _toConsumableArray = (__webpack_require__(1132)["default"]); var _classCallCheck = (__webpack_require__(7383)["default"]); var _createClass = (__webpack_require__(4579)["default"]); var _defineProperty = (__webpack_require__(3693)["default"]); -var _Symbol$iterator; var _require = __webpack_require__(6771), kHeadersList = _require.kHeadersList, kConstruct = _require.kConstruct; @@ -18479,7 +20599,6 @@ function appendHeader(headers, name, value) { // 8. If headers’s guard is "request-no-cors", then remove // privileged no-CORS request headers from headers } -_Symbol$iterator = Symbol.iterator; var HeadersList = /*#__PURE__*/function () { function HeadersList(init) { _classCallCheck(this, HeadersList); @@ -18496,7 +20615,7 @@ var HeadersList = /*#__PURE__*/function () { } // https://fetch.spec.whatwg.org/#header-list-contains - _createClass(HeadersList, [{ + return _createClass(HeadersList, [{ key: "contains", value: function contains(name) { // A header list list contains a header name name if list @@ -18589,7 +20708,7 @@ var HeadersList = /*#__PURE__*/function () { return value === undefined ? null : value.value; } }, { - key: _Symbol$iterator, + key: Symbol.iterator, value: /*#__PURE__*/_regeneratorRuntime().mark(function value() { var _iterator, _step, _step$value, name, value; return _regeneratorRuntime().wrap(function value$(_context) { @@ -18650,9 +20769,8 @@ var HeadersList = /*#__PURE__*/function () { return headers; } }]); - return HeadersList; }(); // https://fetch.spec.whatwg.org/#headers-class -var Headers = /*#__PURE__*/function (_Symbol$for) { +var Headers = /*#__PURE__*/function () { function Headers() { var init = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined; _classCallCheck(this, Headers); @@ -18674,7 +20792,7 @@ var Headers = /*#__PURE__*/function (_Symbol$for) { } // https://fetch.spec.whatwg.org/#dom-headers-append - _createClass(Headers, [{ + return _createClass(Headers, [{ key: "append", value: function append(name, value) { webidl.brandCheck(this, Headers); @@ -18977,14 +21095,13 @@ var Headers = /*#__PURE__*/function (_Symbol$for) { } } }, { - key: _Symbol$for, + key: Symbol["for"]('nodejs.util.inspect.custom'), value: function value() { webidl.brandCheck(this, Headers); return this[kHeadersList]; } }]); - return Headers; -}(Symbol["for"]('nodejs.util.inspect.custom')); +}(); Headers.prototype[Symbol.iterator] = Headers.prototype.entries; Object.defineProperties(Headers.prototype, _defineProperty(_defineProperty({ append: kEnumerableProperty, @@ -19130,7 +21247,6 @@ var GET_OR_HEAD = ['GET', 'HEAD']; var resolveObjectURL; var ReadableStream = globalThis.ReadableStream; var Fetch = /*#__PURE__*/function (_EE) { - _inherits(Fetch, _EE); function Fetch(dispatcher) { var _this; _classCallCheck(this, Fetch); @@ -19147,7 +21263,8 @@ var Fetch = /*#__PURE__*/function (_EE) { _this.setMaxListeners(21); return _this; } - _createClass(Fetch, [{ + _inherits(Fetch, _EE); + return _createClass(Fetch, [{ key: "terminate", value: function terminate(reason) { var _this$connection; @@ -19187,7 +21304,6 @@ var Fetch = /*#__PURE__*/function (_EE) { this.emit('terminated', error); } }]); - return Fetch; }(EE); // https://fetch.spec.whatwg.org/#fetch-method function fetch(input) { var _globalObject$constru, _init$dispatcher; @@ -19589,7 +21705,7 @@ function mainFetch(_x2) { } // https://fetch.spec.whatwg.org/#concept-scheme-fetch // given a fetch params fetchParams function _mainFetch() { - _mainFetch = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(fetchParams) { + _mainFetch = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(fetchParams) { var recursive, request, response, @@ -19657,7 +21773,7 @@ function _mainFetch() { break; } _context2.next = 11; - return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() { + return _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() { var currentURL; return _regeneratorRuntime().wrap(function _callee$(_context) { while (1) switch (_context.prev = _context.next) { @@ -20116,7 +22232,7 @@ function httpFetch(_x3) { return _httpFetch.apply(this, arguments); } // https://fetch.spec.whatwg.org/#http-redirect-fetch function _httpFetch() { - _httpFetch = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(fetchParams) { + _httpFetch = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(fetchParams) { var request, response, actualResponse, timingInfo; return _regeneratorRuntime().wrap(function _callee3$(_context3) { while (1) switch (_context3.prev = _context3.next) { @@ -20362,7 +22478,7 @@ function httpNetworkOrCacheFetch(_x4) { return _httpNetworkOrCacheFetch.apply(this, arguments); } // https://fetch.spec.whatwg.org/#http-network-fetch function _httpNetworkOrCacheFetch() { - _httpNetworkOrCacheFetch = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(fetchParams) { + _httpNetworkOrCacheFetch = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(fetchParams) { var isAuthenticationFetch, isNewConnectionFetch, request, @@ -20663,7 +22779,7 @@ function httpNetworkFetch(_x5) { return _httpNetworkFetch.apply(this, arguments); } function _httpNetworkFetch() { - _httpNetworkFetch = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(fetchParams) { + _httpNetworkFetch = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee12(fetchParams) { var includeCredentials, forceNewConnection, request, @@ -20693,7 +22809,7 @@ function _httpNetworkFetch() { while (1) switch (_context12.prev = _context12.next) { case 0: _dispatch = function _dispatch3() { - _dispatch = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(_ref5) { + _dispatch = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee11(_ref5) { var body, url, agent; return _regeneratorRuntime().wrap(function _callee11$(_context11) { while (1) switch (_context11.prev = _context11.next) { @@ -21016,7 +23132,7 @@ function _httpNetworkFetch() { // 2. Otherwise, if body is non-null: // 1. Let processBodyChunk given bytes be these steps: processBodyChunk = /*#__PURE__*/function () { - var _ref = _wrapAsyncGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(bytes) { + var _ref = _wrapAsyncGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5(bytes) { var _fetchParams$processR; return _regeneratorRuntime().wrap(function _callee5$(_context5) { while (1) switch (_context5.prev = _context5.next) { @@ -21069,7 +23185,7 @@ function _httpNetworkFetch() { } }; // 4. Incrementally read request’s body given processBodyChunk, processEndOfBody, // processBodyError, and fetchParams’s task destination. - requestBody = _wrapAsyncGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() { + requestBody = _wrapAsyncGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6() { var _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _iterator, _step, bytes; return _regeneratorRuntime().wrap(function _callee6$(_context6) { while (1) switch (_context6.prev = _context6.next) { @@ -21206,7 +23322,7 @@ function _httpNetworkFetch() { } stream = new ReadableStream({ start: function start(controller) { - return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() { + return _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee7() { return _regeneratorRuntime().wrap(function _callee7$(_context7) { while (1) switch (_context7.prev = _context7.next) { case 0: @@ -21219,7 +23335,7 @@ function _httpNetworkFetch() { }))(); }, pull: function pull(controller) { - return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() { + return _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee8() { return _regeneratorRuntime().wrap(function _callee8$(_context8) { while (1) switch (_context8.prev = _context8.next) { case 0: @@ -21233,7 +23349,7 @@ function _httpNetworkFetch() { }))(); }, cancel: function cancel(reason) { - return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9() { + return _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee9() { return _regeneratorRuntime().wrap(function _callee9$(_context9) { while (1) switch (_context9.prev = _context9.next) { case 0: @@ -21275,7 +23391,7 @@ function _httpNetworkFetch() { // 1. Run these steps, but abort when fetchParams is canceled: fetchParams.controller.on('terminated', onAborted); - fetchParams.controller.resume = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10() { + fetchParams.controller.resume = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee10() { var _bytes$byteLength, _bytes, bytes, isFailure, _yield$fetchParams$co, done, value; return _regeneratorRuntime().wrap(function _callee10$(_context10) { while (1) switch (_context10.prev = _context10.next) { @@ -21945,7 +24061,7 @@ var Request = /*#__PURE__*/function () { } // Returns request’s HTTP method, which is "GET" by default. - _createClass(Request, [{ + return _createClass(Request, [{ key: "method", get: function get() { webidl.brandCheck(this, Request); @@ -22191,7 +24307,6 @@ var Request = /*#__PURE__*/function () { return clonedRequestObject; } }]); - return Request; }(); mixinBody(Request); function makeRequest(init) { @@ -22466,7 +24581,7 @@ var Response = /*#__PURE__*/function () { } // Returns response’s type, e.g., "cors". - _createClass(Response, [{ + return _createClass(Response, [{ key: "type", get: function get() { webidl.brandCheck(this, Response); @@ -22697,7 +24812,6 @@ var Response = /*#__PURE__*/function () { return responseObject; } }]); - return Response; }(); mixinBody(Response); Object.defineProperties(Response.prototype, _defineProperty({ @@ -23017,12 +25131,18 @@ var _require4 = __webpack_require__(6632), var assert = __webpack_require__(2613); var _require5 = __webpack_require__(8253), isUint8Array = _require5.isUint8Array; +var supportedHashes = []; // https://nodejs.org/api/crypto.html#determining-if-crypto-support-is-unavailable /** @type {import('crypto')|undefined} */ var crypto; try { crypto = __webpack_require__(6982); + var possibleRelevantHashes = ['sha256', 'sha384', 'sha512']; + supportedHashes = crypto.getHashes().filter(function (hash) { + return possibleRelevantHashes.includes(hash); + }); + /* c8 ignore next 3 */ } catch (_unused) {} function responseURL(response) { // https://fetch.spec.whatwg.org/#responses @@ -23526,24 +25646,20 @@ function bytesMatch(bytes, metadataList) { return true; } - // 3. If parsedMetadata is the empty set, return true. + // 3. If response is not eligible for integrity validation, return false. + // TODO + + // 4. If parsedMetadata is the empty set, return true. if (parsedMetadata.length === 0) { return true; } - // 4. Let metadata be the result of getting the strongest + // 5. Let metadata be the result of getting the strongest // metadata from parsedMetadata. - var list = parsedMetadata.sort(function (c, d) { - return d.algo.localeCompare(c.algo); - }); - // get the strongest algorithm - var strongest = list[0].algo; - // get all entries that use the strongest algorithm; ignore weaker - var metadata = list.filter(function (item) { - return item.algo === strongest; - }); + var strongest = getStrongestMetadata(parsedMetadata); + var metadata = filterMetadataListByAlgorithm(parsedMetadata, strongest); - // 5. For each item in metadata: + // 6. For each item in metadata: var _iterator = _createForOfIteratorHelper(metadata), _step; try { @@ -23558,31 +25674,24 @@ function bytesMatch(bytes, metadataList) { // See https://github.com/web-platform-tests/wpt/commit/e4c5cc7a5e48093220528dfdd1c4012dc3837a0e // "be liberal with padding". This is annoying, and it's not even in the spec. - if (expectedValue.endsWith('==')) { - expectedValue = expectedValue.slice(0, -2); - } - // 3. Let actualValue be the result of applying algorithm to bytes. var actualValue = crypto.createHash(algorithm).update(bytes).digest('base64'); - if (actualValue.endsWith('==')) { - actualValue = actualValue.slice(0, -2); + if (actualValue[actualValue.length - 1] === '=') { + if (actualValue[actualValue.length - 2] === '=') { + actualValue = actualValue.slice(0, -2); + } else { + actualValue = actualValue.slice(0, -1); + } } // 4. If actualValue is a case-sensitive match for expectedValue, // return true. - if (actualValue === expectedValue) { - return true; - } - var actualBase64URL = crypto.createHash(algorithm).update(bytes).digest('base64url'); - if (actualBase64URL.endsWith('==')) { - actualBase64URL = actualBase64URL.slice(0, -2); - } - if (actualBase64URL === expectedValue) { + if (compareBase64Mixed(actualValue, expectedValue)) { return true; } } - // 6. Return false. + // 7. Return false. } catch (err) { _iterator.e(err); } finally { @@ -23594,8 +25703,8 @@ function bytesMatch(bytes, metadataList) { // https://w3c.github.io/webappsec-subresource-integrity/#grammardef-hash-with-options // https://www.w3.org/TR/CSP2/#source-list-syntax // https://www.rfc-editor.org/rfc/rfc5234#appendix-B.1 -var parseHashWithOptions = /*#__PURE__*/_wrapRegExp(/((sha256|sha384|sha512)\x2D([A-z0-9+/]{1}.*={0,2}))( +[\x21-\x7E]?)?/i, { - algo: 2, +var parseHashWithOptions = /*#__PURE__*/_wrapRegExp(/(sha256|sha384|sha512)-(([A-Za-z0-9+/]+|[A-Za-z0-9_-]+)={0,2}(?:\s|$)( +[!-~]*)?)?/i, { + algo: 1, hash: 3 }); @@ -23610,7 +25719,6 @@ function parseMetadata(metadata) { // 2. Let empty be equal to true. var empty = true; - var supportedHashes = crypto.getHashes(); // 3. For each token returned by splitting metadata on spaces: var _iterator2 = _createForOfIteratorHelper(metadata.split(' ')), @@ -23625,7 +25733,7 @@ function parseMetadata(metadata) { var parsedToken = parseHashWithOptions.exec(token); // 3. If token does not parse, continue to the next token. - if (parsedToken === null || parsedToken.groups === undefined) { + if (parsedToken === null || parsedToken.groups === undefined || parsedToken.groups.algo === undefined) { // Note: Chromium blocks the request at this point, but Firefox // gives a warning that an invalid integrity was given. The // correct behavior is to ignore these, and subsequently not @@ -23634,11 +25742,11 @@ function parseMetadata(metadata) { } // 4. Let algorithm be the hash-algo component of token. - var algorithm = parsedToken.groups.algo; + var algorithm = parsedToken.groups.algo.toLowerCase(); // 5. If algorithm is a hash function recognized by the user // agent, add the parsed token to result. - if (supportedHashes.includes(algorithm.toLowerCase())) { + if (supportedHashes.includes(algorithm)) { result.push(parsedToken.groups); } } @@ -23655,6 +25763,73 @@ function parseMetadata(metadata) { return result; } +/** + * @param {{ algo: 'sha256' | 'sha384' | 'sha512' }[]} metadataList + */ +function getStrongestMetadata(metadataList) { + // Let algorithm be the algo component of the first item in metadataList. + // Can be sha256 + var algorithm = metadataList[0].algo; + // If the algorithm is sha512, then it is the strongest + // and we can return immediately + if (algorithm[3] === '5') { + return algorithm; + } + for (var i = 1; i < metadataList.length; ++i) { + var metadata = metadataList[i]; + // If the algorithm is sha512, then it is the strongest + // and we can break the loop immediately + if (metadata.algo[3] === '5') { + algorithm = 'sha512'; + break; + // If the algorithm is sha384, then a potential sha256 or sha384 is ignored + } else if (algorithm[3] === '3') { + continue; + // algorithm is sha256, check if algorithm is sha384 and if so, set it as + // the strongest + } else if (metadata.algo[3] === '3') { + algorithm = 'sha384'; + } + } + return algorithm; +} +function filterMetadataListByAlgorithm(metadataList, algorithm) { + if (metadataList.length === 1) { + return metadataList; + } + var pos = 0; + for (var i = 0; i < metadataList.length; ++i) { + if (metadataList[i].algo === algorithm) { + metadataList[pos++] = metadataList[i]; + } + } + metadataList.length = pos; + return metadataList; +} + +/** + * Compares two base64 strings, allowing for base64url + * in the second string. + * +* @param {string} actualValue always base64 + * @param {string} expectedValue base64 or base64url + * @returns {boolean} + */ +function compareBase64Mixed(actualValue, expectedValue) { + if (actualValue.length !== expectedValue.length) { + return false; + } + for (var i = 0; i < actualValue.length; ++i) { + if (actualValue[i] !== expectedValue[i]) { + if (actualValue[i] === '+' && expectedValue[i] === '-' || actualValue[i] === '/' && expectedValue[i] === '_') { + continue; + } + return false; + } + } + return true; +} + // https://w3c.github.io/webappsec-upgrade-insecure-requests/#upgrade-request function tryUpgradeRequestToAPotentiallyTrustworthyURL(request) { // TODO @@ -23869,7 +26044,7 @@ function fullyReadBody(_x, _x2, _x3) { } /** @type {ReadableStream} */ function _fullyReadBody() { - _fullyReadBody = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(body, processBody, processBodyError) { + _fullyReadBody = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(body, processBody, processBodyError) { var successSteps, errorSteps, reader, result; return _regeneratorRuntime().wrap(function _callee$(_context) { while (1) switch (_context.prev = _context.next) { @@ -23982,7 +26157,7 @@ function readAllBytes(_x4) { * @param {URL} url */ function _readAllBytes() { - _readAllBytes = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(reader) { + _readAllBytes = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(reader) { var bytes, byteLength, _yield$reader$read, done, chunk; return _regeneratorRuntime().wrap(function _callee2$(_context2) { while (1) switch (_context2.prev = _context2.next) { @@ -24102,7 +26277,8 @@ module.exports = { urlHasHttpsScheme: urlHasHttpsScheme, urlIsHttpHttpsScheme: urlIsHttpHttpsScheme, readAllBytes: readAllBytes, - normalizeMethodRecord: normalizeMethodRecord + normalizeMethodRecord: normalizeMethodRecord, + parseMetadata: parseMetadata }; /***/ }), @@ -25062,7 +27238,6 @@ var _require3 = __webpack_require__(3702), var _require4 = __webpack_require__(6632), kEnumerableProperty = _require4.kEnumerableProperty; var FileReader = /*#__PURE__*/function (_EventTarget) { - _inherits(FileReader, _EventTarget); function FileReader() { var _this; _classCallCheck(this, FileReader); @@ -25085,7 +27260,8 @@ var FileReader = /*#__PURE__*/function (_EventTarget) { * @see https://w3c.github.io/FileAPI/#dfn-readAsArrayBuffer * @param {import('buffer').Blob} blob */ - _createClass(FileReader, [{ + _inherits(FileReader, _EventTarget); + return _createClass(FileReader, [{ key: "readAsArrayBuffer", value: function readAsArrayBuffer(blob) { webidl.brandCheck(this, FileReader); @@ -25356,8 +27532,7 @@ var FileReader = /*#__PURE__*/function (_EventTarget) { } } }]); - return FileReader; -}( /*#__PURE__*/_wrapNativeSuper(EventTarget)); // https://w3c.github.io/FileAPI/#dom-filereader-empty +}(/*#__PURE__*/_wrapNativeSuper(EventTarget)); // https://w3c.github.io/FileAPI/#dom-filereader-empty FileReader.EMPTY = FileReader.prototype.EMPTY = 0; // https://w3c.github.io/FileAPI/#dom-filereader-loading FileReader.LOADING = FileReader.prototype.LOADING = 1; @@ -25417,7 +27592,6 @@ var kState = Symbol('ProgressEvent state'); * @see https://xhr.spec.whatwg.org/#progressevent */ var ProgressEvent = /*#__PURE__*/function (_Event) { - _inherits(ProgressEvent, _Event); function ProgressEvent(type) { var _eventInitDict; var _this; @@ -25433,7 +27607,8 @@ var ProgressEvent = /*#__PURE__*/function (_Event) { }; return _this; } - _createClass(ProgressEvent, [{ + _inherits(ProgressEvent, _Event); + return _createClass(ProgressEvent, [{ key: "lengthComputable", get: function get() { webidl.brandCheck(this, ProgressEvent); @@ -25452,8 +27627,7 @@ var ProgressEvent = /*#__PURE__*/function (_Event) { return this[kState].total; } }]); - return ProgressEvent; -}( /*#__PURE__*/_wrapNativeSuper(Event)); +}(/*#__PURE__*/_wrapNativeSuper(Event)); webidl.converters.ProgressEventInit = webidl.dictionaryConverter([{ key: 'lengthComputable', converter: webidl.converters["boolean"], @@ -25588,7 +27762,7 @@ function readOperation(fr, blob, type, encodingName) { // reading the body would then reject the promise, instead // of throwing an error. ; - _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() { + _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() { var _loop, _ret; return _regeneratorRuntime().wrap(function _callee$(_context2) { while (1) switch (_context2.prev = _context2.next) { @@ -26020,7 +28194,7 @@ module.exports = /*#__PURE__*/function () { _classCallCheck(this, DecoratorHandler); this.handler = handler; } - _createClass(DecoratorHandler, [{ + return _createClass(DecoratorHandler, [{ key: "onConnect", value: function onConnect() { var _this$handler; @@ -26063,7 +28237,6 @@ module.exports = /*#__PURE__*/function () { return (_this$handler7 = this.handler).onBodySent.apply(_this$handler7, arguments); } }]); - return DecoratorHandler; }(); /***/ }), @@ -26091,17 +28264,17 @@ var _require2 = __webpack_require__(3515), var EE = __webpack_require__(4434); var redirectableStatusCodes = [300, 301, 302, 303, 307, 308]; var kBody = Symbol('body'); -var BodyAsyncIterable = /*#__PURE__*/function (_Symbol$asyncIterator) { +var BodyAsyncIterable = /*#__PURE__*/function () { function BodyAsyncIterable(body) { _classCallCheck(this, BodyAsyncIterable); this[kBody] = body; this[kBodyUsed] = false; } - _createClass(BodyAsyncIterable, [{ - key: _Symbol$asyncIterator, + return _createClass(BodyAsyncIterable, [{ + key: Symbol.asyncIterator, value: function value() { var _this = this; - return _wrapAsyncGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() { + return _wrapAsyncGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() { return _regeneratorRuntime().wrap(function _callee$(_context) { while (1) switch (_context.prev = _context.next) { case 0: @@ -26116,8 +28289,7 @@ var BodyAsyncIterable = /*#__PURE__*/function (_Symbol$asyncIterator) { }))(); } }]); - return BodyAsyncIterable; -}(Symbol.asyncIterator); +}(); var RedirectHandler = /*#__PURE__*/function () { function RedirectHandler(dispatch, maxRedirections, opts, handler) { _classCallCheck(this, RedirectHandler); @@ -26160,7 +28332,7 @@ var RedirectHandler = /*#__PURE__*/function () { this.opts.body = new BodyAsyncIterable(this.opts.body); } } - _createClass(RedirectHandler, [{ + return _createClass(RedirectHandler, [{ key: "onConnect", value: function onConnect(abort) { this.abort = abort; @@ -26257,7 +28429,6 @@ var RedirectHandler = /*#__PURE__*/function () { } } }]); - return RedirectHandler; }(); function parseLocation(statusCode, headers) { if (redirectableStatusCodes.indexOf(statusCode) === -1) { @@ -26272,7 +28443,17 @@ function parseLocation(statusCode, headers) { // https://tools.ietf.org/html/rfc7231#section-6.4.4 function shouldRemoveHeader(header, removeContent, unknownOrigin) { - return header.length === 4 && header.toString().toLowerCase() === 'host' || removeContent && header.toString().toLowerCase().indexOf('content-') === 0 || unknownOrigin && header.length === 13 && header.toString().toLowerCase() === 'authorization' || unknownOrigin && header.length === 6 && header.toString().toLowerCase() === 'cookie'; + if (header.length === 4) { + return util.headerNameToString(header) === 'host'; + } + if (removeContent && util.headerNameToString(header).startsWith('content-')) { + return true; + } + if (unknownOrigin && (header.length === 13 || header.length === 6 || header.length === 19)) { + var name = util.headerNameToString(header); + return name === 'authorization' || name === 'cookie' || name === 'proxy-authorization'; + } + return false; } // https://tools.ietf.org/html/rfc7231#section-6.4 @@ -26377,7 +28558,7 @@ var RetryHandler = /*#__PURE__*/function () { } }); } - _createClass(RetryHandler, [{ + return _createClass(RetryHandler, [{ key: "onRequestSent", value: function onRequestSent() { if (this.handler.onRequestSent) { @@ -26589,7 +28770,6 @@ var RetryHandler = /*#__PURE__*/function () { }, retryTimeout); } }]); - return RetryHandler; }(); module.exports = RetryHandler; @@ -26955,16 +29135,14 @@ var FakeWeakRef = /*#__PURE__*/function () { _classCallCheck(this, FakeWeakRef); this.value = value; } - _createClass(FakeWeakRef, [{ + return _createClass(FakeWeakRef, [{ key: "deref", value: function deref() { return this.value; } }]); - return FakeWeakRef; }(); var MockAgent = /*#__PURE__*/function (_Dispatcher) { - _inherits(MockAgent, _Dispatcher); function MockAgent(opts) { var _this; _classCallCheck(this, MockAgent); @@ -26982,7 +29160,8 @@ var MockAgent = /*#__PURE__*/function (_Dispatcher) { _this[kOptions] = buildMockOptions(opts); return _this; } - _createClass(MockAgent, [{ + _inherits(MockAgent, _Dispatcher); + return _createClass(MockAgent, [{ key: "get", value: function get(origin) { var dispatcher = this[kMockAgentGet](origin); @@ -27002,7 +29181,7 @@ var MockAgent = /*#__PURE__*/function (_Dispatcher) { }, { key: "close", value: function () { - var _close = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() { + var _close = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() { return _regeneratorRuntime().wrap(function _callee$(_context) { while (1) switch (_context.prev = _context.next) { case 0: @@ -27139,7 +29318,6 @@ var MockAgent = /*#__PURE__*/function (_Dispatcher) { throw new UndiciError("\n".concat(pluralizer.count, " ").concat(pluralizer.noun, " ").concat(pluralizer.is, " pending:\n\n").concat(pendingInterceptorsFormatter.format(pending), "\n").trim()); } }]); - return MockAgent; }(Dispatcher); module.exports = MockAgent; @@ -27156,7 +29334,6 @@ var _asyncToGenerator = (__webpack_require__(9293)["default"]); var _classCallCheck = (__webpack_require__(7383)["default"]); var _createClass = (__webpack_require__(4579)["default"]); var _callSuper = (__webpack_require__(8336)["default"]); -var _assertThisInitialized = (__webpack_require__(2475)["default"]); var _inherits = (__webpack_require__(9511)["default"]); var _require = __webpack_require__(9023), promisify = _require.promisify; @@ -27181,7 +29358,6 @@ var _require5 = __webpack_require__(3515), * MockClient provides an API that extends the Client to influence the mockDispatches. */ var MockClient = /*#__PURE__*/function (_Client, _Symbols$kConnected) { - _inherits(MockClient, _Client); function MockClient(origin, opts) { var _this; _classCallCheck(this, MockClient); @@ -27194,12 +29370,13 @@ var MockClient = /*#__PURE__*/function (_Client, _Symbols$kConnected) { _this[kDispatches] = []; _this[kConnected] = 1; _this[kOriginalDispatch] = _this.dispatch; - _this[kOriginalClose] = _this.close.bind(_assertThisInitialized(_this)); - _this.dispatch = buildMockDispatch.call(_assertThisInitialized(_this)); + _this[kOriginalClose] = _this.close.bind(_this); + _this.dispatch = buildMockDispatch.call(_this); _this.close = _this[kClose]; return _this; } - _createClass(MockClient, [{ + _inherits(MockClient, _Client); + return _createClass(MockClient, [{ key: _Symbols$kConnected, get: function get() { return this[kConnected]; @@ -27216,7 +29393,7 @@ var MockClient = /*#__PURE__*/function (_Client, _Symbols$kConnected) { }, { key: kClose, value: function () { - var _value = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() { + var _value = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() { return _regeneratorRuntime().wrap(function _callee$(_context) { while (1) switch (_context.prev = _context.next) { case 0: @@ -27237,7 +29414,6 @@ var MockClient = /*#__PURE__*/function (_Client, _Symbols$kConnected) { return value; }() }]); - return MockClient; }(Client, Symbols.kConnected); module.exports = MockClient; @@ -27252,22 +29428,21 @@ module.exports = MockClient; var _createClass = (__webpack_require__(4579)["default"]); var _classCallCheck = (__webpack_require__(7383)["default"]); var _callSuper = (__webpack_require__(8336)["default"]); -var _assertThisInitialized = (__webpack_require__(2475)["default"]); var _inherits = (__webpack_require__(9511)["default"]); var _require = __webpack_require__(3515), UndiciError = _require.UndiciError; var MockNotMatchedError = /*#__PURE__*/function (_UndiciError) { - _inherits(MockNotMatchedError, _UndiciError); function MockNotMatchedError(message) { var _this; _classCallCheck(this, MockNotMatchedError); _this = _callSuper(this, MockNotMatchedError, [message]); - Error.captureStackTrace(_assertThisInitialized(_this), MockNotMatchedError); + Error.captureStackTrace(_this, MockNotMatchedError); _this.name = 'MockNotMatchedError'; _this.message = message || 'The request does not match any registered mock dispatches'; _this.code = 'UND_MOCK_ERR_MOCK_NOT_MATCHED'; return _this; } + _inherits(MockNotMatchedError, _UndiciError); return _createClass(MockNotMatchedError); }(UndiciError); module.exports = { @@ -27313,7 +29488,7 @@ var MockScope = /*#__PURE__*/function () { /** * Delay a reply by a set amount in ms. */ - _createClass(MockScope, [{ + return _createClass(MockScope, [{ key: "delay", value: function delay(waitInMs) { if (typeof waitInMs !== 'number' || !Number.isInteger(waitInMs) || waitInMs <= 0) { @@ -27346,7 +29521,6 @@ var MockScope = /*#__PURE__*/function () { return this; } }]); - return MockScope; }(); /** * Defines an interceptor for a Mock @@ -27384,7 +29558,7 @@ var MockInterceptor = /*#__PURE__*/function () { this[kDefaultTrailers] = {}; this[kContentLength] = false; } - _createClass(MockInterceptor, [{ + return _createClass(MockInterceptor, [{ key: "createMockScopeDispatchData", value: function createMockScopeDispatchData(statusCode, data) { var responseOptions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; @@ -27521,7 +29695,6 @@ var MockInterceptor = /*#__PURE__*/function () { return this; } }]); - return MockInterceptor; }(); module.exports.MockInterceptor = MockInterceptor; module.exports.MockScope = MockScope; @@ -27539,7 +29712,6 @@ var _asyncToGenerator = (__webpack_require__(9293)["default"]); var _classCallCheck = (__webpack_require__(7383)["default"]); var _createClass = (__webpack_require__(4579)["default"]); var _callSuper = (__webpack_require__(8336)["default"]); -var _assertThisInitialized = (__webpack_require__(2475)["default"]); var _inherits = (__webpack_require__(9511)["default"]); var _require = __webpack_require__(9023), promisify = _require.promisify; @@ -27564,7 +29736,6 @@ var _require5 = __webpack_require__(3515), * MockPool provides an API that extends the Pool to influence the mockDispatches. */ var MockPool = /*#__PURE__*/function (_Pool, _Symbols$kConnected) { - _inherits(MockPool, _Pool); function MockPool(origin, opts) { var _this; _classCallCheck(this, MockPool); @@ -27577,12 +29748,13 @@ var MockPool = /*#__PURE__*/function (_Pool, _Symbols$kConnected) { _this[kDispatches] = []; _this[kConnected] = 1; _this[kOriginalDispatch] = _this.dispatch; - _this[kOriginalClose] = _this.close.bind(_assertThisInitialized(_this)); - _this.dispatch = buildMockDispatch.call(_assertThisInitialized(_this)); + _this[kOriginalClose] = _this.close.bind(_this); + _this.dispatch = buildMockDispatch.call(_this); _this.close = _this[kClose]; return _this; } - _createClass(MockPool, [{ + _inherits(MockPool, _Pool); + return _createClass(MockPool, [{ key: _Symbols$kConnected, get: function get() { return this[kConnected]; @@ -27599,7 +29771,7 @@ var MockPool = /*#__PURE__*/function (_Pool, _Symbols$kConnected) { }, { key: kClose, value: function () { - var _value = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() { + var _value = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() { return _regeneratorRuntime().wrap(function _callee$(_context) { while (1) switch (_context.prev = _context.next) { case 0: @@ -27620,7 +29792,6 @@ var MockPool = /*#__PURE__*/function (_Pool, _Symbols$kConnected) { return value; }() }]); - return MockPool; }(Pool, Symbols.kConnected); module.exports = MockPool; @@ -27904,7 +30075,7 @@ function getResponse(_x) { * Mock dispatch function used to simulate undici dispatches */ function _getResponse() { - _getResponse = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(body) { + _getResponse = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(body) { var buffers, _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _iterator, _step, data; return _regeneratorRuntime().wrap(function _callee$(_context) { while (1) switch (_context.prev = _context.next) { @@ -28139,7 +30310,7 @@ module.exports = /*#__PURE__*/function () { } }); } - _createClass(PendingInterceptorsFormatter, [{ + return _createClass(PendingInterceptorsFormatter, [{ key: "format", value: function format(pendingInterceptors) { var withPrettyHeaders = pendingInterceptors.map(function (_ref2) { @@ -28164,7 +30335,6 @@ module.exports = /*#__PURE__*/function () { return this.transform.read().toString(); } }]); - return PendingInterceptorsFormatter; }(); /***/ }), @@ -28196,7 +30366,7 @@ module.exports = /*#__PURE__*/function () { this.singular = singular; this.plural = plural; } - _createClass(Pluralizer, [{ + return _createClass(Pluralizer, [{ key: "pluralize", value: function pluralize(count) { var one = count === 1; @@ -28208,7 +30378,6 @@ module.exports = /*#__PURE__*/function () { }); } }]); - return Pluralizer; }(); /***/ }), @@ -28284,7 +30453,7 @@ var FixedCircularBuffer = /*#__PURE__*/function () { this.list = new Array(kSize); this.next = null; } - _createClass(FixedCircularBuffer, [{ + return _createClass(FixedCircularBuffer, [{ key: "isEmpty", value: function isEmpty() { return this.top === this.bottom; @@ -28310,14 +30479,13 @@ var FixedCircularBuffer = /*#__PURE__*/function () { return nextItem; } }]); - return FixedCircularBuffer; }(); module.exports = /*#__PURE__*/function () { function FixedQueue() { _classCallCheck(this, FixedQueue); this.head = this.tail = new FixedCircularBuffer(); } - _createClass(FixedQueue, [{ + return _createClass(FixedQueue, [{ key: "isEmpty", value: function isEmpty() { return this.head.isEmpty(); @@ -28344,7 +30512,6 @@ module.exports = /*#__PURE__*/function () { return next; } }]); - return FixedQueue; }(); /***/ }), @@ -28362,7 +30529,6 @@ var _toConsumableArray = (__webpack_require__(1132)["default"]); var _classCallCheck = (__webpack_require__(7383)["default"]); var _createClass = (__webpack_require__(4579)["default"]); var _callSuper = (__webpack_require__(8336)["default"]); -var _assertThisInitialized = (__webpack_require__(2475)["default"]); var _inherits = (__webpack_require__(9511)["default"]); var DispatcherBase = __webpack_require__(8281); var FixedQueue = __webpack_require__(2557); @@ -28392,7 +30558,6 @@ var kAddClient = Symbol('add client'); var kRemoveClient = Symbol('remove client'); var kStats = Symbol('stats'); var PoolBase = /*#__PURE__*/function (_DispatcherBase) { - _inherits(PoolBase, _DispatcherBase); function PoolBase() { var _this; _classCallCheck(this, PoolBase); @@ -28400,7 +30565,7 @@ var PoolBase = /*#__PURE__*/function (_DispatcherBase) { _this[kQueue] = new FixedQueue(); _this[kClients] = []; _this[kQueued] = 0; - var pool = _assertThisInitialized(_this); + var pool = _this; _this[kOnDrain] = function onDrain(origin, targets) { var queue = pool[kQueue]; var needDrain = false; @@ -28432,10 +30597,11 @@ var PoolBase = /*#__PURE__*/function (_DispatcherBase) { _this[kOnConnectionError] = function (origin, targets, err) { pool.emit('connectionError', origin, [pool].concat(_toConsumableArray(targets)), err); }; - _this[kStats] = new PoolStats(_assertThisInitialized(_this)); + _this[kStats] = new PoolStats(_this); return _this; } - _createClass(PoolBase, [{ + _inherits(PoolBase, _DispatcherBase); + return _createClass(PoolBase, [{ key: kBusy, get: function get() { return this[kNeedDrain]; @@ -28516,7 +30682,7 @@ var PoolBase = /*#__PURE__*/function (_DispatcherBase) { }, { key: kClose, value: function () { - var _value = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() { + var _value = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() { var _this2 = this; return _regeneratorRuntime().wrap(function _callee$(_context) { while (1) switch (_context.prev = _context.next) { @@ -28546,7 +30712,7 @@ var PoolBase = /*#__PURE__*/function (_DispatcherBase) { }, { key: kDestroy, value: function () { - var _value2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(err) { + var _value2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(err) { var item; return _regeneratorRuntime().wrap(function _callee2$(_context2) { while (1) switch (_context2.prev = _context2.next) { @@ -28624,7 +30790,6 @@ var PoolBase = /*#__PURE__*/function (_DispatcherBase) { }); } }]); - return PoolBase; }(DispatcherBase); module.exports = { PoolBase: PoolBase, @@ -28657,7 +30822,7 @@ var PoolStats = /*#__PURE__*/function () { _classCallCheck(this, PoolStats); this[kPool] = pool; } - _createClass(PoolStats, [{ + return _createClass(PoolStats, [{ key: "connected", get: function get() { return this[kPool][kConnected]; @@ -28688,7 +30853,6 @@ var PoolStats = /*#__PURE__*/function () { return this[kPool][kSize]; } }]); - return PoolStats; }(); module.exports = PoolStats; @@ -28728,7 +30892,6 @@ function defaultFactory(origin, opts) { return new Client(origin, opts); } var Pool = /*#__PURE__*/function (_PoolBase) { - _inherits(Pool, _PoolBase); function Pool(origin) { var _this; var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, @@ -28777,7 +30940,8 @@ var Pool = /*#__PURE__*/function (_PoolBase) { _this[kFactory] = factory; return _this; } - _createClass(Pool, [{ + _inherits(Pool, _PoolBase); + return _createClass(Pool, [{ key: kGetDispatcher, value: function value() { var dispatcher = this[kClients].find(function (dispatcher) { @@ -28793,7 +30957,6 @@ var Pool = /*#__PURE__*/function (_PoolBase) { return dispatcher; } }]); - return Pool; }(PoolBase); module.exports = Pool; @@ -28853,7 +31016,6 @@ function defaultFactory(origin, opts) { return new Pool(origin, opts); } var ProxyAgent = /*#__PURE__*/function (_DispatcherBase) { - _inherits(ProxyAgent, _DispatcherBase); function ProxyAgent(opts) { var _this; _classCallCheck(this, ProxyAgent); @@ -28901,7 +31063,7 @@ var ProxyAgent = /*#__PURE__*/function (_DispatcherBase) { }); _this[kAgent] = new Agent(_objectSpread(_objectSpread({}, opts), {}, { connect: function () { - var _connect = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(opts, callback) { + var _connect = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(opts, callback) { var requestedHost, _yield$_this$kClient$, socket, statusCode, servername; return _regeneratorRuntime().wrap(function _callee$(_context) { while (1) switch (_context.prev = _context.next) { @@ -28965,7 +31127,8 @@ var ProxyAgent = /*#__PURE__*/function (_DispatcherBase) { })); return _this; } - _createClass(ProxyAgent, [{ + _inherits(ProxyAgent, _DispatcherBase); + return _createClass(ProxyAgent, [{ key: "dispatch", value: function dispatch(opts, handler) { var _URL = new URL(opts.origin), @@ -28981,7 +31144,7 @@ var ProxyAgent = /*#__PURE__*/function (_DispatcherBase) { }, { key: kClose, value: function () { - var _value = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() { + var _value = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2() { return _regeneratorRuntime().wrap(function _callee2$(_context2) { while (1) switch (_context2.prev = _context2.next) { case 0: @@ -29004,7 +31167,7 @@ var ProxyAgent = /*#__PURE__*/function (_DispatcherBase) { }, { key: kDestroy, value: function () { - var _value2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() { + var _value2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3() { return _regeneratorRuntime().wrap(function _callee3$(_context3) { while (1) switch (_context3.prev = _context3.next) { case 0: @@ -29025,7 +31188,6 @@ var ProxyAgent = /*#__PURE__*/function (_DispatcherBase) { return value; }() }]); - return ProxyAgent; }(DispatcherBase); /** * @param {string[] | Record} headers @@ -29129,7 +31291,7 @@ var Timeout = /*#__PURE__*/function () { this.state = -2; this.refresh(); } - _createClass(Timeout, [{ + return _createClass(Timeout, [{ key: "refresh", value: function refresh() { if (this.state === -2) { @@ -29146,7 +31308,6 @@ var Timeout = /*#__PURE__*/function () { this.state = -1; } }]); - return Timeout; }(); module.exports = { setTimeout: function (_setTimeout) { @@ -29544,12 +31705,11 @@ var _defineProperty = (__webpack_require__(3693)["default"]); var _classCallCheck = (__webpack_require__(7383)["default"]); var _createClass = (__webpack_require__(4579)["default"]); var _callSuper = (__webpack_require__(8336)["default"]); -var _assertThisInitialized = (__webpack_require__(2475)["default"]); var _inherits = (__webpack_require__(9511)["default"]); var _wrapNativeSuper = (__webpack_require__(1837)["default"]); var _classPrivateFieldInitSpec = (__webpack_require__(2459)["default"]); -var _classPrivateFieldGet = (__webpack_require__(4972)["default"]); -var _classPrivateFieldSet = (__webpack_require__(2808)["default"]); +var _classPrivateFieldGet = (__webpack_require__(6668)["default"]); +var _classPrivateFieldSet = (__webpack_require__(7088)["default"]); var _require = __webpack_require__(3702), webidl = _require.webidl; var _require2 = __webpack_require__(6632), @@ -29562,7 +31722,6 @@ var _require3 = __webpack_require__(8167), */ var _eventInit = /*#__PURE__*/new WeakMap(); var MessageEvent = /*#__PURE__*/function (_Event) { - _inherits(MessageEvent, _Event); function MessageEvent(type) { var _this; var eventInitDict = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; @@ -29573,45 +31732,43 @@ var MessageEvent = /*#__PURE__*/function (_Event) { type = webidl.converters.DOMString(type); eventInitDict = webidl.converters.MessageEventInit(eventInitDict); _this = _callSuper(this, MessageEvent, [type, eventInitDict]); - _classPrivateFieldInitSpec(_assertThisInitialized(_this), _eventInit, { - writable: true, - value: void 0 - }); - _classPrivateFieldSet(_assertThisInitialized(_this), _eventInit, eventInitDict); + _classPrivateFieldInitSpec(_this, _eventInit, void 0); + _classPrivateFieldSet(_eventInit, _this, eventInitDict); return _this; } - _createClass(MessageEvent, [{ + _inherits(MessageEvent, _Event); + return _createClass(MessageEvent, [{ key: "data", get: function get() { webidl.brandCheck(this, MessageEvent); - return _classPrivateFieldGet(this, _eventInit).data; + return _classPrivateFieldGet(_eventInit, this).data; } }, { key: "origin", get: function get() { webidl.brandCheck(this, MessageEvent); - return _classPrivateFieldGet(this, _eventInit).origin; + return _classPrivateFieldGet(_eventInit, this).origin; } }, { key: "lastEventId", get: function get() { webidl.brandCheck(this, MessageEvent); - return _classPrivateFieldGet(this, _eventInit).lastEventId; + return _classPrivateFieldGet(_eventInit, this).lastEventId; } }, { key: "source", get: function get() { webidl.brandCheck(this, MessageEvent); - return _classPrivateFieldGet(this, _eventInit).source; + return _classPrivateFieldGet(_eventInit, this).source; } }, { key: "ports", get: function get() { webidl.brandCheck(this, MessageEvent); - if (!Object.isFrozen(_classPrivateFieldGet(this, _eventInit).ports)) { - Object.freeze(_classPrivateFieldGet(this, _eventInit).ports); + if (!Object.isFrozen(_classPrivateFieldGet(_eventInit, this).ports)) { + Object.freeze(_classPrivateFieldGet(_eventInit, this).ports); } - return _classPrivateFieldGet(this, _eventInit).ports; + return _classPrivateFieldGet(_eventInit, this).ports; } }, { key: "initMessageEvent", @@ -29638,14 +31795,12 @@ var MessageEvent = /*#__PURE__*/function (_Event) { }); } }]); - return MessageEvent; -}( /*#__PURE__*/_wrapNativeSuper(Event)); +}(/*#__PURE__*/_wrapNativeSuper(Event)); /** * @see https://websockets.spec.whatwg.org/#the-closeevent-interface */ var _eventInit2 = /*#__PURE__*/new WeakMap(); var CloseEvent = /*#__PURE__*/function (_Event2) { - _inherits(CloseEvent, _Event2); function CloseEvent(type) { var _this2; var eventInitDict = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; @@ -29656,37 +31811,33 @@ var CloseEvent = /*#__PURE__*/function (_Event2) { type = webidl.converters.DOMString(type); eventInitDict = webidl.converters.CloseEventInit(eventInitDict); _this2 = _callSuper(this, CloseEvent, [type, eventInitDict]); - _classPrivateFieldInitSpec(_assertThisInitialized(_this2), _eventInit2, { - writable: true, - value: void 0 - }); - _classPrivateFieldSet(_assertThisInitialized(_this2), _eventInit2, eventInitDict); + _classPrivateFieldInitSpec(_this2, _eventInit2, void 0); + _classPrivateFieldSet(_eventInit2, _this2, eventInitDict); return _this2; } - _createClass(CloseEvent, [{ + _inherits(CloseEvent, _Event2); + return _createClass(CloseEvent, [{ key: "wasClean", get: function get() { webidl.brandCheck(this, CloseEvent); - return _classPrivateFieldGet(this, _eventInit2).wasClean; + return _classPrivateFieldGet(_eventInit2, this).wasClean; } }, { key: "code", get: function get() { webidl.brandCheck(this, CloseEvent); - return _classPrivateFieldGet(this, _eventInit2).code; + return _classPrivateFieldGet(_eventInit2, this).code; } }, { key: "reason", get: function get() { webidl.brandCheck(this, CloseEvent); - return _classPrivateFieldGet(this, _eventInit2).reason; + return _classPrivateFieldGet(_eventInit2, this).reason; } }]); - return CloseEvent; -}( /*#__PURE__*/_wrapNativeSuper(Event)); // https://html.spec.whatwg.org/multipage/webappapis.html#the-errorevent-interface +}(/*#__PURE__*/_wrapNativeSuper(Event)); // https://html.spec.whatwg.org/multipage/webappapis.html#the-errorevent-interface var _eventInit3 = /*#__PURE__*/new WeakMap(); var ErrorEvent = /*#__PURE__*/function (_Event3) { - _inherits(ErrorEvent, _Event3); function ErrorEvent(type, eventInitDict) { var _eventInitDict; var _this3; @@ -29695,48 +31846,45 @@ var ErrorEvent = /*#__PURE__*/function (_Event3) { header: 'ErrorEvent constructor' }); _this3 = _callSuper(this, ErrorEvent, [type, eventInitDict]); - _classPrivateFieldInitSpec(_assertThisInitialized(_this3), _eventInit3, { - writable: true, - value: void 0 - }); + _classPrivateFieldInitSpec(_this3, _eventInit3, void 0); type = webidl.converters.DOMString(type); eventInitDict = webidl.converters.ErrorEventInit((_eventInitDict = eventInitDict) !== null && _eventInitDict !== void 0 ? _eventInitDict : {}); - _classPrivateFieldSet(_assertThisInitialized(_this3), _eventInit3, eventInitDict); + _classPrivateFieldSet(_eventInit3, _this3, eventInitDict); return _this3; } - _createClass(ErrorEvent, [{ + _inherits(ErrorEvent, _Event3); + return _createClass(ErrorEvent, [{ key: "message", get: function get() { webidl.brandCheck(this, ErrorEvent); - return _classPrivateFieldGet(this, _eventInit3).message; + return _classPrivateFieldGet(_eventInit3, this).message; } }, { key: "filename", get: function get() { webidl.brandCheck(this, ErrorEvent); - return _classPrivateFieldGet(this, _eventInit3).filename; + return _classPrivateFieldGet(_eventInit3, this).filename; } }, { key: "lineno", get: function get() { webidl.brandCheck(this, ErrorEvent); - return _classPrivateFieldGet(this, _eventInit3).lineno; + return _classPrivateFieldGet(_eventInit3, this).lineno; } }, { key: "colno", get: function get() { webidl.brandCheck(this, ErrorEvent); - return _classPrivateFieldGet(this, _eventInit3).colno; + return _classPrivateFieldGet(_eventInit3, this).colno; } }, { key: "error", get: function get() { webidl.brandCheck(this, ErrorEvent); - return _classPrivateFieldGet(this, _eventInit3).error; + return _classPrivateFieldGet(_eventInit3, this).error; } }]); - return ErrorEvent; -}( /*#__PURE__*/_wrapNativeSuper(Event)); +}(/*#__PURE__*/_wrapNativeSuper(Event)); Object.defineProperties(MessageEvent.prototype, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, Symbol.toStringTag, { value: 'MessageEvent', configurable: true @@ -29855,7 +32003,7 @@ var WebsocketFrameSend = /*#__PURE__*/function () { this.frameData = data; this.maskKey = crypto.randomBytes(4); } - _createClass(WebsocketFrameSend, [{ + return _createClass(WebsocketFrameSend, [{ key: "createFrame", value: function createFrame(opcode) { var _this$frameData$byteL, _this$frameData; @@ -29900,7 +32048,6 @@ var WebsocketFrameSend = /*#__PURE__*/function () { return buffer; } }]); - return WebsocketFrameSend; }(); module.exports = { WebsocketFrameSend: WebsocketFrameSend @@ -29917,11 +32064,10 @@ module.exports = { var _classCallCheck = (__webpack_require__(7383)["default"]); var _createClass = (__webpack_require__(4579)["default"]); var _callSuper = (__webpack_require__(8336)["default"]); -var _assertThisInitialized = (__webpack_require__(2475)["default"]); var _inherits = (__webpack_require__(9511)["default"]); var _classPrivateFieldInitSpec = (__webpack_require__(2459)["default"]); -var _classPrivateFieldSet = (__webpack_require__(2808)["default"]); -var _classPrivateFieldGet = (__webpack_require__(4972)["default"]); +var _classPrivateFieldSet = (__webpack_require__(7088)["default"]); +var _classPrivateFieldGet = (__webpack_require__(6668)["default"]); var _require = __webpack_require__(2203), Writable = _require.Writable; var diagnosticsChannel = __webpack_require__(1637); @@ -29956,31 +32102,15 @@ var _state = /*#__PURE__*/new WeakMap(); var _info = /*#__PURE__*/new WeakMap(); var _fragments = /*#__PURE__*/new WeakMap(); var ByteParser = /*#__PURE__*/function (_Writable) { - _inherits(ByteParser, _Writable); function ByteParser(ws) { var _this; _classCallCheck(this, ByteParser); _this = _callSuper(this, ByteParser); - _classPrivateFieldInitSpec(_assertThisInitialized(_this), _buffers, { - writable: true, - value: [] - }); - _classPrivateFieldInitSpec(_assertThisInitialized(_this), _byteOffset, { - writable: true, - value: 0 - }); - _classPrivateFieldInitSpec(_assertThisInitialized(_this), _state, { - writable: true, - value: parserStates.INFO - }); - _classPrivateFieldInitSpec(_assertThisInitialized(_this), _info, { - writable: true, - value: {} - }); - _classPrivateFieldInitSpec(_assertThisInitialized(_this), _fragments, { - writable: true, - value: [] - }); + _classPrivateFieldInitSpec(_this, _buffers, []); + _classPrivateFieldInitSpec(_this, _byteOffset, 0); + _classPrivateFieldInitSpec(_this, _state, parserStates.INFO); + _classPrivateFieldInitSpec(_this, _info, {}); + _classPrivateFieldInitSpec(_this, _fragments, []); _this.ws = ws; return _this; } @@ -29989,11 +32119,12 @@ var ByteParser = /*#__PURE__*/function (_Writable) { * @param {Buffer} chunk * @param {() => void} callback */ - _createClass(ByteParser, [{ + _inherits(ByteParser, _Writable); + return _createClass(ByteParser, [{ key: "_write", value: function _write(chunk, _, callback) { - _classPrivateFieldGet(this, _buffers).push(chunk); - _classPrivateFieldSet(this, _byteOffset, _classPrivateFieldGet(this, _byteOffset) + chunk.length); + _classPrivateFieldGet(_buffers, this).push(chunk); + _classPrivateFieldSet(_byteOffset, this, _classPrivateFieldGet(_byteOffset, this) + chunk.length); this.run(callback); } @@ -30007,56 +32138,56 @@ var ByteParser = /*#__PURE__*/function (_Writable) { value: function run(callback) { var _this2 = this; while (true) { - if (_classPrivateFieldGet(this, _state) === parserStates.INFO) { + if (_classPrivateFieldGet(_state, this) === parserStates.INFO) { var _classPrivateFieldGet2, _classPrivateFieldGet3; // If there aren't enough bytes to parse the payload length, etc. - if (_classPrivateFieldGet(this, _byteOffset) < 2) { + if (_classPrivateFieldGet(_byteOffset, this) < 2) { return callback(); } var buffer = this.consume(2); - _classPrivateFieldGet(this, _info).fin = (buffer[0] & 0x80) !== 0; - _classPrivateFieldGet(this, _info).opcode = buffer[0] & 0x0F; + _classPrivateFieldGet(_info, this).fin = (buffer[0] & 0x80) !== 0; + _classPrivateFieldGet(_info, this).opcode = buffer[0] & 0x0F; // If we receive a fragmented message, we use the type of the first // frame to parse the full message as binary/text, when it's terminated - (_classPrivateFieldGet3 = (_classPrivateFieldGet2 = _classPrivateFieldGet(this, _info)).originalOpcode) !== null && _classPrivateFieldGet3 !== void 0 ? _classPrivateFieldGet3 : _classPrivateFieldGet2.originalOpcode = _classPrivateFieldGet(this, _info).opcode; - _classPrivateFieldGet(this, _info).fragmented = !_classPrivateFieldGet(this, _info).fin && _classPrivateFieldGet(this, _info).opcode !== opcodes.CONTINUATION; - if (_classPrivateFieldGet(this, _info).fragmented && _classPrivateFieldGet(this, _info).opcode !== opcodes.BINARY && _classPrivateFieldGet(this, _info).opcode !== opcodes.TEXT) { + (_classPrivateFieldGet3 = (_classPrivateFieldGet2 = _classPrivateFieldGet(_info, this)).originalOpcode) !== null && _classPrivateFieldGet3 !== void 0 ? _classPrivateFieldGet3 : _classPrivateFieldGet2.originalOpcode = _classPrivateFieldGet(_info, this).opcode; + _classPrivateFieldGet(_info, this).fragmented = !_classPrivateFieldGet(_info, this).fin && _classPrivateFieldGet(_info, this).opcode !== opcodes.CONTINUATION; + if (_classPrivateFieldGet(_info, this).fragmented && _classPrivateFieldGet(_info, this).opcode !== opcodes.BINARY && _classPrivateFieldGet(_info, this).opcode !== opcodes.TEXT) { // Only text and binary frames can be fragmented failWebsocketConnection(this.ws, 'Invalid frame type was fragmented.'); return; } var payloadLength = buffer[1] & 0x7F; if (payloadLength <= 125) { - _classPrivateFieldGet(this, _info).payloadLength = payloadLength; - _classPrivateFieldSet(this, _state, parserStates.READ_DATA); + _classPrivateFieldGet(_info, this).payloadLength = payloadLength; + _classPrivateFieldSet(_state, this, parserStates.READ_DATA); } else if (payloadLength === 126) { - _classPrivateFieldSet(this, _state, parserStates.PAYLOADLENGTH_16); + _classPrivateFieldSet(_state, this, parserStates.PAYLOADLENGTH_16); } else if (payloadLength === 127) { - _classPrivateFieldSet(this, _state, parserStates.PAYLOADLENGTH_64); + _classPrivateFieldSet(_state, this, parserStates.PAYLOADLENGTH_64); } - if (_classPrivateFieldGet(this, _info).fragmented && payloadLength > 125) { + if (_classPrivateFieldGet(_info, this).fragmented && payloadLength > 125) { // A fragmented frame can't be fragmented itself failWebsocketConnection(this.ws, 'Fragmented frame exceeded 125 bytes.'); return; - } else if ((_classPrivateFieldGet(this, _info).opcode === opcodes.PING || _classPrivateFieldGet(this, _info).opcode === opcodes.PONG || _classPrivateFieldGet(this, _info).opcode === opcodes.CLOSE) && payloadLength > 125) { + } else if ((_classPrivateFieldGet(_info, this).opcode === opcodes.PING || _classPrivateFieldGet(_info, this).opcode === opcodes.PONG || _classPrivateFieldGet(_info, this).opcode === opcodes.CLOSE) && payloadLength > 125) { // Control frames can have a payload length of 125 bytes MAX failWebsocketConnection(this.ws, 'Payload length for control frame exceeded 125 bytes.'); return; - } else if (_classPrivateFieldGet(this, _info).opcode === opcodes.CLOSE) { + } else if (_classPrivateFieldGet(_info, this).opcode === opcodes.CLOSE) { if (payloadLength === 1) { failWebsocketConnection(this.ws, 'Received close frame with a 1-byte body.'); return; } var body = this.consume(payloadLength); - _classPrivateFieldGet(this, _info).closeInfo = this.parseCloseBody(false, body); + _classPrivateFieldGet(_info, this).closeInfo = this.parseCloseBody(false, body); if (!this.ws[kSentClose]) { // If an endpoint receives a Close frame and did not previously send a // Close frame, the endpoint MUST send a Close frame in response. (When // sending a Close frame in response, the endpoint typically echos the // status code it received.) var _body = Buffer.allocUnsafe(2); - _body.writeUInt16BE(_classPrivateFieldGet(this, _info).closeInfo.code, 0); + _body.writeUInt16BE(_classPrivateFieldGet(_info, this).closeInfo.code, 0); var closeFrame = new WebsocketFrameSend(_body); this.ws[kResponse].socket.write(closeFrame.createFrame(opcodes.CLOSE), function (err) { if (!err) { @@ -30072,7 +32203,7 @@ var ByteParser = /*#__PURE__*/function (_Writable) { this.ws[kReceivedClose] = true; this.end(); return; - } else if (_classPrivateFieldGet(this, _info).opcode === opcodes.PING) { + } else if (_classPrivateFieldGet(_info, this).opcode === opcodes.PING) { // Upon receipt of a Ping frame, an endpoint MUST send a Pong frame in // response, unless it already received a Close frame. // A Pong frame sent in response to a Ping frame must have identical @@ -30088,14 +32219,14 @@ var ByteParser = /*#__PURE__*/function (_Writable) { }); } } - _classPrivateFieldSet(this, _state, parserStates.INFO); - if (_classPrivateFieldGet(this, _byteOffset) > 0) { + _classPrivateFieldSet(_state, this, parserStates.INFO); + if (_classPrivateFieldGet(_byteOffset, this) > 0) { continue; } else { callback(); return; } - } else if (_classPrivateFieldGet(this, _info).opcode === opcodes.PONG) { + } else if (_classPrivateFieldGet(_info, this).opcode === opcodes.PONG) { // A Pong frame MAY be sent unsolicited. This serves as a // unidirectional heartbeat. A response to an unsolicited Pong frame is // not expected. @@ -30106,22 +32237,22 @@ var ByteParser = /*#__PURE__*/function (_Writable) { payload: _body3 }); } - if (_classPrivateFieldGet(this, _byteOffset) > 0) { + if (_classPrivateFieldGet(_byteOffset, this) > 0) { continue; } else { callback(); return; } } - } else if (_classPrivateFieldGet(this, _state) === parserStates.PAYLOADLENGTH_16) { - if (_classPrivateFieldGet(this, _byteOffset) < 2) { + } else if (_classPrivateFieldGet(_state, this) === parserStates.PAYLOADLENGTH_16) { + if (_classPrivateFieldGet(_byteOffset, this) < 2) { return callback(); } var _buffer = this.consume(2); - _classPrivateFieldGet(this, _info).payloadLength = _buffer.readUInt16BE(0); - _classPrivateFieldSet(this, _state, parserStates.READ_DATA); - } else if (_classPrivateFieldGet(this, _state) === parserStates.PAYLOADLENGTH_64) { - if (_classPrivateFieldGet(this, _byteOffset) < 8) { + _classPrivateFieldGet(_info, this).payloadLength = _buffer.readUInt16BE(0); + _classPrivateFieldSet(_state, this, parserStates.READ_DATA); + } else if (_classPrivateFieldGet(_state, this) === parserStates.PAYLOADLENGTH_64) { + if (_classPrivateFieldGet(_byteOffset, this) < 8) { return callback(); } var _buffer2 = this.consume(8); @@ -30138,30 +32269,30 @@ var ByteParser = /*#__PURE__*/function (_Writable) { return; } var lower = _buffer2.readUInt32BE(4); - _classPrivateFieldGet(this, _info).payloadLength = (upper << 8) + lower; - _classPrivateFieldSet(this, _state, parserStates.READ_DATA); - } else if (_classPrivateFieldGet(this, _state) === parserStates.READ_DATA) { - if (_classPrivateFieldGet(this, _byteOffset) < _classPrivateFieldGet(this, _info).payloadLength) { + _classPrivateFieldGet(_info, this).payloadLength = (upper << 8) + lower; + _classPrivateFieldSet(_state, this, parserStates.READ_DATA); + } else if (_classPrivateFieldGet(_state, this) === parserStates.READ_DATA) { + if (_classPrivateFieldGet(_byteOffset, this) < _classPrivateFieldGet(_info, this).payloadLength) { // If there is still more data in this chunk that needs to be read return callback(); - } else if (_classPrivateFieldGet(this, _byteOffset) >= _classPrivateFieldGet(this, _info).payloadLength) { + } else if (_classPrivateFieldGet(_byteOffset, this) >= _classPrivateFieldGet(_info, this).payloadLength) { // If the server sent multiple frames in a single chunk - var _body4 = this.consume(_classPrivateFieldGet(this, _info).payloadLength); - _classPrivateFieldGet(this, _fragments).push(_body4); + var _body4 = this.consume(_classPrivateFieldGet(_info, this).payloadLength); + _classPrivateFieldGet(_fragments, this).push(_body4); // If the frame is unfragmented, or a fragmented frame was terminated, // a message was received - if (!_classPrivateFieldGet(this, _info).fragmented || _classPrivateFieldGet(this, _info).fin && _classPrivateFieldGet(this, _info).opcode === opcodes.CONTINUATION) { - var fullMessage = Buffer.concat(_classPrivateFieldGet(this, _fragments)); - websocketMessageReceived(this.ws, _classPrivateFieldGet(this, _info).originalOpcode, fullMessage); - _classPrivateFieldSet(this, _info, {}); - _classPrivateFieldGet(this, _fragments).length = 0; + if (!_classPrivateFieldGet(_info, this).fragmented || _classPrivateFieldGet(_info, this).fin && _classPrivateFieldGet(_info, this).opcode === opcodes.CONTINUATION) { + var fullMessage = Buffer.concat(_classPrivateFieldGet(_fragments, this)); + websocketMessageReceived(this.ws, _classPrivateFieldGet(_info, this).originalOpcode, fullMessage); + _classPrivateFieldSet(_info, this, {}); + _classPrivateFieldGet(_fragments, this).length = 0; } - _classPrivateFieldSet(this, _state, parserStates.INFO); + _classPrivateFieldSet(_state, this, parserStates.INFO); } } - if (_classPrivateFieldGet(this, _byteOffset) > 0) { + if (_classPrivateFieldGet(_byteOffset, this) > 0) { continue; } else { callback(); @@ -30178,33 +32309,33 @@ var ByteParser = /*#__PURE__*/function (_Writable) { }, { key: "consume", value: function consume(n) { - if (n > _classPrivateFieldGet(this, _byteOffset)) { + if (n > _classPrivateFieldGet(_byteOffset, this)) { return null; } else if (n === 0) { return emptyBuffer; } - if (_classPrivateFieldGet(this, _buffers)[0].length === n) { - _classPrivateFieldSet(this, _byteOffset, _classPrivateFieldGet(this, _byteOffset) - _classPrivateFieldGet(this, _buffers)[0].length); - return _classPrivateFieldGet(this, _buffers).shift(); + if (_classPrivateFieldGet(_buffers, this)[0].length === n) { + _classPrivateFieldSet(_byteOffset, this, _classPrivateFieldGet(_byteOffset, this) - _classPrivateFieldGet(_buffers, this)[0].length); + return _classPrivateFieldGet(_buffers, this).shift(); } var buffer = Buffer.allocUnsafe(n); var offset = 0; while (offset !== n) { - var next = _classPrivateFieldGet(this, _buffers)[0]; + var next = _classPrivateFieldGet(_buffers, this)[0]; var length = next.length; if (length + offset === n) { - buffer.set(_classPrivateFieldGet(this, _buffers).shift(), offset); + buffer.set(_classPrivateFieldGet(_buffers, this).shift(), offset); break; } else if (length + offset > n) { buffer.set(next.subarray(0, n - offset), offset); - _classPrivateFieldGet(this, _buffers)[0] = next.subarray(n - offset); + _classPrivateFieldGet(_buffers, this)[0] = next.subarray(n - offset); break; } else { - buffer.set(_classPrivateFieldGet(this, _buffers).shift(), offset); + buffer.set(_classPrivateFieldGet(_buffers, this).shift(), offset); offset += next.length; } } - _classPrivateFieldSet(this, _byteOffset, _classPrivateFieldGet(this, _byteOffset) - n); + _classPrivateFieldSet(_byteOffset, this, _classPrivateFieldGet(_byteOffset, this) - n); return buffer; } }, { @@ -30255,10 +32386,9 @@ var ByteParser = /*#__PURE__*/function (_Writable) { }, { key: "closingInfo", get: function get() { - return _classPrivateFieldGet(this, _info).closeInfo; + return _classPrivateFieldGet(_info, this).closeInfo; } }]); - return ByteParser; }(Writable); module.exports = { ByteParser: ByteParser @@ -30499,14 +32629,13 @@ var _defineProperty = (__webpack_require__(3693)["default"]); var _classCallCheck = (__webpack_require__(7383)["default"]); var _createClass = (__webpack_require__(4579)["default"]); var _callSuper = (__webpack_require__(8336)["default"]); -var _assertThisInitialized = (__webpack_require__(2475)["default"]); var _inherits = (__webpack_require__(9511)["default"]); var _wrapNativeSuper = (__webpack_require__(1837)["default"]); var _classPrivateMethodInitSpec = (__webpack_require__(3312)["default"]); var _classPrivateFieldInitSpec = (__webpack_require__(2459)["default"]); -var _classPrivateFieldSet = (__webpack_require__(2808)["default"]); -var _classPrivateFieldGet = (__webpack_require__(4972)["default"]); -var _classPrivateMethodGet = (__webpack_require__(137)["default"]); +var _classPrivateFieldSet = (__webpack_require__(7088)["default"]); +var _classPrivateFieldGet = (__webpack_require__(6668)["default"]); +var _assertClassBrand = (__webpack_require__(1756)["default"]); var _require = __webpack_require__(3702), webidl = _require.webidl; var _require2 = __webpack_require__(8422), @@ -30554,9 +32683,8 @@ var _events = /*#__PURE__*/new WeakMap(); var _bufferedAmount = /*#__PURE__*/new WeakMap(); var _protocol = /*#__PURE__*/new WeakMap(); var _extensions = /*#__PURE__*/new WeakMap(); -var _onConnectionEstablished = /*#__PURE__*/new WeakSet(); +var _WebSocket_brand = /*#__PURE__*/new WeakSet(); var WebSocket = /*#__PURE__*/function (_EventTarget) { - _inherits(WebSocket, _EventTarget); /** * @param {string} url * @param {string|string[]} protocols @@ -30569,28 +32697,16 @@ var WebSocket = /*#__PURE__*/function (_EventTarget) { /** * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol */ - _classPrivateMethodInitSpec(_assertThisInitialized(_this), _onConnectionEstablished); - _classPrivateFieldInitSpec(_assertThisInitialized(_this), _events, { - writable: true, - value: { - open: null, - error: null, - close: null, - message: null - } - }); - _classPrivateFieldInitSpec(_assertThisInitialized(_this), _bufferedAmount, { - writable: true, - value: 0 - }); - _classPrivateFieldInitSpec(_assertThisInitialized(_this), _protocol, { - writable: true, - value: '' - }); - _classPrivateFieldInitSpec(_assertThisInitialized(_this), _extensions, { - writable: true, - value: '' + _classPrivateMethodInitSpec(_this, _WebSocket_brand); + _classPrivateFieldInitSpec(_this, _events, { + open: null, + error: null, + close: null, + message: null }); + _classPrivateFieldInitSpec(_this, _bufferedAmount, 0); + _classPrivateFieldInitSpec(_this, _protocol, ''); + _classPrivateFieldInitSpec(_this, _extensions, ''); webidl.argumentLengthCheck(arguments, 1, { header: 'WebSocket constructor' }); @@ -30665,8 +32781,8 @@ var WebSocket = /*#__PURE__*/function (_EventTarget) { // 1. Establish a WebSocket connection given urlRecord, protocols, // and client. - _this[kController] = establishWebSocketConnection(urlRecord, protocols, _assertThisInitialized(_this), function (response) { - return _classPrivateMethodGet(_assertThisInitialized(_this), _onConnectionEstablished, _onConnectionEstablished2).call(_assertThisInitialized(_this), response); + _this[kController] = establishWebSocketConnection(urlRecord, protocols, _this, function (response) { + return _assertClassBrand(_WebSocket_brand, _this, _onConnectionEstablished).call(_this, response); }, options); // Each WebSocket object has an associated ready state, which is a @@ -30689,7 +32805,8 @@ var WebSocket = /*#__PURE__*/function (_EventTarget) { * @param {number|undefined} code * @param {string|undefined} reason */ - _createClass(WebSocket, [{ + _inherits(WebSocket, _EventTarget); + return _createClass(WebSocket, [{ key: "close", value: function close() { var _this2 = this; @@ -30834,9 +32951,9 @@ var WebSocket = /*#__PURE__*/function (_EventTarget) { var value = Buffer.from(data); var frame = new WebsocketFrameSend(value); var buffer = frame.createFrame(opcodes.TEXT); - _classPrivateFieldSet(this, _bufferedAmount, _classPrivateFieldGet(this, _bufferedAmount) + value.byteLength); + _classPrivateFieldSet(_bufferedAmount, this, _classPrivateFieldGet(_bufferedAmount, this) + value.byteLength); socket.write(buffer, function () { - _classPrivateFieldSet(_this3, _bufferedAmount, _classPrivateFieldGet(_this3, _bufferedAmount) - value.byteLength); + _classPrivateFieldSet(_bufferedAmount, _this3, _classPrivateFieldGet(_bufferedAmount, _this3) - value.byteLength); }); } else if (types.isArrayBuffer(data)) { // If the WebSocket connection is established, and the WebSocket @@ -30854,9 +32971,9 @@ var WebSocket = /*#__PURE__*/function (_EventTarget) { var _value = Buffer.from(data); var _frame = new WebsocketFrameSend(_value); var _buffer = _frame.createFrame(opcodes.BINARY); - _classPrivateFieldSet(this, _bufferedAmount, _classPrivateFieldGet(this, _bufferedAmount) + _value.byteLength); + _classPrivateFieldSet(_bufferedAmount, this, _classPrivateFieldGet(_bufferedAmount, this) + _value.byteLength); socket.write(_buffer, function () { - _classPrivateFieldSet(_this3, _bufferedAmount, _classPrivateFieldGet(_this3, _bufferedAmount) - _value.byteLength); + _classPrivateFieldSet(_bufferedAmount, _this3, _classPrivateFieldGet(_bufferedAmount, _this3) - _value.byteLength); }); } else if (ArrayBuffer.isView(data)) { // If the WebSocket connection is established, and the WebSocket @@ -30874,9 +32991,9 @@ var WebSocket = /*#__PURE__*/function (_EventTarget) { var ab = Buffer.from(data, data.byteOffset, data.byteLength); var _frame2 = new WebsocketFrameSend(ab); var _buffer2 = _frame2.createFrame(opcodes.BINARY); - _classPrivateFieldSet(this, _bufferedAmount, _classPrivateFieldGet(this, _bufferedAmount) + ab.byteLength); + _classPrivateFieldSet(_bufferedAmount, this, _classPrivateFieldGet(_bufferedAmount, this) + ab.byteLength); socket.write(_buffer2, function () { - _classPrivateFieldSet(_this3, _bufferedAmount, _classPrivateFieldGet(_this3, _bufferedAmount) - ab.byteLength); + _classPrivateFieldSet(_bufferedAmount, _this3, _classPrivateFieldGet(_bufferedAmount, _this3) - ab.byteLength); }); } else if (isBlobLike(data)) { // If the WebSocket connection is established, and the WebSocket @@ -30895,9 +33012,9 @@ var WebSocket = /*#__PURE__*/function (_EventTarget) { var value = Buffer.from(ab); _frame3.frameData = value; var buffer = _frame3.createFrame(opcodes.BINARY); - _classPrivateFieldSet(_this3, _bufferedAmount, _classPrivateFieldGet(_this3, _bufferedAmount) + value.byteLength); + _classPrivateFieldSet(_bufferedAmount, _this3, _classPrivateFieldGet(_bufferedAmount, _this3) + value.byteLength); socket.write(buffer, function () { - _classPrivateFieldSet(_this3, _bufferedAmount, _classPrivateFieldGet(_this3, _bufferedAmount) - value.byteLength); + _classPrivateFieldSet(_bufferedAmount, _this3, _classPrivateFieldGet(_bufferedAmount, _this3) - value.byteLength); }); }); } @@ -30914,7 +33031,7 @@ var WebSocket = /*#__PURE__*/function (_EventTarget) { key: "bufferedAmount", get: function get() { webidl.brandCheck(this, WebSocket); - return _classPrivateFieldGet(this, _bufferedAmount); + return _classPrivateFieldGet(_bufferedAmount, this); } }, { key: "url", @@ -30928,84 +33045,84 @@ var WebSocket = /*#__PURE__*/function (_EventTarget) { key: "extensions", get: function get() { webidl.brandCheck(this, WebSocket); - return _classPrivateFieldGet(this, _extensions); + return _classPrivateFieldGet(_extensions, this); } }, { key: "protocol", get: function get() { webidl.brandCheck(this, WebSocket); - return _classPrivateFieldGet(this, _protocol); + return _classPrivateFieldGet(_protocol, this); } }, { key: "onopen", get: function get() { webidl.brandCheck(this, WebSocket); - return _classPrivateFieldGet(this, _events).open; + return _classPrivateFieldGet(_events, this).open; }, set: function set(fn) { webidl.brandCheck(this, WebSocket); - if (_classPrivateFieldGet(this, _events).open) { - this.removeEventListener('open', _classPrivateFieldGet(this, _events).open); + if (_classPrivateFieldGet(_events, this).open) { + this.removeEventListener('open', _classPrivateFieldGet(_events, this).open); } if (typeof fn === 'function') { - _classPrivateFieldGet(this, _events).open = fn; + _classPrivateFieldGet(_events, this).open = fn; this.addEventListener('open', fn); } else { - _classPrivateFieldGet(this, _events).open = null; + _classPrivateFieldGet(_events, this).open = null; } } }, { key: "onerror", get: function get() { webidl.brandCheck(this, WebSocket); - return _classPrivateFieldGet(this, _events).error; + return _classPrivateFieldGet(_events, this).error; }, set: function set(fn) { webidl.brandCheck(this, WebSocket); - if (_classPrivateFieldGet(this, _events).error) { - this.removeEventListener('error', _classPrivateFieldGet(this, _events).error); + if (_classPrivateFieldGet(_events, this).error) { + this.removeEventListener('error', _classPrivateFieldGet(_events, this).error); } if (typeof fn === 'function') { - _classPrivateFieldGet(this, _events).error = fn; + _classPrivateFieldGet(_events, this).error = fn; this.addEventListener('error', fn); } else { - _classPrivateFieldGet(this, _events).error = null; + _classPrivateFieldGet(_events, this).error = null; } } }, { key: "onclose", get: function get() { webidl.brandCheck(this, WebSocket); - return _classPrivateFieldGet(this, _events).close; + return _classPrivateFieldGet(_events, this).close; }, set: function set(fn) { webidl.brandCheck(this, WebSocket); - if (_classPrivateFieldGet(this, _events).close) { - this.removeEventListener('close', _classPrivateFieldGet(this, _events).close); + if (_classPrivateFieldGet(_events, this).close) { + this.removeEventListener('close', _classPrivateFieldGet(_events, this).close); } if (typeof fn === 'function') { - _classPrivateFieldGet(this, _events).close = fn; + _classPrivateFieldGet(_events, this).close = fn; this.addEventListener('close', fn); } else { - _classPrivateFieldGet(this, _events).close = null; + _classPrivateFieldGet(_events, this).close = null; } } }, { key: "onmessage", get: function get() { webidl.brandCheck(this, WebSocket); - return _classPrivateFieldGet(this, _events).message; + return _classPrivateFieldGet(_events, this).message; }, set: function set(fn) { webidl.brandCheck(this, WebSocket); - if (_classPrivateFieldGet(this, _events).message) { - this.removeEventListener('message', _classPrivateFieldGet(this, _events).message); + if (_classPrivateFieldGet(_events, this).message) { + this.removeEventListener('message', _classPrivateFieldGet(_events, this).message); } if (typeof fn === 'function') { - _classPrivateFieldGet(this, _events).message = fn; + _classPrivateFieldGet(_events, this).message = fn; this.addEventListener('message', fn); } else { - _classPrivateFieldGet(this, _events).message = null; + _classPrivateFieldGet(_events, this).message = null; } } }, { @@ -31023,9 +33140,8 @@ var WebSocket = /*#__PURE__*/function (_EventTarget) { } } }]); - return WebSocket; -}( /*#__PURE__*/_wrapNativeSuper(EventTarget)); // https://websockets.spec.whatwg.org/#dom-websocket-connecting -function _onConnectionEstablished2(response) { +}(/*#__PURE__*/_wrapNativeSuper(EventTarget)); // https://websockets.spec.whatwg.org/#dom-websocket-connecting +function _onConnectionEstablished(response) { // processResponse is called when the "response’s header list has been received and initialized." // once this happens, the connection is open this[kResponse] = response; @@ -31044,7 +33160,7 @@ function _onConnectionEstablished2(response) { // https://datatracker.ietf.org/doc/html/rfc6455#section-9.1 var extensions = response.headersList.get('sec-websocket-extensions'); if (extensions !== null) { - _classPrivateFieldSet(this, _extensions, extensions); + _classPrivateFieldSet(_extensions, this, extensions); } // 3. Change the protocol attribute’s value to the subprotocol in use, if @@ -31052,7 +33168,7 @@ function _onConnectionEstablished2(response) { // https://datatracker.ietf.org/doc/html/rfc6455#section-1.9 var protocol = response.headersList.get('sec-websocket-protocol'); if (protocol !== null) { - _classPrivateFieldSet(this, _protocol, protocol); + _classPrivateFieldSet(_protocol, this, protocol); } // 4. Fire an event named open at the WebSocket object. @@ -31189,323 +33305,6 @@ exports.fromPromise = function (fn) { }); }; -/***/ }), - -/***/ 3730: -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -// ESM COMPAT FLAG -__webpack_require__.r(__webpack_exports__); - -// EXPORTS -__webpack_require__.d(__webpack_exports__, { - NIL: () => (/* reexport */ nil), - parse: () => (/* reexport */ esm_node_parse), - stringify: () => (/* reexport */ esm_node_stringify), - v1: () => (/* reexport */ esm_node_v1), - v3: () => (/* reexport */ esm_node_v3), - v4: () => (/* reexport */ esm_node_v4), - v5: () => (/* reexport */ esm_node_v5), - validate: () => (/* reexport */ esm_node_validate), - version: () => (/* reexport */ esm_node_version) -}); - -// EXTERNAL MODULE: external "crypto" -var external_crypto_ = __webpack_require__(6982); -var external_crypto_default = /*#__PURE__*/__webpack_require__.n(external_crypto_); -;// CONCATENATED MODULE: ./node_modules/uuid/dist/esm-node/rng.js - -var rnds8Pool = new Uint8Array(256); // # of random values to pre-allocate - -var poolPtr = rnds8Pool.length; -function rng() { - if (poolPtr > rnds8Pool.length - 16) { - external_crypto_default().randomFillSync(rnds8Pool); - poolPtr = 0; - } - return rnds8Pool.slice(poolPtr, poolPtr += 16); -} -;// CONCATENATED MODULE: ./node_modules/uuid/dist/esm-node/regex.js -/* harmony default export */ const regex = (/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i); -;// CONCATENATED MODULE: ./node_modules/uuid/dist/esm-node/validate.js - -function validate(uuid) { - return typeof uuid === 'string' && regex.test(uuid); -} -/* harmony default export */ const esm_node_validate = (validate); -;// CONCATENATED MODULE: ./node_modules/uuid/dist/esm-node/stringify.js - -/** - * Convert array of 16 byte values to UUID string format of the form: - * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX - */ - -var byteToHex = []; -for (var i = 0; i < 256; ++i) { - byteToHex.push((i + 0x100).toString(16).substr(1)); -} -function stringify(arr) { - var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; - // Note: Be careful editing this code! It's been tuned for performance - // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434 - var uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID. If this throws, it's likely due to one - // of the following: - // - One or more input array values don't map to a hex octet (leading to - // "undefined" in the uuid) - // - Invalid input values for the RFC `version` or `variant` fields - - if (!esm_node_validate(uuid)) { - throw TypeError('Stringified UUID is invalid'); - } - return uuid; -} -/* harmony default export */ const esm_node_stringify = (stringify); -;// CONCATENATED MODULE: ./node_modules/uuid/dist/esm-node/v1.js - - // **`v1()` - Generate time-based UUID** -// -// Inspired by https://github.com/LiosK/UUID.js -// and http://docs.python.org/library/uuid.html - -var _nodeId; -var _clockseq; // Previous uuid creation time - -var _lastMSecs = 0; -var _lastNSecs = 0; // See https://github.com/uuidjs/uuid for API details - -function v1(options, buf, offset) { - var i = buf && offset || 0; - var b = buf || new Array(16); - options = options || {}; - var node = options.node || _nodeId; - var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; // node and clockseq need to be initialized to random values if they're not - // specified. We do this lazily to minimize issues related to insufficient - // system entropy. See #189 - - if (node == null || clockseq == null) { - var seedBytes = options.random || (options.rng || rng)(); - if (node == null) { - // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1) - node = _nodeId = [seedBytes[0] | 0x01, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]]; - } - if (clockseq == null) { - // Per 4.2.2, randomize (14 bit) clockseq - clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff; - } - } // UUID timestamps are 100 nano-second units since the Gregorian epoch, - // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so - // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs' - // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00. - - var msecs = options.msecs !== undefined ? options.msecs : Date.now(); // Per 4.2.1.2, use count of uuid's generated during the current clock - // cycle to simulate higher resolution clock - - var nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs) - - var dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000; // Per 4.2.1.2, Bump clockseq on clock regression - - if (dt < 0 && options.clockseq === undefined) { - clockseq = clockseq + 1 & 0x3fff; - } // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new - // time interval - - if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) { - nsecs = 0; - } // Per 4.2.1.2 Throw error if too many uuids are requested - - if (nsecs >= 10000) { - throw new Error("uuid.v1(): Can't create more than 10M uuids/sec"); - } - _lastMSecs = msecs; - _lastNSecs = nsecs; - _clockseq = clockseq; // Per 4.1.4 - Convert from unix epoch to Gregorian epoch - - msecs += 12219292800000; // `time_low` - - var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000; - b[i++] = tl >>> 24 & 0xff; - b[i++] = tl >>> 16 & 0xff; - b[i++] = tl >>> 8 & 0xff; - b[i++] = tl & 0xff; // `time_mid` - - var tmh = msecs / 0x100000000 * 10000 & 0xfffffff; - b[i++] = tmh >>> 8 & 0xff; - b[i++] = tmh & 0xff; // `time_high_and_version` - - b[i++] = tmh >>> 24 & 0xf | 0x10; // include version - - b[i++] = tmh >>> 16 & 0xff; // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant) - - b[i++] = clockseq >>> 8 | 0x80; // `clock_seq_low` - - b[i++] = clockseq & 0xff; // `node` - - for (var n = 0; n < 6; ++n) { - b[i + n] = node[n]; - } - return buf || esm_node_stringify(b); -} -/* harmony default export */ const esm_node_v1 = (v1); -;// CONCATENATED MODULE: ./node_modules/uuid/dist/esm-node/parse.js - -function parse(uuid) { - if (!esm_node_validate(uuid)) { - throw TypeError('Invalid UUID'); - } - var v; - var arr = new Uint8Array(16); // Parse ########-....-....-....-............ - - arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24; - arr[1] = v >>> 16 & 0xff; - arr[2] = v >>> 8 & 0xff; - arr[3] = v & 0xff; // Parse ........-####-....-....-............ - - arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8; - arr[5] = v & 0xff; // Parse ........-....-####-....-............ - - arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8; - arr[7] = v & 0xff; // Parse ........-....-....-####-............ - - arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8; - arr[9] = v & 0xff; // Parse ........-....-....-....-############ - // (Use "/" to avoid 32-bit truncation when bit-shifting high-order bytes) - - arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000 & 0xff; - arr[11] = v / 0x100000000 & 0xff; - arr[12] = v >>> 24 & 0xff; - arr[13] = v >>> 16 & 0xff; - arr[14] = v >>> 8 & 0xff; - arr[15] = v & 0xff; - return arr; -} -/* harmony default export */ const esm_node_parse = (parse); -;// CONCATENATED MODULE: ./node_modules/uuid/dist/esm-node/v35.js - - -function stringToBytes(str) { - str = unescape(encodeURIComponent(str)); // UTF8 escape - - var bytes = []; - for (var i = 0; i < str.length; ++i) { - bytes.push(str.charCodeAt(i)); - } - return bytes; -} -var DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8'; -var URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8'; -/* harmony default export */ function v35(name, version, hashfunc) { - function generateUUID(value, namespace, buf, offset) { - if (typeof value === 'string') { - value = stringToBytes(value); - } - if (typeof namespace === 'string') { - namespace = esm_node_parse(namespace); - } - if (namespace.length !== 16) { - throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)'); - } // Compute hash of namespace and value, Per 4.3 - // Future: Use spread syntax when supported on all platforms, e.g. `bytes = - // hashfunc([...namespace, ... value])` - - var bytes = new Uint8Array(16 + value.length); - bytes.set(namespace); - bytes.set(value, namespace.length); - bytes = hashfunc(bytes); - bytes[6] = bytes[6] & 0x0f | version; - bytes[8] = bytes[8] & 0x3f | 0x80; - if (buf) { - offset = offset || 0; - for (var i = 0; i < 16; ++i) { - buf[offset + i] = bytes[i]; - } - return buf; - } - return esm_node_stringify(bytes); - } // Function#name is not settable on some platforms (#270) - - try { - generateUUID.name = name; // eslint-disable-next-line no-empty - } catch (err) {} // For CommonJS default export support - - generateUUID.DNS = DNS; - generateUUID.URL = URL; - return generateUUID; -} -;// CONCATENATED MODULE: ./node_modules/uuid/dist/esm-node/md5.js - -function md5(bytes) { - if (Array.isArray(bytes)) { - bytes = Buffer.from(bytes); - } else if (typeof bytes === 'string') { - bytes = Buffer.from(bytes, 'utf8'); - } - return external_crypto_default().createHash('md5').update(bytes).digest(); -} -/* harmony default export */ const esm_node_md5 = (md5); -;// CONCATENATED MODULE: ./node_modules/uuid/dist/esm-node/v3.js - - -var v3 = v35('v3', 0x30, esm_node_md5); -/* harmony default export */ const esm_node_v3 = (v3); -;// CONCATENATED MODULE: ./node_modules/uuid/dist/esm-node/v4.js - - -function v4(options, buf, offset) { - options = options || {}; - var rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved` - - rnds[6] = rnds[6] & 0x0f | 0x40; - rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided - - if (buf) { - offset = offset || 0; - for (var i = 0; i < 16; ++i) { - buf[offset + i] = rnds[i]; - } - return buf; - } - return esm_node_stringify(rnds); -} -/* harmony default export */ const esm_node_v4 = (v4); -;// CONCATENATED MODULE: ./node_modules/uuid/dist/esm-node/sha1.js - -function sha1(bytes) { - if (Array.isArray(bytes)) { - bytes = Buffer.from(bytes); - } else if (typeof bytes === 'string') { - bytes = Buffer.from(bytes, 'utf8'); - } - return external_crypto_default().createHash('sha1').update(bytes).digest(); -} -/* harmony default export */ const esm_node_sha1 = (sha1); -;// CONCATENATED MODULE: ./node_modules/uuid/dist/esm-node/v5.js - - -var v5 = v35('v5', 0x50, esm_node_sha1); -/* harmony default export */ const esm_node_v5 = (v5); -;// CONCATENATED MODULE: ./node_modules/uuid/dist/esm-node/nil.js -/* harmony default export */ const nil = ('00000000-0000-0000-0000-000000000000'); -;// CONCATENATED MODULE: ./node_modules/uuid/dist/esm-node/version.js - -function version(uuid) { - if (!esm_node_validate(uuid)) { - throw TypeError('Invalid UUID'); - } - return parseInt(uuid.substr(14, 1), 16); -} -/* harmony default export */ const esm_node_version = (version); -;// CONCATENATED MODULE: ./node_modules/uuid/dist/esm-node/index.js - - - - - - - - - - /***/ }), /***/ 2613: @@ -31532,6 +33331,14 @@ module.exports = require("buffer"); /***/ }), +/***/ 5317: +/***/ ((module) => { + +"use strict"; +module.exports = require("child_process"); + +/***/ }), + /***/ 4236: /***/ ((module) => { @@ -31692,6 +33499,14 @@ module.exports = require("string_decoder"); /***/ }), +/***/ 3557: +/***/ ((module) => { + +"use strict"; +module.exports = require("timers"); + +/***/ }), + /***/ 4756: /***/ ((module) => { @@ -31740,81 +33555,11 @@ module.exports = require("zlib"); /***/ }), -/***/ 7490: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -var OverloadYield = __webpack_require__(5172); -function AsyncGenerator(e) { - var r, t; - function resume(r, t) { - try { - var n = e[r](t), - o = n.value, - u = o instanceof OverloadYield; - Promise.resolve(u ? o.v : o).then(function (t) { - if (u) { - var i = "return" === r ? "return" : "next"; - if (!o.k || t.done) return resume(i, t); - t = e[i](t).value; - } - settle(n.done ? "return" : "normal", t); - }, function (e) { - resume("throw", e); - }); - } catch (e) { - settle("throw", e); - } - } - function settle(e, n) { - switch (e) { - case "return": - r.resolve({ - value: n, - done: !0 - }); - break; - case "throw": - r.reject(n); - break; - default: - r.resolve({ - value: n, - done: !1 - }); - } - (r = r.next) ? resume(r.key, r.arg) : t = null; - } - this._invoke = function (e, n) { - return new Promise(function (o, u) { - var i = { - key: e, - arg: n, - resolve: o, - reject: u, - next: null - }; - t ? t = t.next = i : (r = t = i, resume(e, n)); - }); - }, "function" != typeof e["return"] && (this["return"] = void 0); -} -AsyncGenerator.prototype["function" == typeof Symbol && Symbol.asyncIterator || "@@asyncIterator"] = function () { - return this; -}, AsyncGenerator.prototype.next = function (e) { - return this._invoke("next", e); -}, AsyncGenerator.prototype["throw"] = function (e) { - return this._invoke("throw", e); -}, AsyncGenerator.prototype["return"] = function (e) { - return this._invoke("return", e); -}; -module.exports = AsyncGenerator, module.exports.__esModule = true, module.exports["default"] = module.exports; - -/***/ }), - /***/ 5172: /***/ ((module) => { -function _OverloadYield(t, e) { - this.v = t, this.k = e; +function _OverloadYield(e, d) { + this.v = e, this.k = d; } module.exports = _OverloadYield, module.exports.__esModule = true, module.exports["default"] = module.exports; @@ -31823,10 +33568,10 @@ module.exports = _OverloadYield, module.exports.__esModule = true, module.export /***/ 79: /***/ ((module) => { -function _arrayLikeToArray(arr, len) { - if (len == null || len > arr.length) len = arr.length; - for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; - return arr2; +function _arrayLikeToArray(r, a) { + (null == a || a > r.length) && (a = r.length); + for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; + return n; } module.exports = _arrayLikeToArray, module.exports.__esModule = true, module.exports["default"] = module.exports; @@ -31835,8 +33580,8 @@ module.exports = _arrayLikeToArray, module.exports.__esModule = true, module.exp /***/ 2987: /***/ ((module) => { -function _arrayWithHoles(arr) { - if (Array.isArray(arr)) return arr; +function _arrayWithHoles(r) { + if (Array.isArray(r)) return r; } module.exports = _arrayWithHoles, module.exports.__esModule = true, module.exports["default"] = module.exports; @@ -31846,21 +33591,30 @@ module.exports = _arrayWithHoles, module.exports.__esModule = true, module.expor /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var arrayLikeToArray = __webpack_require__(79); -function _arrayWithoutHoles(arr) { - if (Array.isArray(arr)) return arrayLikeToArray(arr); +function _arrayWithoutHoles(r) { + if (Array.isArray(r)) return arrayLikeToArray(r); } module.exports = _arrayWithoutHoles, module.exports.__esModule = true, module.exports["default"] = module.exports; /***/ }), +/***/ 1756: +/***/ ((module) => { + +function _assertClassBrand(e, t, n) { + if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; + throw new TypeError("Private element is not present on this object"); +} +module.exports = _assertClassBrand, module.exports.__esModule = true, module.exports["default"] = module.exports; + +/***/ }), + /***/ 2475: /***/ ((module) => { -function _assertThisInitialized(self) { - if (self === void 0) { - throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); - } - return self; +function _assertThisInitialized(e) { + if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + return e; } module.exports = _assertThisInitialized, module.exports.__esModule = true, module.exports["default"] = module.exports; @@ -31950,33 +33704,28 @@ module.exports = _asyncIterator, module.exports.__esModule = true, module.export /***/ 9293: /***/ ((module) => { -function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { +function asyncGeneratorStep(n, t, e, r, o, a, c) { try { - var info = gen[key](arg); - var value = info.value; - } catch (error) { - reject(error); - return; - } - if (info.done) { - resolve(value); - } else { - Promise.resolve(value).then(_next, _throw); + var i = n[a](c), + u = i.value; + } catch (n) { + return void e(n); } + i.done ? t(u) : Promise.resolve(u).then(r, o); } -function _asyncToGenerator(fn) { +function _asyncToGenerator(n) { return function () { - var self = this, - args = arguments; - return new Promise(function (resolve, reject) { - var gen = fn.apply(self, args); - function _next(value) { - asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); + var t = this, + e = arguments; + return new Promise(function (r, o) { + var a = n.apply(t, e); + function _next(n) { + asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } - function _throw(err) { - asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); + function _throw(n) { + asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } - _next(undefined); + _next(void 0); }); }; } @@ -32011,80 +33760,31 @@ module.exports = _callSuper, module.exports.__esModule = true, module.exports["d /***/ 7101: /***/ ((module) => { -function _checkPrivateRedeclaration(obj, privateCollection) { - if (privateCollection.has(obj)) { - throw new TypeError("Cannot initialize the same private elements twice on an object"); - } +function _checkPrivateRedeclaration(e, t) { + if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); } module.exports = _checkPrivateRedeclaration, module.exports.__esModule = true, module.exports["default"] = module.exports; /***/ }), -/***/ 5764: -/***/ ((module) => { - -function _classApplyDescriptorGet(receiver, descriptor) { - if (descriptor.get) { - return descriptor.get.call(receiver); - } - return descriptor.value; -} -module.exports = _classApplyDescriptorGet, module.exports.__esModule = true, module.exports["default"] = module.exports; - -/***/ }), - -/***/ 9056: -/***/ ((module) => { - -function _classApplyDescriptorSet(receiver, descriptor, value) { - if (descriptor.set) { - descriptor.set.call(receiver, value); - } else { - if (!descriptor.writable) { - throw new TypeError("attempted to set read only private field"); - } - descriptor.value = value; - } -} -module.exports = _classApplyDescriptorSet, module.exports.__esModule = true, module.exports["default"] = module.exports; - -/***/ }), - /***/ 7383: /***/ ((module) => { -function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } +function _classCallCheck(a, n) { + if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } module.exports = _classCallCheck, module.exports.__esModule = true, module.exports["default"] = module.exports; /***/ }), -/***/ 1413: -/***/ ((module) => { - -function _classExtractFieldDescriptor(receiver, privateMap, action) { - if (!privateMap.has(receiver)) { - throw new TypeError("attempted to " + action + " private field on non-instance"); - } - return privateMap.get(receiver); -} -module.exports = _classExtractFieldDescriptor, module.exports.__esModule = true, module.exports["default"] = module.exports; - -/***/ }), - -/***/ 4972: +/***/ 6668: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var classApplyDescriptorGet = __webpack_require__(5764); -var classExtractFieldDescriptor = __webpack_require__(1413); -function _classPrivateFieldGet(receiver, privateMap) { - var descriptor = classExtractFieldDescriptor(receiver, privateMap, "get"); - return classApplyDescriptorGet(receiver, descriptor); +var assertClassBrand = __webpack_require__(1756); +function _classPrivateFieldGet2(s, a) { + return s.get(assertClassBrand(s, a)); } -module.exports = _classPrivateFieldGet, module.exports.__esModule = true, module.exports["default"] = module.exports; +module.exports = _classPrivateFieldGet2, module.exports.__esModule = true, module.exports["default"] = module.exports; /***/ }), @@ -32092,38 +33792,21 @@ module.exports = _classPrivateFieldGet, module.exports.__esModule = true, module /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var checkPrivateRedeclaration = __webpack_require__(7101); -function _classPrivateFieldInitSpec(obj, privateMap, value) { - checkPrivateRedeclaration(obj, privateMap); - privateMap.set(obj, value); +function _classPrivateFieldInitSpec(e, t, a) { + checkPrivateRedeclaration(e, t), t.set(e, a); } module.exports = _classPrivateFieldInitSpec, module.exports.__esModule = true, module.exports["default"] = module.exports; /***/ }), -/***/ 2808: +/***/ 7088: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var classApplyDescriptorSet = __webpack_require__(9056); -var classExtractFieldDescriptor = __webpack_require__(1413); -function _classPrivateFieldSet(receiver, privateMap, value) { - var descriptor = classExtractFieldDescriptor(receiver, privateMap, "set"); - classApplyDescriptorSet(receiver, descriptor, value); - return value; +var assertClassBrand = __webpack_require__(1756); +function _classPrivateFieldSet2(s, a, r) { + return s.set(assertClassBrand(s, a), r), r; } -module.exports = _classPrivateFieldSet, module.exports.__esModule = true, module.exports["default"] = module.exports; - -/***/ }), - -/***/ 137: -/***/ ((module) => { - -function _classPrivateMethodGet(receiver, privateSet, fn) { - if (!privateSet.has(receiver)) { - throw new TypeError("attempted to get private field on non-instance"); - } - return fn; -} -module.exports = _classPrivateMethodGet, module.exports.__esModule = true, module.exports["default"] = module.exports; +module.exports = _classPrivateFieldSet2, module.exports.__esModule = true, module.exports["default"] = module.exports; /***/ }), @@ -32131,9 +33814,8 @@ module.exports = _classPrivateMethodGet, module.exports.__esModule = true, modul /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var checkPrivateRedeclaration = __webpack_require__(7101); -function _classPrivateMethodInitSpec(obj, privateSet) { - checkPrivateRedeclaration(obj, privateSet); - privateSet.add(obj); +function _classPrivateMethodInitSpec(e, a) { + checkPrivateRedeclaration(e, a), a.add(e); } module.exports = _classPrivateMethodInitSpec, module.exports.__esModule = true, module.exports["default"] = module.exports; @@ -32142,8 +33824,8 @@ module.exports = _classPrivateMethodInitSpec, module.exports.__esModule = true, /***/ 9646: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var setPrototypeOf = __webpack_require__(5636); var isNativeReflectConstruct = __webpack_require__(7550); +var setPrototypeOf = __webpack_require__(5636); function _construct(t, e, r) { if (isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments); var o = [null]; @@ -32159,22 +33841,16 @@ module.exports = _construct, module.exports.__esModule = true, module.exports["d /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var toPropertyKey = __webpack_require__(7736); -function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, toPropertyKey(descriptor.key), descriptor); - } -} -function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - Object.defineProperty(Constructor, "prototype", { - writable: false - }); - return Constructor; +function _defineProperties(e, r) { + for (var t = 0; t < r.length; t++) { + var o = r[t]; + o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, toPropertyKey(o.key), o); + } +} +function _createClass(e, r, t) { + return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { + writable: !1 + }), e; } module.exports = _createClass, module.exports.__esModule = true, module.exports["default"] = module.exports; @@ -32184,53 +33860,50 @@ module.exports = _createClass, module.exports.__esModule = true, module.exports[ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var unsupportedIterableToArray = __webpack_require__(7122); -function _createForOfIteratorHelper(o, allowArrayLike) { - var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; - if (!it) { - if (Array.isArray(o) || (it = unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { - if (it) o = it; - var i = 0; - var F = function F() {}; +function _createForOfIteratorHelper(r, e) { + var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; + if (!t) { + if (Array.isArray(r) || (t = unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { + t && (r = t); + var _n = 0, + F = function F() {}; return { s: F, n: function n() { - if (i >= o.length) return { - done: true - }; - return { - done: false, - value: o[i++] + return _n >= r.length ? { + done: !0 + } : { + done: !1, + value: r[_n++] }; }, - e: function e(_e) { - throw _e; + e: function e(r) { + throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } - var normalCompletion = true, - didErr = false, - err; + var o, + a = !0, + u = !1; return { s: function s() { - it = it.call(o); + t = t.call(r); }, n: function n() { - var step = it.next(); - normalCompletion = step.done; - return step; + var r = t.next(); + return a = r.done, r; }, - e: function e(_e2) { - didErr = true; - err = _e2; + e: function e(r) { + u = !0, o = r; }, f: function f() { try { - if (!normalCompletion && it["return"] != null) it["return"](); + a || null == t["return"] || t["return"](); } finally { - if (didErr) throw err; + if (u) throw o; } } }; @@ -32243,19 +33916,13 @@ module.exports = _createForOfIteratorHelper, module.exports.__esModule = true, m /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var toPropertyKey = __webpack_require__(7736); -function _defineProperty(obj, key, value) { - key = toPropertyKey(key); - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; - } - return obj; +function _defineProperty(e, r, t) { + return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, { + value: t, + enumerable: !0, + configurable: !0, + writable: !0 + }) : e[r] = t, e; } module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports; @@ -32266,20 +33933,13 @@ module.exports = _defineProperty, module.exports.__esModule = true, module.expor var superPropBase = __webpack_require__(9552); function _get() { - if (typeof Reflect !== "undefined" && Reflect.get) { - module.exports = _get = Reflect.get.bind(), module.exports.__esModule = true, module.exports["default"] = module.exports; - } else { - module.exports = _get = function _get(target, property, receiver) { - var base = superPropBase(target, property); - if (!base) return; - var desc = Object.getOwnPropertyDescriptor(base, property); - if (desc.get) { - return desc.get.call(arguments.length < 3 ? target : receiver); - } - return desc.value; - }, module.exports.__esModule = true, module.exports["default"] = module.exports; - } - return _get.apply(this, arguments); + return module.exports = _get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) { + var p = superPropBase(e, t); + if (p) { + var n = Object.getOwnPropertyDescriptor(p, t); + return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value; + } + }, module.exports.__esModule = true, module.exports["default"] = module.exports, _get.apply(null, arguments); } module.exports = _get, module.exports.__esModule = true, module.exports["default"] = module.exports; @@ -32288,11 +33948,10 @@ module.exports = _get, module.exports.__esModule = true, module.exports["default /***/ 3072: /***/ ((module) => { -function _getPrototypeOf(o) { - module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }, module.exports.__esModule = true, module.exports["default"] = module.exports; - return _getPrototypeOf(o); +function _getPrototypeOf(t) { + return module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { + return t.__proto__ || Object.getPrototypeOf(t); + }, module.exports.__esModule = true, module.exports["default"] = module.exports, _getPrototypeOf(t); } module.exports = _getPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports; @@ -32302,21 +33961,17 @@ module.exports = _getPrototypeOf, module.exports.__esModule = true, module.expor /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var setPrototypeOf = __webpack_require__(5636); -function _inherits(subClass, superClass) { - if (typeof superClass !== "function" && superClass !== null) { - throw new TypeError("Super expression must either be null or a function"); - } - subClass.prototype = Object.create(superClass && superClass.prototype, { +function _inherits(t, e) { + if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); + t.prototype = Object.create(e && e.prototype, { constructor: { - value: subClass, - writable: true, - configurable: true + value: t, + writable: !0, + configurable: !0 } - }); - Object.defineProperty(subClass, "prototype", { - writable: false - }); - if (superClass) setPrototypeOf(subClass, superClass); + }), Object.defineProperty(t, "prototype", { + writable: !1 + }), e && setPrototypeOf(t, e); } module.exports = _inherits, module.exports.__esModule = true, module.exports["default"] = module.exports; @@ -32325,11 +33980,11 @@ module.exports = _inherits, module.exports.__esModule = true, module.exports["de /***/ 691: /***/ ((module) => { -function _isNativeFunction(fn) { +function _isNativeFunction(t) { try { - return Function.toString.call(fn).indexOf("[native code]") !== -1; - } catch (e) { - return typeof fn === "function"; + return -1 !== Function.toString.call(t).indexOf("[native code]"); + } catch (n) { + return "function" == typeof t; } } module.exports = _isNativeFunction, module.exports.__esModule = true, module.exports["default"] = module.exports; @@ -32354,8 +34009,8 @@ module.exports = _isNativeReflectConstruct, module.exports.__esModule = true, mo /***/ 9291: /***/ ((module) => { -function _iterableToArray(iter) { - if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); +function _iterableToArray(r) { + if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); } module.exports = _iterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports; @@ -32448,20 +34103,16 @@ module.exports = _objectSpread2, module.exports.__esModule = true, module.export /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var objectWithoutPropertiesLoose = __webpack_require__(4893); -function _objectWithoutProperties(source, excluded) { - if (source == null) return {}; - var target = objectWithoutPropertiesLoose(source, excluded); - var key, i; +function _objectWithoutProperties(e, t) { + if (null == e) return {}; + var o, + r, + i = objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { - var sourceSymbolKeys = Object.getOwnPropertySymbols(source); - for (i = 0; i < sourceSymbolKeys.length; i++) { - key = sourceSymbolKeys[i]; - if (excluded.indexOf(key) >= 0) continue; - if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; - target[key] = source[key]; - } + var s = Object.getOwnPropertySymbols(e); + for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } - return target; + return i; } module.exports = _objectWithoutProperties, module.exports.__esModule = true, module.exports["default"] = module.exports; @@ -32470,17 +34121,14 @@ module.exports = _objectWithoutProperties, module.exports.__esModule = true, mod /***/ 4893: /***/ ((module) => { -function _objectWithoutPropertiesLoose(source, excluded) { - if (source == null) return {}; - var target = {}; - var sourceKeys = Object.keys(source); - var key, i; - for (i = 0; i < sourceKeys.length; i++) { - key = sourceKeys[i]; - if (excluded.indexOf(key) >= 0) continue; - target[key] = source[key]; +function _objectWithoutPropertiesLoose(r, e) { + if (null == r) return {}; + var t = {}; + for (var n in r) if ({}.hasOwnProperty.call(r, n)) { + if (e.includes(n)) continue; + t[n] = r[n]; } - return target; + return t; } module.exports = _objectWithoutPropertiesLoose, module.exports.__esModule = true, module.exports["default"] = module.exports; @@ -32491,13 +34139,10 @@ module.exports = _objectWithoutPropertiesLoose, module.exports.__esModule = true var _typeof = (__webpack_require__(3738)["default"]); var assertThisInitialized = __webpack_require__(2475); -function _possibleConstructorReturn(self, call) { - if (call && (_typeof(call) === "object" || typeof call === "function")) { - return call; - } else if (call !== void 0) { - throw new TypeError("Derived constructors may only return object or undefined"); - } - return assertThisInitialized(self); +function _possibleConstructorReturn(t, e) { + if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; + if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); + return assertThisInitialized(t); } module.exports = _possibleConstructorReturn, module.exports.__esModule = true, module.exports["default"] = module.exports; @@ -32616,7 +34261,7 @@ function _regeneratorRuntime() { function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { - if (o === f) throw new Error("Generator is already running"); + if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { @@ -32758,7 +34403,7 @@ function _regeneratorRuntime() { } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { - if (!u) throw new Error("try statement without catch or finally"); + if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } @@ -32798,7 +34443,7 @@ function _regeneratorRuntime() { return o; } } - throw new Error("illegal catch attempt"); + throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { @@ -32816,12 +34461,10 @@ module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.e /***/ 5636: /***/ ((module) => { -function _setPrototypeOf(o, p) { - module.exports = _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }, module.exports.__esModule = true, module.exports["default"] = module.exports; - return _setPrototypeOf(o, p); +function _setPrototypeOf(t, e) { + return module.exports = _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { + return t.__proto__ = e, t; + }, module.exports.__esModule = true, module.exports["default"] = module.exports, _setPrototypeOf(t, e); } module.exports = _setPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports; @@ -32834,8 +34477,8 @@ var arrayWithHoles = __webpack_require__(2987); var iterableToArrayLimit = __webpack_require__(1156); var unsupportedIterableToArray = __webpack_require__(7122); var nonIterableRest = __webpack_require__(7752); -function _slicedToArray(arr, i) { - return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest(); +function _slicedToArray(r, e) { + return arrayWithHoles(r) || iterableToArrayLimit(r, e) || unsupportedIterableToArray(r, e) || nonIterableRest(); } module.exports = _slicedToArray, module.exports.__esModule = true, module.exports["default"] = module.exports; @@ -32845,17 +34488,29 @@ module.exports = _slicedToArray, module.exports.__esModule = true, module.export /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var getPrototypeOf = __webpack_require__(3072); -function _superPropBase(object, property) { - while (!Object.prototype.hasOwnProperty.call(object, property)) { - object = getPrototypeOf(object); - if (object === null) break; - } - return object; +function _superPropBase(t, o) { + for (; !{}.hasOwnProperty.call(t, o) && null !== (t = getPrototypeOf(t));); + return t; } module.exports = _superPropBase, module.exports.__esModule = true, module.exports["default"] = module.exports; /***/ }), +/***/ 9901: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var get = __webpack_require__(2395); +var getPrototypeOf = __webpack_require__(3072); +function _superPropertyGet(t, e, o, r) { + var p = get(getPrototypeOf(1 & r ? t.prototype : t), e, o); + return 2 & r && "function" == typeof p ? function (t) { + return p.apply(o, t); + } : p; +} +module.exports = _superPropertyGet, module.exports.__esModule = true, module.exports["default"] = module.exports; + +/***/ }), + /***/ 8053: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { @@ -32863,8 +34518,8 @@ var arrayWithHoles = __webpack_require__(2987); var iterableToArray = __webpack_require__(9291); var unsupportedIterableToArray = __webpack_require__(7122); var nonIterableRest = __webpack_require__(7752); -function _toArray(arr) { - return arrayWithHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableRest(); +function _toArray(r) { + return arrayWithHoles(r) || iterableToArray(r) || unsupportedIterableToArray(r) || nonIterableRest(); } module.exports = _toArray, module.exports.__esModule = true, module.exports["default"] = module.exports; @@ -32877,8 +34532,8 @@ var arrayWithoutHoles = __webpack_require__(5901); var iterableToArray = __webpack_require__(9291); var unsupportedIterableToArray = __webpack_require__(7122); var nonIterableSpread = __webpack_require__(1869); -function _toConsumableArray(arr) { - return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread(); +function _toConsumableArray(r) { + return arrayWithoutHoles(r) || iterableToArray(r) || unsupportedIterableToArray(r) || nonIterableSpread(); } module.exports = _toConsumableArray, module.exports.__esModule = true, module.exports["default"] = module.exports; @@ -32909,7 +34564,7 @@ var _typeof = (__webpack_require__(3738)["default"]); var toPrimitive = __webpack_require__(9045); function toPropertyKey(t) { var i = toPrimitive(t, "string"); - return "symbol" == _typeof(i) ? i : String(i); + return "symbol" == _typeof(i) ? i : i + ""; } module.exports = toPropertyKey, module.exports.__esModule = true, module.exports["default"] = module.exports; @@ -32921,11 +34576,11 @@ module.exports = toPropertyKey, module.exports.__esModule = true, module.exports function _typeof(o) { "@babel/helpers - typeof"; - return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { + return module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; - }, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(o); + }, module.exports.__esModule = true, module.exports["default"] = module.exports, _typeof(o); } module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports; @@ -32935,13 +34590,12 @@ module.exports = _typeof, module.exports.__esModule = true, module.exports["defa /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var arrayLikeToArray = __webpack_require__(79); -function _unsupportedIterableToArray(o, minLen) { - if (!o) return; - if (typeof o === "string") return arrayLikeToArray(o, minLen); - var n = Object.prototype.toString.call(o).slice(8, -1); - if (n === "Object" && o.constructor) n = o.constructor.name; - if (n === "Map" || n === "Set") return Array.from(o); - if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen); +function _unsupportedIterableToArray(r, a) { + if (r) { + if ("string" == typeof r) return arrayLikeToArray(r, a); + var t = {}.toString.call(r).slice(8, -1); + return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? arrayLikeToArray(r, a) : void 0; + } } module.exports = _unsupportedIterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports; @@ -32950,12 +34604,74 @@ module.exports = _unsupportedIterableToArray, module.exports.__esModule = true, /***/ 2958: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var AsyncGenerator = __webpack_require__(7490); -function _wrapAsyncGenerator(fn) { +var OverloadYield = __webpack_require__(5172); +function _wrapAsyncGenerator(e) { return function () { - return new AsyncGenerator(fn.apply(this, arguments)); + return new AsyncGenerator(e.apply(this, arguments)); }; } +function AsyncGenerator(e) { + var r, t; + function resume(r, t) { + try { + var n = e[r](t), + o = n.value, + u = o instanceof OverloadYield; + Promise.resolve(u ? o.v : o).then(function (t) { + if (u) { + var i = "return" === r ? "return" : "next"; + if (!o.k || t.done) return resume(i, t); + t = e[i](t).value; + } + settle(n.done ? "return" : "normal", t); + }, function (e) { + resume("throw", e); + }); + } catch (e) { + settle("throw", e); + } + } + function settle(e, n) { + switch (e) { + case "return": + r.resolve({ + value: n, + done: !0 + }); + break; + case "throw": + r.reject(n); + break; + default: + r.resolve({ + value: n, + done: !1 + }); + } + (r = r.next) ? resume(r.key, r.arg) : t = null; + } + this._invoke = function (e, n) { + return new Promise(function (o, u) { + var i = { + key: e, + arg: n, + resolve: o, + reject: u, + next: null + }; + t ? t = t.next = i : (r = t = i, resume(e, n)); + }); + }, "function" != typeof e["return"] && (this["return"] = void 0); +} +AsyncGenerator.prototype["function" == typeof Symbol && Symbol.asyncIterator || "@@asyncIterator"] = function () { + return this; +}, AsyncGenerator.prototype.next = function (e) { + return this._invoke("next", e); +}, AsyncGenerator.prototype["throw"] = function (e) { + return this._invoke("throw", e); +}, AsyncGenerator.prototype["return"] = function (e) { + return this._invoke("return", e); +}; module.exports = _wrapAsyncGenerator, module.exports.__esModule = true, module.exports["default"] = module.exports; /***/ }), @@ -32967,31 +34683,27 @@ var getPrototypeOf = __webpack_require__(3072); var setPrototypeOf = __webpack_require__(5636); var isNativeFunction = __webpack_require__(691); var construct = __webpack_require__(9646); -function _wrapNativeSuper(Class) { - var _cache = typeof Map === "function" ? new Map() : undefined; - module.exports = _wrapNativeSuper = function _wrapNativeSuper(Class) { - if (Class === null || !isNativeFunction(Class)) return Class; - if (typeof Class !== "function") { - throw new TypeError("Super expression must either be null or a function"); - } - if (typeof _cache !== "undefined") { - if (_cache.has(Class)) return _cache.get(Class); - _cache.set(Class, Wrapper); +function _wrapNativeSuper(t) { + var r = "function" == typeof Map ? new Map() : void 0; + return module.exports = _wrapNativeSuper = function _wrapNativeSuper(t) { + if (null === t || !isNativeFunction(t)) return t; + if ("function" != typeof t) throw new TypeError("Super expression must either be null or a function"); + if (void 0 !== r) { + if (r.has(t)) return r.get(t); + r.set(t, Wrapper); } function Wrapper() { - return construct(Class, arguments, getPrototypeOf(this).constructor); + return construct(t, arguments, getPrototypeOf(this).constructor); } - Wrapper.prototype = Object.create(Class.prototype, { + return Wrapper.prototype = Object.create(t.prototype, { constructor: { value: Wrapper, - enumerable: false, - writable: true, - configurable: true + enumerable: !1, + writable: !0, + configurable: !0 } - }); - return setPrototypeOf(Wrapper, Class); - }, module.exports.__esModule = true, module.exports["default"] = module.exports; - return _wrapNativeSuper(Class); + }), setPrototypeOf(Wrapper, t); + }, module.exports.__esModule = true, module.exports["default"] = module.exports, _wrapNativeSuper(t); } module.exports = _wrapNativeSuper, module.exports.__esModule = true, module.exports["default"] = module.exports; @@ -33010,7 +34722,7 @@ function _wrapRegExp() { var e = RegExp.prototype, r = new WeakMap(); function BabelRegExp(e, t, p) { - var o = new RegExp(e, t); + var o = RegExp(e, t); return r.set(o, p || r.get(e)), setPrototypeOf(o, BabelRegExp.prototype); } function buildGroups(e, t) { @@ -33140,7 +34852,7 @@ Dicer.prototype._write = function (data, encoding, cb) { if (this._headerFirst && this._isPreamble) { if (!this._part) { this._part = new PartStream(this._partOpts); - if (this._events.preamble) { + if (this.listenerCount('preamble') !== 0) { this.emit('preamble', this._part); } else { this._ignore(); @@ -33208,7 +34920,7 @@ Dicer.prototype._oninfo = function (isMatch, data, start, end) { } } if (this._dashes === 2) { - if (start + i < end && this._events.trailer) { + if (start + i < end && this.listenerCount('trailer') !== 0) { this.emit('trailer', data.slice(start + i, end)); } this.reset(); @@ -33232,9 +34944,9 @@ Dicer.prototype._oninfo = function (isMatch, data, start, end) { this._part._read = function (n) { self._unpause(); }; - if (this._isPreamble && this._events.preamble) { + if (this._isPreamble && this.listenerCount('preamble') !== 0) { this.emit('preamble', this._part); - } else if (this._isPreamble !== true && this._events.part) { + } else if (this._isPreamble !== true && this.listenerCount('part') !== 0) { this.emit('part', this._part); } else { this._ignore(); @@ -33885,7 +35597,7 @@ function Multipart(boy, cfg) { return skipPart(part); } ++nfiles; - if (!boy._events.file) { + if (boy.listenerCount('file') === 0) { self.parser._ignore(); return; } @@ -34394,7 +36106,7 @@ var decoders = { if (textDecoders.has(_this.toString())) { try { return textDecoders.get(_this).decode(data); - } catch (e) {} + } catch (_unused) {} } return typeof data === 'string' ? data : data.toString(); } @@ -35025,7 +36737,7 @@ module.exports = parseParams; /***/ ((module) => { "use strict"; -module.exports = /*#__PURE__*/JSON.parse('{"name":"coverage-badges-cli","version":"1.2.5","description":"Create coverage badges from coverage reports. Using GitHub Actions and GitHub Workflow CPU time (no 3rd parties servers).","homepage":"https://jaywcjlove.github.io/coverage-badges-cli/","funding":"https://jaywcjlove.github.io/#/sponsor","license":"MIT","bin":{"coverage-badges":"bin/cli","coverage-badges-cli":"bin/cli"},"scripts":{"prepare":"husky install && npm run package","package":"ncc build src/action.ts","make-badges":"node bin/cli","watch":"tsbb watch","build":"tsbb build","test":"tsbb test","coverage":"tsbb test --coverage"},"files":["bin","lib","src"],"repository":{"type":"git","url":"https://github.com/jaywcjlove/coverage-badges-cli"},"keywords":["coverage","coverage-badges","coverage-badges-cli","badges"],"jest":{"coverageReporters":["lcov","json-summary"]},"engines":{"node":">=v20.11.0","npm":">=10.2.4"},"lint-staged":{"*.ts?(x)":["npm run package"]},"dependencies":{"@types/fs-extra":"~11.0.0","@types/minimist":"~1.2.2","badgen":"~3.2.2","fs-extra":"~11.2.0","lodash.get":"^4.4.2","mini-svg-data-uri":"^1.4.4","minimist":"~1.2.5"},"devDependencies":{"@actions/core":"^1.10.0","@kkt/ncc":"^1.0.15","@types/lodash.get":"^4.4.9","husky":"^9.0.11","lint-staged":"^15.2.2","tsbb":"^4.1.3"}}'); +module.exports = /*#__PURE__*/JSON.parse('{"name":"coverage-badges-cli","version":"2.0.0","description":"Create coverage badges from coverage reports. Using GitHub Actions and GitHub Workflow CPU time (no 3rd parties servers).","homepage":"https://jaywcjlove.github.io/coverage-badges-cli/","funding":"https://jaywcjlove.github.io/#/sponsor","license":"MIT","bin":{"coverage-badges":"bin/cli","coverage-badges-cli":"bin/cli"},"scripts":{"prepare":"husky && npm run package","package":"ncc build src/action.ts","make-badges":"node bin/cli","watch":"tsbb watch","build":"tsbb build","test":"tsbb test","coverage":"tsbb test --coverage"},"files":["bin","lib","src"],"repository":{"type":"git","url":"https://github.com/jaywcjlove/coverage-badges-cli"},"keywords":["coverage","coverage-badges","coverage-badges-cli","badges"],"jest":{"coverageReporters":["lcov","json-summary"]},"engines":{"node":">=v20.11.0","npm":">=10.2.4"},"lint-staged":{"*.ts?(x)":["npm run package"]},"dependencies":{"@types/fs-extra":"~11.0.0","@types/minimist":"~1.2.2","badgen":"~3.2.3","fs-extra":"~11.2.0","lodash.get":"^4.4.2","mini-svg-data-uri":"^1.4.4","minimist":"~1.2.5"},"devDependencies":{"@actions/core":"^1.10.0","@kkt/ncc":"^1.0.15","@types/lodash.get":"^4.4.9","husky":"^9.0.11","lint-staged":"^15.2.2","tsbb":"^4.1.3"}}'); /***/ }) @@ -35085,26 +36797,13 @@ module.exports = /*#__PURE__*/JSON.parse('{"name":"coverage-badges-cli","version /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) /******/ })(); /******/ -/******/ /* webpack/runtime/make namespace object */ -/******/ (() => { -/******/ // define __esModule on exports -/******/ __webpack_require__.r = (exports) => { -/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { -/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/******/ } -/******/ Object.defineProperty(exports, '__esModule', { value: true }); -/******/ }; -/******/ })(); -/******/ /************************************************************************/ var __webpack_exports__ = {}; // This entry need to be wrapped in an IIFE because it need to be in strict mode. (() => { "use strict"; -// ESM COMPAT FLAG -__webpack_require__.r(__webpack_exports__); -;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/typeof.js +;// ./node_modules/@babel/runtime/helpers/esm/typeof.js function _typeof(o) { "@babel/helpers - typeof"; @@ -35114,7 +36813,8 @@ function _typeof(o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } -;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js + +;// ./node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ @@ -35225,7 +36925,7 @@ function _regeneratorRuntime() { function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { - if (o === f) throw new Error("Generator is already running"); + if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { @@ -35367,7 +37067,7 @@ function _regeneratorRuntime() { } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { - if (!u) throw new Error("try statement without catch or finally"); + if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } @@ -35407,7 +37107,7 @@ function _regeneratorRuntime() { return o; } } - throw new Error("illegal catch attempt"); + throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { @@ -35418,37 +37118,34 @@ function _regeneratorRuntime() { } }, e; } -;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js -function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { + +;// ./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js +function asyncGeneratorStep(n, t, e, r, o, a, c) { try { - var info = gen[key](arg); - var value = info.value; - } catch (error) { - reject(error); - return; - } - if (info.done) { - resolve(value); - } else { - Promise.resolve(value).then(_next, _throw); + var i = n[a](c), + u = i.value; + } catch (n) { + return void e(n); } + i.done ? t(u) : Promise.resolve(u).then(r, o); } -function _asyncToGenerator(fn) { +function _asyncToGenerator(n) { return function () { - var self = this, - args = arguments; - return new Promise(function (resolve, reject) { - var gen = fn.apply(self, args); - function _next(value) { - asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); + var t = this, + e = arguments; + return new Promise(function (r, o) { + var a = n.apply(t, e); + function _next(n) { + asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } - function _throw(err) { - asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); + function _throw(n) { + asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } - _next(undefined); + _next(void 0); }); }; } + // EXTERNAL MODULE: external "path" var external_path_ = __webpack_require__(6928); var external_path_default = /*#__PURE__*/__webpack_require__.n(external_path_); @@ -35467,10 +37164,10 @@ var mini_svg_data_uri_default = /*#__PURE__*/__webpack_require__.n(mini_svg_data // EXTERNAL MODULE: ./node_modules/lodash.get/index.js var lodash_get = __webpack_require__(7935); var lodash_get_default = /*#__PURE__*/__webpack_require__.n(lodash_get); -;// CONCATENATED MODULE: ./src/badges.ts +;// ./src/badges.ts // Copied from `badgen` because it's not exported -var getIconString=function getIconString(path){return (0,external_fs_.readFileSync)(path,'utf8');};function badge(option,summary){var _ref=option||{},_ref$label=_ref.label,label=_ref$label===void 0?'coverage':_ref$label,_ref$style=_ref.style,style=_ref$style===void 0?'classic':_ref$style,_ref$jsonPath=_ref.jsonPath,jsonPath=_ref$jsonPath===void 0?'total.statements.pct':_ref$jsonPath;var pct=summary;pct=lodash_get_default()(summary,jsonPath,0);if(!isNaN(Number(pct))){pct=Number(pct);}if(typeof pct!=='number'){throw new Error("".concat(jsonPath," evaluates to ").concat(JSON.stringify(pct)," and is not a suitable path in the JSON coverage data"));}var colorData={'#49c31a':[100],'#97c40f':[99.99,90],'#a0a127':[89.99,80],'#cba317':[79.99,60],'#ce0000':[59.99,0]};var color=Object.keys(colorData).find(function(value,idx){if(colorData[value].length===1&&pct>=colorData[value][0]){return true;}if(colorData[value].length===2&&pct<=colorData[value][0]&&pct>=colorData[value][1]){return true;}return false;});var badgenArgs={style:style,label:label,status:"".concat(pct<0?'Unknown':"".concat(pct,"%")),color:(color||'e5e5e5').replace(/^#/,'')};if(option.icon){var svgString=getIconString(option.icon);var svgDataUri=mini_svg_data_uri_default()(svgString);badgenArgs.icon=svgDataUri;}return (0,dist.badgen)(badgenArgs);} -;// CONCATENATED MODULE: ./src/action.ts +var getIconString=function getIconString(path){return (0,external_fs_.readFileSync)(path,'utf8');};var defaultColorData={'#49c31a':[100],'#97c40f':[99.99,90],'#a0a127':[89.99,80],'#cba317':[79.99,60],'#ce0000':[59.99,0]};function badge(option,summary){var _ref=option||{},_ref$label=_ref.label,label=_ref$label===void 0?'coverage':_ref$label,_ref$style=_ref.style,style=_ref$style===void 0?'classic':_ref$style,_ref$jsonPath=_ref.jsonPath,jsonPath=_ref$jsonPath===void 0?'total.statements.pct':_ref$jsonPath;var pct=summary;pct=lodash_get_default()(summary,jsonPath,0);if(!isNaN(Number(pct))){pct=Number(pct);}if(typeof pct!=='number'){throw new Error("".concat(jsonPath," evaluates to ").concat(JSON.stringify(pct)," and is not a suitable path in the JSON coverage data"));}var colorData=defaultColorData;var color=Object.keys(colorData).find(function(value,idx){if(colorData[value].length===1&&pct>=colorData[value][0]){return true;}if(colorData[value].length===2&&pct<=colorData[value][0]&&pct>=colorData[value][1]){return true;}return false;});var badgenArgs={style:style,label:label,status:"".concat(pct<0?'Unknown':"".concat(pct,"%")),color:(color||'e5e5e5').replace(/^#/,'')};if(option.icon){var svgString=getIconString(option.icon);var svgDataUri=mini_svg_data_uri_default()(svgString);badgenArgs.icon=svgDataUri;}return (0,dist.badgen)(badgenArgs);} +;// ./src/action.ts ;_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(){var _require,version,output,source,label,jsonPath,style,sourceData,svgStr;return _regeneratorRuntime().wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:_context.prev=0;_require=__webpack_require__(8330),version=_require.version;(0,core.info)("coverage-badges-cli v\x1B[32;1m".concat(version,"\x1B[0m"));output=external_path_default().resolve(process.cwd(),(0,core.getInput)('output')||'coverage/badges.svg');source=external_path_default().resolve(process.cwd(),(0,core.getInput)('source')||'coverage/coverage-summary.json');label=(0,core.getInput)('label')||'coverage';jsonPath=(0,core.getInput)('jsonPath')||'total.statements.pct';style=(0,core.getInput)('style')||'classic';lib_default().ensureDirSync(external_path_default().dirname(output));if(lib_default().existsSync(source)){_context.next=12;break;}(0,core.setFailed)("File \x1B[31m".concat(source,"\x1B[0m does not exist.\n please specify the file directory\n\x1B[35mnpm\x1B[0m coverage-badges-cli \x1B[33m--source\x1B[0m coverage/coverage-summary.json"));return _context.abrupt("return");case 12:(0,core.info)("Source Path: \x1B[32;1m".concat(source,"\x1B[0m"));(0,core.info)("Output Path: \x1B[32;1m".concat(output,"\x1B[0m"));sourceData=lib_default().readJSONSync(source);(0,core.startGroup)("Source Path: \x1B[32;1m".concat(source,"\x1B[0m"));(0,core.info)("".concat(JSON.stringify(sourceData,null,2)));(0,core.endGroup)();svgStr=badge({label:label,style:style,jsonPath:jsonPath},sourceData);(0,core.setOutput)('svg',svgStr);(0,core.startGroup)("SVG String: \x1B[32;1m".concat(output,"\x1B[0m"));(0,core.info)("".concat(svgStr));(0,core.endGroup)();lib_default().writeFileSync(output,svgStr);(0,core.info)("\nCreate Coverage Badges: \x1B[32;1m".concat(external_path_default().relative(process.cwd(),output),"\x1B[0m\n"));_context.next=30;break;case 27:_context.prev=27;_context.t0=_context["catch"](0);(0,core.setFailed)(_context.t0.message);case 30:case"end":return _context.stop();}},_callee,null,[[0,27]]);}))(); })(); diff --git a/package.json b/package.json index 006ca03..eea4440 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,7 @@ "dependencies": { "@types/fs-extra": "~11.0.0", "@types/minimist": "~1.2.2", - "badgen": "~3.2.2", + "badgen": "~3.2.3", "fs-extra": "~11.2.0", "lodash.get": "^4.4.2", "mini-svg-data-uri": "^1.4.4", diff --git a/src/action.ts b/src/action.ts index 0a53b34..80fde01 100644 --- a/src/action.ts +++ b/src/action.ts @@ -1,6 +1,6 @@ import path from 'path'; import fs from 'fs-extra'; -import { setFailed, getInput, setOutput, info, startGroup, endGroup } from '@actions/core'; +import { setFailed, getInput, getBooleanInput, setOutput, info, startGroup, endGroup } from '@actions/core'; import { badge, BadgeOption } from './badges'; ;(async () => { @@ -10,6 +10,8 @@ import { badge, BadgeOption } from './badges'; const output = path.resolve(process.cwd(), getInput('output') || 'coverage/badges.svg'); const source = path.resolve(process.cwd(), getInput('source') || 'coverage/coverage-summary.json'); const label = getInput('label') || 'coverage'; + const labelColor = getInput('labelColor') || '555'; + const scale = Number(getInput('scale') || 1) || 1; const jsonPath = getInput('jsonPath') || 'total.statements.pct'; const style = (getInput('style') || 'classic') as BadgeOption['style']; fs.ensureDirSync(path.dirname(output)); @@ -25,7 +27,7 @@ import { badge, BadgeOption } from './badges'; info(`${JSON.stringify(sourceData, null, 2)}`); endGroup(); - const svgStr = badge({ label, style, jsonPath } as BadgeOption, sourceData); + const svgStr = badge({ label, labelColor, style, jsonPath, scale } as BadgeOption, sourceData); setOutput('svg', svgStr); diff --git a/src/badges.ts b/src/badges.ts index 80c075e..b38dc54 100644 --- a/src/badges.ts +++ b/src/badges.ts @@ -19,16 +19,24 @@ export interface BadgenOptions { scale?: number; } -export interface BadgeOption extends BadgenOptions { -} +export interface BadgeOption extends BadgenOptions {} const getIconString = (path: string) => { return readFileSync(path, 'utf8'); } +type ColorData = Record; + +const defaultColorData: ColorData = { + '#49c31a': [100], + '#97c40f': [99.99, 90], + '#a0a127': [89.99, 80], + '#cba317': [79.99, 60], + '#ce0000': [59.99, 0], +} export function badge(option: BadgeOption, summary: object) { - const { label = 'coverage', style = 'classic', jsonPath = 'total.statements.pct' } = option || {} + const { label = 'coverage', style = 'classic', jsonPath = 'total.statements.pct', ...otherOption } = (option || {}) as BadgenOptions let pct: any = summary; pct = get(summary, jsonPath, 0); @@ -39,13 +47,7 @@ export function badge(option: BadgeOption, summary: object) { if (typeof pct !== 'number') { throw new Error(`${jsonPath} evaluates to ${JSON.stringify(pct)} and is not a suitable path in the JSON coverage data`); } - const colorData = { - '#49c31a': [100], - '#97c40f': [99.99, 90], - '#a0a127': [89.99, 80], - '#cba317': [79.99, 60], - '#ce0000': [59.99, 0], - } + const colorData = defaultColorData const color = Object.keys(colorData).find((value: keyof typeof colorData, idx) => { if (colorData[value].length === 1 && pct >= colorData[value][0]) { return true @@ -57,6 +59,7 @@ export function badge(option: BadgeOption, summary: object) { }); const badgenArgs: BadgenOptions = { + ...otherOption, style, label, status: `${pct < 0 ? 'Unknown' : `${pct}%`}`, @@ -70,5 +73,6 @@ export function badge(option: BadgeOption, summary: object) { badgenArgs.icon = svgDataUri; } + console.log("badgenArgs", badgenArgs) return badgen(badgenArgs); } \ No newline at end of file diff --git a/src/index.ts b/src/index.ts index 8965055..a4b26c9 100644 --- a/src/index.ts +++ b/src/index.ts @@ -7,6 +7,8 @@ export interface RunArgvs extends ParsedArgs, Partial { version?: string; output?: string; jsonPath?: string; + /// or (default: '555') + labelColor?: string; } export default function run() { @@ -33,6 +35,7 @@ export default function run() { console.log(`\n coverage-badges-cli v${version}\n`); return; } + console.log("argvs: ", argvs); create(argvs); } @@ -52,5 +55,6 @@ export function exampleHelp() { console.log(' \x1b[35mnpm\x1b[0m coverage-badges-cli \x1b[33m--output\x1b[0m coverage/badges.svg'); console.log(' \x1b[35mnpm\x1b[0m coverage-badges-cli \x1b[33m--style\x1b[0m plastic'); console.log(' \x1b[35mnpm\x1b[0m coverage-badges-cli \x1b[33m--source\x1b[0m coverage/coverage-summary.json'); + console.log(' \x1b[35mnpm\x1b[0m coverage-badges-cli \x1b[33m--labelColor\x1b[0m ADF'); console.log('\n'); } \ No newline at end of file diff --git a/test/index.test.ts b/test/index.test.ts index d3c4394..409f5a8 100644 --- a/test/index.test.ts +++ b/test/index.test.ts @@ -85,6 +85,14 @@ it('test badge case - custom label', async () => { expect(str.indexOf(`${customLabel}`) > 0).toBeTruthy(); }); +it('test badge case - label color', async () => { + const customLabel = "Custon Label"; + const str = badge({ style: 'flat', status: '85%', labelColor: "ADF", label: customLabel }, mockSummary as any); + console.log("str", str) + expect(str.indexOf(`${customLabel}`) > 0).toBeTruthy(); + expect(str.indexOf(``) > 0).toBeTruthy(); +}); + it('test badge case - custom icon', async () => { const customIcon = "./test/sample-logo.svg"; const processedIconString = ``;