module.exports = /******/ (() => { // webpackBootstrap /******/ var __webpack_modules__ = ({ /***/ 3617: /***/ ((module) => { "use strict"; module.exports = JSON.parse("{\"bundleVersion\":\"codeql-bundle-20201028\"}"); /***/ }), /***/ 2560: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; result["default"] = mod; return result; }; Object.defineProperty(exports, "__esModule", ({ value: true })); const core = __importStar(__webpack_require__(2186)); const toolrunnner = __importStar(__webpack_require__(8159)); const api = __importStar(__webpack_require__(5883)); const sharedEnv = __importStar(__webpack_require__(3019)); const util_1 = __webpack_require__(4024); /** * Wrapper around core.getInput for inputs that always have a value. * Also see getOptionalInput. * * This allows us to get stronger type checking of required/optional inputs * and make behaviour more consistent between actions and the runner. */ function getRequiredInput(name) { return core.getInput(name, { required: true }); } exports.getRequiredInput = getRequiredInput; /** * Wrapper around core.getInput that converts empty inputs to undefined. * Also see getRequiredInput. * * This allows us to get stronger type checking of required/optional inputs * and make behaviour more consistent between actions and the runner. */ function getOptionalInput(name) { const value = core.getInput(name); return value.length > 0 ? value : undefined; } exports.getOptionalInput = getOptionalInput; /** * Get an environment parameter, but throw an error if it is not set. */ function getRequiredEnvParam(paramName) { const value = process.env[paramName]; if (value === undefined || value.length === 0) { throw new Error(`${paramName} environment variable must be set`); } core.debug(`${paramName}=${value}`); return value; } exports.getRequiredEnvParam = getRequiredEnvParam; /** * Ensures all required environment variables are set in the context of a local run. */ function prepareLocalRunEnvironment() { if (!util_1.isLocalRun()) { return; } core.debug("Action is running locally."); if (!process.env.GITHUB_JOB) { core.exportVariable("GITHUB_JOB", "UNKNOWN-JOB"); } } exports.prepareLocalRunEnvironment = prepareLocalRunEnvironment; /** * Gets the SHA of the commit that is currently checked out. */ exports.getCommitOid = async function () { // Try to use git to get the current commit SHA. If that fails then // log but otherwise silently fall back to using the SHA from the environment. // The only time these two values will differ is during analysis of a PR when // the workflow has changed the current commit to the head commit instead of // the merge commit, which must mean that git is available. // Even if this does go wrong, it's not a huge problem for the alerts to // reported on the merge commit. try { let commitOid = ""; await new toolrunnner.ToolRunner("git", ["rev-parse", "HEAD"], { silent: true, listeners: { stdout: (data) => { commitOid += data.toString(); }, stderr: (data) => { process.stderr.write(data); }, }, }).exec(); return commitOid.trim(); } catch (e) { core.info(`Failed to call git to get current commit. Continuing with data from environment: ${e}`); return getRequiredEnvParam("GITHUB_SHA"); } }; /** * Get the path of the currently executing workflow. */ async function getWorkflowPath() { const repo_nwo = getRequiredEnvParam("GITHUB_REPOSITORY").split("/"); const owner = repo_nwo[0]; const repo = repo_nwo[1]; const run_id = Number(getRequiredEnvParam("GITHUB_RUN_ID")); if (util_1.isLocalRun()) { return 'UNKNOWN-WORKFLOW'; } const apiClient = api.getActionsApiClient(); const runsResponse = await apiClient.request("GET /repos/:owner/:repo/actions/runs/:run_id", { owner, repo, run_id, }); const workflowUrl = runsResponse.data.workflow_url; const workflowResponse = await apiClient.request(`GET ${workflowUrl}`); return workflowResponse.data.path; } /** * Get the workflow run ID. */ function getWorkflowRunID() { const workflowRunID = parseInt(getRequiredEnvParam("GITHUB_RUN_ID"), 10); if (Number.isNaN(workflowRunID)) { throw new Error("GITHUB_RUN_ID must define a non NaN workflow run ID"); } return workflowRunID; } exports.getWorkflowRunID = getWorkflowRunID; /** * Get the analysis key paramter for the current job. * * This will combine the workflow path and current job name. * Computing this the first time requires making requests to * the github API, but after that the result will be cached. */ async function getAnalysisKey() { const analysisKeyEnvVar = "CODEQL_ACTION_ANALYSIS_KEY"; let analysisKey = process.env[analysisKeyEnvVar]; if (analysisKey !== undefined) { return analysisKey; } const workflowPath = await getWorkflowPath(); const jobName = getRequiredEnvParam("GITHUB_JOB"); analysisKey = `${workflowPath}:${jobName}`; core.exportVariable(analysisKeyEnvVar, analysisKey); return analysisKey; } exports.getAnalysisKey = getAnalysisKey; /** * Get the ref currently being analyzed. */ async function getRef() { // Will be in the form "refs/heads/master" on a push event // or in the form "refs/pull/N/merge" on a pull_request event const ref = getRequiredEnvParam("GITHUB_REF"); // For pull request refs we want to detect whether the workflow // has run `git checkout HEAD^2` to analyze the 'head' ref rather // than the 'merge' ref. If so, we want to convert the ref that // we report back. const pull_ref_regex = /refs\/pull\/(\d+)\/merge/; const checkoutSha = await exports.getCommitOid(); if (pull_ref_regex.test(ref) && checkoutSha !== getRequiredEnvParam("GITHUB_SHA")) { return ref.replace(pull_ref_regex, "refs/pull/$1/head"); } else { return ref; } } exports.getRef = getRef; /** * Compose a StatusReport. * * @param actionName The name of the action, e.g. 'init', 'finish', 'upload-sarif' * @param status The status. Must be 'success', 'failure', or 'starting' * @param startedAt The time this action started executing. * @param cause Cause of failure (only supply if status is 'failure') * @param exception Exception (only supply if status is 'failure') */ async function createStatusReportBase(actionName, status, actionStartedAt, cause, exception) { const commitOid = process.env["GITHUB_SHA"] || ""; const ref = await getRef(); const workflowRunIDStr = process.env["GITHUB_RUN_ID"]; let workflowRunID = -1; if (workflowRunIDStr) { workflowRunID = parseInt(workflowRunIDStr, 10); } const workflowName = process.env["GITHUB_WORKFLOW"] || ""; const jobName = process.env["GITHUB_JOB"] || ""; const analysis_key = await getAnalysisKey(); let workflowStartedAt = process.env[sharedEnv.CODEQL_WORKFLOW_STARTED_AT]; if (workflowStartedAt === undefined) { workflowStartedAt = actionStartedAt.toISOString(); core.exportVariable(sharedEnv.CODEQL_WORKFLOW_STARTED_AT, workflowStartedAt); } const statusReport = { workflow_run_id: workflowRunID, workflow_name: workflowName, job_name: jobName, analysis_key, commit_oid: commitOid, ref, action_name: actionName, action_oid: "unknown", started_at: workflowStartedAt, action_started_at: actionStartedAt.toISOString(), status, }; // Add optional parameters if (cause) { statusReport.cause = cause; } if (exception) { statusReport.exception = exception; } if (status === "success" || status === "failure" || status === "aborted") { statusReport.completed_at = new Date().toISOString(); } const matrix = getRequiredInput("matrix"); if (matrix) { statusReport.matrix_vars = matrix; } return statusReport; } exports.createStatusReportBase = createStatusReportBase; /** * Send a status report to the code_scanning/analysis/status endpoint. * * Optionally checks the response from the API endpoint and sets the action * as failed if the status report failed. This is only expected to be used * when sending a 'starting' report. * * Returns whether sending the status report was successful of not. */ async function sendStatusReport(statusReport, ignoreFailures) { if (getRequiredEnvParam("GITHUB_SERVER_URL") !== util_1.GITHUB_DOTCOM_URL) { core.debug("Not sending status report to GitHub Enterprise"); return true; } if (util_1.isLocalRun()) { core.debug("Not sending status report because this is a local run"); return true; } const statusReportJSON = JSON.stringify(statusReport); core.debug(`Sending status report: ${statusReportJSON}`); const nwo = getRequiredEnvParam("GITHUB_REPOSITORY"); const [owner, repo] = nwo.split("/"); const client = api.getActionsApiClient(); const statusResponse = await client.request("PUT /repos/:owner/:repo/code-scanning/analysis/status", { owner, repo, data: statusReportJSON, }); if (!ignoreFailures) { // If the status report request fails with a 403 or a 404, then this is a deliberate // message from the endpoint that the SARIF upload can be expected to fail too, // so the action should fail to avoid wasting actions minutes. // // Other failure responses (or lack thereof) could be transitory and should not // cause the action to fail. if (statusResponse.status === 403) { core.setFailed("The repo on which this action is running is not opted-in to CodeQL code scanning."); return false; } if (statusResponse.status === 404) { core.setFailed("Not authorized to used the CodeQL code scanning feature on this repo."); return false; } } return true; } exports.sendStatusReport = sendStatusReport; //# sourceMappingURL=actions-util.js.map /***/ }), /***/ 2691: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; result["default"] = mod; return result; }; Object.defineProperty(exports, "__esModule", ({ value: true })); const path = __importStar(__webpack_require__(5622)); function isInterpretedLanguage(language) { return language === "javascript" || language === "python"; } // Matches a string containing only characters that are legal to include in paths on windows. exports.legalWindowsPathCharactersRegex = /^[^<>:"|?]*$/; // Builds an environment variable suitable for LGTM_INDEX_INCLUDE or LGTM_INDEX_EXCLUDE function buildIncludeExcludeEnvVar(paths) { // Ignore anything containing a * paths = paths.filter((p) => p.indexOf("*") === -1); // Some characters are illegal in path names in windows if (process.platform === "win32") { paths = paths.filter((p) => p.match(exports.legalWindowsPathCharactersRegex)); } return paths.join("\n"); } function printPathFiltersWarning(config, logger) { // Index include/exclude/filters only work in javascript and python. // If any other languages are detected/configured then show a warning. if ((config.paths.length !== 0 || config.pathsIgnore.length !== 0) && !config.languages.every(isInterpretedLanguage)) { logger.warning('The "paths"/"paths-ignore" fields of the config only have effect for Javascript and Python'); } } exports.printPathFiltersWarning = printPathFiltersWarning; function includeAndExcludeAnalysisPaths(config) { // The 'LGTM_INDEX_INCLUDE' and 'LGTM_INDEX_EXCLUDE' environment variables // control which files/directories are traversed when scanning. // This allows including files that otherwise would not be scanned, or // excluding and not traversing entire file subtrees. // It does not understand globs or double-globs because that would require it to // traverse the entire file tree to determine which files are matched. // Any paths containing "*" are not included in these. if (config.paths.length !== 0) { process.env["LGTM_INDEX_INCLUDE"] = buildIncludeExcludeEnvVar(config.paths); } // If the temporary or tools directory is in the working directory ignore that too. const tempRelativeToWorking = path.relative(process.cwd(), config.tempDir); const toolsRelativeToWorking = path.relative(process.cwd(), config.toolCacheDir); let pathsIgnore = config.pathsIgnore; if (!tempRelativeToWorking.startsWith("..")) { pathsIgnore = pathsIgnore.concat(tempRelativeToWorking); } if (!toolsRelativeToWorking.startsWith("..")) { pathsIgnore = pathsIgnore.concat(toolsRelativeToWorking); } if (pathsIgnore.length !== 0) { process.env["LGTM_INDEX_EXCLUDE"] = buildIncludeExcludeEnvVar(pathsIgnore); } // The 'LGTM_INDEX_FILTERS' environment variable controls which files are // extracted or ignored. It does not control which directories are traversed. // This does understand the glob and double-glob syntax. const filters = []; filters.push(...config.paths.map((p) => `include:${p}`)); filters.push(...config.pathsIgnore.map((p) => `exclude:${p}`)); if (filters.length !== 0) { process.env["LGTM_INDEX_FILTERS"] = filters.join("\n"); } } exports.includeAndExcludeAnalysisPaths = includeAndExcludeAnalysisPaths; //# sourceMappingURL=analysis-paths.js.map /***/ }), /***/ 7465: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; result["default"] = mod; return result; }; Object.defineProperty(exports, "__esModule", ({ value: true })); const core = __importStar(__webpack_require__(2186)); const actionsUtil = __importStar(__webpack_require__(2560)); const analyze_1 = __webpack_require__(53); const config_utils_1 = __webpack_require__(6920); const logging_1 = __webpack_require__(41); const repository_1 = __webpack_require__(1558); const util = __importStar(__webpack_require__(4024)); async function sendStatusReport(startedAt, stats, error) { var _a, _b, _c; const status = ((_a = stats) === null || _a === void 0 ? void 0 : _a.analyze_failure_language) !== undefined || error !== undefined ? "failure" : "success"; const statusReportBase = await actionsUtil.createStatusReportBase("finish", status, startedAt, (_b = error) === null || _b === void 0 ? void 0 : _b.message, (_c = error) === null || _c === void 0 ? void 0 : _c.stack); const statusReport = { ...statusReportBase, ...(stats || {}), }; await actionsUtil.sendStatusReport(statusReport); } async function run() { const startedAt = new Date(); let stats = undefined; try { actionsUtil.prepareLocalRunEnvironment(); if (!(await actionsUtil.sendStatusReport(await actionsUtil.createStatusReportBase("finish", "starting", startedAt), true))) { return; } const logger = logging_1.getActionsLogger(); const config = await config_utils_1.getConfig(actionsUtil.getRequiredEnvParam("RUNNER_TEMP"), logger); if (config === undefined) { throw new Error("Config file could not be found at expected location. Has the 'init' action been called?"); } stats = await analyze_1.runAnalyze(repository_1.parseRepositoryNwo(actionsUtil.getRequiredEnvParam("GITHUB_REPOSITORY")), await actionsUtil.getCommitOid(), await actionsUtil.getRef(), await actionsUtil.getAnalysisKey(), actionsUtil.getRequiredEnvParam("GITHUB_WORKFLOW"), actionsUtil.getWorkflowRunID(), actionsUtil.getRequiredInput("checkout_path"), actionsUtil.getRequiredInput("matrix"), actionsUtil.getRequiredInput("token"), actionsUtil.getRequiredEnvParam("GITHUB_SERVER_URL"), actionsUtil.getRequiredInput("upload") === "true", "actions", actionsUtil.getRequiredInput("output"), util.getMemoryFlag(actionsUtil.getOptionalInput("ram")), util.getAddSnippetsFlag(actionsUtil.getRequiredInput("add-snippets")), util.getThreadsFlag(actionsUtil.getOptionalInput("threads"), logger), config, logger); } catch (error) { core.setFailed(error.message); console.log(error); if (error instanceof analyze_1.CodeQLAnalysisError) { stats = { ...error.queriesStatusReport }; } await sendStatusReport(startedAt, stats, error); return; } await sendStatusReport(startedAt, stats); } run().catch((e) => { core.setFailed(`analyze action failed: ${e}`); console.log(e); }); //# sourceMappingURL=analyze-action.js.map /***/ }), /***/ 53: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; result["default"] = mod; return result; }; Object.defineProperty(exports, "__esModule", ({ value: true })); const fs = __importStar(__webpack_require__(5747)); const path = __importStar(__webpack_require__(5622)); const toolrunnner = __importStar(__webpack_require__(8159)); const analysisPaths = __importStar(__webpack_require__(2691)); const codeql_1 = __webpack_require__(6456); const languages_1 = __webpack_require__(7985); const sharedEnv = __importStar(__webpack_require__(3019)); const upload_lib = __importStar(__webpack_require__(201)); const util = __importStar(__webpack_require__(4024)); class CodeQLAnalysisError extends Error { constructor(queriesStatusReport, message) { super(message); this.name = "CodeQLAnalysisError"; this.queriesStatusReport = queriesStatusReport; } } exports.CodeQLAnalysisError = CodeQLAnalysisError; async function setupPythonExtractor(logger) { const codeqlPython = process.env["CODEQL_PYTHON"]; if (codeqlPython === undefined || codeqlPython.length === 0) { // If CODEQL_PYTHON is not set, no dependencies were installed, so we don't need to do anything return; } let output = ""; const options = { listeners: { stdout: (data) => { output += data.toString(); }, }, }; await new toolrunnner.ToolRunner(codeqlPython, [ "-c", "import os; import pip; print(os.path.dirname(os.path.dirname(pip.__file__)))", ], options).exec(); logger.info(`Setting LGTM_INDEX_IMPORT_PATH=${output}`); process.env["LGTM_INDEX_IMPORT_PATH"] = output; output = ""; await new toolrunnner.ToolRunner(codeqlPython, ["-c", "import sys; print(sys.version_info[0])"], options).exec(); logger.info(`Setting LGTM_PYTHON_SETUP_VERSION=${output}`); process.env["LGTM_PYTHON_SETUP_VERSION"] = output; } async function createdDBForScannedLanguages(config, logger) { // Insert the LGTM_INDEX_X env vars at this point so they are set when // we extract any scanned languages. analysisPaths.includeAndExcludeAnalysisPaths(config); const codeql = codeql_1.getCodeQL(config.codeQLCmd); for (const language of config.languages) { if (languages_1.isScannedLanguage(language)) { logger.startGroup(`Extracting ${language}`); if (language === languages_1.Language.python) { await setupPythonExtractor(logger); } await codeql.extractScannedLanguage(util.getCodeQLDatabasePath(config.tempDir, language), language); logger.endGroup(); } } } async function finalizeDatabaseCreation(config, logger) { await createdDBForScannedLanguages(config, logger); const codeql = codeql_1.getCodeQL(config.codeQLCmd); for (const language of config.languages) { logger.startGroup(`Finalizing ${language}`); await codeql.finalizeDatabase(util.getCodeQLDatabasePath(config.tempDir, language)); logger.endGroup(); } } // Runs queries and creates sarif files in the given folder async function runQueries(sarifFolder, memoryFlag, addSnippetsFlag, threadsFlag, config, logger) { const statusReport = {}; for (const language of config.languages) { logger.startGroup(`Analyzing ${language}`); const queries = config.queries[language]; if (queries.builtin.length === 0 && queries.custom.length === 0) { throw new Error(`Unable to analyse ${language} as no queries were selected for this language`); } try { for (const type of ["builtin", "custom"]) { if (queries[type].length > 0) { const startTime = new Date().getTime(); const databasePath = util.getCodeQLDatabasePath(config.tempDir, language); // Pass the queries to codeql using a file instead of using the command // line to avoid command line length restrictions, particularly on windows. const querySuitePath = `${databasePath}-queries-${type}.qls`; const querySuiteContents = queries[type] .map((q) => `- query: ${q}`) .join("\n"); fs.writeFileSync(querySuitePath, querySuiteContents); logger.debug(`Query suite file for ${language}...\n${querySuiteContents}`); const sarifFile = path.join(sarifFolder, `${language}-${type}.sarif`); const codeql = codeql_1.getCodeQL(config.codeQLCmd); await codeql.databaseAnalyze(databasePath, sarifFile, querySuitePath, memoryFlag, addSnippetsFlag, threadsFlag); logger.debug(`SARIF results for database ${language} created at "${sarifFile}"`); logger.endGroup(); // Record the performance const endTime = new Date().getTime(); statusReport[`analyze_${type}_queries_${language}_duration_ms`] = endTime - startTime; } } } catch (e) { logger.info(e); statusReport.analyze_failure_language = language; throw new CodeQLAnalysisError(statusReport, `Error running analysis for ${language}: ${e}`); } } return statusReport; } exports.runQueries = runQueries; async function runAnalyze(repositoryNwo, commitOid, ref, analysisKey, analysisName, workflowRunID, checkoutPath, environment, githubAuth, githubUrl, doUpload, mode, outputDir, memoryFlag, addSnippetsFlag, threadsFlag, config, logger) { // Delete the tracer config env var to avoid tracing ourselves delete process.env[sharedEnv.ODASA_TRACER_CONFIGURATION]; fs.mkdirSync(outputDir, { recursive: true }); logger.info("Finalizing database creation"); await finalizeDatabaseCreation(config, logger); logger.info("Analyzing database"); const queriesStats = await runQueries(outputDir, memoryFlag, addSnippetsFlag, threadsFlag, config, logger); if (!doUpload) { logger.info("Not uploading results"); return { ...queriesStats }; } const uploadStats = await upload_lib.upload(outputDir, repositoryNwo, commitOid, ref, analysisKey, analysisName, workflowRunID, checkoutPath, environment, githubAuth, githubUrl, mode, logger); return { ...queriesStats, ...uploadStats }; } exports.runAnalyze = runAnalyze; //# sourceMappingURL=analyze.js.map /***/ }), /***/ 5883: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; result["default"] = mod; return result; }; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", ({ value: true })); const path = __importStar(__webpack_require__(5622)); const githubUtils = __importStar(__webpack_require__(3030)); const retry = __importStar(__webpack_require__(6298)); const console_log_level_1 = __importDefault(__webpack_require__(385)); const actions_util_1 = __webpack_require__(2560); const util_1 = __webpack_require__(4024); exports.getApiClient = function (githubAuth, githubUrl, allowLocalRun = false) { if (util_1.isLocalRun() && !allowLocalRun) { throw new Error("Invalid API call in local run"); } const retryingOctokit = githubUtils.GitHub.plugin(retry.retry); return new retryingOctokit(githubUtils.getOctokitOptions(githubAuth, { baseUrl: getApiUrl(githubUrl), userAgent: "CodeQL Action", log: console_log_level_1.default({ level: "info" }), })); }; function getApiUrl(githubUrl) { const url = new URL(githubUrl); // If we detect this is trying to be to github.com // then return with a fixed canonical URL. if (url.hostname === "github.com" || url.hostname === "api.github.com") { return "https://api.github.com"; } // Add the /api/v3 API prefix url.pathname = path.join(url.pathname, "api", "v3"); return url.toString(); } // Temporary function to aid in the transition to running on and off of github actions. // Once all code has been coverted this function should be removed or made canonical // and called only from the action entrypoints. function getActionsApiClient(allowLocalRun = false) { return exports.getApiClient(actions_util_1.getRequiredInput("token"), actions_util_1.getRequiredEnvParam("GITHUB_SERVER_URL"), allowLocalRun); } exports.getActionsApiClient = getActionsApiClient; //# sourceMappingURL=api-client.js.map /***/ }), /***/ 6456: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; result["default"] = mod; return result; }; Object.defineProperty(exports, "__esModule", ({ value: true })); const fs = __importStar(__webpack_require__(5747)); const path = __importStar(__webpack_require__(5622)); const stream = __importStar(__webpack_require__(2413)); const globalutil = __importStar(__webpack_require__(1669)); const toolrunnner = __importStar(__webpack_require__(8159)); const http = __importStar(__webpack_require__(9925)); const toolcache = __importStar(__webpack_require__(7784)); const semver = __importStar(__webpack_require__(1383)); const uuid_1 = __webpack_require__(4552); const actions_util_1 = __webpack_require__(2560); const api = __importStar(__webpack_require__(5883)); const defaults = __importStar(__webpack_require__(3617)); // Referenced from codeql-action-sync-tool! const error_matcher_1 = __webpack_require__(8112); const toolrunner_error_catcher_1 = __webpack_require__(5507); const util = __importStar(__webpack_require__(4024)); /** * Stores the CodeQL object, and is populated by `setupCodeQL` or `getCodeQL`. * Can be overridden in tests using `setCodeQL`. */ let cachedCodeQL = undefined; const CODEQL_BUNDLE_VERSION = defaults.bundleVersion; const CODEQL_DEFAULT_ACTION_REPOSITORY = "github/codeql-action"; function getCodeQLBundleName() { let platform; if (process.platform === "win32") { platform = "win64"; } else if (process.platform === "linux") { platform = "linux64"; } else if (process.platform === "darwin") { platform = "osx64"; } else { return "codeql-bundle.tar.gz"; } return `codeql-bundle-${platform}.tar.gz`; } function getCodeQLActionRepository(mode) { if (mode !== "actions") { return CODEQL_DEFAULT_ACTION_REPOSITORY; } // Actions do not know their own repository name, // so we currently use this hack to find the name based on where our files are. // This can be removed once the change to the runner in https://github.com/actions/runner/pull/585 is deployed. const runnerTemp = actions_util_1.getRequiredEnvParam("RUNNER_TEMP"); const actionsDirectory = path.join(path.dirname(runnerTemp), "_actions"); const relativeScriptPath = path.relative(actionsDirectory, __filename); // This handles the case where the Action does not come from an Action repository, // e.g. our integration tests which use the Action code from the current checkout. if (relativeScriptPath.startsWith("..") || path.isAbsolute(relativeScriptPath)) { return CODEQL_DEFAULT_ACTION_REPOSITORY; } const relativeScriptPathParts = relativeScriptPath.split(path.sep); return `${relativeScriptPathParts[0]}/${relativeScriptPathParts[1]}`; } async function getCodeQLBundleDownloadURL(githubAuth, githubUrl, mode, logger) { const codeQLActionRepository = getCodeQLActionRepository(mode); const potentialDownloadSources = [ // This GitHub instance, and this Action. [githubUrl, codeQLActionRepository], // This GitHub instance, and the canonical Action. [githubUrl, CODEQL_DEFAULT_ACTION_REPOSITORY], // GitHub.com, and the canonical Action. [util.GITHUB_DOTCOM_URL, CODEQL_DEFAULT_ACTION_REPOSITORY], ]; // We now filter out any duplicates. // Duplicates will happen either because the GitHub instance is GitHub.com, or because the Action is not a fork. const uniqueDownloadSources = potentialDownloadSources.filter((url, index, self) => index === self.indexOf(url)); const codeQLBundleName = getCodeQLBundleName(); for (const downloadSource of uniqueDownloadSources) { const [apiURL, repository] = downloadSource; // If we've reached the final case, short-circuit the API check since we know the bundle exists and is public. if (apiURL === util.GITHUB_DOTCOM_URL && repository === CODEQL_DEFAULT_ACTION_REPOSITORY) { break; } const [repositoryOwner, repositoryName] = repository.split("/"); try { const release = await api .getApiClient(githubAuth, githubUrl) .repos.getReleaseByTag({ owner: repositoryOwner, repo: repositoryName, tag: CODEQL_BUNDLE_VERSION, }); for (const asset of release.data.assets) { if (asset.name === codeQLBundleName) { logger.info(`Found CodeQL bundle in ${downloadSource[1]} on ${downloadSource[0]} with URL ${asset.url}.`); return asset.url; } } } catch (e) { logger.info(`Looked for CodeQL bundle in ${downloadSource[1]} on ${downloadSource[0]} but got error ${e}.`); } } return `https://github.com/${CODEQL_DEFAULT_ACTION_REPOSITORY}/releases/download/${CODEQL_BUNDLE_VERSION}/${codeQLBundleName}`; } // We have to download CodeQL manually because the toolcache doesn't support Accept headers. // This can be removed once https://github.com/actions/toolkit/pull/530 is merged and released. async function toolcacheDownloadTool(url, headers, tempDir, logger) { const client = new http.HttpClient("CodeQL Action"); const dest = path.join(tempDir, uuid_1.v4()); const response = await client.get(url, headers); if (response.message.statusCode !== 200) { logger.info(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`); throw new Error(`Unexpected HTTP response: ${response.message.statusCode}`); } const pipeline = globalutil.promisify(stream.pipeline); fs.mkdirSync(path.dirname(dest), { recursive: true }); await pipeline(response.message, fs.createWriteStream(dest)); return dest; } async function setupCodeQL(codeqlURL, githubAuth, githubUrl, tempDir, toolsDir, mode, logger) { // Setting these two env vars makes the toolcache code safe to use outside, // of actions but this is obviously not a great thing we're doing and it would // be better to write our own implementation to use outside of actions. process.env["RUNNER_TEMP"] = tempDir; process.env["RUNNER_TOOL_CACHE"] = toolsDir; try { // We use the special value of 'latest' to prioritize the version in the // defaults over any pinned cached version. const forceLatest = codeqlURL === "latest"; if (forceLatest) { codeqlURL = undefined; } const codeqlURLVersion = getCodeQLURLVersion(codeqlURL || `/${CODEQL_BUNDLE_VERSION}/`, logger); // If we find the specified version, we always use that. let codeqlFolder = toolcache.find("CodeQL", codeqlURLVersion); // If we don't find the requested version, in some cases we may allow a // different version to save download time if the version hasn't been // specified explicitly (in which case we always honor it). if (!codeqlFolder && !codeqlURL && !forceLatest) { const codeqlVersions = toolcache.findAllVersions("CodeQL"); if (codeqlVersions.length === 1) { const tmpCodeqlFolder = toolcache.find("CodeQL", codeqlVersions[0]); if (fs.existsSync(path.join(tmpCodeqlFolder, "pinned-version"))) { logger.debug(`CodeQL in cache overriding the default ${CODEQL_BUNDLE_VERSION}`); codeqlFolder = tmpCodeqlFolder; } } } if (codeqlFolder) { logger.debug(`CodeQL found in cache ${codeqlFolder}`); } else { if (!codeqlURL) { codeqlURL = await getCodeQLBundleDownloadURL(githubAuth, githubUrl, mode, logger); } const headers = { accept: "application/octet-stream" }; // We only want to provide an authorization header if we are downloading // from the same GitHub instance the Action is running on. // This avoids leaking Enterprise tokens to dotcom. if (codeqlURL.startsWith(`${githubUrl}/`)) { logger.debug("Downloading CodeQL bundle with token."); headers.authorization = `token ${githubAuth}`; } else { logger.debug("Downloading CodeQL bundle without token."); } logger.info(`Downloading CodeQL tools from ${codeqlURL}. This may take a while.`); const codeqlPath = await toolcacheDownloadTool(codeqlURL, headers, tempDir, logger); logger.debug(`CodeQL bundle download to ${codeqlPath} complete.`); const codeqlExtracted = await toolcache.extractTar(codeqlPath); codeqlFolder = await toolcache.cacheDir(codeqlExtracted, "CodeQL", codeqlURLVersion); } let codeqlCmd = path.join(codeqlFolder, "codeql", "codeql"); if (process.platform === "win32") { codeqlCmd += ".exe"; } else if (process.platform !== "linux" && process.platform !== "darwin") { throw new Error(`Unsupported platform: ${process.platform}`); } cachedCodeQL = getCodeQLForCmd(codeqlCmd); return cachedCodeQL; } catch (e) { logger.error(e); throw new Error("Unable to download and extract CodeQL CLI"); } } exports.setupCodeQL = setupCodeQL; function getCodeQLURLVersion(url, logger) { const match = url.match(/\/codeql-bundle-(.*)\//); if (match === null || match.length < 2) { throw new Error(`Malformed tools url: ${url}. Version could not be inferred`); } let version = match[1]; if (!semver.valid(version)) { logger.debug(`Bundle version ${version} is not in SemVer format. Will treat it as pre-release 0.0.0-${version}.`); version = `0.0.0-${version}`; } const s = semver.clean(version); if (!s) { throw new Error(`Malformed tools url ${url}. Version should be in SemVer format but have ${version} instead`); } return s; } exports.getCodeQLURLVersion = getCodeQLURLVersion; /** * Use the CodeQL executable located at the given path. */ function getCodeQL(cmd) { if (cachedCodeQL === undefined) { cachedCodeQL = getCodeQLForCmd(cmd); } return cachedCodeQL; } exports.getCodeQL = getCodeQL; function resolveFunction(partialCodeql, methodName, defaultImplementation) { if (typeof partialCodeql[methodName] !== "function") { if (defaultImplementation !== undefined) { return defaultImplementation; } const dummyMethod = () => { throw new Error(`CodeQL ${methodName} method not correctly defined`); }; return dummyMethod; } return partialCodeql[methodName]; } /** * Set the functionality for CodeQL methods. Only for use in tests. * * Accepts a partial object and any undefined methods will be implemented * to immediately throw an exception indicating which method is missing. */ function setCodeQL(partialCodeql) { cachedCodeQL = { getPath: resolveFunction(partialCodeql, "getPath", () => "/tmp/dummy-path"), printVersion: resolveFunction(partialCodeql, "printVersion"), getTracerEnv: resolveFunction(partialCodeql, "getTracerEnv"), databaseInit: resolveFunction(partialCodeql, "databaseInit"), runAutobuild: resolveFunction(partialCodeql, "runAutobuild"), extractScannedLanguage: resolveFunction(partialCodeql, "extractScannedLanguage"), finalizeDatabase: resolveFunction(partialCodeql, "finalizeDatabase"), resolveQueries: resolveFunction(partialCodeql, "resolveQueries"), databaseAnalyze: resolveFunction(partialCodeql, "databaseAnalyze"), }; return cachedCodeQL; } exports.setCodeQL = setCodeQL; /** * Get the cached CodeQL object. Should only be used from tests. * * TODO: Work out a good way for tests to get this from the test context * instead of having to have this method. */ function getCachedCodeQL() { if (cachedCodeQL === undefined) { // Should never happen as setCodeQL is called by testing-utils.setupTests throw new Error("cachedCodeQL undefined"); } return cachedCodeQL; } exports.getCachedCodeQL = getCachedCodeQL; function getCodeQLForCmd(cmd) { return { getPath() { return cmd; }, async printVersion() { await new toolrunnner.ToolRunner(cmd, [ "version", "--format=json", ]).exec(); }, async getTracerEnv(databasePath) { // Write tracer-env.js to a temp location. const tracerEnvJs = path.resolve(databasePath, "working", "tracer-env.js"); fs.mkdirSync(path.dirname(tracerEnvJs), { recursive: true }); fs.writeFileSync(tracerEnvJs, ` const fs = require('fs'); const env = {}; for (let entry of Object.entries(process.env)) { const key = entry[0]; const value = entry[1]; if (typeof value !== 'undefined' && key !== '_' && !key.startsWith('JAVA_MAIN_CLASS_')) { env[key] = value; } } process.stdout.write(process.argv[2]); fs.writeFileSync(process.argv[2], JSON.stringify(env), 'utf-8');`); const envFile = path.resolve(databasePath, "working", "env.tmp"); await new toolrunnner.ToolRunner(cmd, [ "database", "trace-command", databasePath, ...getExtraOptionsFromEnv(["database", "trace-command"]), process.execPath, tracerEnvJs, envFile, ]).exec(); return JSON.parse(fs.readFileSync(envFile, "utf-8")); }, async databaseInit(databasePath, language, sourceRoot) { await new toolrunnner.ToolRunner(cmd, [ "database", "init", databasePath, `--language=${language}`, `--source-root=${sourceRoot}`, ...getExtraOptionsFromEnv(["database", "init"]), ]).exec(); }, async runAutobuild(language) { const cmdName = process.platform === "win32" ? "autobuild.cmd" : "autobuild.sh"; const autobuildCmd = path.join(path.dirname(cmd), language, "tools", cmdName); // Update JAVA_TOOL_OPTIONS to contain '-Dhttp.keepAlive=false' // This is because of an issue with Azure pipelines timing out connections after 4 minutes // and Maven not properly handling closed connections // Otherwise long build processes will timeout when pulling down Java packages // https://developercommunity.visualstudio.com/content/problem/292284/maven-hosted-agent-connection-timeout.html const javaToolOptions = process.env["JAVA_TOOL_OPTIONS"] || ""; process.env["JAVA_TOOL_OPTIONS"] = [ ...javaToolOptions.split(/\s+/), "-Dhttp.keepAlive=false", "-Dmaven.wagon.http.pool=false", ].join(" "); await new toolrunnner.ToolRunner(autobuildCmd).exec(); }, async extractScannedLanguage(databasePath, language) { // Get extractor location let extractorPath = ""; await new toolrunnner.ToolRunner(cmd, [ "resolve", "extractor", "--format=json", `--language=${language}`, ...getExtraOptionsFromEnv(["resolve", "extractor"]), ], { silent: true, listeners: { stdout: (data) => { extractorPath += data.toString(); }, stderr: (data) => { process.stderr.write(data); }, }, }).exec(); // Set trace command const ext = process.platform === "win32" ? ".cmd" : ".sh"; const traceCommand = path.resolve(JSON.parse(extractorPath), "tools", `autobuild${ext}`); // Run trace command await toolrunner_error_catcher_1.toolrunnerErrorCatcher(cmd, [ "database", "trace-command", ...getExtraOptionsFromEnv(["database", "trace-command"]), databasePath, "--", traceCommand, ], error_matcher_1.errorMatchers); }, async finalizeDatabase(databasePath) { await toolrunner_error_catcher_1.toolrunnerErrorCatcher(cmd, [ "database", "finalize", ...getExtraOptionsFromEnv(["database", "finalize"]), databasePath, ], error_matcher_1.errorMatchers); }, async resolveQueries(queries, extraSearchPath) { const codeqlArgs = [ "resolve", "queries", ...queries, "--format=bylanguage", ...getExtraOptionsFromEnv(["resolve", "queries"]), ]; if (extraSearchPath !== undefined) { codeqlArgs.push("--search-path", extraSearchPath); } let output = ""; await new toolrunnner.ToolRunner(cmd, codeqlArgs, { listeners: { stdout: (data) => { output += data.toString(); }, }, }).exec(); return JSON.parse(output); }, async databaseAnalyze(databasePath, sarifFile, querySuite, memoryFlag, addSnippetsFlag, threadsFlag) { await new toolrunnner.ToolRunner(cmd, [ "database", "analyze", memoryFlag, threadsFlag, databasePath, "--min-disk-free=1024", "--format=sarif-latest", `--output=${sarifFile}`, addSnippetsFlag, ...getExtraOptionsFromEnv(["database", "analyze"]), querySuite, ]).exec(); }, }; } /** * Gets the options for `path` of `options` as an array of extra option strings. */ function getExtraOptionsFromEnv(path) { const options = util.getExtraOptionsEnvParam(); return getExtraOptions(options, path, []); } /** * Gets the options for `path` of `options` as an array of extra option strings. * * - the special terminal step name '*' in `options` matches all path steps * - throws an exception if this conversion is impossible. * * Exported for testing. */ function getExtraOptions(options, path, pathInfo) { var _a, _b, _c; /** * Gets `options` as an array of extra option strings. * * - throws an exception mentioning `pathInfo` if this conversion is impossible. */ function asExtraOptions(options, pathInfo) { if (options === undefined) { return []; } if (!Array.isArray(options)) { const msg = `The extra options for '${pathInfo.join(".")}' ('${JSON.stringify(options)}') are not in an array.`; throw new Error(msg); } return options.map((o) => { const t = typeof o; if (t !== "string" && t !== "number" && t !== "boolean") { const msg = `The extra option for '${pathInfo.join(".")}' ('${JSON.stringify(o)}') is not a primitive value.`; throw new Error(msg); } return `${o}`; }); } const all = asExtraOptions((_a = options) === null || _a === void 0 ? void 0 : _a["*"], pathInfo.concat("*")); const specific = path.length === 0 ? asExtraOptions(options, pathInfo) : getExtraOptions((_b = options) === null || _b === void 0 ? void 0 : _b[path[0]], (_c = path) === null || _c === void 0 ? void 0 : _c.slice(1), pathInfo.concat(path[0])); return all.concat(specific); } exports.getExtraOptions = getExtraOptions; //# sourceMappingURL=codeql.js.map /***/ }), /***/ 6920: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; result["default"] = mod; return result; }; Object.defineProperty(exports, "__esModule", ({ value: true })); const fs = __importStar(__webpack_require__(5747)); const path = __importStar(__webpack_require__(5622)); const yaml = __importStar(__webpack_require__(1917)); const api = __importStar(__webpack_require__(5883)); const externalQueries = __importStar(__webpack_require__(9045)); const languages_1 = __webpack_require__(7985); // Property names from the user-supplied config file. const NAME_PROPERTY = "name"; const DISABLE_DEFAULT_QUERIES_PROPERTY = "disable-default-queries"; const QUERIES_PROPERTY = "queries"; const QUERIES_USES_PROPERTY = "uses"; const PATHS_IGNORE_PROPERTY = "paths-ignore"; const PATHS_PROPERTY = "paths"; /** * A list of queries from https://github.com/github/codeql that * we don't want to run. Disabling them here is a quicker alternative to * disabling them in the code scanning query suites. Queries should also * be disabled in the suites, and removed from this list here once the * bundle is updated to make those suite changes live. * * Format is a map from language to an array of path suffixes of .ql files. */ const DISABLED_BUILTIN_QUERIES = { csharp: [ "ql/src/Security Features/CWE-937/VulnerablePackage.ql", "ql/src/Security Features/CWE-451/MissingXFrameOptions.ql", ], }; function queryIsDisabled(language, query) { return (DISABLED_BUILTIN_QUERIES[language] || []).some((disabledQuery) => query.endsWith(disabledQuery)); } /** * Asserts that the noDeclaredLanguage and multipleDeclaredLanguages fields are * both empty and errors if they are not. */ function validateQueries(resolvedQueries) { const noDeclaredLanguage = resolvedQueries.noDeclaredLanguage; const noDeclaredLanguageQueries = Object.keys(noDeclaredLanguage); if (noDeclaredLanguageQueries.length !== 0) { throw new Error(`${"The following queries do not declare a language. " + "Their qlpack.yml files are either missing or is invalid.\n"}${noDeclaredLanguageQueries.join("\n")}`); } const multipleDeclaredLanguages = resolvedQueries.multipleDeclaredLanguages; const multipleDeclaredLanguagesQueries = Object.keys(multipleDeclaredLanguages); if (multipleDeclaredLanguagesQueries.length !== 0) { throw new Error(`${"The following queries declare multiple languages. " + "Their qlpack.yml files are either missing or is invalid.\n"}${multipleDeclaredLanguagesQueries.join("\n")}`); } } /** * Run 'codeql resolve queries' and add the results to resultMap * * If a checkout path is given then the queries are assumed to be custom queries * and an error will be thrown if there is anything invalid about the queries. * If a checkout path is not given then the queries are assumed to be builtin * queries, and error checking will be suppressed. */ async function runResolveQueries(codeQL, resultMap, toResolve, extraSearchPath) { const resolvedQueries = await codeQL.resolveQueries(toResolve, extraSearchPath); if (extraSearchPath !== undefined) { validateQueries(resolvedQueries); } for (const [language, queryPaths] of Object.entries(resolvedQueries.byLanguage)) { if (resultMap[language] === undefined) { resultMap[language] = { builtin: [], custom: [], }; } const queries = Object.keys(queryPaths).filter((q) => !queryIsDisabled(language, q)); if (extraSearchPath !== undefined) { resultMap[language].custom.push(...queries); } else { resultMap[language].builtin.push(...queries); } } } /** * Get the set of queries included by default. */ async function addDefaultQueries(codeQL, languages, resultMap) { const suites = languages.map((l) => `${l}-code-scanning.qls`); await runResolveQueries(codeQL, resultMap, suites, undefined); } // The set of acceptable values for built-in suites from the codeql bundle const builtinSuites = ["security-extended", "security-and-quality"]; /** * Determine the set of queries associated with suiteName's suites and add them to resultMap. * Throws an error if suiteName is not a valid builtin suite. */ async function addBuiltinSuiteQueries(languages, codeQL, resultMap, suiteName, configFile) { const suite = builtinSuites.find((suite) => suite === suiteName); if (!suite) { throw new Error(getQueryUsesInvalid(configFile, suiteName)); } const suites = languages.map((l) => `${l}-${suiteName}.qls`); await runResolveQueries(codeQL, resultMap, suites, undefined); } /** * Retrieve the set of queries at localQueryPath and add them to resultMap. */ async function addLocalQueries(codeQL, resultMap, localQueryPath, checkoutPath, configFile) { // Resolve the local path against the workspace so that when this is // passed to codeql it resolves to exactly the path we expect it to resolve to. let absoluteQueryPath = path.join(checkoutPath, localQueryPath); // Check the file exists if (!fs.existsSync(absoluteQueryPath)) { throw new Error(getLocalPathDoesNotExist(configFile, localQueryPath)); } // Call this after checking file exists, because it'll fail if file doesn't exist absoluteQueryPath = fs.realpathSync(absoluteQueryPath); // Check the local path doesn't jump outside the repo using '..' or symlinks if (!(absoluteQueryPath + path.sep).startsWith(fs.realpathSync(checkoutPath) + path.sep)) { throw new Error(getLocalPathOutsideOfRepository(configFile, localQueryPath)); } await runResolveQueries(codeQL, resultMap, [absoluteQueryPath], checkoutPath); } /** * Retrieve the set of queries at the referenced remote repo and add them to resultMap. */ async function addRemoteQueries(codeQL, resultMap, queryUses, tempDir, githubUrl, logger, configFile) { let tok = queryUses.split("@"); if (tok.length !== 2) { throw new Error(getQueryUsesInvalid(configFile, queryUses)); } const ref = tok[1]; tok = tok[0].split("/"); // The first token is the owner // The second token is the repo // The rest is a path, if there is more than one token combine them to form the full path if (tok.length < 2) { throw new Error(getQueryUsesInvalid(configFile, queryUses)); } // Check none of the parts of the repository name are empty if (tok[0].trim() === "" || tok[1].trim() === "") { throw new Error(getQueryUsesInvalid(configFile, queryUses)); } const nwo = `${tok[0]}/${tok[1]}`; // Checkout the external repository const checkoutPath = await externalQueries.checkoutExternalRepository(nwo, ref, githubUrl, tempDir, logger); const queryPath = tok.length > 2 ? path.join(checkoutPath, tok.slice(2).join("/")) : checkoutPath; await runResolveQueries(codeQL, resultMap, [queryPath], checkoutPath); } /** * Parse a query 'uses' field to a discrete set of query files and update resultMap. * * The logic for parsing the string is based on what actions does for * parsing the 'uses' actions in the workflow file. So it can handle * local paths starting with './', or references to remote repos, or * a finite set of hardcoded terms for builtin suites. */ async function parseQueryUses(languages, codeQL, resultMap, queryUses, tempDir, checkoutPath, githubUrl, logger, configFile) { queryUses = queryUses.trim(); if (queryUses === "") { throw new Error(getQueryUsesInvalid(configFile)); } // Check for the local path case before we start trying to parse the repository name if (queryUses.startsWith("./")) { await addLocalQueries(codeQL, resultMap, queryUses.slice(2), checkoutPath, configFile); return; } // Check for one of the builtin suites if (queryUses.indexOf("/") === -1 && queryUses.indexOf("@") === -1) { await addBuiltinSuiteQueries(languages, codeQL, resultMap, queryUses, configFile); return; } // Otherwise, must be a reference to another repo await addRemoteQueries(codeQL, resultMap, queryUses, tempDir, githubUrl, logger, configFile); } // Regex validating stars in paths or paths-ignore entries. // The intention is to only allow ** to appear when immediately // preceded and followed by a slash. const pathStarsRegex = /.*(?:\*\*[^/].*|\*\*$|[^/]\*\*.*)/; // Characters that are supported by filters in workflows, but not by us. // See https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet const filterPatternCharactersRegex = /.*[?+[\]!].*/; // Checks that a paths of paths-ignore entry is valid, possibly modifying it // to make it valid, or if not possible then throws an error. function validateAndSanitisePath(originalPath, propertyName, configFile, logger) { // Take a copy so we don't modify the original path, so we can still construct error messages let path = originalPath; // All paths are relative to the src root, so strip off leading slashes. while (path.charAt(0) === "/") { path = path.substring(1); } // Trailing ** are redundant, so strip them off if (path.endsWith("/**")) { path = path.substring(0, path.length - 2); } // An empty path is not allowed as it's meaningless if (path === "") { throw new Error(getConfigFilePropertyError(configFile, propertyName, `"${originalPath}" is not an invalid path. ` + `It is not necessary to include it, and it is not allowed to exclude it.`)); } // Check for illegal uses of ** if (path.match(pathStarsRegex)) { throw new Error(getConfigFilePropertyError(configFile, propertyName, `"${originalPath}" contains an invalid "**" wildcard. ` + `They must be immediately preceeded and followed by a slash as in "/**/", or come at the start or end.`)); } // Check for other regex characters that we don't support. // Output a warning so the user knows, but otherwise continue normally. if (path.match(filterPatternCharactersRegex)) { logger.warning(getConfigFilePropertyError(configFile, propertyName, `"${originalPath}" contains an unsupported character. ` + `The filter pattern characters ?, +, [, ], ! are not supported and will be matched literally.`)); } // Ban any uses of backslash for now. // This may not play nicely with project layouts. // This restriction can be lifted later if we determine they are ok. if (path.indexOf("\\") !== -1) { throw new Error(getConfigFilePropertyError(configFile, propertyName, `"${originalPath}" contains an "\\" character. These are not allowed in filters. ` + `If running on windows we recommend using "/" instead for path filters.`)); } return path; } exports.validateAndSanitisePath = validateAndSanitisePath; // An undefined configFile in some of these functions indicates that // the property was in a workflow file, not a config file function getNameInvalid(configFile) { return getConfigFilePropertyError(configFile, NAME_PROPERTY, "must be a non-empty string"); } exports.getNameInvalid = getNameInvalid; function getDisableDefaultQueriesInvalid(configFile) { return getConfigFilePropertyError(configFile, DISABLE_DEFAULT_QUERIES_PROPERTY, "must be a boolean"); } exports.getDisableDefaultQueriesInvalid = getDisableDefaultQueriesInvalid; function getQueriesInvalid(configFile) { return getConfigFilePropertyError(configFile, QUERIES_PROPERTY, "must be an array"); } exports.getQueriesInvalid = getQueriesInvalid; function getQueryUsesInvalid(configFile, queryUses) { return getConfigFilePropertyError(configFile, `${QUERIES_PROPERTY}.${QUERIES_USES_PROPERTY}`, `must be a built-in suite (${builtinSuites.join(" or ")}), a relative path, or be of the form "owner/repo[/path]@ref"${queryUses !== undefined ? `\n Found: ${queryUses}` : ""}`); } exports.getQueryUsesInvalid = getQueryUsesInvalid; function getPathsIgnoreInvalid(configFile) { return getConfigFilePropertyError(configFile, PATHS_IGNORE_PROPERTY, "must be an array of non-empty strings"); } exports.getPathsIgnoreInvalid = getPathsIgnoreInvalid; function getPathsInvalid(configFile) { return getConfigFilePropertyError(configFile, PATHS_PROPERTY, "must be an array of non-empty strings"); } exports.getPathsInvalid = getPathsInvalid; function getLocalPathOutsideOfRepository(configFile, localPath) { return getConfigFilePropertyError(configFile, `${QUERIES_PROPERTY}.${QUERIES_USES_PROPERTY}`, `is invalid as the local path "${localPath}" is outside of the repository`); } exports.getLocalPathOutsideOfRepository = getLocalPathOutsideOfRepository; function getLocalPathDoesNotExist(configFile, localPath) { return getConfigFilePropertyError(configFile, `${QUERIES_PROPERTY}.${QUERIES_USES_PROPERTY}`, `is invalid as the local path "${localPath}" does not exist in the repository`); } exports.getLocalPathDoesNotExist = getLocalPathDoesNotExist; function getConfigFileOutsideWorkspaceErrorMessage(configFile) { return `The configuration file "${configFile}" is outside of the workspace`; } exports.getConfigFileOutsideWorkspaceErrorMessage = getConfigFileOutsideWorkspaceErrorMessage; function getConfigFileDoesNotExistErrorMessage(configFile) { return `The configuration file "${configFile}" does not exist`; } exports.getConfigFileDoesNotExistErrorMessage = getConfigFileDoesNotExistErrorMessage; function getConfigFileRepoFormatInvalidMessage(configFile) { let error = `The configuration file "${configFile}" is not a supported remote file reference.`; error += " Expected format //@"; return error; } exports.getConfigFileRepoFormatInvalidMessage = getConfigFileRepoFormatInvalidMessage; function getConfigFileFormatInvalidMessage(configFile) { return `The configuration file "${configFile}" could not be read`; } exports.getConfigFileFormatInvalidMessage = getConfigFileFormatInvalidMessage; function getConfigFileDirectoryGivenMessage(configFile) { return `The configuration file "${configFile}" looks like a directory, not a file`; } exports.getConfigFileDirectoryGivenMessage = getConfigFileDirectoryGivenMessage; function getConfigFilePropertyError(configFile, property, error) { if (configFile === undefined) { return `The workflow property "${property}" is invalid: ${error}`; } else { return `The configuration file "${configFile}" is invalid: property "${property}" ${error}`; } } function getNoLanguagesError() { return ("Did not detect any languages to analyze. " + "Please update input in workflow or check that GitHub detects the correct languages in your repository."); } exports.getNoLanguagesError = getNoLanguagesError; function getUnknownLanguagesError(languages) { return `Did not recognise the following languages: ${languages.join(", ")}`; } exports.getUnknownLanguagesError = getUnknownLanguagesError; /** * Gets the set of languages in the current repository */ async function getLanguagesInRepo(repository, githubAuth, githubUrl, logger) { logger.debug(`GitHub repo ${repository.owner} ${repository.repo}`); const response = await api .getApiClient(githubAuth, githubUrl, true) .repos.listLanguages({ owner: repository.owner, repo: repository.repo, }); logger.debug(`Languages API response: ${JSON.stringify(response)}`); // The GitHub API is going to return languages in order of popularity, // When we pick a language to autobuild we want to pick the most popular traced language // Since sets in javascript maintain insertion order, using a set here and then splatting it // into an array gives us an array of languages ordered by popularity const languages = new Set(); for (const lang of Object.keys(response.data)) { const parsedLang = languages_1.parseLanguage(lang); if (parsedLang !== undefined) { languages.add(parsedLang); } } return [...languages]; } /** * Get the languages to analyse. * * The result is obtained from the action input parameter 'languages' if that * has been set, otherwise it is deduced as all languages in the repo that * can be analysed. * * If no languages could be detected from either the workflow or the repository * then throw an error. */ async function getLanguages(languagesInput, repository, githubAuth, githubUrl, logger) { // Obtain from action input 'languages' if set let languages = (languagesInput || "") .split(",") .map((x) => x.trim()) .filter((x) => x.length > 0); logger.info(`Languages from configuration: ${JSON.stringify(languages)}`); if (languages.length === 0) { // Obtain languages as all languages in the repo that can be analysed languages = await getLanguagesInRepo(repository, githubAuth, githubUrl, logger); logger.info(`Automatically detected languages: ${JSON.stringify(languages)}`); } // If the languages parameter was not given and no languages were // detected then fail here as this is a workflow configuration error. if (languages.length === 0) { throw new Error(getNoLanguagesError()); } // Make sure they are supported const parsedLanguages = []; const unknownLanguages = []; for (const language of languages) { const parsedLanguage = languages_1.parseLanguage(language); if (parsedLanguage === undefined) { unknownLanguages.push(language); } else if (parsedLanguages.indexOf(parsedLanguage) === -1) { parsedLanguages.push(parsedLanguage); } } if (unknownLanguages.length > 0) { throw new Error(getUnknownLanguagesError(unknownLanguages)); } return parsedLanguages; } async function addQueriesFromWorkflow(codeQL, queriesInput, languages, resultMap, tempDir, checkoutPath, githubUrl, logger) { queriesInput = queriesInput.trim(); // "+" means "don't override config file" - see shouldAddConfigFileQueries queriesInput = queriesInput.replace(/^\+/, ""); for (const query of queriesInput.split(",")) { await parseQueryUses(languages, codeQL, resultMap, query, tempDir, checkoutPath, githubUrl, logger); } } // Returns true if either no queries were provided in the workflow. // or if the queries in the workflow were provided in "additive" mode, // indicating that they shouldn't override the config queries but // should instead be added in addition function shouldAddConfigFileQueries(queriesInput) { if (queriesInput) { return queriesInput.trimStart().substr(0, 1) === "+"; } return true; } /** * Get the default config for when the user has not supplied one. */ async function getDefaultConfig(languagesInput, queriesInput, repository, tempDir, toolCacheDir, codeQL, checkoutPath, githubAuth, githubUrl, logger) { const languages = await getLanguages(languagesInput, repository, githubAuth, githubUrl, logger); const queries = {}; await addDefaultQueries(codeQL, languages, queries); if (queriesInput) { await addQueriesFromWorkflow(codeQL, queriesInput, languages, queries, tempDir, checkoutPath, githubUrl, logger); } return { languages, queries, pathsIgnore: [], paths: [], originalUserInput: {}, tempDir, toolCacheDir, codeQLCmd: codeQL.getPath(), }; } exports.getDefaultConfig = getDefaultConfig; /** * Load the config from the given file. */ async function loadConfig(languagesInput, queriesInput, configFile, repository, tempDir, toolCacheDir, codeQL, checkoutPath, githubAuth, githubUrl, logger) { let parsedYAML; if (isLocal(configFile)) { // Treat the config file as relative to the workspace configFile = path.resolve(checkoutPath, configFile); parsedYAML = getLocalConfig(configFile, checkoutPath); } else { parsedYAML = await getRemoteConfig(configFile, githubAuth, githubUrl); } // Validate that the 'name' property is syntactically correct, // even though we don't use the value yet. if (NAME_PROPERTY in parsedYAML) { if (typeof parsedYAML[NAME_PROPERTY] !== "string") { throw new Error(getNameInvalid(configFile)); } if (parsedYAML[NAME_PROPERTY].length === 0) { throw new Error(getNameInvalid(configFile)); } } const languages = await getLanguages(languagesInput, repository, githubAuth, githubUrl, logger); const queries = {}; const pathsIgnore = []; const paths = []; let disableDefaultQueries = false; if (DISABLE_DEFAULT_QUERIES_PROPERTY in parsedYAML) { if (typeof parsedYAML[DISABLE_DEFAULT_QUERIES_PROPERTY] !== "boolean") { throw new Error(getDisableDefaultQueriesInvalid(configFile)); } disableDefaultQueries = parsedYAML[DISABLE_DEFAULT_QUERIES_PROPERTY]; } if (!disableDefaultQueries) { await addDefaultQueries(codeQL, languages, queries); } // If queries were provided using `with` in the action configuration, // they should take precedence over the queries in the config file // unless they're prefixed with "+", in which case they supplement those // in the config file. if (queriesInput) { await addQueriesFromWorkflow(codeQL, queriesInput, languages, queries, tempDir, checkoutPath, githubUrl, logger); } if (shouldAddConfigFileQueries(queriesInput) && QUERIES_PROPERTY in parsedYAML) { if (!(parsedYAML[QUERIES_PROPERTY] instanceof Array)) { throw new Error(getQueriesInvalid(configFile)); } for (const query of parsedYAML[QUERIES_PROPERTY]) { if (!(QUERIES_USES_PROPERTY in query) || typeof query[QUERIES_USES_PROPERTY] !== "string") { throw new Error(getQueryUsesInvalid(configFile)); } await parseQueryUses(languages, codeQL, queries, query[QUERIES_USES_PROPERTY], tempDir, checkoutPath, githubUrl, logger, configFile); } } if (PATHS_IGNORE_PROPERTY in parsedYAML) { if (!(parsedYAML[PATHS_IGNORE_PROPERTY] instanceof Array)) { throw new Error(getPathsIgnoreInvalid(configFile)); } for (const path of parsedYAML[PATHS_IGNORE_PROPERTY]) { if (typeof path !== "string" || path === "") { throw new Error(getPathsIgnoreInvalid(configFile)); } pathsIgnore.push(validateAndSanitisePath(path, PATHS_IGNORE_PROPERTY, configFile, logger)); } } if (PATHS_PROPERTY in parsedYAML) { if (!(parsedYAML[PATHS_PROPERTY] instanceof Array)) { throw new Error(getPathsInvalid(configFile)); } for (const path of parsedYAML[PATHS_PROPERTY]) { if (typeof path !== "string" || path === "") { throw new Error(getPathsInvalid(configFile)); } paths.push(validateAndSanitisePath(path, PATHS_PROPERTY, configFile, logger)); } } // The list of queries should not be empty for any language. If it is then // it is a user configuration error. for (const language of languages) { if (queries[language] === undefined || (queries[language].builtin.length === 0 && queries[language].custom.length === 0)) { throw new Error(`Did not detect any queries to run for ${language}. ` + "Please make sure that the default queries are enabled, or you are specifying queries to run."); } } return { languages, queries, pathsIgnore, paths, originalUserInput: parsedYAML, tempDir, toolCacheDir, codeQLCmd: codeQL.getPath(), }; } /** * Load and return the config. * * This will parse the config from the user input if present, or generate * a default config. The parsed config is then stored to a known location. */ async function initConfig(languagesInput, queriesInput, configFile, repository, tempDir, toolCacheDir, codeQL, checkoutPath, githubAuth, githubUrl, logger) { let config; // If no config file was provided create an empty one if (!configFile) { logger.debug("No configuration file was provided"); config = await getDefaultConfig(languagesInput, queriesInput, repository, tempDir, toolCacheDir, codeQL, checkoutPath, githubAuth, githubUrl, logger); } else { config = await loadConfig(languagesInput, queriesInput, configFile, repository, tempDir, toolCacheDir, codeQL, checkoutPath, githubAuth, githubUrl, logger); } // Save the config so we can easily access it again in the future await saveConfig(config, logger); return config; } exports.initConfig = initConfig; function isLocal(configPath) { // If the path starts with ./, look locally if (configPath.indexOf("./") === 0) { return true; } return configPath.indexOf("@") === -1; } function getLocalConfig(configFile, checkoutPath) { // Error if the config file is now outside of the workspace if (!(configFile + path.sep).startsWith(checkoutPath + path.sep)) { throw new Error(getConfigFileOutsideWorkspaceErrorMessage(configFile)); } // Error if the file does not exist if (!fs.existsSync(configFile)) { throw new Error(getConfigFileDoesNotExistErrorMessage(configFile)); } return yaml.safeLoad(fs.readFileSync(configFile, "utf8")); } async function getRemoteConfig(configFile, githubAuth, githubUrl) { // retrieve the various parts of the config location, and ensure they're present const format = new RegExp("(?[^/]+)/(?[^/]+)/(?[^@]+)@(?.*)"); const pieces = format.exec(configFile); // 5 = 4 groups + the whole expression if (pieces === null || pieces.groups === undefined || pieces.length < 5) { throw new Error(getConfigFileRepoFormatInvalidMessage(configFile)); } const response = await api .getApiClient(githubAuth, githubUrl, true) .repos.getContent({ owner: pieces.groups.owner, repo: pieces.groups.repo, path: pieces.groups.path, ref: pieces.groups.ref, }); let fileContents; if ("content" in response.data && response.data.content !== undefined) { fileContents = response.data.content; } else if (Array.isArray(response.data)) { throw new Error(getConfigFileDirectoryGivenMessage(configFile)); } else { throw new Error(getConfigFileFormatInvalidMessage(configFile)); } return yaml.safeLoad(Buffer.from(fileContents, "base64").toString("binary")); } /** * Get the file path where the parsed config will be stored. */ function getPathToParsedConfigFile(tempDir) { return path.join(tempDir, "config"); } exports.getPathToParsedConfigFile = getPathToParsedConfigFile; /** * Store the given config to the path returned from getPathToParsedConfigFile. */ async function saveConfig(config, logger) { const configString = JSON.stringify(config); const configFile = getPathToParsedConfigFile(config.tempDir); fs.mkdirSync(path.dirname(configFile), { recursive: true }); fs.writeFileSync(configFile, configString, "utf8"); logger.debug("Saved config:"); logger.debug(configString); } /** * Get the config that has been saved to the given temp dir. * If the config could not be found then returns undefined. */ async function getConfig(tempDir, logger) { const configFile = getPathToParsedConfigFile(tempDir); if (!fs.existsSync(configFile)) { return undefined; } const configString = fs.readFileSync(configFile, "utf8"); logger.debug("Loaded config:"); logger.debug(configString); return JSON.parse(configString); } exports.getConfig = getConfig; //# sourceMappingURL=config-utils.js.map /***/ }), /***/ 8112: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); // exported only for testing purposes exports.namedMatchersForTesting = { /* In due course it may be possible to remove the regex, if/when javascript also exits with code 32. */ noSourceCodeFound: { exitCode: 32, outputRegex: new RegExp("No JavaScript or TypeScript code found\\."), message: "No code found during the build. Please see:\n" + "https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/troubleshooting-code-scanning#no-code-found-during-the-build", }, }; // we collapse the matches into an array for use in execErrorCatcher exports.errorMatchers = Object.values(exports.namedMatchersForTesting); //# sourceMappingURL=error-matcher.js.map /***/ }), /***/ 9045: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; result["default"] = mod; return result; }; Object.defineProperty(exports, "__esModule", ({ value: true })); const fs = __importStar(__webpack_require__(5747)); const path = __importStar(__webpack_require__(5622)); const toolrunnner = __importStar(__webpack_require__(8159)); /** * Check out repository at the given ref, and return the directory of the checkout. */ async function checkoutExternalRepository(repository, ref, githubUrl, tempDir, logger) { logger.info(`Checking out ${repository}`); const checkoutLocation = path.join(tempDir, repository, ref); if (!checkoutLocation.startsWith(tempDir)) { // this still permits locations that mess with sibling repositories in `tempDir`, but that is acceptable throw new Error(`'${repository}@${ref}' is not a valid repository and reference.`); } if (!fs.existsSync(checkoutLocation)) { const repoURL = `${githubUrl}/${repository}`; await new toolrunnner.ToolRunner("git", [ "clone", repoURL, checkoutLocation, ]).exec(); await new toolrunnner.ToolRunner("git", [ `--work-tree=${checkoutLocation}`, `--git-dir=${checkoutLocation}/.git`, "checkout", ref, ]).exec(); } return checkoutLocation; } exports.checkoutExternalRepository = checkoutExternalRepository; //# sourceMappingURL=external-queries.js.map /***/ }), /***/ 9099: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; result["default"] = mod; return result; }; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", ({ value: true })); const fs = __importStar(__webpack_require__(5747)); const long_1 = __importDefault(__webpack_require__(3482)); const tab = "\t".charCodeAt(0); const space = " ".charCodeAt(0); const lf = "\n".charCodeAt(0); const cr = "\r".charCodeAt(0); const BLOCK_SIZE = 100; const MOD = long_1.default.fromInt(37); // L // Compute the starting point for the hash mod function computeFirstMod() { let firstMod = long_1.default.ONE; // L for (let i = 0; i < BLOCK_SIZE; i++) { firstMod = firstMod.multiply(MOD); } return firstMod; } /** * Hash the contents of a file * * The hash method computes a rolling hash for every line in the input. The hash is computed using the first * BLOCK_SIZE non-space/tab characters counted from the start of the line. For the computation of the hash all * line endings (i.e. \r, \n, and \r\n) are normalized to '\n'. A special value (-1) is added at the end of the * file followed by enough '\0' characters to ensure that there are BLOCK_SIZE characters available for computing * the hashes of the lines near the end of the file. * * @param callback function that is called with the line number (1-based) and hash for every line * @param input The file's contents */ function hash(callback, input) { // A rolling view in to the input const window = Array(BLOCK_SIZE).fill(0); // If the character in the window is the start of a new line // then records the line number, otherwise will be -1. // Indexes match up with those from the window variable. const lineNumbers = Array(BLOCK_SIZE).fill(-1); // The current hash value, updated as we read each character let hash = long_1.default.ZERO; const firstMod = computeFirstMod(); // The current index in the window, will wrap around to zero when we reach BLOCK_SIZE let index = 0; // The line number of the character we are currently processing from the input let lineNumber = 0; // Is the next character to be read the start of a new line let lineStart = true; // Was the previous character a CR (carriage return) let prevCR = false; // A map of hashes we've seen before and how many times, // so we can disambiguate identical hashes const hashCounts = {}; // Output the current hash and line number to the callback function const outputHash = function () { const hashValue = hash.toUnsigned().toString(16); if (!hashCounts[hashValue]) { hashCounts[hashValue] = 0; } hashCounts[hashValue]++; callback(lineNumbers[index], `${hashValue}:${hashCounts[hashValue]}`); lineNumbers[index] = -1; }; // Update the current hash value and increment the index in the window const updateHash = function (current) { const begin = window[index]; window[index] = current; hash = MOD.multiply(hash) .add(long_1.default.fromInt(current)) .subtract(firstMod.multiply(long_1.default.fromInt(begin))); index = (index + 1) % BLOCK_SIZE; }; // First process every character in the input, updating the hash and lineNumbers // as we go. Once we reach a point in the window again then we've processed // BLOCK_SIZE characters and if the last character at this point in the window // was the start of a line then we should output the hash for that line. for (let i = 0, len = input.length; i <= len; i++) { let current = i === len ? 65535 : input.charCodeAt(i); // skip tabs, spaces, and line feeds that come directly after a carriage return if (current === space || current === tab || (prevCR && current === lf)) { prevCR = false; continue; } // replace CR with LF if (current === cr) { current = lf; prevCR = true; } else { prevCR = false; } if (lineNumbers[index] !== -1) { outputHash(); } if (lineStart) { lineStart = false; lineNumber++; lineNumbers[index] = lineNumber; } if (current === lf) { lineStart = true; } updateHash(current); } // Flush the remaining lines for (let i = 0; i < BLOCK_SIZE; i++) { if (lineNumbers[index] !== -1) { outputHash(); } updateHash(0); } } exports.hash = hash; // Generate a hash callback function that updates the given result in-place // when it recieves a hash for the correct line number. Ignores hashes for other lines. function locationUpdateCallback(result, location, logger) { var _a, _b; let locationStartLine = (_b = (_a = location.physicalLocation) === null || _a === void 0 ? void 0 : _a.region) === null || _b === void 0 ? void 0 : _b.startLine; if (locationStartLine === undefined) { // We expect the region section to be present, but it can be absent if the // alert pertains to the entire file. In this case, we compute the fingerprint // using the hash of the first line of the file. locationStartLine = 1; } return function (lineNumber, hash) { // Ignore hashes for lines that don't concern us if (locationStartLine !== lineNumber) { return; } if (!result.partialFingerprints) { result.partialFingerprints = {}; } const existingFingerprint = result.partialFingerprints.primaryLocationLineHash; // If the hash doesn't match the existing fingerprint then // output a warning and don't overwrite it. if (!existingFingerprint) { result.partialFingerprints.primaryLocationLineHash = hash; } else if (existingFingerprint !== hash) { logger.warning(`Calculated fingerprint of ${hash} for file ${location.physicalLocation.artifactLocation.uri} line ${lineNumber}, but found existing inconsistent fingerprint value ${existingFingerprint}`); } }; } // Can we fingerprint the given location. This requires access to // the source file so we can hash it. // If possible returns a absolute file path for the source file, // or if not possible then returns undefined. function resolveUriToFile(location, artifacts, checkoutPath, logger) { // This may be referencing an artifact if (!location.uri && location.index !== undefined) { if (typeof location.index !== "number" || location.index < 0 || location.index >= artifacts.length || typeof artifacts[location.index].location !== "object") { logger.debug(`Ignoring location as URI "${location.index}" is invalid`); return undefined; } location = artifacts[location.index].location; } // Get the URI and decode if (typeof location.uri !== "string") { logger.debug(`Ignoring location as index "${location.uri}" is invalid`); return undefined; } let uri = decodeURIComponent(location.uri); // Remove a file scheme, and abort if the scheme is anything else const fileUriPrefix = "file://"; if (uri.startsWith(fileUriPrefix)) { uri = uri.substring(fileUriPrefix.length); } if (uri.indexOf("://") !== -1) { logger.debug(`Ignoring location URI "${uri}" as the scheme is not recognised`); return undefined; } // Discard any absolute paths that aren't in the src root const srcRootPrefix = `${checkoutPath}/`; if (uri.startsWith("/") && !uri.startsWith(srcRootPrefix)) { logger.debug(`Ignoring location URI "${uri}" as it is outside of the src root`); return undefined; } // Just assume a relative path is relative to the src root. // This is not necessarily true but should be a good approximation // and here we likely want to err on the side of handling more cases. if (!uri.startsWith("/")) { uri = srcRootPrefix + uri; } // Check the file exists if (!fs.existsSync(uri)) { logger.debug(`Unable to compute fingerprint for non-existent file: ${uri}`); return undefined; } return uri; } exports.resolveUriToFile = resolveUriToFile; // Compute fingerprints for results in the given sarif file // and return an updated sarif file contents. function addFingerprints(sarifContents, checkoutPath, logger) { var _a, _b; const sarif = JSON.parse(sarifContents); // Gather together results for the same file and construct // callbacks to accept hashes for that file and update the location const callbacksByFile = {}; for (const run of sarif.runs || []) { // We may need the list of artifacts to resolve against const artifacts = run.artifacts || []; for (const result of run.results || []) { // Check the primary location is defined correctly and is in the src root const primaryLocation = (result.locations || [])[0]; if (!((_b = (_a = primaryLocation) === null || _a === void 0 ? void 0 : _a.physicalLocation) === null || _b === void 0 ? void 0 : _b.artifactLocation)) { logger.debug(`Unable to compute fingerprint for invalid location: ${JSON.stringify(primaryLocation)}`); continue; } const filepath = resolveUriToFile(primaryLocation.physicalLocation.artifactLocation, artifacts, checkoutPath, logger); if (!filepath) { continue; } if (!callbacksByFile[filepath]) { callbacksByFile[filepath] = []; } callbacksByFile[filepath].push(locationUpdateCallback(result, primaryLocation, logger)); } } // Now hash each file that was found for (const [filepath, callbacks] of Object.entries(callbacksByFile)) { // A callback that forwards the hash to all other callbacks for that file const teeCallback = function (lineNumber, hash) { for (const c of Object.values(callbacks)) { c(lineNumber, hash); } }; const fileContents = fs.readFileSync(filepath).toString(); hash(teeCallback, fileContents); } return JSON.stringify(sarif); } exports.addFingerprints = addFingerprints; //# sourceMappingURL=fingerprints.js.map /***/ }), /***/ 7985: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); // All the languages supported by CodeQL var Language; (function (Language) { Language["csharp"] = "csharp"; Language["cpp"] = "cpp"; Language["go"] = "go"; Language["java"] = "java"; Language["javascript"] = "javascript"; Language["python"] = "python"; })(Language = exports.Language || (exports.Language = {})); // Additional names for languages const LANGUAGE_ALIASES = { c: Language.cpp, "c++": Language.cpp, "c#": Language.csharp, typescript: Language.javascript, }; // Translate from user input or GitHub's API names for languages to CodeQL's names for languages function parseLanguage(language) { // Normalise to lower case language = language.toLowerCase(); // See if it's an exact match if (language in Language) { return language; } // Check language aliases if (language in LANGUAGE_ALIASES) { return LANGUAGE_ALIASES[language]; } return undefined; } exports.parseLanguage = parseLanguage; function isTracedLanguage(language) { return ["cpp", "java", "csharp"].includes(language); } exports.isTracedLanguage = isTracedLanguage; function isScannedLanguage(language) { return !isTracedLanguage(language); } exports.isScannedLanguage = isScannedLanguage; //# sourceMappingURL=languages.js.map /***/ }), /***/ 41: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; result["default"] = mod; return result; }; Object.defineProperty(exports, "__esModule", ({ value: true })); const core = __importStar(__webpack_require__(2186)); function getActionsLogger() { return core; } exports.getActionsLogger = getActionsLogger; function getRunnerLogger(debugMode) { return { debug: debugMode ? console.debug : () => undefined, info: console.info, warning: console.warn, error: console.error, startGroup: () => undefined, endGroup: () => undefined, }; } exports.getRunnerLogger = getRunnerLogger; //# sourceMappingURL=logging.js.map /***/ }), /***/ 1558: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); function parseRepositoryNwo(input) { const parts = input.split("/"); if (parts.length !== 2) { throw new Error(`"${input}" is not a valid repository name`); } return { owner: parts[0], repo: parts[1], }; } exports.parseRepositoryNwo = parseRepositoryNwo; //# sourceMappingURL=repository.js.map /***/ }), /***/ 3019: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.ODASA_TRACER_CONFIGURATION = "ODASA_TRACER_CONFIGURATION"; // The time at which the first action (normally init) started executing. // If a workflow invokes a different action without first invoking the init // action (i.e. the upload action is being used by a third-party integrator) // then this variable will be assigned the start time of the action invoked // rather that the init action. exports.CODEQL_WORKFLOW_STARTED_AT = "CODEQL_WORKFLOW_STARTED_AT"; //# sourceMappingURL=shared-environment.js.map /***/ }), /***/ 5507: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; result["default"] = mod; return result; }; Object.defineProperty(exports, "__esModule", ({ value: true })); const toolrunnner = __importStar(__webpack_require__(8159)); /** * Wrapper for toolrunner.Toolrunner which checks for specific return code and/or regex matches in console output. * Output will be streamed to the live console as well as captured for subsequent processing. * Returns promise with return code * * @param commandLine command to execute * @param args optional arguments for tool. Escaping is handled by the lib. * @param matchers defines specific codes and/or regexes that should lead to return of a custom error * @param options optional exec options. See ExecOptions * @returns Promise exit code */ async function toolrunnerErrorCatcher(commandLine, args, matchers, options) { var _a, _b, _c; let stdout = ""; let stderr = ""; const listeners = { stdout: (data) => { var _a, _b; stdout += data.toString(); if (((_b = (_a = options) === null || _a === void 0 ? void 0 : _a.listeners) === null || _b === void 0 ? void 0 : _b.stdout) !== undefined) { options.listeners.stdout(data); } else { // if no stdout listener was originally defined then we match default behavior of Toolrunner process.stdout.write(data); } }, stderr: (data) => { var _a, _b; stderr += data.toString(); if (((_b = (_a = options) === null || _a === void 0 ? void 0 : _a.listeners) === null || _b === void 0 ? void 0 : _b.stderr) !== undefined) { options.listeners.stderr(data); } else { // if no stderr listener was originally defined then we match default behavior of Toolrunner process.stderr.write(data); } }, }; // we capture the original return code or error so that if no match is found we can duplicate the behavior let returnState; try { returnState = await new toolrunnner.ToolRunner(commandLine, args, { ...options, listeners, ignoreReturnCode: true, }).exec(); } catch (e) { returnState = e; } // if there is a zero return code then we do not apply the matchers if (returnState === 0) return returnState; if (matchers) { for (const matcher of matchers) { if (matcher.exitCode === returnState || ((_a = matcher.outputRegex) === null || _a === void 0 ? void 0 : _a.test(stderr)) || ((_b = matcher.outputRegex) === null || _b === void 0 ? void 0 : _b.test(stdout))) { throw new Error(matcher.message); } } } if (typeof returnState === "number") { // only if we were instructed to ignore the return code do we ever return it non-zero if ((_c = options) === null || _c === void 0 ? void 0 : _c.ignoreReturnCode) { return returnState; } else { throw new Error(`The process '${commandLine}' failed with exit code ${returnState}`); } } else { throw returnState; } } exports.toolrunnerErrorCatcher = toolrunnerErrorCatcher; //# sourceMappingURL=toolrunner-error-catcher.js.map /***/ }), /***/ 201: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; result["default"] = mod; return result; }; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", ({ value: true })); const fs = __importStar(__webpack_require__(5747)); const path = __importStar(__webpack_require__(5622)); const zlib_1 = __importDefault(__webpack_require__(8761)); const core = __importStar(__webpack_require__(2186)); const file_url_1 = __importDefault(__webpack_require__(1589)); const jsonschema = __importStar(__webpack_require__(3978)); const api = __importStar(__webpack_require__(5883)); const fingerprints = __importStar(__webpack_require__(9099)); const sharedEnv = __importStar(__webpack_require__(3019)); const util = __importStar(__webpack_require__(4024)); // Takes a list of paths to sarif files and combines them together, // returning the contents of the combined sarif file. function combineSarifFiles(sarifFiles) { const combinedSarif = { version: null, runs: [], }; for (const sarifFile of sarifFiles) { const sarifObject = JSON.parse(fs.readFileSync(sarifFile, "utf8")); // Check SARIF version if (combinedSarif.version === null) { combinedSarif.version = sarifObject.version; } else if (combinedSarif.version !== sarifObject.version) { throw new Error(`Different SARIF versions encountered: ${combinedSarif.version} and ${sarifObject.version}`); } combinedSarif.runs.push(...sarifObject.runs); } return JSON.stringify(combinedSarif); } exports.combineSarifFiles = combineSarifFiles; // Upload the given payload. // If the request fails then this will retry a small number of times. async function uploadPayload(payload, repositoryNwo, githubAuth, githubUrl, mode, logger) { logger.info("Uploading results"); // If in test mode we don't want to upload the results const testMode = process.env["TEST_MODE"] === "true" || false; if (testMode) { return; } const client = api.getApiClient(githubAuth, githubUrl); const reqURL = mode === "actions" ? "PUT /repos/:owner/:repo/code-scanning/analysis" : "POST /repos/:owner/:repo/code-scanning/sarifs"; const response = await client.request(reqURL, { owner: repositoryNwo.owner, repo: repositoryNwo.repo, data: payload, }); logger.debug(`response status: ${response.status}`); logger.info("Successfully uploaded results"); } // Uploads a single sarif file or a directory of sarif files // depending on what the path happens to refer to. // Returns true iff the upload occurred and succeeded async function upload(sarifPath, repositoryNwo, commitOid, ref, analysisKey, analysisName, workflowRunID, checkoutPath, environment, githubAuth, githubUrl, mode, logger) { const sarifFiles = []; if (!fs.existsSync(sarifPath)) { throw new Error(`Path does not exist: ${sarifPath}`); } if (fs.lstatSync(sarifPath).isDirectory()) { const paths = fs .readdirSync(sarifPath) .filter((f) => f.endsWith(".sarif")) .map((f) => path.resolve(sarifPath, f)); for (const path of paths) { sarifFiles.push(path); } if (sarifFiles.length === 0) { throw new Error(`No SARIF files found to upload in "${sarifPath}".`); } } else { sarifFiles.push(sarifPath); } return await uploadFiles(sarifFiles, repositoryNwo, commitOid, ref, analysisKey, analysisName, workflowRunID, checkoutPath, environment, githubAuth, githubUrl, mode, logger); } exports.upload = upload; // Counts the number of results in the given SARIF file function countResultsInSarif(sarif) { let numResults = 0; for (const run of JSON.parse(sarif).runs) { numResults += run.results.length; } return numResults; } exports.countResultsInSarif = countResultsInSarif; // Validates that the given file path refers to a valid SARIF file. // Throws an error if the file is invalid. function validateSarifFileSchema(sarifFilePath, logger) { const sarif = JSON.parse(fs.readFileSync(sarifFilePath, "utf8")); const schema = __webpack_require__(2182); const result = new jsonschema.Validator().validate(sarif, schema); if (!result.valid) { // Output the more verbose error messages in groups as these may be very large. for (const error of result.errors) { logger.startGroup(`Error details: ${error.stack}`); logger.info(JSON.stringify(error, null, 2)); logger.endGroup(); } // Set the main error message to the stacks of all the errors. // This should be of a manageable size and may even give enough to fix the error. const sarifErrors = result.errors.map((e) => `- ${e.stack}`); throw new Error(`Unable to upload "${sarifFilePath}" as it is not valid SARIF:\n${sarifErrors.join("\n")}`); } } exports.validateSarifFileSchema = validateSarifFileSchema; // Uploads the given set of sarif files. // Returns true iff the upload occurred and succeeded async function uploadFiles(sarifFiles, repositoryNwo, commitOid, ref, analysisKey, analysisName, workflowRunID, checkoutPath, environment, githubAuth, githubUrl, mode, logger) { logger.info(`Uploading sarif files: ${JSON.stringify(sarifFiles)}`); if (mode === "actions") { // This check only works on actions as env vars don't persist between calls to the runner const sentinelEnvVar = "CODEQL_UPLOAD_SARIF"; if (process.env[sentinelEnvVar]) { throw new Error("Aborting upload: only one run of the codeql/analyze or codeql/upload-sarif actions is allowed per job"); } core.exportVariable(sentinelEnvVar, sentinelEnvVar); } // Validate that the files we were asked to upload are all valid SARIF files for (const file of sarifFiles) { validateSarifFileSchema(file, logger); } let sarifPayload = combineSarifFiles(sarifFiles); sarifPayload = fingerprints.addFingerprints(sarifPayload, checkoutPath, logger); const zipped_sarif = zlib_1.default.gzipSync(sarifPayload).toString("base64"); const checkoutURI = file_url_1.default(checkoutPath); const toolNames = util.getToolNames(sarifPayload); let payload; if (mode === "actions") { payload = JSON.stringify({ commit_oid: commitOid, ref, analysis_key: analysisKey, analysis_name: analysisName, sarif: zipped_sarif, workflow_run_id: workflowRunID, checkout_uri: checkoutURI, environment, started_at: process.env[sharedEnv.CODEQL_WORKFLOW_STARTED_AT], tool_names: toolNames, }); } else { payload = JSON.stringify({ commit_sha: commitOid, ref, sarif: zipped_sarif, checkout_uri: checkoutURI, tool_name: toolNames[0], }); } // Log some useful debug info about the info const rawUploadSizeBytes = sarifPayload.length; logger.debug(`Raw upload size: ${rawUploadSizeBytes} bytes`); const zippedUploadSizeBytes = zipped_sarif.length; logger.debug(`Base64 zipped upload size: ${zippedUploadSizeBytes} bytes`); const numResultInSarif = countResultsInSarif(sarifPayload); logger.debug(`Number of results in upload: ${numResultInSarif}`); // Make the upload await uploadPayload(payload, repositoryNwo, githubAuth, githubUrl, mode, logger); return { raw_upload_size_bytes: rawUploadSizeBytes, zipped_upload_size_bytes: zippedUploadSizeBytes, num_results_in_sarif: numResultInSarif, }; } //# sourceMappingURL=upload-lib.js.map /***/ }), /***/ 4024: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; result["default"] = mod; return result; }; Object.defineProperty(exports, "__esModule", ({ value: true })); const fs = __importStar(__webpack_require__(5747)); const os = __importStar(__webpack_require__(2087)); const path = __importStar(__webpack_require__(5622)); /** * The URL for github.com. */ exports.GITHUB_DOTCOM_URL = "https://github.com"; /** * Get the extra options for the codeql commands. */ function getExtraOptionsEnvParam() { const varName = "CODEQL_ACTION_EXTRA_OPTIONS"; const raw = process.env[varName]; if (raw === undefined || raw.length === 0) { return {}; } try { return JSON.parse(raw); } catch (e) { throw new Error(`${varName} environment variable is set, but does not contain valid JSON: ${e.message}`); } } exports.getExtraOptionsEnvParam = getExtraOptionsEnvParam; function isLocalRun() { return (!!process.env.CODEQL_LOCAL_RUN && process.env.CODEQL_LOCAL_RUN !== "false" && process.env.CODEQL_LOCAL_RUN !== "0"); } exports.isLocalRun = isLocalRun; /** * Get the array of all the tool names contained in the given sarif contents. * * Returns an array of unique string tool names. */ function getToolNames(sarifContents) { const sarif = JSON.parse(sarifContents); const toolNames = {}; for (const run of sarif.runs || []) { const tool = run.tool || {}; const driver = tool.driver || {}; if (typeof driver.name === "string" && driver.name.length > 0) { toolNames[driver.name] = true; } } return Object.keys(toolNames); } exports.getToolNames = getToolNames; // Creates a random temporary directory, runs the given body, and then deletes the directory. // Mostly intended for use within tests. async function withTmpDir(body) { const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), "codeql-action-")); const realSubdir = path.join(tmpDir, "real"); fs.mkdirSync(realSubdir); const symlinkSubdir = path.join(tmpDir, "symlink"); fs.symlinkSync(realSubdir, symlinkSubdir, "dir"); const result = await body(symlinkSubdir); fs.rmdirSync(tmpDir, { recursive: true }); return result; } exports.withTmpDir = withTmpDir; /** * Get the codeql `--ram` flag as configured by the `ram` input. If no value was * specified, the total available memory will be used minus 256 MB. * * @returns string */ function getMemoryFlag(userInput) { let memoryToUseMegaBytes; if (userInput) { memoryToUseMegaBytes = Number(userInput); if (Number.isNaN(memoryToUseMegaBytes) || memoryToUseMegaBytes <= 0) { throw new Error(`Invalid RAM setting "${userInput}", specified.`); } } else { const totalMemoryBytes = os.totalmem(); const totalMemoryMegaBytes = totalMemoryBytes / (1024 * 1024); const systemReservedMemoryMegaBytes = 256; memoryToUseMegaBytes = totalMemoryMegaBytes - systemReservedMemoryMegaBytes; } return `--ram=${Math.floor(memoryToUseMegaBytes)}`; } exports.getMemoryFlag = getMemoryFlag; /** * Get the codeql flag to specify whether to add code snippets to the sarif file. * * @returns string */ function getAddSnippetsFlag(userInput) { if (typeof userInput === "string") { // have to process specifically because any non-empty string is truthy userInput = userInput.toLowerCase() === "true"; } return userInput ? "--sarif-add-snippets" : "--no-sarif-add-snippets"; } exports.getAddSnippetsFlag = getAddSnippetsFlag; /** * Get the codeql `--threads` value specified for the `threads` input. * If not value was specified, all available threads will be used. * * The value will be capped to the number of available CPUs. * * @returns string */ function getThreadsFlag(userInput, logger) { let numThreads; const maxThreads = os.cpus().length; if (userInput) { numThreads = Number(userInput); if (Number.isNaN(numThreads)) { throw new Error(`Invalid threads setting "${userInput}", specified.`); } if (numThreads > maxThreads) { logger.info(`Clamping desired number of threads (${numThreads}) to max available (${maxThreads}).`); numThreads = maxThreads; } const minThreads = -maxThreads; if (numThreads < minThreads) { logger.info(`Clamping desired number of free threads (${numThreads}) to max available (${minThreads}).`); numThreads = minThreads; } } else { // Default to using all threads numThreads = maxThreads; } return `--threads=${numThreads}`; } exports.getThreadsFlag = getThreadsFlag; /** * Get the directory where CodeQL databases should be placed. */ function getCodeQLDatabasesDir(tempDir) { return path.resolve(tempDir, "codeql_databases"); } exports.getCodeQLDatabasesDir = getCodeQLDatabasesDir; /** * Get the path where the CodeQL database for the given language lives. */ function getCodeQLDatabasePath(tempDir, language) { return path.resolve(getCodeQLDatabasesDir(tempDir), language); } exports.getCodeQLDatabasePath = getCodeQLDatabasePath; /** * Parses user input of a github.com or GHES URL to a canonical form. * Removes any API prefix or suffix if one is present. */ function parseGithubUrl(inputUrl) { const originalUrl = inputUrl; if (inputUrl.indexOf("://") === -1) { inputUrl = `https://${inputUrl}`; } if (!inputUrl.startsWith("http://") && !inputUrl.startsWith("https://")) { throw new Error(`"${originalUrl}" is not a http or https URL`); } let url; try { url = new URL(inputUrl); } catch (e) { throw new Error(`"${originalUrl}" is not a valid URL`); } // If we detect this is trying to be to github.com // then return with a fixed canonical URL. if (url.hostname === "github.com" || url.hostname === "api.github.com") { return exports.GITHUB_DOTCOM_URL; } // Remove the API prefix if it's present if (url.pathname.indexOf("/api/v3") !== -1) { url.pathname = url.pathname.substring(0, url.pathname.indexOf("/api/v3")); } // Also consider subdomain isolation on GHES if (url.hostname.startsWith("api.")) { url.hostname = url.hostname.substring(4); } // Normalise path to having a trailing slash for consistency if (!url.pathname.endsWith("/")) { url.pathname = `${url.pathname}/`; } return url.toString(); } exports.parseGithubUrl = parseGithubUrl; //# sourceMappingURL=util.js.map /***/ }), /***/ 7351: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; result["default"] = mod; return result; }; Object.defineProperty(exports, "__esModule", ({ value: true })); const os = __importStar(__webpack_require__(2087)); const utils_1 = __webpack_require__(5278); /** * Commands * * Command Format: * ::name key=value,key=value::message * * Examples: * ::warning::This is the message * ::set-env name=MY_VAR::some value */ function issueCommand(command, properties, message) { const cmd = new Command(command, properties, message); process.stdout.write(cmd.toString() + os.EOL); } exports.issueCommand = issueCommand; function issue(name, message = '') { issueCommand(name, {}, message); } exports.issue = issue; const CMD_STRING = '::'; class Command { constructor(command, properties, message) { if (!command) { command = 'missing.command'; } this.command = command; this.properties = properties; this.message = message; } toString() { let cmdStr = CMD_STRING + this.command; if (this.properties && Object.keys(this.properties).length > 0) { cmdStr += ' '; let first = true; for (const key in this.properties) { if (this.properties.hasOwnProperty(key)) { const val = this.properties[key]; if (val) { if (first) { first = false; } else { cmdStr += ','; } cmdStr += `${key}=${escapeProperty(val)}`; } } } } cmdStr += `${CMD_STRING}${escapeData(this.message)}`; return cmdStr; } } function escapeData(s) { return 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'); } //# sourceMappingURL=command.js.map /***/ }), /***/ 2186: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; result["default"] = mod; return result; }; Object.defineProperty(exports, "__esModule", ({ value: true })); const command_1 = __webpack_require__(7351); const file_command_1 = __webpack_require__(717); const utils_1 = __webpack_require__(5278); const os = __importStar(__webpack_require__(2087)); const path = __importStar(__webpack_require__(5622)); /** * The code to exit an action */ var ExitCode; (function (ExitCode) { /** * A code indicating that the action was successful */ ExitCode[ExitCode["Success"] = 0] = "Success"; /** * A code indicating that the action was a failure */ ExitCode[ExitCode["Failure"] = 1] = "Failure"; })(ExitCode = exports.ExitCode || (exports.ExitCode = {})); //----------------------------------------------------------------------- // Variables //----------------------------------------------------------------------- /** * Sets env variable for this action and future actions in the job * @param name the name of the variable to set * @param val the value of the variable. Non-string values will be converted to a string via JSON.stringify */ // eslint-disable-next-line @typescript-eslint/no-explicit-any function exportVariable(name, val) { const convertedVal = utils_1.toCommandValue(val); process.env[name] = convertedVal; const filePath = process.env['GITHUB_ENV'] || ''; if (filePath) { const delimiter = '_GitHubActionsFileCommandDelimeter_'; const commandValue = `${name}<<${delimiter}${os.EOL}${convertedVal}${os.EOL}${delimiter}`; file_command_1.issueCommand('ENV', commandValue); } else { command_1.issueCommand('set-env', { name }, convertedVal); } } exports.exportVariable = exportVariable; /** * Registers a secret which will get masked from logs * @param secret value of the secret */ function setSecret(secret) { command_1.issueCommand('add-mask', {}, secret); } exports.setSecret = setSecret; /** * Prepends inputPath to the PATH (for this action and future actions) * @param inputPath */ function addPath(inputPath) { const filePath = process.env['GITHUB_PATH'] || ''; if (filePath) { file_command_1.issueCommand('PATH', inputPath); } else { command_1.issueCommand('add-path', {}, inputPath); } process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`; } exports.addPath = addPath; /** * Gets the value of an input. The value is also trimmed. * * @param name name of the input to get * @param options optional. See InputOptions. * @returns string */ function getInput(name, options) { const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || ''; if (options && options.required && !val) { throw new Error(`Input required and not supplied: ${name}`); } return val.trim(); } exports.getInput = getInput; /** * Sets the value of an output. * * @param name name of the output to set * @param value value to store. Non-string values will be converted to a string via JSON.stringify */ // eslint-disable-next-line @typescript-eslint/no-explicit-any function setOutput(name, value) { command_1.issueCommand('set-output', { name }, value); } exports.setOutput = setOutput; /** * Enables or disables the echoing of commands into stdout for the rest of the step. * Echoing is disabled by default if ACTIONS_STEP_DEBUG is not set. * */ function setCommandEcho(enabled) { command_1.issue('echo', enabled ? 'on' : 'off'); } exports.setCommandEcho = setCommandEcho; //----------------------------------------------------------------------- // Results //----------------------------------------------------------------------- /** * Sets the action status to failed. * When the action exits it will be with an exit code of 1 * @param message add error issue message */ function setFailed(message) { process.exitCode = ExitCode.Failure; error(message); } exports.setFailed = setFailed; //----------------------------------------------------------------------- // Logging Commands //----------------------------------------------------------------------- /** * Gets whether Actions Step Debug is on or not */ function isDebug() { return process.env['RUNNER_DEBUG'] === '1'; } exports.isDebug = isDebug; /** * Writes debug message to user log * @param message debug message */ function debug(message) { command_1.issueCommand('debug', {}, message); } exports.debug = debug; /** * Adds an error issue * @param message error issue message. Errors will be converted to string via toString() */ function error(message) { command_1.issue('error', message instanceof Error ? message.toString() : message); } exports.error = error; /** * Adds an warning issue * @param message warning issue message. Errors will be converted to string via toString() */ function warning(message) { command_1.issue('warning', message instanceof Error ? message.toString() : message); } exports.warning = warning; /** * Writes info to log with console.log. * @param message info message */ function info(message) { process.stdout.write(message + os.EOL); } exports.info = info; /** * Begin an output group. * * Output until the next `groupEnd` will be foldable in this group * * @param name The name of the output group */ function startGroup(name) { command_1.issue('group', name); } exports.startGroup = startGroup; /** * End an output group. */ function endGroup() { command_1.issue('endgroup'); } exports.endGroup = endGroup; /** * Wrap an asynchronous function call in a group. * * Returns the same type as the function itself. * * @param name The name of the group * @param fn The function to wrap in the group */ function group(name, fn) { return __awaiter(this, void 0, void 0, function* () { startGroup(name); let result; try { result = yield fn(); } finally { endGroup(); } return result; }); } exports.group = group; //----------------------------------------------------------------------- // Wrapper action state //----------------------------------------------------------------------- /** * Saves state for current action, the state can only be retrieved by this action's post job execution. * * @param name name of the state to store * @param value value to store. Non-string values will be converted to a string via JSON.stringify */ // eslint-disable-next-line @typescript-eslint/no-explicit-any function saveState(name, value) { command_1.issueCommand('save-state', { name }, value); } exports.saveState = saveState; /** * Gets the value of an state set by this action's main execution. * * @param name name of the state to get * @returns string */ function getState(name) { return process.env[`STATE_${name}`] || ''; } exports.getState = getState; //# sourceMappingURL=core.js.map /***/ }), /***/ 717: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; // For internal use, subject to change. var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; result["default"] = mod; return result; }; Object.defineProperty(exports, "__esModule", ({ value: true })); // We use any as a valid input type /* eslint-disable @typescript-eslint/no-explicit-any */ const fs = __importStar(__webpack_require__(5747)); const os = __importStar(__webpack_require__(2087)); const utils_1 = __webpack_require__(5278); function issueCommand(command, message) { const filePath = process.env[`GITHUB_${command}`]; if (!filePath) { throw new Error(`Unable to find environment variable for file command ${command}`); } if (!fs.existsSync(filePath)) { throw new Error(`Missing file at path: ${filePath}`); } fs.appendFileSync(filePath, `${utils_1.toCommandValue(message)}${os.EOL}`, { encoding: 'utf8' }); } exports.issueCommand = issueCommand; //# sourceMappingURL=file-command.js.map /***/ }), /***/ 5278: /***/ ((__unused_webpack_module, exports) => { "use strict"; // We use any as a valid input type /* eslint-disable @typescript-eslint/no-explicit-any */ Object.defineProperty(exports, "__esModule", ({ value: true })); /** * Sanitizes an input into a string so it can be passed into issueCommand safely * @param input input to sanitize into a string */ function toCommandValue(input) { if (input === null || input === undefined) { return ''; } else if (typeof input === 'string' || input instanceof String) { return input; } return JSON.stringify(input); } exports.toCommandValue = toCommandValue; //# sourceMappingURL=utils.js.map /***/ }), /***/ 1514: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", ({ value: true })); const tr = __webpack_require__(8159); /** * 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, function* () { const commandArgs = tr.argStringToArray(commandLine); if (commandArgs.length === 0) { throw new Error(`Parameter 'commandLine' cannot be null or empty.`); } // Path to tool to execute should be first arg const toolPath = commandArgs[0]; args = commandArgs.slice(1).concat(args || []); const runner = new tr.ToolRunner(toolPath, args, options); return runner.exec(); }); } exports.exec = exec; //# sourceMappingURL=exec.js.map /***/ }), /***/ 8159: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", ({ value: true })); const os = __webpack_require__(2087); const events = __webpack_require__(8614); const child = __webpack_require__(3129); /* eslint-disable @typescript-eslint/unbound-method */ const IS_WINDOWS = process.platform === 'win32'; /* * Class for running command line tools. Handles quoting and arg parsing in a platform agnostic way. */ class ToolRunner extends events.EventEmitter { constructor(toolPath, args, options) { super(); if (!toolPath) { throw new Error("Parameter 'toolPath' cannot be null or empty."); } this.toolPath = toolPath; this.args = args || []; this.options = options || {}; } _debug(message) { if (this.options.listeners && this.options.listeners.debug) { this.options.listeners.debug(message); } } _getCommandString(options, noPrefix) { const toolPath = this._getSpawnFileName(); const args = this._getSpawnArgs(options); let cmd = noPrefix ? '' : '[command]'; // omit prefix when piped to a second tool if (IS_WINDOWS) { // Windows + cmd file if (this._isCmdFile()) { cmd += toolPath; for (const a of args) { cmd += ` ${a}`; } } // Windows + verbatim else if (options.windowsVerbatimArguments) { cmd += `"${toolPath}"`; for (const a of args) { cmd += ` ${a}`; } } // Windows (regular) else { cmd += this._windowsQuoteCmdArg(toolPath); for (const a of args) { cmd += ` ${this._windowsQuoteCmdArg(a)}`; } } } 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; for (const a of args) { cmd += ` ${a}`; } } return cmd; } _processLineBuffer(data, strBuffer, onLine) { try { let s = strBuffer + data.toString(); let n = s.indexOf(os.EOL); while (n > -1) { const line = s.substring(0, n); onLine(line); // the rest of the string ... s = s.substring(n + os.EOL.length); n = s.indexOf(os.EOL); } strBuffer = s; } catch (err) { // streaming lines to console is best effort. Don't fail a build. this._debug(`error processing line. Failed with error ${err}`); } } _getSpawnFileName() { if (IS_WINDOWS) { if (this._isCmdFile()) { return process.env['COMSPEC'] || 'cmd.exe'; } } return this.toolPath; } _getSpawnArgs(options) { if (IS_WINDOWS) { if (this._isCmdFile()) { let argline = `/D /S /C "${this._windowsQuoteCmdArg(this.toolPath)}`; for (const a of this.args) { argline += ' '; argline += options.windowsVerbatimArguments ? a : this._windowsQuoteCmdArg(a); } argline += '"'; return [argline]; } } return this.args; } _endsWith(str, end) { return str.endsWith(end); } _isCmdFile() { const upperToolPath = this.toolPath.toUpperCase(); return (this._endsWith(upperToolPath, '.CMD') || this._endsWith(upperToolPath, '.BAT')); } _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 const cmdSpecialChars = [ ' ', '\t', '&', '(', ')', '[', ']', '{', '}', '^', '=', ';', '!', "'", '+', ',', '`', '~', '|', '<', '>', '"' ]; let needsQuotes = false; for (const char of arg) { if (cmdSpecialChars.some(x => x === char)) { needsQuotes = true; break; } } // short-circuit if quotes not needed 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. let reverse = '"'; let quoteHit = true; for (let 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(''); } _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 `"${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\\" let reverse = '"'; let quoteHit = true; for (let 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(''); } _cloneExecOptions(options) { options = options || {}; const 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; } _getSpawnOptions(options, toolPath) { options = options || {}; const result = {}; result.cwd = options.cwd; result.env = options.env; result['windowsVerbatimArguments'] = options.windowsVerbatimArguments || this._isCmdFile(); if (options.windowsVerbatimArguments) { result.argv0 = `"${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 */ exec() { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => { this._debug(`exec tool: ${this.toolPath}`); this._debug('arguments:'); for (const arg of this.args) { this._debug(` ${arg}`); } const optionsNonNull = this._cloneExecOptions(this.options); if (!optionsNonNull.silent && optionsNonNull.outStream) { optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os.EOL); } const state = new ExecState(optionsNonNull, this.toolPath); state.on('debug', (message) => { this._debug(message); }); const fileName = this._getSpawnFileName(); const cp = child.spawn(fileName, this._getSpawnArgs(optionsNonNull), this._getSpawnOptions(this.options, fileName)); const stdbuffer = ''; if (cp.stdout) { cp.stdout.on('data', (data) => { if (this.options.listeners && this.options.listeners.stdout) { this.options.listeners.stdout(data); } if (!optionsNonNull.silent && optionsNonNull.outStream) { optionsNonNull.outStream.write(data); } this._processLineBuffer(data, stdbuffer, (line) => { if (this.options.listeners && this.options.listeners.stdline) { this.options.listeners.stdline(line); } }); }); } const errbuffer = ''; if (cp.stderr) { cp.stderr.on('data', (data) => { state.processStderr = true; if (this.options.listeners && this.options.listeners.stderr) { this.options.listeners.stderr(data); } if (!optionsNonNull.silent && optionsNonNull.errStream && optionsNonNull.outStream) { const s = optionsNonNull.failOnStdErr ? optionsNonNull.errStream : optionsNonNull.outStream; s.write(data); } this._processLineBuffer(data, errbuffer, (line) => { if (this.options.listeners && this.options.listeners.errline) { this.options.listeners.errline(line); } }); }); } cp.on('error', (err) => { state.processError = err.message; state.processExited = true; state.processClosed = true; state.CheckComplete(); }); cp.on('exit', (code) => { state.processExitCode = code; state.processExited = true; this._debug(`Exit code ${code} received from tool '${this.toolPath}'`); state.CheckComplete(); }); cp.on('close', (code) => { state.processExitCode = code; state.processExited = true; state.processClosed = true; this._debug(`STDIO streams have closed for tool '${this.toolPath}'`); state.CheckComplete(); }); state.on('done', (error, exitCode) => { if (stdbuffer.length > 0) { this.emit('stdline', stdbuffer); } if (errbuffer.length > 0) { this.emit('errline', errbuffer); } cp.removeAllListeners(); if (error) { reject(error); } else { resolve(exitCode); } }); }); }); } } 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) { const args = []; let inQuotes = false; let escaped = false; let arg = ''; function append(c) { // we only escape double quotes. if (escaped && c !== '"') { arg += '\\'; } arg += c; escaped = false; } for (let i = 0; i < argString.length; i++) { const 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; class ExecState extends events.EventEmitter { constructor(options, toolPath) { super(); this.processClosed = false; // tracks whether the process has exited and stdio is closed this.processError = ''; this.processExitCode = 0; this.processExited = false; // tracks whether the process has exited this.processStderr = false; // tracks whether stderr was written to this.delay = 10000; // 10 seconds this.done = false; this.timeout = null; if (!toolPath) { throw new Error('toolPath must not be empty'); } this.options = options; this.toolPath = toolPath; if (options.delay) { this.delay = options.delay; } } CheckComplete() { if (this.done) { return; } if (this.processClosed) { this._setResult(); } else if (this.processExited) { this.timeout = setTimeout(ExecState.HandleTimeout, this.delay, this); } } _debug(message) { this.emit('debug', message); } _setResult() { // determine whether there is an error let error; if (this.processExited) { if (this.processError) { error = new Error(`There was an error when attempting to execute the process '${this.toolPath}'. This may indicate the process failed to start. Error: ${this.processError}`); } else if (this.processExitCode !== 0 && !this.options.ignoreReturnCode) { error = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`); } else if (this.processStderr && this.options.failOnStdErr) { error = new Error(`The process '${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); } static HandleTimeout(state) { if (state.done) { return; } if (!state.processClosed && state.processExited) { const message = `The STDIO streams did not close within ${state.delay / 1000} seconds of the exit event from process '${state.toolPath}'. This may indicate a child process inherited the STDIO streams and has not yet exited.`; state._debug(message); } state._setResult(); } } //# sourceMappingURL=toolrunner.js.map /***/ }), /***/ 4087: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.Context = void 0; const fs_1 = __webpack_require__(5747); const os_1 = __webpack_require__(2087); class Context { /** * Hydrate the context from the environment */ constructor() { this.payload = {}; if (process.env.GITHUB_EVENT_PATH) { if (fs_1.existsSync(process.env.GITHUB_EVENT_PATH)) { this.payload = JSON.parse(fs_1.readFileSync(process.env.GITHUB_EVENT_PATH, { encoding: 'utf8' })); } else { const path = process.env.GITHUB_EVENT_PATH; process.stdout.write(`GITHUB_EVENT_PATH ${path} does not exist${os_1.EOL}`); } } this.eventName = process.env.GITHUB_EVENT_NAME; this.sha = process.env.GITHUB_SHA; this.ref = process.env.GITHUB_REF; this.workflow = process.env.GITHUB_WORKFLOW; this.action = process.env.GITHUB_ACTION; this.actor = process.env.GITHUB_ACTOR; this.job = process.env.GITHUB_JOB; this.runNumber = parseInt(process.env.GITHUB_RUN_NUMBER, 10); this.runId = parseInt(process.env.GITHUB_RUN_ID, 10); } get issue() { const payload = this.payload; return Object.assign(Object.assign({}, this.repo), { number: (payload.issue || payload.pull_request || payload).number }); } get repo() { if (process.env.GITHUB_REPOSITORY) { const [owner, repo] = process.env.GITHUB_REPOSITORY.split('/'); return { owner, repo }; } if (this.payload.repository) { return { owner: this.payload.repository.owner.login, repo: this.payload.repository.name }; } throw new Error("context.repo requires a GITHUB_REPOSITORY environment variable like 'owner/repo'"); } } exports.Context = Context; //# sourceMappingURL=context.js.map /***/ }), /***/ 7914: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; 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() { 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 (Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getApiBaseUrl = exports.getProxyAgent = exports.getAuthString = void 0; const httpClient = __importStar(__webpack_require__(9925)); function getAuthString(token, options) { if (!token && !options.auth) { throw new Error('Parameter token or opts.auth is required'); } else if (token && options.auth) { throw new Error('Parameters token and opts.auth may not both be specified'); } return typeof options.auth === 'string' ? options.auth : `token ${token}`; } exports.getAuthString = getAuthString; function getProxyAgent(destinationUrl) { const hc = new httpClient.HttpClient(); return hc.getAgent(destinationUrl); } exports.getProxyAgent = getProxyAgent; function getApiBaseUrl() { return process.env['GITHUB_API_URL'] || 'https://api.github.com'; } exports.getApiBaseUrl = getApiBaseUrl; //# sourceMappingURL=utils.js.map /***/ }), /***/ 3030: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; 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() { 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 (Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getOctokitOptions = exports.GitHub = exports.context = void 0; const Context = __importStar(__webpack_require__(4087)); const Utils = __importStar(__webpack_require__(7914)); // octokit + plugins const core_1 = __webpack_require__(6762); const plugin_rest_endpoint_methods_1 = __webpack_require__(3044); const plugin_paginate_rest_1 = __webpack_require__(4193); exports.context = new Context.Context(); const baseUrl = Utils.getApiBaseUrl(); const defaults = { baseUrl, request: { agent: Utils.getProxyAgent(baseUrl) } }; exports.GitHub = core_1.Octokit.plugin(plugin_rest_endpoint_methods_1.restEndpointMethods, plugin_paginate_rest_1.paginateRest).defaults(defaults); /** * Convience function to correctly format Octokit Options to pass into the constructor. * * @param token the repo PAT or GITHUB_TOKEN * @param options other options to set */ function getOctokitOptions(token, options) { const opts = Object.assign({}, options || {}); // Shallow clone - don't mutate the object provided by the caller // Auth const auth = Utils.getAuthString(token, opts); if (auth) { opts.auth = auth; } return opts; } exports.getOctokitOptions = getOctokitOptions; //# sourceMappingURL=utils.js.map /***/ }), /***/ 9925: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const url = __webpack_require__(8835); const http = __webpack_require__(8605); const https = __webpack_require__(7211); const pm = __webpack_require__(6443); let tunnel; var HttpCodes; (function (HttpCodes) { HttpCodes[HttpCodes["OK"] = 200] = "OK"; HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices"; HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently"; HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved"; HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther"; HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified"; HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy"; HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy"; HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect"; HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect"; HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest"; HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized"; HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired"; HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden"; HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound"; HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed"; HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable"; HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired"; HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout"; HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict"; HttpCodes[HttpCodes["Gone"] = 410] = "Gone"; HttpCodes[HttpCodes["TooManyRequests"] = 429] = "TooManyRequests"; HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError"; HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented"; HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway"; HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable"; HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout"; })(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {})); var Headers; (function (Headers) { Headers["Accept"] = "accept"; Headers["ContentType"] = "content-type"; })(Headers = exports.Headers || (exports.Headers = {})); var MediaTypes; (function (MediaTypes) { MediaTypes["ApplicationJson"] = "application/json"; })(MediaTypes = exports.MediaTypes || (exports.MediaTypes = {})); /** * Returns the proxy URL, depending upon the supplied url and proxy environment variables. * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com */ function getProxyUrl(serverUrl) { let proxyUrl = pm.getProxyUrl(url.parse(serverUrl)); return proxyUrl ? proxyUrl.href : ''; } exports.getProxyUrl = getProxyUrl; const HttpRedirectCodes = [ HttpCodes.MovedPermanently, HttpCodes.ResourceMoved, HttpCodes.SeeOther, HttpCodes.TemporaryRedirect, HttpCodes.PermanentRedirect ]; const HttpResponseRetryCodes = [ HttpCodes.BadGateway, HttpCodes.ServiceUnavailable, HttpCodes.GatewayTimeout ]; const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD']; const ExponentialBackoffCeiling = 10; const ExponentialBackoffTimeSlice = 5; class HttpClientResponse { constructor(message) { this.message = message; } readBody() { return new Promise(async (resolve, reject) => { let output = Buffer.alloc(0); this.message.on('data', (chunk) => { output = Buffer.concat([output, chunk]); }); this.message.on('end', () => { resolve(output.toString()); }); }); } } exports.HttpClientResponse = HttpClientResponse; function isHttps(requestUrl) { let parsedUrl = url.parse(requestUrl); return parsedUrl.protocol === 'https:'; } exports.isHttps = isHttps; class HttpClient { constructor(userAgent, handlers, requestOptions) { this._ignoreSslError = false; this._allowRedirects = true; this._allowRedirectDowngrade = false; this._maxRedirects = 50; this._allowRetries = false; this._maxRetries = 1; this._keepAlive = false; this._disposed = false; this.userAgent = userAgent; this.handlers = handlers || []; this.requestOptions = requestOptions; if (requestOptions) { if (requestOptions.ignoreSslError != null) { this._ignoreSslError = requestOptions.ignoreSslError; } this._socketTimeout = requestOptions.socketTimeout; if (requestOptions.allowRedirects != null) { this._allowRedirects = requestOptions.allowRedirects; } if (requestOptions.allowRedirectDowngrade != null) { this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade; } if (requestOptions.maxRedirects != null) { this._maxRedirects = Math.max(requestOptions.maxRedirects, 0); } if (requestOptions.keepAlive != null) { this._keepAlive = requestOptions.keepAlive; } if (requestOptions.allowRetries != null) { this._allowRetries = requestOptions.allowRetries; } if (requestOptions.maxRetries != null) { this._maxRetries = requestOptions.maxRetries; } } } options(requestUrl, additionalHeaders) { return this.request('OPTIONS', requestUrl, null, additionalHeaders || {}); } get(requestUrl, additionalHeaders) { return this.request('GET', requestUrl, null, additionalHeaders || {}); } del(requestUrl, additionalHeaders) { return this.request('DELETE', requestUrl, null, additionalHeaders || {}); } post(requestUrl, data, additionalHeaders) { return this.request('POST', requestUrl, data, additionalHeaders || {}); } patch(requestUrl, data, additionalHeaders) { return this.request('PATCH', requestUrl, data, additionalHeaders || {}); } put(requestUrl, data, additionalHeaders) { return this.request('PUT', requestUrl, data, additionalHeaders || {}); } head(requestUrl, additionalHeaders) { return this.request('HEAD', requestUrl, null, additionalHeaders || {}); } sendStream(verb, requestUrl, stream, additionalHeaders) { return this.request(verb, requestUrl, stream, additionalHeaders); } /** * Gets a typed object from an endpoint * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise */ async getJson(requestUrl, additionalHeaders = {}) { additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); let res = await this.get(requestUrl, additionalHeaders); return this._processResponse(res, this.requestOptions); } async postJson(requestUrl, obj, additionalHeaders = {}) { let data = JSON.stringify(obj, null, 2); additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson); let res = await this.post(requestUrl, data, additionalHeaders); return this._processResponse(res, this.requestOptions); } async putJson(requestUrl, obj, additionalHeaders = {}) { let data = JSON.stringify(obj, null, 2); additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson); let res = await this.put(requestUrl, data, additionalHeaders); return this._processResponse(res, this.requestOptions); } async patchJson(requestUrl, obj, additionalHeaders = {}) { let data = JSON.stringify(obj, null, 2); additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson); let res = await this.patch(requestUrl, data, additionalHeaders); return this._processResponse(res, this.requestOptions); } /** * Makes a raw http request. * All other methods such as get, post, patch, and request ultimately call this. * Prefer get, del, post and patch */ async request(verb, requestUrl, data, headers) { if (this._disposed) { throw new Error('Client has already been disposed.'); } let parsedUrl = url.parse(requestUrl); let info = this._prepareRequest(verb, parsedUrl, headers); // Only perform retries on reads since writes may not be idempotent. let maxTries = this._allowRetries && RetryableHttpVerbs.indexOf(verb) != -1 ? this._maxRetries + 1 : 1; let numTries = 0; let response; while (numTries < maxTries) { response = await this.requestRaw(info, data); // Check if it's an authentication challenge if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) { let authenticationHandler; for (let i = 0; i < this.handlers.length; i++) { if (this.handlers[i].canHandleAuthentication(response)) { authenticationHandler = this.handlers[i]; break; } } if (authenticationHandler) { return authenticationHandler.handleAuthentication(this, info, data); } else { // We have received an unauthorized response but have no handlers to handle it. // Let the response return to the caller. return response; } } let redirectsRemaining = this._maxRedirects; while (HttpRedirectCodes.indexOf(response.message.statusCode) != -1 && this._allowRedirects && redirectsRemaining > 0) { const redirectUrl = response.message.headers['location']; if (!redirectUrl) { // if there's no location to redirect to, we won't break; } let parsedRedirectUrl = url.parse(redirectUrl); if (parsedUrl.protocol == 'https:' && parsedUrl.protocol != parsedRedirectUrl.protocol && !this._allowRedirectDowngrade) { throw new Error('Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true.'); } // we need to finish reading the response before reassigning response // which will leak the open socket. await response.readBody(); // strip authorization header if redirected to a different hostname if (parsedRedirectUrl.hostname !== parsedUrl.hostname) { for (let header in headers) { // header names are case insensitive if (header.toLowerCase() === 'authorization') { delete headers[header]; } } } // let's make the request with the new redirectUrl info = this._prepareRequest(verb, parsedRedirectUrl, headers); response = await this.requestRaw(info, data); redirectsRemaining--; } if (HttpResponseRetryCodes.indexOf(response.message.statusCode) == -1) { // If not a retry code, return immediately instead of retrying return response; } numTries += 1; if (numTries < maxTries) { await response.readBody(); await this._performExponentialBackoff(numTries); } } return response; } /** * Needs to be called if keepAlive is set to true in request options. */ dispose() { if (this._agent) { this._agent.destroy(); } this._disposed = true; } /** * Raw request. * @param info * @param data */ requestRaw(info, data) { return new Promise((resolve, reject) => { let callbackForResult = function (err, res) { if (err) { reject(err); } resolve(res); }; this.requestRawWithCallback(info, data, callbackForResult); }); } /** * Raw request with callback. * @param info * @param data * @param onResult */ requestRawWithCallback(info, data, onResult) { let socket; if (typeof data === 'string') { info.options.headers['Content-Length'] = Buffer.byteLength(data, 'utf8'); } let callbackCalled = false; let handleResult = (err, res) => { if (!callbackCalled) { callbackCalled = true; onResult(err, res); } }; let req = info.httpModule.request(info.options, (msg) => { let res = new HttpClientResponse(msg); handleResult(null, res); }); req.on('socket', sock => { socket = sock; }); // If we ever get disconnected, we want the socket to timeout eventually req.setTimeout(this._socketTimeout || 3 * 60000, () => { if (socket) { socket.end(); } handleResult(new Error('Request timeout: ' + info.options.path), null); }); req.on('error', function (err) { // err has statusCode property // res should have headers handleResult(err, null); }); if (data && typeof data === 'string') { req.write(data, 'utf8'); } if (data && typeof data !== 'string') { data.on('close', function () { req.end(); }); data.pipe(req); } else { req.end(); } } /** * Gets an http agent. This function is useful when you need an http agent that handles * routing through a proxy server - depending upon the url and proxy environment variables. * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com */ getAgent(serverUrl) { let parsedUrl = url.parse(serverUrl); return this._getAgent(parsedUrl); } _prepareRequest(method, requestUrl, headers) { const info = {}; info.parsedUrl = requestUrl; const usingSsl = info.parsedUrl.protocol === 'https:'; info.httpModule = usingSsl ? https : http; const defaultPort = usingSsl ? 443 : 80; info.options = {}; info.options.host = info.parsedUrl.hostname; info.options.port = info.parsedUrl.port ? parseInt(info.parsedUrl.port) : defaultPort; info.options.path = (info.parsedUrl.pathname || '') + (info.parsedUrl.search || ''); info.options.method = method; info.options.headers = this._mergeHeaders(headers); if (this.userAgent != null) { info.options.headers['user-agent'] = this.userAgent; } info.options.agent = this._getAgent(info.parsedUrl); // gives handlers an opportunity to participate if (this.handlers) { this.handlers.forEach(handler => { handler.prepareRequest(info.options); }); } return info; } _mergeHeaders(headers) { const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {}); if (this.requestOptions && this.requestOptions.headers) { return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers)); } return lowercaseKeys(headers || {}); } _getExistingOrDefaultHeader(additionalHeaders, header, _default) { const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {}); let clientHeader; if (this.requestOptions && this.requestOptions.headers) { clientHeader = lowercaseKeys(this.requestOptions.headers)[header]; } return additionalHeaders[header] || clientHeader || _default; } _getAgent(parsedUrl) { let agent; let proxyUrl = pm.getProxyUrl(parsedUrl); let useProxy = proxyUrl && proxyUrl.hostname; if (this._keepAlive && useProxy) { agent = this._proxyAgent; } if (this._keepAlive && !useProxy) { agent = this._agent; } // if agent is already assigned use that agent. if (!!agent) { return agent; } const usingSsl = parsedUrl.protocol === 'https:'; let maxSockets = 100; if (!!this.requestOptions) { maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets; } if (useProxy) { // If using proxy, need tunnel if (!tunnel) { tunnel = __webpack_require__(9153); } const agentOptions = { maxSockets: maxSockets, keepAlive: this._keepAlive, proxy: { proxyAuth: proxyUrl.auth, host: proxyUrl.hostname, port: proxyUrl.port } }; let tunnelAgent; const overHttps = proxyUrl.protocol === 'https:'; if (usingSsl) { tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp; } else { tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp; } 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) { const options = { keepAlive: this._keepAlive, maxSockets: maxSockets }; 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 // we have to cast it to any and change it directly agent.options = Object.assign(agent.options || {}, { rejectUnauthorized: false }); } return agent; } _performExponentialBackoff(retryNumber) { retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); return new Promise(resolve => setTimeout(() => resolve(), ms)); } static dateTimeDeserializer(key, value) { if (typeof value === 'string') { let a = new Date(value); if (!isNaN(a.valueOf())) { return a; } } return value; } async _processResponse(res, options) { return new Promise(async (resolve, reject) => { const statusCode = res.message.statusCode; const response = { statusCode: statusCode, result: null, headers: {} }; // not found leads to null obj returned if (statusCode == HttpCodes.NotFound) { resolve(response); } let obj; let contents; // get the result from the body try { contents = await res.readBody(); if (contents && contents.length > 0) { if (options && options.deserializeDates) { obj = JSON.parse(contents, HttpClient.dateTimeDeserializer); } else { obj = JSON.parse(contents); } response.result = obj; } response.headers = res.message.headers; } catch (err) { // Invalid resource (contents not json); leaving result obj null } // note that 3xx redirects are handled by the http layer. if (statusCode > 299) { let msg; // if exception/error in body, attempt to get better error if (obj && obj.message) { msg = obj.message; } else if (contents && contents.length > 0) { // it may be the case that the exception is in the body message as string msg = contents; } else { msg = 'Failed request: (' + statusCode + ')'; } let err = new Error(msg); // attach statusCode and body obj (if available) to the error object err['statusCode'] = statusCode; if (response.result) { err['result'] = response.result; } reject(err); } else { resolve(response); } }); } } exports.HttpClient = HttpClient; /***/ }), /***/ 9153: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { module.exports = __webpack_require__(1406); /***/ }), /***/ 1406: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var net = __webpack_require__(1631); var tls = __webpack_require__(4016); var http = __webpack_require__(8605); var https = __webpack_require__(7211); var events = __webpack_require__(8614); var assert = __webpack_require__(2357); var util = __webpack_require__(1669); exports.httpOverHttp = httpOverHttp; exports.httpsOverHttp = httpsOverHttp; exports.httpOverHttps = httpOverHttps; exports.httpsOverHttps = httpsOverHttps; function httpOverHttp(options) { var agent = new TunnelingAgent(options); agent.request = http.request; return agent; } function httpsOverHttp(options) { var agent = new TunnelingAgent(options); agent.request = http.request; agent.createSocket = createSecureSocket; agent.defaultPort = 443; return agent; } function httpOverHttps(options) { var agent = new TunnelingAgent(options); agent.request = https.request; return agent; } function httpsOverHttps(options) { var agent = new TunnelingAgent(options); agent.request = https.request; agent.createSocket = createSecureSocket; agent.defaultPort = 443; return agent; } function TunnelingAgent(options) { var self = this; self.options = options || {}; self.proxyOptions = self.options.proxy || {}; self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets; self.requests = []; self.sockets = []; self.on('free', function onFree(socket, host, port, localAddress) { var options = toOptions(host, port, localAddress); for (var i = 0, len = self.requests.length; i < len; ++i) { var pending = self.requests[i]; if (pending.host === options.host && pending.port === options.port) { // Detect the request to connect same origin server, // reuse the connection. self.requests.splice(i, 1); pending.request.onSocket(socket); return; } } socket.destroy(); self.removeSocket(socket); }); } util.inherits(TunnelingAgent, events.EventEmitter); TunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) { var self = this; var options = mergeOptions({request: req}, self.options, toOptions(host, port, localAddress)); if (self.sockets.length >= this.maxSockets) { // We are over limit so we'll add it to the queue. self.requests.push(options); return; } // If we are under maxSockets create a new one. self.createSocket(options, function(socket) { socket.on('free', onFree); socket.on('close', onCloseOrRemove); socket.on('agentRemove', onCloseOrRemove); req.onSocket(socket); function onFree() { self.emit('free', socket, options); } function onCloseOrRemove(err) { self.removeSocket(socket); socket.removeListener('free', onFree); socket.removeListener('close', onCloseOrRemove); socket.removeListener('agentRemove', onCloseOrRemove); } }); }; TunnelingAgent.prototype.createSocket = function createSocket(options, cb) { var self = this; var placeholder = {}; self.sockets.push(placeholder); var connectOptions = mergeOptions({}, self.proxyOptions, { method: 'CONNECT', path: options.host + ':' + options.port, agent: false, headers: { host: options.host + ':' + options.port } }); if (options.localAddress) { connectOptions.localAddress = options.localAddress; } if (connectOptions.proxyAuth) { connectOptions.headers = connectOptions.headers || {}; connectOptions.headers['Proxy-Authorization'] = 'Basic ' + new Buffer(connectOptions.proxyAuth).toString('base64'); } debug('making CONNECT request'); var connectReq = self.request(connectOptions); connectReq.useChunkedEncodingByDefault = false; // for v0.6 connectReq.once('response', onResponse); // for v0.6 connectReq.once('upgrade', onUpgrade); // for v0.6 connectReq.once('connect', onConnect); // for v0.7 or later connectReq.once('error', onError); connectReq.end(); function onResponse(res) { // Very hacky. This is necessary to avoid http-parser leaks. res.upgrade = true; } function onUpgrade(res, socket, head) { // Hacky. process.nextTick(function() { onConnect(res, socket, head); }); } function onConnect(res, socket, head) { connectReq.removeAllListeners(); socket.removeAllListeners(); if (res.statusCode !== 200) { debug('tunneling socket could not be established, statusCode=%d', res.statusCode); socket.destroy(); var error = new Error('tunneling socket could not be established, ' + 'statusCode=' + res.statusCode); error.code = 'ECONNRESET'; options.request.emit('error', error); self.removeSocket(placeholder); return; } if (head.length > 0) { debug('got illegal response body from proxy'); socket.destroy(); var error = new Error('got illegal response body from proxy'); error.code = 'ECONNRESET'; options.request.emit('error', error); self.removeSocket(placeholder); return; } debug('tunneling connection has established'); self.sockets[self.sockets.indexOf(placeholder)] = socket; return cb(socket); } function onError(cause) { connectReq.removeAllListeners(); debug('tunneling socket could not be established, cause=%s\n', cause.message, cause.stack); var error = new Error('tunneling socket could not be established, ' + 'cause=' + cause.message); error.code = 'ECONNRESET'; options.request.emit('error', error); self.removeSocket(placeholder); } }; TunnelingAgent.prototype.removeSocket = function removeSocket(socket) { var pos = this.sockets.indexOf(socket) if (pos === -1) { return; } this.sockets.splice(pos, 1); var pending = this.requests.shift(); if (pending) { // If we have pending requests and a socket gets closed a new one // needs to be created to take over in the pool for the one that closed. this.createSocket(pending, function(socket) { pending.request.onSocket(socket); }); } }; function createSecureSocket(options, cb) { var self = this; TunnelingAgent.prototype.createSocket.call(self, options, function(socket) { var hostHeader = options.request.getHeader('host'); var tlsOptions = mergeOptions({}, self.options, { socket: socket, servername: hostHeader ? hostHeader.replace(/:.*$/, '') : options.host }); // 0 is dummy port for v0.6 var secureSocket = tls.connect(0, tlsOptions); self.sockets[self.sockets.indexOf(socket)] = secureSocket; cb(secureSocket); }); } function toOptions(host, port, localAddress) { if (typeof host === 'string') { // since v0.10 return { host: host, port: port, localAddress: localAddress }; } return host; // for v0.11 or later } function mergeOptions(target) { for (var i = 1, len = arguments.length; i < len; ++i) { var overrides = arguments[i]; if (typeof overrides === 'object') { var keys = Object.keys(overrides); for (var j = 0, keyLen = keys.length; j < keyLen; ++j) { var k = keys[j]; if (overrides[k] !== undefined) { target[k] = overrides[k]; } } } } return target; } var debug; if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) { debug = function() { var args = Array.prototype.slice.call(arguments); if (typeof args[0] === 'string') { args[0] = 'TUNNEL: ' + args[0]; } else { args.unshift('TUNNEL:'); } console.error.apply(console, args); } } else { debug = function() {}; } exports.debug = debug; // for test /***/ }), /***/ 6443: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const url = __webpack_require__(8835); function getProxyUrl(reqUrl) { let usingSsl = reqUrl.protocol === 'https:'; let proxyUrl; if (checkBypass(reqUrl)) { return proxyUrl; } let proxyVar; if (usingSsl) { proxyVar = process.env['https_proxy'] || process.env['HTTPS_PROXY']; } else { proxyVar = process.env['http_proxy'] || process.env['HTTP_PROXY']; } if (proxyVar) { proxyUrl = url.parse(proxyVar); } return proxyUrl; } exports.getProxyUrl = getProxyUrl; function checkBypass(reqUrl) { if (!reqUrl.hostname) { return false; } let noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || ''; if (!noProxy) { return false; } // Determine the request port let reqPort; if (reqUrl.port) { reqPort = Number(reqUrl.port); } else if (reqUrl.protocol === 'http:') { reqPort = 80; } else if (reqUrl.protocol === 'https:') { reqPort = 443; } // Format the request hostname and hostname with port let upperReqHosts = [reqUrl.hostname.toUpperCase()]; if (typeof reqPort === 'number') { upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`); } // Compare request host against noproxy for (let upperNoProxyItem of noProxy .split(',') .map(x => x.trim().toUpperCase()) .filter(x => x)) { if (upperReqHosts.some(x => x === upperNoProxyItem)) { return true; } } return false; } exports.checkBypass = checkBypass; /***/ }), /***/ 1962: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var _a; Object.defineProperty(exports, "__esModule", ({ value: true })); const assert_1 = __webpack_require__(2357); const fs = __webpack_require__(5747); const path = __webpack_require__(5622); _a = fs.promises, exports.chmod = _a.chmod, exports.copyFile = _a.copyFile, exports.lstat = _a.lstat, exports.mkdir = _a.mkdir, exports.readdir = _a.readdir, exports.readlink = _a.readlink, exports.rename = _a.rename, exports.rmdir = _a.rmdir, exports.stat = _a.stat, exports.symlink = _a.symlink, exports.unlink = _a.unlink; exports.IS_WINDOWS = process.platform === 'win32'; function exists(fsPath) { return __awaiter(this, void 0, void 0, function* () { try { yield exports.stat(fsPath); } catch (err) { if (err.code === 'ENOENT') { return false; } throw err; } return true; }); } exports.exists = exists; function isDirectory(fsPath, useStat = false) { return __awaiter(this, void 0, void 0, function* () { const stats = useStat ? yield exports.stat(fsPath) : yield exports.lstat(fsPath); return stats.isDirectory(); }); } 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; /** * Recursively create a directory at `fsPath`. * * This implementation is optimistic, meaning it attempts to create the full * path first, and backs up the path stack from there. * * @param fsPath The path to create * @param maxDepth The maximum recursion depth * @param depth The current recursion depth */ function mkdirP(fsPath, maxDepth = 1000, depth = 1) { return __awaiter(this, void 0, void 0, function* () { assert_1.ok(fsPath, 'a path argument must be provided'); fsPath = path.resolve(fsPath); if (depth >= maxDepth) return exports.mkdir(fsPath); try { yield exports.mkdir(fsPath); return; } catch (err) { switch (err.code) { case 'ENOENT': { yield mkdirP(path.dirname(fsPath), maxDepth, depth + 1); yield exports.mkdir(fsPath); return; } default: { let stats; try { stats = yield exports.stat(fsPath); } catch (err2) { throw err; } if (!stats.isDirectory()) throw err; } } } }); } exports.mkdirP = mkdirP; /** * 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, function* () { let stats = undefined; try { // test file exists stats = yield exports.stat(filePath); } catch (err) { if (err.code !== 'ENOENT') { // eslint-disable-next-line no-console console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`); } } if (stats && stats.isFile()) { if (exports.IS_WINDOWS) { // on Windows, test for valid extension const upperExt = path.extname(filePath).toUpperCase(); if (extensions.some(validExt => validExt.toUpperCase() === upperExt)) { return filePath; } } else { if (isUnixExecutable(stats)) { return filePath; } } } // try each extension const originalFilePath = filePath; for (const extension of extensions) { filePath = originalFilePath + extension; stats = undefined; try { stats = yield exports.stat(filePath); } catch (err) { if (err.code !== 'ENOENT') { // eslint-disable-next-line no-console console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`); } } if (stats && stats.isFile()) { if (exports.IS_WINDOWS) { // preserve the case of the actual file (since an extension was appended) try { const directory = path.dirname(filePath); const upperName = path.basename(filePath).toUpperCase(); for (const actualName of yield exports.readdir(directory)) { if (upperName === actualName.toUpperCase()) { filePath = path.join(directory, actualName); break; } } } catch (err) { // eslint-disable-next-line no-console console.log(`Unexpected error attempting to determine the actual case of the file '${filePath}': ${err}`); } return filePath; } else { if (isUnixExecutable(stats)) { return filePath; } } } } return ''; }); } 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())); } //# sourceMappingURL=io-util.js.map /***/ }), /***/ 7436: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", ({ value: true })); const childProcess = __webpack_require__(3129); const path = __webpack_require__(5622); const util_1 = __webpack_require__(1669); const ioUtil = __webpack_require__(1962); const exec = util_1.promisify(childProcess.exec); /** * 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, options = {}) { return __awaiter(this, void 0, void 0, function* () { const { force, recursive } = readCopyOptions(options); const destStat = (yield ioUtil.exists(dest)) ? yield ioUtil.stat(dest) : null; // Dest is an existing file, but not forcing if (destStat && destStat.isFile() && !force) { return; } // If dest is an existing directory, should copy inside. const newDest = destStat && destStat.isDirectory() ? path.join(dest, path.basename(source)) : dest; if (!(yield ioUtil.exists(source))) { throw new Error(`no such file or directory: ${source}`); } const sourceStat = yield ioUtil.stat(source); if (sourceStat.isDirectory()) { if (!recursive) { throw new Error(`Failed to copy. ${source} is a directory, but tried to copy without recursive flag.`); } else { yield cpDirRecursive(source, newDest, 0, force); } } else { if (path.relative(source, newDest) === '') { // a file cannot be copied to itself throw new Error(`'${newDest}' and '${source}' are the same file`); } yield copyFile(source, newDest, force); } }); } exports.cp = cp; /** * Moves a path. * * @param source source path * @param dest destination path * @param options optional. See MoveOptions. */ function mv(source, dest, options = {}) { return __awaiter(this, void 0, void 0, function* () { if (yield ioUtil.exists(dest)) { let destExists = true; if (yield ioUtil.isDirectory(dest)) { // If dest is directory copy src into dest dest = path.join(dest, path.basename(source)); destExists = yield ioUtil.exists(dest); } if (destExists) { if (options.force == null || options.force) { yield rmRF(dest); } else { throw new Error('Destination already exists'); } } } yield mkdirP(path.dirname(dest)); yield ioUtil.rename(source, dest); }); } exports.mv = mv; /** * Remove a path recursively with force * * @param inputPath path to remove */ function rmRF(inputPath) { return __awaiter(this, void 0, void 0, function* () { if (ioUtil.IS_WINDOWS) { // Node doesn't provide a delete operation, only an unlink function. This means that if the file is being used by another // program (e.g. antivirus), it won't be deleted. To address this, we shell out the work to rd/del. try { if (yield ioUtil.isDirectory(inputPath, true)) { yield exec(`rd /s /q "${inputPath}"`); } else { yield exec(`del /f /a "${inputPath}"`); } } catch (err) { // if you try to delete a file that doesn't exist, desired result is achieved // other errors are valid if (err.code !== 'ENOENT') throw err; } // Shelling out fails to remove a symlink folder with missing source, this unlink catches that try { yield ioUtil.unlink(inputPath); } catch (err) { // if you try to delete a file that doesn't exist, desired result is achieved // other errors are valid if (err.code !== 'ENOENT') throw err; } } else { let isDir = false; try { isDir = yield ioUtil.isDirectory(inputPath); } catch (err) { // if you try to delete a file that doesn't exist, desired result is achieved // other errors are valid if (err.code !== 'ENOENT') throw err; return; } if (isDir) { yield exec(`rm -rf "${inputPath}"`); } else { yield ioUtil.unlink(inputPath); } } }); } 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, function* () { yield ioUtil.mkdirP(fsPath); }); } 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, function* () { if (!tool) { throw new Error("parameter 'tool' is required"); } // recursive when check=true if (check) { const result = yield which(tool, false); if (!result) { if (ioUtil.IS_WINDOWS) { throw new Error(`Unable to locate executable file: ${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.`); } else { throw new Error(`Unable to locate executable file: ${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.`); } } } try { // build the list of extensions to try const extensions = []; if (ioUtil.IS_WINDOWS && process.env.PATHEXT) { for (const extension of process.env.PATHEXT.split(path.delimiter)) { if (extension) { extensions.push(extension); } } } // if it's rooted, return it if exists. otherwise return empty. if (ioUtil.isRooted(tool)) { const filePath = yield ioUtil.tryGetExecutablePath(tool, extensions); if (filePath) { return filePath; } return ''; } // if any path separators, return empty if (tool.includes('/') || (ioUtil.IS_WINDOWS && tool.includes('\\'))) { return ''; } // 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. const directories = []; if (process.env.PATH) { for (const p of process.env.PATH.split(path.delimiter)) { if (p) { directories.push(p); } } } // return the first match for (const directory of directories) { const filePath = yield ioUtil.tryGetExecutablePath(directory + path.sep + tool, extensions); if (filePath) { return filePath; } } return ''; } catch (err) { throw new Error(`which failed with message ${err.message}`); } }); } exports.which = which; function readCopyOptions(options) { const force = options.force == null ? true : options.force; const recursive = Boolean(options.recursive); return { force, recursive }; } function cpDirRecursive(sourceDir, destDir, currentDepth, force) { return __awaiter(this, void 0, void 0, function* () { // Ensure there is not a run away recursive copy if (currentDepth >= 255) return; currentDepth++; yield mkdirP(destDir); const files = yield ioUtil.readdir(sourceDir); for (const fileName of files) { const srcFile = `${sourceDir}/${fileName}`; const destFile = `${destDir}/${fileName}`; const srcFileStat = yield ioUtil.lstat(srcFile); if (srcFileStat.isDirectory()) { // Recurse yield cpDirRecursive(srcFile, destFile, currentDepth, force); } else { yield copyFile(srcFile, destFile, force); } } // Change the mode for the newly created directory yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode); }); } // Buffered file copy function copyFile(srcFile, destFile, force) { return __awaiter(this, void 0, void 0, function* () { if ((yield ioUtil.lstat(srcFile)).isSymbolicLink()) { // unlink/re-link it try { yield ioUtil.lstat(destFile); yield ioUtil.unlink(destFile); } catch (e) { // Try to override file permission if (e.code === 'EPERM') { yield ioUtil.chmod(destFile, '0666'); yield ioUtil.unlink(destFile); } // other errors = it doesn't exist, no work to do } // Copy over symlink const symlinkFull = yield ioUtil.readlink(srcFile); yield ioUtil.symlink(symlinkFull, destFile, ioUtil.IS_WINDOWS ? 'junction' : null); } else if (!(yield ioUtil.exists(destFile)) || force) { yield ioUtil.copyFile(srcFile, destFile); } }); } //# sourceMappingURL=io.js.map /***/ }), /***/ 2473: /***/ (function(module, exports, __webpack_require__) { "use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; result["default"] = mod; return result; }; Object.defineProperty(exports, "__esModule", ({ value: true })); const semver = __importStar(__webpack_require__(562)); const core_1 = __webpack_require__(6705); // needs to be require for core node modules to be mocked /* eslint @typescript-eslint/no-require-imports: 0 */ const os = __webpack_require__(2087); const cp = __webpack_require__(3129); const fs = __webpack_require__(5747); function _findMatch(versionSpec, stable, candidates, archFilter) { return __awaiter(this, void 0, void 0, function* () { const platFilter = os.platform(); let result; let match; let file; for (const candidate of candidates) { const version = candidate.version; core_1.debug(`check ${version} satisfies ${versionSpec}`); if (semver.satisfies(version, versionSpec) && (!stable || candidate.stable === stable)) { file = candidate.files.find(item => { core_1.debug(`${item.arch}===${archFilter} && ${item.platform}===${platFilter}`); let chk = item.arch === archFilter && item.platform === platFilter; if (chk && item.platform_version) { const osVersion = module.exports._getOsVersion(); if (osVersion === item.platform_version) { chk = true; } else { chk = semver.satisfies(osVersion, item.platform_version); } } return chk; }); if (file) { core_1.debug(`matched ${candidate.version}`); match = candidate; break; } } } if (match && file) { // clone since we're mutating the file list to be only the file that matches result = Object.assign({}, match); result.files = [file]; } return result; }); } exports._findMatch = _findMatch; function _getOsVersion() { // TODO: add windows and other linux, arm variants // right now filtering on version is only an ubuntu and macos scenario for tools we build for hosted (python) const plat = os.platform(); let version = ''; if (plat === 'darwin') { version = cp.execSync('sw_vers -productVersion').toString(); } else if (plat === 'linux') { // lsb_release process not in some containers, readfile // Run cat /etc/lsb-release // DISTRIB_ID=Ubuntu // DISTRIB_RELEASE=18.04 // DISTRIB_CODENAME=bionic // DISTRIB_DESCRIPTION="Ubuntu 18.04.4 LTS" const lsbContents = module.exports._readLinuxVersionFile(); if (lsbContents) { const lines = lsbContents.split('\n'); for (const line of lines) { const parts = line.split('='); if (parts.length === 2 && parts[0].trim() === 'DISTRIB_RELEASE') { version = parts[1].trim(); break; } } } } return version; } exports._getOsVersion = _getOsVersion; function _readLinuxVersionFile() { const lsbFile = '/etc/lsb-release'; let contents = ''; if (fs.existsSync(lsbFile)) { contents = fs.readFileSync(lsbFile).toString(); } return contents; } exports._readLinuxVersionFile = _readLinuxVersionFile; //# sourceMappingURL=manifest.js.map /***/ }), /***/ 8279: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; result["default"] = mod; return result; }; Object.defineProperty(exports, "__esModule", ({ value: true })); const core = __importStar(__webpack_require__(6705)); /** * Internal class for retries */ class RetryHelper { constructor(maxAttempts, minSeconds, maxSeconds) { if (maxAttempts < 1) { throw new Error('max attempts should be greater than or equal to 1'); } this.maxAttempts = maxAttempts; this.minSeconds = Math.floor(minSeconds); this.maxSeconds = Math.floor(maxSeconds); if (this.minSeconds > this.maxSeconds) { throw new Error('min seconds should be less than or equal to max seconds'); } } execute(action, isRetryable) { return __awaiter(this, void 0, void 0, function* () { let attempt = 1; while (attempt < this.maxAttempts) { // Try try { return yield action(); } catch (err) { if (isRetryable && !isRetryable(err)) { throw err; } core.info(err.message); } // Sleep const seconds = this.getSleepAmount(); core.info(`Waiting ${seconds} seconds before trying again`); yield this.sleep(seconds); attempt++; } // Last attempt return yield action(); }); } getSleepAmount() { return (Math.floor(Math.random() * (this.maxSeconds - this.minSeconds + 1)) + this.minSeconds); } sleep(seconds) { return __awaiter(this, void 0, void 0, function* () { return new Promise(resolve => setTimeout(resolve, seconds * 1000)); }); } } exports.RetryHelper = RetryHelper; //# sourceMappingURL=retry-helper.js.map /***/ }), /***/ 7784: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; result["default"] = mod; return result; }; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", ({ value: true })); const core = __importStar(__webpack_require__(6705)); const io = __importStar(__webpack_require__(7436)); const fs = __importStar(__webpack_require__(5747)); const mm = __importStar(__webpack_require__(2473)); const os = __importStar(__webpack_require__(2087)); const path = __importStar(__webpack_require__(5622)); const httpm = __importStar(__webpack_require__(9925)); const semver = __importStar(__webpack_require__(562)); const stream = __importStar(__webpack_require__(2413)); const util = __importStar(__webpack_require__(1669)); const v4_1 = __importDefault(__webpack_require__(7468)); const exec_1 = __webpack_require__(1514); const assert_1 = __webpack_require__(2357); const retry_helper_1 = __webpack_require__(8279); class HTTPError extends Error { constructor(httpStatusCode) { super(`Unexpected HTTP response: ${httpStatusCode}`); this.httpStatusCode = httpStatusCode; Object.setPrototypeOf(this, /* unsupported import.meta.prototype */ undefined); } } exports.HTTPError = HTTPError; const IS_WINDOWS = process.platform === 'win32'; const userAgent = 'actions/tool-cache'; /** * Download a tool from an url and stream it into a file * * @param url url of tool to download * @param dest path to download tool * @param auth authorization header * @returns path to downloaded tool */ function downloadTool(url, dest, auth) { return __awaiter(this, void 0, void 0, function* () { dest = dest || path.join(_getTempDirectory(), v4_1.default()); yield io.mkdirP(path.dirname(dest)); core.debug(`Downloading ${url}`); core.debug(`Destination ${dest}`); const maxAttempts = 3; const minSeconds = _getGlobal('TEST_DOWNLOAD_TOOL_RETRY_MIN_SECONDS', 10); const maxSeconds = _getGlobal('TEST_DOWNLOAD_TOOL_RETRY_MAX_SECONDS', 20); const retryHelper = new retry_helper_1.RetryHelper(maxAttempts, minSeconds, maxSeconds); return yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () { return yield downloadToolAttempt(url, dest || '', auth); }), (err) => { if (err instanceof HTTPError && err.httpStatusCode) { // Don't retry anything less than 500, except 408 Request Timeout and 429 Too Many Requests if (err.httpStatusCode < 500 && err.httpStatusCode !== 408 && err.httpStatusCode !== 429) { return false; } } // Otherwise retry return true; }); }); } exports.downloadTool = downloadTool; function downloadToolAttempt(url, dest, auth) { return __awaiter(this, void 0, void 0, function* () { if (fs.existsSync(dest)) { throw new Error(`Destination file path ${dest} already exists`); } // Get the response headers const http = new httpm.HttpClient(userAgent, [], { allowRetries: false }); let headers; if (auth) { core.debug('set auth'); headers = { authorization: auth }; } const response = yield http.get(url, headers); if (response.message.statusCode !== 200) { const err = new HTTPError(response.message.statusCode); core.debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`); throw err; } // Download the response body const pipeline = util.promisify(stream.pipeline); const responseMessageFactory = _getGlobal('TEST_DOWNLOAD_TOOL_RESPONSE_MESSAGE_FACTORY', () => response.message); const readStream = responseMessageFactory(); let succeeded = false; try { yield pipeline(readStream, fs.createWriteStream(dest)); core.debug('download complete'); succeeded = true; return dest; } finally { // Error, delete dest before retry if (!succeeded) { core.debug('download failed'); try { yield io.rmRF(dest); } catch (err) { core.debug(`Failed to delete '${dest}'. ${err.message}`); } } } }); } /** * Extract a .7z file * * @param file path to the .7z file * @param dest destination directory. Optional. * @param _7zPath path to 7zr.exe. Optional, for long path support. Most .7z archives do not have this * problem. If your .7z archive contains very long paths, you can pass the path to 7zr.exe which will * gracefully handle long paths. By default 7zdec.exe is used because it is a very small program and is * bundled with the tool lib. However it does not support long paths. 7zr.exe is the reduced command line * interface, it is smaller than the full command line interface, and it does support long paths. At the * time of this writing, it is freely available from the LZMA SDK that is available on the 7zip website. * Be sure to check the current license agreement. If 7zr.exe is bundled with your action, then the path * to 7zr.exe can be pass to this function. * @returns path to the destination directory */ function extract7z(file, dest, _7zPath) { return __awaiter(this, void 0, void 0, function* () { assert_1.ok(IS_WINDOWS, 'extract7z() not supported on current OS'); assert_1.ok(file, 'parameter "file" is required'); dest = yield _createExtractFolder(dest); const originalCwd = process.cwd(); process.chdir(dest); if (_7zPath) { try { const logLevel = core.isDebug() ? '-bb1' : '-bb0'; const args = [ 'x', logLevel, '-bd', '-sccUTF-8', file ]; const options = { silent: true }; yield exec_1.exec(`"${_7zPath}"`, args, options); } finally { process.chdir(originalCwd); } } else { const escapedScript = path .join(__dirname, '..', 'scripts', 'Invoke-7zdec.ps1') .replace(/'/g, "''") .replace(/"|\n|\r/g, ''); // double-up single quotes, remove double quotes and newlines const escapedFile = file.replace(/'/g, "''").replace(/"|\n|\r/g, ''); const escapedTarget = dest.replace(/'/g, "''").replace(/"|\n|\r/g, ''); const command = `& '${escapedScript}' -Source '${escapedFile}' -Target '${escapedTarget}'`; const args = [ '-NoLogo', '-Sta', '-NoProfile', '-NonInteractive', '-ExecutionPolicy', 'Unrestricted', '-Command', command ]; const options = { silent: true }; try { const powershellPath = yield io.which('powershell', true); yield exec_1.exec(`"${powershellPath}"`, args, options); } finally { process.chdir(originalCwd); } } return dest; }); } exports.extract7z = extract7z; /** * Extract a compressed tar archive * * @param file path to the tar * @param dest destination directory. Optional. * @param flags flags for the tar command to use for extraction. Defaults to 'xz' (extracting gzipped tars). Optional. * @returns path to the destination directory */ function extractTar(file, dest, flags = 'xz') { return __awaiter(this, void 0, void 0, function* () { if (!file) { throw new Error("parameter 'file' is required"); } // Create dest dest = yield _createExtractFolder(dest); // Determine whether GNU tar core.debug('Checking tar --version'); let versionOutput = ''; yield exec_1.exec('tar --version', [], { ignoreReturnCode: true, silent: true, listeners: { stdout: (data) => (versionOutput += data.toString()), stderr: (data) => (versionOutput += data.toString()) } }); core.debug(versionOutput.trim()); const isGnuTar = versionOutput.toUpperCase().includes('GNU TAR'); // Initialize args let args; if (flags instanceof Array) { args = flags; } else { args = [flags]; } if (core.isDebug() && !flags.includes('v')) { args.push('-v'); } let destArg = dest; let fileArg = file; if (IS_WINDOWS && isGnuTar) { args.push('--force-local'); destArg = dest.replace(/\\/g, '/'); // Technically only the dest needs to have `/` but for aesthetic consistency // convert slashes in the file arg too. fileArg = file.replace(/\\/g, '/'); } if (isGnuTar) { // Suppress warnings when using GNU tar to extract archives created by BSD tar args.push('--warning=no-unknown-keyword'); } args.push('-C', destArg, '-f', fileArg); yield exec_1.exec(`tar`, args); return dest; }); } exports.extractTar = extractTar; /** * Extract a zip * * @param file path to the zip * @param dest destination directory. Optional. * @returns path to the destination directory */ function extractZip(file, dest) { return __awaiter(this, void 0, void 0, function* () { if (!file) { throw new Error("parameter 'file' is required"); } dest = yield _createExtractFolder(dest); if (IS_WINDOWS) { yield extractZipWin(file, dest); } else { yield extractZipNix(file, dest); } return dest; }); } exports.extractZip = extractZip; function extractZipWin(file, dest) { return __awaiter(this, void 0, void 0, function* () { // build the powershell command const escapedFile = file.replace(/'/g, "''").replace(/"|\n|\r/g, ''); // double-up single quotes, remove double quotes and newlines const escapedDest = dest.replace(/'/g, "''").replace(/"|\n|\r/g, ''); const command = `$ErrorActionPreference = 'Stop' ; try { Add-Type -AssemblyName System.IO.Compression.FileSystem } catch { } ; [System.IO.Compression.ZipFile]::ExtractToDirectory('${escapedFile}', '${escapedDest}')`; // run powershell const powershellPath = yield io.which('powershell', true); const args = [ '-NoLogo', '-Sta', '-NoProfile', '-NonInteractive', '-ExecutionPolicy', 'Unrestricted', '-Command', command ]; yield exec_1.exec(`"${powershellPath}"`, args); }); } function extractZipNix(file, dest) { return __awaiter(this, void 0, void 0, function* () { const unzipPath = yield io.which('unzip', true); const args = [file]; if (!core.isDebug()) { args.unshift('-q'); } yield exec_1.exec(`"${unzipPath}"`, args, { cwd: dest }); }); } /** * Caches a directory and installs it into the tool cacheDir * * @param sourceDir the directory to cache into tools * @param tool tool name * @param version version of the tool. semver format * @param arch architecture of the tool. Optional. Defaults to machine architecture */ function cacheDir(sourceDir, tool, version, arch) { return __awaiter(this, void 0, void 0, function* () { version = semver.clean(version) || version; arch = arch || os.arch(); core.debug(`Caching tool ${tool} ${version} ${arch}`); core.debug(`source dir: ${sourceDir}`); if (!fs.statSync(sourceDir).isDirectory()) { throw new Error('sourceDir is not a directory'); } // Create the tool dir const destPath = yield _createToolPath(tool, version, arch); // copy each child item. do not move. move can fail on Windows // due to anti-virus software having an open handle on a file. for (const itemName of fs.readdirSync(sourceDir)) { const s = path.join(sourceDir, itemName); yield io.cp(s, destPath, { recursive: true }); } // write .complete _completeToolPath(tool, version, arch); return destPath; }); } exports.cacheDir = cacheDir; /** * Caches a downloaded file (GUID) and installs it * into the tool cache with a given targetName * * @param sourceFile the file to cache into tools. Typically a result of downloadTool which is a guid. * @param targetFile the name of the file name in the tools directory * @param tool tool name * @param version version of the tool. semver format * @param arch architecture of the tool. Optional. Defaults to machine architecture */ function cacheFile(sourceFile, targetFile, tool, version, arch) { return __awaiter(this, void 0, void 0, function* () { version = semver.clean(version) || version; arch = arch || os.arch(); core.debug(`Caching tool ${tool} ${version} ${arch}`); core.debug(`source file: ${sourceFile}`); if (!fs.statSync(sourceFile).isFile()) { throw new Error('sourceFile is not a file'); } // create the tool dir const destFolder = yield _createToolPath(tool, version, arch); // copy instead of move. move can fail on Windows due to // anti-virus software having an open handle on a file. const destPath = path.join(destFolder, targetFile); core.debug(`destination file ${destPath}`); yield io.cp(sourceFile, destPath); // write .complete _completeToolPath(tool, version, arch); return destFolder; }); } exports.cacheFile = cacheFile; /** * Finds the path to a tool version in the local installed tool cache * * @param toolName name of the tool * @param versionSpec version of the tool * @param arch optional arch. defaults to arch of computer */ function find(toolName, versionSpec, arch) { if (!toolName) { throw new Error('toolName parameter is required'); } if (!versionSpec) { throw new Error('versionSpec parameter is required'); } arch = arch || os.arch(); // attempt to resolve an explicit version if (!_isExplicitVersion(versionSpec)) { const localVersions = findAllVersions(toolName, arch); const match = _evaluateVersions(localVersions, versionSpec); versionSpec = match; } // check for the explicit version in the cache let toolPath = ''; if (versionSpec) { versionSpec = semver.clean(versionSpec) || ''; const cachePath = path.join(_getCacheDirectory(), toolName, versionSpec, arch); core.debug(`checking cache: ${cachePath}`); if (fs.existsSync(cachePath) && fs.existsSync(`${cachePath}.complete`)) { core.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch}`); toolPath = cachePath; } else { core.debug('not found'); } } return toolPath; } exports.find = find; /** * Finds the paths to all versions of a tool that are installed in the local tool cache * * @param toolName name of the tool * @param arch optional arch. defaults to arch of computer */ function findAllVersions(toolName, arch) { const versions = []; arch = arch || os.arch(); const toolPath = path.join(_getCacheDirectory(), toolName); if (fs.existsSync(toolPath)) { const children = fs.readdirSync(toolPath); for (const child of children) { if (_isExplicitVersion(child)) { const fullPath = path.join(toolPath, child, arch || ''); if (fs.existsSync(fullPath) && fs.existsSync(`${fullPath}.complete`)) { versions.push(child); } } } } return versions; } exports.findAllVersions = findAllVersions; function getManifestFromRepo(owner, repo, auth, branch = 'master') { return __awaiter(this, void 0, void 0, function* () { let releases = []; const treeUrl = `https://api.github.com/repos/${owner}/${repo}/git/trees/${branch}`; const http = new httpm.HttpClient('tool-cache'); const headers = {}; if (auth) { core.debug('set auth'); headers.authorization = auth; } const response = yield http.getJson(treeUrl, headers); if (!response.result) { return releases; } let manifestUrl = ''; for (const item of response.result.tree) { if (item.path === 'versions-manifest.json') { manifestUrl = item.url; break; } } headers['accept'] = 'application/vnd.github.VERSION.raw'; let versionsRaw = yield (yield http.get(manifestUrl, headers)).readBody(); if (versionsRaw) { // shouldn't be needed but protects against invalid json saved with BOM versionsRaw = versionsRaw.replace(/^\uFEFF/, ''); try { releases = JSON.parse(versionsRaw); } catch (_a) { core.debug('Invalid json'); } } return releases; }); } exports.getManifestFromRepo = getManifestFromRepo; function findFromManifest(versionSpec, stable, manifest, archFilter = os.arch()) { return __awaiter(this, void 0, void 0, function* () { // wrap the internal impl const match = yield mm._findMatch(versionSpec, stable, manifest, archFilter); return match; }); } exports.findFromManifest = findFromManifest; function _createExtractFolder(dest) { return __awaiter(this, void 0, void 0, function* () { if (!dest) { // create a temp dir dest = path.join(_getTempDirectory(), v4_1.default()); } yield io.mkdirP(dest); return dest; }); } function _createToolPath(tool, version, arch) { return __awaiter(this, void 0, void 0, function* () { const folderPath = path.join(_getCacheDirectory(), tool, semver.clean(version) || version, arch || ''); core.debug(`destination ${folderPath}`); const markerPath = `${folderPath}.complete`; yield io.rmRF(folderPath); yield io.rmRF(markerPath); yield io.mkdirP(folderPath); return folderPath; }); } function _completeToolPath(tool, version, arch) { const folderPath = path.join(_getCacheDirectory(), tool, semver.clean(version) || version, arch || ''); const markerPath = `${folderPath}.complete`; fs.writeFileSync(markerPath, ''); core.debug('finished caching tool'); } function _isExplicitVersion(versionSpec) { const c = semver.clean(versionSpec) || ''; core.debug(`isExplicit: ${c}`); const valid = semver.valid(c) != null; core.debug(`explicit? ${valid}`); return valid; } function _evaluateVersions(versions, versionSpec) { let version = ''; core.debug(`evaluating ${versions.length} versions`); versions = versions.sort((a, b) => { if (semver.gt(a, b)) { return 1; } return -1; }); for (let i = versions.length - 1; i >= 0; i--) { const potential = versions[i]; const satisfied = semver.satisfies(potential, versionSpec); if (satisfied) { version = potential; break; } } if (version) { core.debug(`matched: ${version}`); } else { core.debug('match not found'); } return version; } /** * Gets RUNNER_TOOL_CACHE */ function _getCacheDirectory() { const cacheDirectory = process.env['RUNNER_TOOL_CACHE'] || ''; assert_1.ok(cacheDirectory, 'Expected RUNNER_TOOL_CACHE to be defined'); return cacheDirectory; } /** * Gets RUNNER_TEMP */ function _getTempDirectory() { const tempDirectory = process.env['RUNNER_TEMP'] || ''; assert_1.ok(tempDirectory, 'Expected RUNNER_TEMP to be defined'); return tempDirectory; } /** * Gets a global variable */ function _getGlobal(key, defaultValue) { /* eslint-disable @typescript-eslint/no-explicit-any */ const value = global[key]; /* eslint-enable @typescript-eslint/no-explicit-any */ return value !== undefined ? value : defaultValue; } //# sourceMappingURL=tool-cache.js.map /***/ }), /***/ 3532: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; result["default"] = mod; return result; }; Object.defineProperty(exports, "__esModule", ({ value: true })); const os = __importStar(__webpack_require__(2087)); /** * Commands * * Command Format: * ::name key=value,key=value::message * * Examples: * ::warning::This is the message * ::set-env name=MY_VAR::some value */ function issueCommand(command, properties, message) { const cmd = new Command(command, properties, message); process.stdout.write(cmd.toString() + os.EOL); } exports.issueCommand = issueCommand; function issue(name, message = '') { issueCommand(name, {}, message); } exports.issue = issue; const CMD_STRING = '::'; class Command { constructor(command, properties, message) { if (!command) { command = 'missing.command'; } this.command = command; this.properties = properties; this.message = message; } toString() { let cmdStr = CMD_STRING + this.command; if (this.properties && Object.keys(this.properties).length > 0) { cmdStr += ' '; let first = true; for (const key in this.properties) { if (this.properties.hasOwnProperty(key)) { const val = this.properties[key]; if (val) { if (first) { first = false; } else { cmdStr += ','; } cmdStr += `${key}=${escapeProperty(val)}`; } } } } cmdStr += `${CMD_STRING}${escapeData(this.message)}`; return cmdStr; } } /** * Sanitizes an input into a string so it can be passed into issueCommand safely * @param input input to sanitize into a string */ function toCommandValue(input) { if (input === null || input === undefined) { return ''; } else if (typeof input === 'string' || input instanceof String) { return input; } return JSON.stringify(input); } exports.toCommandValue = toCommandValue; function escapeData(s) { return toCommandValue(s) .replace(/%/g, '%25') .replace(/\r/g, '%0D') .replace(/\n/g, '%0A'); } function escapeProperty(s) { return toCommandValue(s) .replace(/%/g, '%25') .replace(/\r/g, '%0D') .replace(/\n/g, '%0A') .replace(/:/g, '%3A') .replace(/,/g, '%2C'); } //# sourceMappingURL=command.js.map /***/ }), /***/ 6705: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; result["default"] = mod; return result; }; Object.defineProperty(exports, "__esModule", ({ value: true })); const command_1 = __webpack_require__(3532); const os = __importStar(__webpack_require__(2087)); const path = __importStar(__webpack_require__(5622)); /** * The code to exit an action */ var ExitCode; (function (ExitCode) { /** * A code indicating that the action was successful */ ExitCode[ExitCode["Success"] = 0] = "Success"; /** * A code indicating that the action was a failure */ ExitCode[ExitCode["Failure"] = 1] = "Failure"; })(ExitCode = exports.ExitCode || (exports.ExitCode = {})); //----------------------------------------------------------------------- // Variables //----------------------------------------------------------------------- /** * Sets env variable for this action and future actions in the job * @param name the name of the variable to set * @param val the value of the variable. Non-string values will be converted to a string via JSON.stringify */ // eslint-disable-next-line @typescript-eslint/no-explicit-any function exportVariable(name, val) { const convertedVal = command_1.toCommandValue(val); process.env[name] = convertedVal; command_1.issueCommand('set-env', { name }, convertedVal); } exports.exportVariable = exportVariable; /** * Registers a secret which will get masked from logs * @param secret value of the secret */ function setSecret(secret) { command_1.issueCommand('add-mask', {}, secret); } exports.setSecret = setSecret; /** * Prepends inputPath to the PATH (for this action and future actions) * @param inputPath */ function addPath(inputPath) { command_1.issueCommand('add-path', {}, inputPath); process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`; } exports.addPath = addPath; /** * Gets the value of an input. The value is also trimmed. * * @param name name of the input to get * @param options optional. See InputOptions. * @returns string */ function getInput(name, options) { const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || ''; if (options && options.required && !val) { throw new Error(`Input required and not supplied: ${name}`); } return val.trim(); } exports.getInput = getInput; /** * Sets the value of an output. * * @param name name of the output to set * @param value value to store. Non-string values will be converted to a string via JSON.stringify */ // eslint-disable-next-line @typescript-eslint/no-explicit-any function setOutput(name, value) { command_1.issueCommand('set-output', { name }, value); } exports.setOutput = setOutput; /** * Enables or disables the echoing of commands into stdout for the rest of the step. * Echoing is disabled by default if ACTIONS_STEP_DEBUG is not set. * */ function setCommandEcho(enabled) { command_1.issue('echo', enabled ? 'on' : 'off'); } exports.setCommandEcho = setCommandEcho; //----------------------------------------------------------------------- // Results //----------------------------------------------------------------------- /** * Sets the action status to failed. * When the action exits it will be with an exit code of 1 * @param message add error issue message */ function setFailed(message) { process.exitCode = ExitCode.Failure; error(message); } exports.setFailed = setFailed; //----------------------------------------------------------------------- // Logging Commands //----------------------------------------------------------------------- /** * Gets whether Actions Step Debug is on or not */ function isDebug() { return process.env['RUNNER_DEBUG'] === '1'; } exports.isDebug = isDebug; /** * Writes debug message to user log * @param message debug message */ function debug(message) { command_1.issueCommand('debug', {}, message); } exports.debug = debug; /** * Adds an error issue * @param message error issue message. Errors will be converted to string via toString() */ function error(message) { command_1.issue('error', message instanceof Error ? message.toString() : message); } exports.error = error; /** * Adds an warning issue * @param message warning issue message. Errors will be converted to string via toString() */ function warning(message) { command_1.issue('warning', message instanceof Error ? message.toString() : message); } exports.warning = warning; /** * Writes info to log with console.log. * @param message info message */ function info(message) { process.stdout.write(message + os.EOL); } exports.info = info; /** * Begin an output group. * * Output until the next `groupEnd` will be foldable in this group * * @param name The name of the output group */ function startGroup(name) { command_1.issue('group', name); } exports.startGroup = startGroup; /** * End an output group. */ function endGroup() { command_1.issue('endgroup'); } exports.endGroup = endGroup; /** * Wrap an asynchronous function call in a group. * * Returns the same type as the function itself. * * @param name The name of the group * @param fn The function to wrap in the group */ function group(name, fn) { return __awaiter(this, void 0, void 0, function* () { startGroup(name); let result; try { result = yield fn(); } finally { endGroup(); } return result; }); } exports.group = group; //----------------------------------------------------------------------- // Wrapper action state //----------------------------------------------------------------------- /** * Saves state for current action, the state can only be retrieved by this action's post job execution. * * @param name name of the state to store * @param value value to store. Non-string values will be converted to a string via JSON.stringify */ // eslint-disable-next-line @typescript-eslint/no-explicit-any function saveState(name, value) { command_1.issueCommand('save-state', { name }, value); } exports.saveState = saveState; /** * Gets the value of an state set by this action's main execution. * * @param name name of the state to get * @returns string */ function getState(name) { return process.env[`STATE_${name}`] || ''; } exports.getState = getState; //# sourceMappingURL=core.js.map /***/ }), /***/ 562: /***/ ((module, exports) => { exports = module.exports = SemVer var debug /* istanbul ignore next */ if (typeof process === 'object' && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG)) { debug = function () { var args = Array.prototype.slice.call(arguments, 0) args.unshift('SEMVER') console.log.apply(console, args) } } else { debug = function () {} } // Note: this is the semver.org version of the spec that it implements // Not necessarily the package version of this code. exports.SEMVER_SPEC_VERSION = '2.0.0' var MAX_LENGTH = 256 var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */ 9007199254740991 // Max safe segment length for coercion. var MAX_SAFE_COMPONENT_LENGTH = 16 // The actual regexps go on exports.re var re = exports.re = [] var src = exports.src = [] var t = exports.tokens = {} var R = 0 function tok (n) { t[n] = R++ } // The following Regular Expressions can be used for tokenizing, // validating, and parsing SemVer version strings. // ## Numeric Identifier // A single `0`, or a non-zero digit followed by zero or more digits. tok('NUMERICIDENTIFIER') src[t.NUMERICIDENTIFIER] = '0|[1-9]\\d*' tok('NUMERICIDENTIFIERLOOSE') src[t.NUMERICIDENTIFIERLOOSE] = '[0-9]+' // ## Non-numeric Identifier // Zero or more digits, followed by a letter or hyphen, and then zero or // more letters, digits, or hyphens. tok('NONNUMERICIDENTIFIER') src[t.NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*' // ## Main Version // Three dot-separated numeric identifiers. tok('MAINVERSION') src[t.MAINVERSION] = '(' + src[t.NUMERICIDENTIFIER] + ')\\.' + '(' + src[t.NUMERICIDENTIFIER] + ')\\.' + '(' + src[t.NUMERICIDENTIFIER] + ')' tok('MAINVERSIONLOOSE') src[t.MAINVERSIONLOOSE] = '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' + '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' + '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')' // ## Pre-release Version Identifier // A numeric identifier, or a non-numeric identifier. tok('PRERELEASEIDENTIFIER') src[t.PRERELEASEIDENTIFIER] = '(?:' + src[t.NUMERICIDENTIFIER] + '|' + src[t.NONNUMERICIDENTIFIER] + ')' tok('PRERELEASEIDENTIFIERLOOSE') src[t.PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[t.NUMERICIDENTIFIERLOOSE] + '|' + src[t.NONNUMERICIDENTIFIER] + ')' // ## Pre-release Version // Hyphen, followed by one or more dot-separated pre-release version // identifiers. tok('PRERELEASE') src[t.PRERELEASE] = '(?:-(' + src[t.PRERELEASEIDENTIFIER] + '(?:\\.' + src[t.PRERELEASEIDENTIFIER] + ')*))' tok('PRERELEASELOOSE') src[t.PRERELEASELOOSE] = '(?:-?(' + src[t.PRERELEASEIDENTIFIERLOOSE] + '(?:\\.' + src[t.PRERELEASEIDENTIFIERLOOSE] + ')*))' // ## Build Metadata Identifier // Any combination of digits, letters, or hyphens. tok('BUILDIDENTIFIER') src[t.BUILDIDENTIFIER] = '[0-9A-Za-z-]+' // ## Build Metadata // Plus sign, followed by one or more period-separated build metadata // identifiers. tok('BUILD') src[t.BUILD] = '(?:\\+(' + src[t.BUILDIDENTIFIER] + '(?:\\.' + src[t.BUILDIDENTIFIER] + ')*))' // ## Full Version String // A main version, followed optionally by a pre-release version and // build metadata. // Note that the only major, minor, patch, and pre-release sections of // the version string are capturing groups. The build metadata is not a // capturing group, because it should not ever be used in version // comparison. tok('FULL') tok('FULLPLAIN') src[t.FULLPLAIN] = 'v?' + src[t.MAINVERSION] + src[t.PRERELEASE] + '?' + src[t.BUILD] + '?' src[t.FULL] = '^' + src[t.FULLPLAIN] + '$' // like full, but allows v1.2.3 and =1.2.3, which people do sometimes. // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty // common in the npm registry. tok('LOOSEPLAIN') src[t.LOOSEPLAIN] = '[v=\\s]*' + src[t.MAINVERSIONLOOSE] + src[t.PRERELEASELOOSE] + '?' + src[t.BUILD] + '?' tok('LOOSE') src[t.LOOSE] = '^' + src[t.LOOSEPLAIN] + '$' tok('GTLT') src[t.GTLT] = '((?:<|>)?=?)' // Something like "2.*" or "1.2.x". // Note that "x.x" is a valid xRange identifer, meaning "any version" // Only the first item is strictly required. tok('XRANGEIDENTIFIERLOOSE') src[t.XRANGEIDENTIFIERLOOSE] = src[t.NUMERICIDENTIFIERLOOSE] + '|x|X|\\*' tok('XRANGEIDENTIFIER') src[t.XRANGEIDENTIFIER] = src[t.NUMERICIDENTIFIER] + '|x|X|\\*' tok('XRANGEPLAIN') src[t.XRANGEPLAIN] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIER] + ')' + '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' + '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' + '(?:' + src[t.PRERELEASE] + ')?' + src[t.BUILD] + '?' + ')?)?' tok('XRANGEPLAINLOOSE') src[t.XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' + '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' + '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' + '(?:' + src[t.PRERELEASELOOSE] + ')?' + src[t.BUILD] + '?' + ')?)?' tok('XRANGE') src[t.XRANGE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAIN] + '$' tok('XRANGELOOSE') src[t.XRANGELOOSE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAINLOOSE] + '$' // Coercion. // Extract anything that could conceivably be a part of a valid semver tok('COERCE') src[t.COERCE] = '(^|[^\\d])' + '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' + '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' + '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' + '(?:$|[^\\d])' tok('COERCERTL') re[t.COERCERTL] = new RegExp(src[t.COERCE], 'g') // Tilde ranges. // Meaning is "reasonably at or greater than" tok('LONETILDE') src[t.LONETILDE] = '(?:~>?)' tok('TILDETRIM') src[t.TILDETRIM] = '(\\s*)' + src[t.LONETILDE] + '\\s+' re[t.TILDETRIM] = new RegExp(src[t.TILDETRIM], 'g') var tildeTrimReplace = '$1~' tok('TILDE') src[t.TILDE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAIN] + '$' tok('TILDELOOSE') src[t.TILDELOOSE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAINLOOSE] + '$' // Caret ranges. // Meaning is "at least and backwards compatible with" tok('LONECARET') src[t.LONECARET] = '(?:\\^)' tok('CARETTRIM') src[t.CARETTRIM] = '(\\s*)' + src[t.LONECARET] + '\\s+' re[t.CARETTRIM] = new RegExp(src[t.CARETTRIM], 'g') var caretTrimReplace = '$1^' tok('CARET') src[t.CARET] = '^' + src[t.LONECARET] + src[t.XRANGEPLAIN] + '$' tok('CARETLOOSE') src[t.CARETLOOSE] = '^' + src[t.LONECARET] + src[t.XRANGEPLAINLOOSE] + '$' // A simple gt/lt/eq thing, or just "" to indicate "any version" tok('COMPARATORLOOSE') src[t.COMPARATORLOOSE] = '^' + src[t.GTLT] + '\\s*(' + src[t.LOOSEPLAIN] + ')$|^$' tok('COMPARATOR') src[t.COMPARATOR] = '^' + src[t.GTLT] + '\\s*(' + src[t.FULLPLAIN] + ')$|^$' // An expression to strip any whitespace between the gtlt and the thing // it modifies, so that `> 1.2.3` ==> `>1.2.3` tok('COMPARATORTRIM') src[t.COMPARATORTRIM] = '(\\s*)' + src[t.GTLT] + '\\s*(' + src[t.LOOSEPLAIN] + '|' + src[t.XRANGEPLAIN] + ')' // this one has to use the /g flag re[t.COMPARATORTRIM] = new RegExp(src[t.COMPARATORTRIM], 'g') var comparatorTrimReplace = '$1$2$3' // Something like `1.2.3 - 1.2.4` // Note that these all use the loose form, because they'll be // checked against either the strict or loose comparator form // later. tok('HYPHENRANGE') src[t.HYPHENRANGE] = '^\\s*(' + src[t.XRANGEPLAIN] + ')' + '\\s+-\\s+' + '(' + src[t.XRANGEPLAIN] + ')' + '\\s*$' tok('HYPHENRANGELOOSE') src[t.HYPHENRANGELOOSE] = '^\\s*(' + src[t.XRANGEPLAINLOOSE] + ')' + '\\s+-\\s+' + '(' + src[t.XRANGEPLAINLOOSE] + ')' + '\\s*$' // Star ranges basically just allow anything at all. tok('STAR') src[t.STAR] = '(<|>)?=?\\s*\\*' // Compile to actual regexp objects. // All are flag-free, unless they were created above with a flag. for (var i = 0; i < R; i++) { debug(i, src[i]) if (!re[i]) { re[i] = new RegExp(src[i]) } } exports.parse = parse function parse (version, options) { if (!options || typeof options !== 'object') { options = { loose: !!options, includePrerelease: false } } if (version instanceof SemVer) { return version } if (typeof version !== 'string') { return null } if (version.length > MAX_LENGTH) { return null } var r = options.loose ? re[t.LOOSE] : re[t.FULL] if (!r.test(version)) { return null } try { return new SemVer(version, options) } catch (er) { return null } } exports.valid = valid function valid (version, options) { var v = parse(version, options) return v ? v.version : null } exports.clean = clean function clean (version, options) { var s = parse(version.trim().replace(/^[=v]+/, ''), options) return s ? s.version : null } exports.SemVer = SemVer function SemVer (version, options) { if (!options || typeof options !== 'object') { options = { loose: !!options, includePrerelease: false } } if (version instanceof SemVer) { if (version.loose === options.loose) { return version } else { version = version.version } } else if (typeof version !== 'string') { throw new TypeError('Invalid Version: ' + version) } if (version.length > MAX_LENGTH) { throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters') } if (!(this instanceof SemVer)) { return new SemVer(version, options) } debug('SemVer', version, options) this.options = options this.loose = !!options.loose var m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]) if (!m) { throw new TypeError('Invalid Version: ' + version) } this.raw = version // these are actually numbers this.major = +m[1] this.minor = +m[2] this.patch = +m[3] if (this.major > MAX_SAFE_INTEGER || this.major < 0) { throw new TypeError('Invalid major version') } if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) { throw new TypeError('Invalid minor version') } if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) { throw new TypeError('Invalid patch version') } // numberify any prerelease numeric ids if (!m[4]) { this.prerelease = [] } else { this.prerelease = m[4].split('.').map(function (id) { if (/^[0-9]+$/.test(id)) { var num = +id if (num >= 0 && num < MAX_SAFE_INTEGER) { return num } } return id }) } this.build = m[5] ? m[5].split('.') : [] this.format() } SemVer.prototype.format = function () { this.version = this.major + '.' + this.minor + '.' + this.patch if (this.prerelease.length) { this.version += '-' + this.prerelease.join('.') } return this.version } SemVer.prototype.toString = function () { return this.version } SemVer.prototype.compare = function (other) { debug('SemVer.compare', this.version, this.options, other) if (!(other instanceof SemVer)) { other = new SemVer(other, this.options) } return this.compareMain(other) || this.comparePre(other) } SemVer.prototype.compareMain = function (other) { if (!(other instanceof SemVer)) { other = new SemVer(other, this.options) } return compareIdentifiers(this.major, other.major) || compareIdentifiers(this.minor, other.minor) || compareIdentifiers(this.patch, other.patch) } SemVer.prototype.comparePre = function (other) { if (!(other instanceof SemVer)) { other = new SemVer(other, this.options) } // NOT having a prerelease is > having one if (this.prerelease.length && !other.prerelease.length) { return -1 } else if (!this.prerelease.length && other.prerelease.length) { return 1 } else if (!this.prerelease.length && !other.prerelease.length) { return 0 } var i = 0 do { var a = this.prerelease[i] var b = other.prerelease[i] debug('prerelease compare', i, a, b) if (a === undefined && b === undefined) { return 0 } else if (b === undefined) { return 1 } else if (a === undefined) { return -1 } else if (a === b) { continue } else { return compareIdentifiers(a, b) } } while (++i) } SemVer.prototype.compareBuild = function (other) { if (!(other instanceof SemVer)) { other = new SemVer(other, this.options) } var i = 0 do { var a = this.build[i] var b = other.build[i] debug('prerelease compare', i, a, b) if (a === undefined && b === undefined) { return 0 } else if (b === undefined) { return 1 } else if (a === undefined) { return -1 } else if (a === b) { continue } else { return compareIdentifiers(a, b) } } while (++i) } // preminor will bump the version up to the next minor release, and immediately // down to pre-release. premajor and prepatch work the same way. SemVer.prototype.inc = function (release, identifier) { switch (release) { case 'premajor': this.prerelease.length = 0 this.patch = 0 this.minor = 0 this.major++ this.inc('pre', identifier) break case 'preminor': this.prerelease.length = 0 this.patch = 0 this.minor++ this.inc('pre', identifier) break case 'prepatch': // If this is already a prerelease, it will bump to the next version // drop any prereleases that might already exist, since they are not // relevant at this point. this.prerelease.length = 0 this.inc('patch', identifier) this.inc('pre', identifier) break // If the input is a non-prerelease version, this acts the same as // prepatch. case 'prerelease': if (this.prerelease.length === 0) { this.inc('patch', identifier) } this.inc('pre', identifier) break case 'major': // If this is a pre-major version, bump up to the same major version. // Otherwise increment major. // 1.0.0-5 bumps to 1.0.0 // 1.1.0 bumps to 2.0.0 if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) { this.major++ } this.minor = 0 this.patch = 0 this.prerelease = [] break case 'minor': // If this is a pre-minor version, bump up to the same minor version. // Otherwise increment minor. // 1.2.0-5 bumps to 1.2.0 // 1.2.1 bumps to 1.3.0 if (this.patch !== 0 || this.prerelease.length === 0) { this.minor++ } this.patch = 0 this.prerelease = [] break case 'patch': // If this is not a pre-release version, it will increment the patch. // If it is a pre-release it will bump up to the same patch version. // 1.2.0-5 patches to 1.2.0 // 1.2.0 patches to 1.2.1 if (this.prerelease.length === 0) { this.patch++ } this.prerelease = [] break // This probably shouldn't be used publicly. // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction. case 'pre': if (this.prerelease.length === 0) { this.prerelease = [0] } else { var i = this.prerelease.length while (--i >= 0) { if (typeof this.prerelease[i] === 'number') { this.prerelease[i]++ i = -2 } } if (i === -1) { // didn't increment anything this.prerelease.push(0) } } if (identifier) { // 1.2.0-beta.1 bumps to 1.2.0-beta.2, // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0 if (this.prerelease[0] === identifier) { if (isNaN(this.prerelease[1])) { this.prerelease = [identifier, 0] } } else { this.prerelease = [identifier, 0] } } break default: throw new Error('invalid increment argument: ' + release) } this.format() this.raw = this.version return this } exports.inc = inc function inc (version, release, loose, identifier) { if (typeof (loose) === 'string') { identifier = loose loose = undefined } try { return new SemVer(version, loose).inc(release, identifier).version } catch (er) { return null } } exports.diff = diff function diff (version1, version2) { if (eq(version1, version2)) { return null } else { var v1 = parse(version1) var v2 = parse(version2) var prefix = '' if (v1.prerelease.length || v2.prerelease.length) { prefix = 'pre' var defaultResult = 'prerelease' } for (var key in v1) { if (key === 'major' || key === 'minor' || key === 'patch') { if (v1[key] !== v2[key]) { return prefix + key } } } return defaultResult // may be undefined } } exports.compareIdentifiers = compareIdentifiers var numeric = /^[0-9]+$/ function compareIdentifiers (a, b) { var anum = numeric.test(a) var bnum = numeric.test(b) if (anum && bnum) { a = +a b = +b } return a === b ? 0 : (anum && !bnum) ? -1 : (bnum && !anum) ? 1 : a < b ? -1 : 1 } exports.rcompareIdentifiers = rcompareIdentifiers function rcompareIdentifiers (a, b) { return compareIdentifiers(b, a) } exports.major = major function major (a, loose) { return new SemVer(a, loose).major } exports.minor = minor function minor (a, loose) { return new SemVer(a, loose).minor } exports.patch = patch function patch (a, loose) { return new SemVer(a, loose).patch } exports.compare = compare function compare (a, b, loose) { return new SemVer(a, loose).compare(new SemVer(b, loose)) } exports.compareLoose = compareLoose function compareLoose (a, b) { return compare(a, b, true) } exports.compareBuild = compareBuild function compareBuild (a, b, loose) { var versionA = new SemVer(a, loose) var versionB = new SemVer(b, loose) return versionA.compare(versionB) || versionA.compareBuild(versionB) } exports.rcompare = rcompare function rcompare (a, b, loose) { return compare(b, a, loose) } exports.sort = sort function sort (list, loose) { return list.sort(function (a, b) { return exports.compareBuild(a, b, loose) }) } exports.rsort = rsort function rsort (list, loose) { return list.sort(function (a, b) { return exports.compareBuild(b, a, loose) }) } exports.gt = gt function gt (a, b, loose) { return compare(a, b, loose) > 0 } exports.lt = lt function lt (a, b, loose) { return compare(a, b, loose) < 0 } exports.eq = eq function eq (a, b, loose) { return compare(a, b, loose) === 0 } exports.neq = neq function neq (a, b, loose) { return compare(a, b, loose) !== 0 } exports.gte = gte function gte (a, b, loose) { return compare(a, b, loose) >= 0 } exports.lte = lte function lte (a, b, loose) { return compare(a, b, loose) <= 0 } exports.cmp = cmp function cmp (a, op, b, loose) { switch (op) { case '===': if (typeof a === 'object') a = a.version if (typeof b === 'object') b = b.version return a === b case '!==': if (typeof a === 'object') a = a.version if (typeof b === 'object') b = b.version return a !== b case '': case '=': case '==': return eq(a, b, loose) case '!=': return neq(a, b, loose) case '>': return gt(a, b, loose) case '>=': return gte(a, b, loose) case '<': return lt(a, b, loose) case '<=': return lte(a, b, loose) default: throw new TypeError('Invalid operator: ' + op) } } exports.Comparator = Comparator function Comparator (comp, options) { if (!options || typeof options !== 'object') { options = { loose: !!options, includePrerelease: false } } if (comp instanceof Comparator) { if (comp.loose === !!options.loose) { return comp } else { comp = comp.value } } if (!(this instanceof Comparator)) { return new Comparator(comp, options) } debug('comparator', comp, options) this.options = options this.loose = !!options.loose this.parse(comp) if (this.semver === ANY) { this.value = '' } else { this.value = this.operator + this.semver.version } debug('comp', this) } var ANY = {} Comparator.prototype.parse = function (comp) { var r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR] var m = comp.match(r) if (!m) { throw new TypeError('Invalid comparator: ' + comp) } this.operator = m[1] !== undefined ? m[1] : '' if (this.operator === '=') { this.operator = '' } // if it literally is just '>' or '' then allow anything. if (!m[2]) { this.semver = ANY } else { this.semver = new SemVer(m[2], this.options.loose) } } Comparator.prototype.toString = function () { return this.value } Comparator.prototype.test = function (version) { debug('Comparator.test', version, this.options.loose) if (this.semver === ANY || version === ANY) { return true } if (typeof version === 'string') { try { version = new SemVer(version, this.options) } catch (er) { return false } } return cmp(version, this.operator, this.semver, this.options) } Comparator.prototype.intersects = function (comp, options) { if (!(comp instanceof Comparator)) { throw new TypeError('a Comparator is required') } if (!options || typeof options !== 'object') { options = { loose: !!options, includePrerelease: false } } var rangeTmp if (this.operator === '') { if (this.value === '') { return true } rangeTmp = new Range(comp.value, options) return satisfies(this.value, rangeTmp, options) } else if (comp.operator === '') { if (comp.value === '') { return true } rangeTmp = new Range(this.value, options) return satisfies(comp.semver, rangeTmp, options) } var sameDirectionIncreasing = (this.operator === '>=' || this.operator === '>') && (comp.operator === '>=' || comp.operator === '>') var sameDirectionDecreasing = (this.operator === '<=' || this.operator === '<') && (comp.operator === '<=' || comp.operator === '<') var sameSemVer = this.semver.version === comp.semver.version var differentDirectionsInclusive = (this.operator === '>=' || this.operator === '<=') && (comp.operator === '>=' || comp.operator === '<=') var oppositeDirectionsLessThan = cmp(this.semver, '<', comp.semver, options) && ((this.operator === '>=' || this.operator === '>') && (comp.operator === '<=' || comp.operator === '<')) var oppositeDirectionsGreaterThan = cmp(this.semver, '>', comp.semver, options) && ((this.operator === '<=' || this.operator === '<') && (comp.operator === '>=' || comp.operator === '>')) return sameDirectionIncreasing || sameDirectionDecreasing || (sameSemVer && differentDirectionsInclusive) || oppositeDirectionsLessThan || oppositeDirectionsGreaterThan } exports.Range = Range function Range (range, options) { if (!options || typeof options !== 'object') { options = { loose: !!options, includePrerelease: false } } if (range instanceof Range) { if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) { return range } else { return new Range(range.raw, options) } } if (range instanceof Comparator) { return new Range(range.value, options) } if (!(this instanceof Range)) { return new Range(range, options) } this.options = options this.loose = !!options.loose this.includePrerelease = !!options.includePrerelease // First, split based on boolean or || this.raw = range this.set = range.split(/\s*\|\|\s*/).map(function (range) { return this.parseRange(range.trim()) }, this).filter(function (c) { // throw out any that are not relevant for whatever reason return c.length }) if (!this.set.length) { throw new TypeError('Invalid SemVer Range: ' + range) } this.format() } Range.prototype.format = function () { this.range = this.set.map(function (comps) { return comps.join(' ').trim() }).join('||').trim() return this.range } Range.prototype.toString = function () { return this.range } Range.prototype.parseRange = function (range) { var loose = this.options.loose range = range.trim() // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4` var hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE] range = range.replace(hr, hyphenReplace) debug('hyphen replace', range) // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5` range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace) debug('comparator trim', range, re[t.COMPARATORTRIM]) // `~ 1.2.3` => `~1.2.3` range = range.replace(re[t.TILDETRIM], tildeTrimReplace) // `^ 1.2.3` => `^1.2.3` range = range.replace(re[t.CARETTRIM], caretTrimReplace) // normalize spaces range = range.split(/\s+/).join(' ') // At this point, the range is completely trimmed and // ready to be split into comparators. var compRe = loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR] var set = range.split(' ').map(function (comp) { return parseComparator(comp, this.options) }, this).join(' ').split(/\s+/) if (this.options.loose) { // in loose mode, throw out any that are not valid comparators set = set.filter(function (comp) { return !!comp.match(compRe) }) } set = set.map(function (comp) { return new Comparator(comp, this.options) }, this) return set } Range.prototype.intersects = function (range, options) { if (!(range instanceof Range)) { throw new TypeError('a Range is required') } return this.set.some(function (thisComparators) { return ( isSatisfiable(thisComparators, options) && range.set.some(function (rangeComparators) { return ( isSatisfiable(rangeComparators, options) && thisComparators.every(function (thisComparator) { return rangeComparators.every(function (rangeComparator) { return thisComparator.intersects(rangeComparator, options) }) }) ) }) ) }) } // take a set of comparators and determine whether there // exists a version which can satisfy it function isSatisfiable (comparators, options) { var result = true var remainingComparators = comparators.slice() var testComparator = remainingComparators.pop() while (result && remainingComparators.length) { result = remainingComparators.every(function (otherComparator) { return testComparator.intersects(otherComparator, options) }) testComparator = remainingComparators.pop() } return result } // Mostly just for testing and legacy API reasons exports.toComparators = toComparators function toComparators (range, options) { return new Range(range, options).set.map(function (comp) { return comp.map(function (c) { return c.value }).join(' ').trim().split(' ') }) } // comprised of xranges, tildes, stars, and gtlt's at this point. // already replaced the hyphen ranges // turn into a set of JUST comparators. function parseComparator (comp, options) { debug('comp', comp, options) comp = replaceCarets(comp, options) debug('caret', comp) comp = replaceTildes(comp, options) debug('tildes', comp) comp = replaceXRanges(comp, options) debug('xrange', comp) comp = replaceStars(comp, options) debug('stars', comp) return comp } function isX (id) { return !id || id.toLowerCase() === 'x' || id === '*' } // ~, ~> --> * (any, kinda silly) // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0 // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0 // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0 // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0 // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0 function replaceTildes (comp, options) { return comp.trim().split(/\s+/).map(function (comp) { return replaceTilde(comp, options) }).join(' ') } function replaceTilde (comp, options) { var r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE] return comp.replace(r, function (_, M, m, p, pr) { debug('tilde', comp, _, M, m, p, pr) var ret if (isX(M)) { ret = '' } else if (isX(m)) { ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0' } else if (isX(p)) { // ~1.2 == >=1.2.0 <1.3.0 ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0' } else if (pr) { debug('replaceTilde pr', pr) ret = '>=' + M + '.' + m + '.' + p + '-' + pr + ' <' + M + '.' + (+m + 1) + '.0' } else { // ~1.2.3 == >=1.2.3 <1.3.0 ret = '>=' + M + '.' + m + '.' + p + ' <' + M + '.' + (+m + 1) + '.0' } debug('tilde return', ret) return ret }) } // ^ --> * (any, kinda silly) // ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0 // ^2.0, ^2.0.x --> >=2.0.0 <3.0.0 // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0 // ^1.2.3 --> >=1.2.3 <2.0.0 // ^1.2.0 --> >=1.2.0 <2.0.0 function replaceCarets (comp, options) { return comp.trim().split(/\s+/).map(function (comp) { return replaceCaret(comp, options) }).join(' ') } function replaceCaret (comp, options) { debug('caret', comp, options) var r = options.loose ? re[t.CARETLOOSE] : re[t.CARET] return comp.replace(r, function (_, M, m, p, pr) { debug('caret', comp, _, M, m, p, pr) var ret if (isX(M)) { ret = '' } else if (isX(m)) { ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0' } else if (isX(p)) { if (M === '0') { ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0' } else { ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0' } } else if (pr) { debug('replaceCaret pr', pr) if (M === '0') { if (m === '0') { ret = '>=' + M + '.' + m + '.' + p + '-' + pr + ' <' + M + '.' + m + '.' + (+p + 1) } else { ret = '>=' + M + '.' + m + '.' + p + '-' + pr + ' <' + M + '.' + (+m + 1) + '.0' } } else { ret = '>=' + M + '.' + m + '.' + p + '-' + pr + ' <' + (+M + 1) + '.0.0' } } else { debug('no pr') if (M === '0') { if (m === '0') { ret = '>=' + M + '.' + m + '.' + p + ' <' + M + '.' + m + '.' + (+p + 1) } else { ret = '>=' + M + '.' + m + '.' + p + ' <' + M + '.' + (+m + 1) + '.0' } } else { ret = '>=' + M + '.' + m + '.' + p + ' <' + (+M + 1) + '.0.0' } } debug('caret return', ret) return ret }) } function replaceXRanges (comp, options) { debug('replaceXRanges', comp, options) return comp.split(/\s+/).map(function (comp) { return replaceXRange(comp, options) }).join(' ') } function replaceXRange (comp, options) { comp = comp.trim() var r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE] return comp.replace(r, function (ret, gtlt, M, m, p, pr) { debug('xRange', comp, ret, gtlt, M, m, p, pr) var xM = isX(M) var xm = xM || isX(m) var xp = xm || isX(p) var anyX = xp if (gtlt === '=' && anyX) { gtlt = '' } // if we're including prereleases in the match, then we need // to fix this to -0, the lowest possible prerelease value pr = options.includePrerelease ? '-0' : '' if (xM) { if (gtlt === '>' || gtlt === '<') { // nothing is allowed ret = '<0.0.0-0' } else { // nothing is forbidden ret = '*' } } else if (gtlt && anyX) { // we know patch is an x, because we have any x at all. // replace X with 0 if (xm) { m = 0 } p = 0 if (gtlt === '>') { // >1 => >=2.0.0 // >1.2 => >=1.3.0 // >1.2.3 => >= 1.2.4 gtlt = '>=' if (xm) { M = +M + 1 m = 0 p = 0 } else { m = +m + 1 p = 0 } } else if (gtlt === '<=') { // <=0.7.x is actually <0.8.0, since any 0.7.x should // pass. Similarly, <=7.x is actually <8.0.0, etc. gtlt = '<' if (xm) { M = +M + 1 } else { m = +m + 1 } } ret = gtlt + M + '.' + m + '.' + p + pr } else if (xm) { ret = '>=' + M + '.0.0' + pr + ' <' + (+M + 1) + '.0.0' + pr } else if (xp) { ret = '>=' + M + '.' + m + '.0' + pr + ' <' + M + '.' + (+m + 1) + '.0' + pr } debug('xRange return', ret) return ret }) } // Because * is AND-ed with everything else in the comparator, // and '' means "any version", just remove the *s entirely. function replaceStars (comp, options) { debug('replaceStars', comp, options) // Looseness is ignored here. star is always as loose as it gets! return comp.trim().replace(re[t.STAR], '') } // This function is passed to string.replace(re[t.HYPHENRANGE]) // M, m, patch, prerelease, build // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5 // 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do // 1.2 - 3.4 => >=1.2.0 <3.5.0 function hyphenReplace ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr, tb) { if (isX(fM)) { from = '' } else if (isX(fm)) { from = '>=' + fM + '.0.0' } else if (isX(fp)) { from = '>=' + fM + '.' + fm + '.0' } else { from = '>=' + from } if (isX(tM)) { to = '' } else if (isX(tm)) { to = '<' + (+tM + 1) + '.0.0' } else if (isX(tp)) { to = '<' + tM + '.' + (+tm + 1) + '.0' } else if (tpr) { to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr } else { to = '<=' + to } return (from + ' ' + to).trim() } // if ANY of the sets match ALL of its comparators, then pass Range.prototype.test = function (version) { if (!version) { return false } if (typeof version === 'string') { try { version = new SemVer(version, this.options) } catch (er) { return false } } for (var i = 0; i < this.set.length; i++) { if (testSet(this.set[i], version, this.options)) { return true } } return false } function testSet (set, version, options) { for (var i = 0; i < set.length; i++) { if (!set[i].test(version)) { return false } } if (version.prerelease.length && !options.includePrerelease) { // Find the set of versions that are allowed to have prereleases // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0 // That should allow `1.2.3-pr.2` to pass. // However, `1.2.4-alpha.notready` should NOT be allowed, // even though it's within the range set by the comparators. for (i = 0; i < set.length; i++) { debug(set[i].semver) if (set[i].semver === ANY) { continue } if (set[i].semver.prerelease.length > 0) { var allowed = set[i].semver if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) { return true } } } // Version has a -pre, but it's not one of the ones we like. return false } return true } exports.satisfies = satisfies function satisfies (version, range, options) { try { range = new Range(range, options) } catch (er) { return false } return range.test(version) } exports.maxSatisfying = maxSatisfying function maxSatisfying (versions, range, options) { var max = null var maxSV = null try { var rangeObj = new Range(range, options) } catch (er) { return null } versions.forEach(function (v) { if (rangeObj.test(v)) { // satisfies(v, range, options) if (!max || maxSV.compare(v) === -1) { // compare(max, v, true) max = v maxSV = new SemVer(max, options) } } }) return max } exports.minSatisfying = minSatisfying function minSatisfying (versions, range, options) { var min = null var minSV = null try { var rangeObj = new Range(range, options) } catch (er) { return null } versions.forEach(function (v) { if (rangeObj.test(v)) { // satisfies(v, range, options) if (!min || minSV.compare(v) === 1) { // compare(min, v, true) min = v minSV = new SemVer(min, options) } } }) return min } exports.minVersion = minVersion function minVersion (range, loose) { range = new Range(range, loose) var minver = new SemVer('0.0.0') if (range.test(minver)) { return minver } minver = new SemVer('0.0.0-0') if (range.test(minver)) { return minver } minver = null for (var i = 0; i < range.set.length; ++i) { var comparators = range.set[i] comparators.forEach(function (comparator) { // Clone to avoid manipulating the comparator's semver object. var compver = new SemVer(comparator.semver.version) switch (comparator.operator) { case '>': if (compver.prerelease.length === 0) { compver.patch++ } else { compver.prerelease.push(0) } compver.raw = compver.format() /* fallthrough */ case '': case '>=': if (!minver || gt(minver, compver)) { minver = compver } break case '<': case '<=': /* Ignore maximum versions */ break /* istanbul ignore next */ default: throw new Error('Unexpected operation: ' + comparator.operator) } }) } if (minver && range.test(minver)) { return minver } return null } exports.validRange = validRange function validRange (range, options) { try { // Return '*' instead of '' so that truthiness works. // This will throw if it's invalid anyway return new Range(range, options).range || '*' } catch (er) { return null } } // Determine if version is less than all the versions possible in the range exports.ltr = ltr function ltr (version, range, options) { return outside(version, range, '<', options) } // Determine if version is greater than all the versions possible in the range. exports.gtr = gtr function gtr (version, range, options) { return outside(version, range, '>', options) } exports.outside = outside function outside (version, range, hilo, options) { version = new SemVer(version, options) range = new Range(range, options) var gtfn, ltefn, ltfn, comp, ecomp switch (hilo) { case '>': gtfn = gt ltefn = lte ltfn = lt comp = '>' ecomp = '>=' break case '<': gtfn = lt ltefn = gte ltfn = gt comp = '<' ecomp = '<=' break default: throw new TypeError('Must provide a hilo val of "<" or ">"') } // If it satisifes the range it is not outside if (satisfies(version, range, options)) { return false } // From now on, variable terms are as if we're in "gtr" mode. // but note that everything is flipped for the "ltr" function. for (var i = 0; i < range.set.length; ++i) { var comparators = range.set[i] var high = null var low = null comparators.forEach(function (comparator) { if (comparator.semver === ANY) { comparator = new Comparator('>=0.0.0') } high = high || comparator low = low || comparator if (gtfn(comparator.semver, high.semver, options)) { high = comparator } else if (ltfn(comparator.semver, low.semver, options)) { low = comparator } }) // If the edge version comparator has a operator then our version // isn't outside it if (high.operator === comp || high.operator === ecomp) { return false } // If the lowest version comparator has an operator and our version // is less than it then it isn't higher than the range if ((!low.operator || low.operator === comp) && ltefn(version, low.semver)) { return false } else if (low.operator === ecomp && ltfn(version, low.semver)) { return false } } return true } exports.prerelease = prerelease function prerelease (version, options) { var parsed = parse(version, options) return (parsed && parsed.prerelease.length) ? parsed.prerelease : null } exports.intersects = intersects function intersects (r1, r2, options) { r1 = new Range(r1, options) r2 = new Range(r2, options) return r1.intersects(r2) } exports.coerce = coerce function coerce (version, options) { if (version instanceof SemVer) { return version } if (typeof version === 'number') { version = String(version) } if (typeof version !== 'string') { return null } options = options || {} var match = null if (!options.rtl) { match = version.match(re[t.COERCE]) } else { // Find the right-most coercible string that does not share // a terminus with a more left-ward coercible string. // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4' // // Walk through the string checking with a /g regexp // Manually set the index so as to pick up overlapping matches. // Stop when we get a match that ends at the string end, since no // coercible string can be more right-ward without the same terminus. var next while ((next = re[t.COERCERTL].exec(version)) && (!match || match.index + match[0].length !== version.length) ) { if (!match || next.index + next[0].length !== match.index + match[0].length) { match = next } re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length } // leave it in a clean state re[t.COERCERTL].lastIndex = -1 } if (match === null) { return null } return parse(match[2] + '.' + (match[3] || '0') + '.' + (match[4] || '0'), options) } /***/ }), /***/ 7701: /***/ ((module) => { /** * 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[i] = (i + 0x100).toString(16).substr(1); } function bytesToUuid(buf, offset) { var i = offset || 0; var bth = byteToHex; // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4 return ([ bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], '-', bth[buf[i++]], bth[buf[i++]], '-', bth[buf[i++]], bth[buf[i++]], '-', bth[buf[i++]], bth[buf[i++]], '-', bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], bth[buf[i++]] ]).join(''); } module.exports = bytesToUuid; /***/ }), /***/ 7269: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // Unique ID creation requires a high quality random # generator. In node.js // this is pretty straight-forward - we use the crypto API. var crypto = __webpack_require__(6417); module.exports = function nodeRNG() { return crypto.randomBytes(16); }; /***/ }), /***/ 7468: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var rng = __webpack_require__(7269); var bytesToUuid = __webpack_require__(7701); function v4(options, buf, offset) { var i = buf && offset || 0; if (typeof(options) == 'string') { buf = options === 'binary' ? new Array(16) : null; options = null; } 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) { for (var ii = 0; ii < 16; ++ii) { buf[i + ii] = rnds[ii]; } } return buf || bytesToUuid(rnds); } module.exports = v4; /***/ }), /***/ 334: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); async function auth(token) { const tokenType = token.split(/\./).length === 3 ? "app" : /^v\d+\./.test(token) ? "installation" : "oauth"; return { type: "token", token: token, tokenType }; } /** * Prefix token for usage in the Authorization header * * @param token OAuth token or JSON Web Token */ function withAuthorizationPrefix(token) { if (token.split(/\./).length === 3) { return `bearer ${token}`; } return `token ${token}`; } async function hook(token, request, route, parameters) { const endpoint = request.endpoint.merge(route, parameters); endpoint.headers.authorization = withAuthorizationPrefix(token); return request(endpoint); } const createTokenAuth = function createTokenAuth(token) { if (!token) { throw new Error("[@octokit/auth-token] No token passed to createTokenAuth"); } if (typeof token !== "string") { throw new Error("[@octokit/auth-token] Token passed to createTokenAuth is not a string"); } token = token.replace(/^(token|bearer) +/i, ""); return Object.assign(auth.bind(null, token), { hook: hook.bind(null, token) }); }; exports.createTokenAuth = createTokenAuth; //# sourceMappingURL=index.js.map /***/ }), /***/ 6762: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); var universalUserAgent = __webpack_require__(5030); var beforeAfterHook = __webpack_require__(3682); var request = __webpack_require__(6234); var graphql = __webpack_require__(8467); var authToken = __webpack_require__(334); function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } function _objectSpread2(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } const VERSION = "3.1.2"; class Octokit { constructor(options = {}) { const hook = new beforeAfterHook.Collection(); const requestDefaults = { baseUrl: request.request.endpoint.DEFAULTS.baseUrl, headers: {}, request: Object.assign({}, options.request, { hook: hook.bind(null, "request") }), mediaType: { previews: [], format: "" } }; // prepend default user agent with `options.userAgent` if set requestDefaults.headers["user-agent"] = [options.userAgent, `octokit-core.js/${VERSION} ${universalUserAgent.getUserAgent()}`].filter(Boolean).join(" "); if (options.baseUrl) { requestDefaults.baseUrl = options.baseUrl; } if (options.previews) { requestDefaults.mediaType.previews = options.previews; } if (options.timeZone) { requestDefaults.headers["time-zone"] = options.timeZone; } this.request = request.request.defaults(requestDefaults); this.graphql = graphql.withCustomRequest(this.request).defaults(_objectSpread2(_objectSpread2({}, requestDefaults), {}, { baseUrl: requestDefaults.baseUrl.replace(/\/api\/v3$/, "/api") })); this.log = Object.assign({ debug: () => {}, info: () => {}, warn: console.warn.bind(console), error: console.error.bind(console) }, options.log); this.hook = hook; // (1) If neither `options.authStrategy` nor `options.auth` are set, the `octokit` instance // is unauthenticated. The `this.auth()` method is a no-op and no request hook is registred. // (2) If only `options.auth` is set, use the default token authentication strategy. // (3) If `options.authStrategy` is set then use it and pass in `options.auth`. Always pass own request as many strategies accept a custom request instance. // TODO: type `options.auth` based on `options.authStrategy`. if (!options.authStrategy) { if (!options.auth) { // (1) this.auth = async () => ({ type: "unauthenticated" }); } else { // (2) const auth = authToken.createTokenAuth(options.auth); // @ts-ignore ¯\_(ツ)_/¯ hook.wrap("request", auth.hook); this.auth = auth; } } else { const auth = options.authStrategy(Object.assign({ request: this.request }, options.auth)); // @ts-ignore ¯\_(ツ)_/¯ hook.wrap("request", auth.hook); this.auth = auth; } // apply plugins // https://stackoverflow.com/a/16345172 const classConstructor = this.constructor; classConstructor.plugins.forEach(plugin => { Object.assign(this, plugin(this, options)); }); } static defaults(defaults) { const OctokitWithDefaults = class extends this { constructor(...args) { const options = args[0] || {}; if (typeof defaults === "function") { super(defaults(options)); return; } super(Object.assign({}, defaults, options, options.userAgent && defaults.userAgent ? { userAgent: `${options.userAgent} ${defaults.userAgent}` } : null)); } }; return OctokitWithDefaults; } /** * Attach a plugin (or many) to your Octokit instance. * * @example * const API = Octokit.plugin(plugin1, plugin2, plugin3, ...) */ static plugin(...newPlugins) { var _a; const currentPlugins = this.plugins; const NewOctokit = (_a = class extends this {}, _a.plugins = currentPlugins.concat(newPlugins.filter(plugin => !currentPlugins.includes(plugin))), _a); return NewOctokit; } } Octokit.VERSION = VERSION; Octokit.plugins = []; exports.Octokit = Octokit; //# sourceMappingURL=index.js.map /***/ }), /***/ 9440: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); var isPlainObject = __webpack_require__(558); var universalUserAgent = __webpack_require__(5030); function lowercaseKeys(object) { if (!object) { return {}; } return Object.keys(object).reduce((newObj, key) => { newObj[key.toLowerCase()] = object[key]; return newObj; }, {}); } function mergeDeep(defaults, options) { const result = Object.assign({}, defaults); Object.keys(options).forEach(key => { if (isPlainObject.isPlainObject(options[key])) { if (!(key in defaults)) Object.assign(result, { [key]: options[key] });else result[key] = mergeDeep(defaults[key], options[key]); } else { Object.assign(result, { [key]: options[key] }); } }); return result; } function merge(defaults, route, options) { if (typeof route === "string") { let [method, url] = route.split(" "); options = Object.assign(url ? { method, url } : { url: method }, options); } else { options = Object.assign({}, route); } // lowercase header names before merging with defaults to avoid duplicates options.headers = lowercaseKeys(options.headers); const mergedOptions = mergeDeep(defaults || {}, options); // mediaType.previews arrays are merged, instead of overwritten if (defaults && defaults.mediaType.previews.length) { mergedOptions.mediaType.previews = defaults.mediaType.previews.filter(preview => !mergedOptions.mediaType.previews.includes(preview)).concat(mergedOptions.mediaType.previews); } mergedOptions.mediaType.previews = mergedOptions.mediaType.previews.map(preview => preview.replace(/-preview/, "")); return mergedOptions; } function addQueryParameters(url, parameters) { const separator = /\?/.test(url) ? "&" : "?"; const names = Object.keys(parameters); if (names.length === 0) { return url; } return url + separator + names.map(name => { if (name === "q") { return "q=" + parameters.q.split("+").map(encodeURIComponent).join("+"); } return `${name}=${encodeURIComponent(parameters[name])}`; }).join("&"); } const urlVariableRegex = /\{[^}]+\}/g; function removeNonChars(variableName) { return variableName.replace(/^\W+|\W+$/g, "").split(/,/); } function extractUrlVariableNames(url) { const matches = url.match(urlVariableRegex); if (!matches) { return []; } return matches.map(removeNonChars).reduce((a, b) => a.concat(b), []); } function omit(object, keysToOmit) { return Object.keys(object).filter(option => !keysToOmit.includes(option)).reduce((obj, key) => { obj[key] = object[key]; return obj; }, {}); } // Based on https://github.com/bramstein/url-template, licensed under BSD // TODO: create separate package. // // Copyright (c) 2012-2014, Bram Stein // All rights reserved. // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO // EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, // EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /* istanbul ignore file */ function encodeReserved(str) { return str.split(/(%[0-9A-Fa-f]{2})/g).map(function (part) { if (!/%[0-9A-Fa-f]/.test(part)) { part = encodeURI(part).replace(/%5B/g, "[").replace(/%5D/g, "]"); } return part; }).join(""); } function encodeUnreserved(str) { return encodeURIComponent(str).replace(/[!'()*]/g, function (c) { return "%" + c.charCodeAt(0).toString(16).toUpperCase(); }); } function encodeValue(operator, value, key) { value = operator === "+" || operator === "#" ? encodeReserved(value) : encodeUnreserved(value); if (key) { return encodeUnreserved(key) + "=" + value; } else { return value; } } function isDefined(value) { return value !== undefined && value !== null; } function isKeyOperator(operator) { return operator === ";" || operator === "&" || operator === "?"; } function getValues(context, operator, key, modifier) { var value = context[key], result = []; if (isDefined(value) && value !== "") { if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") { value = value.toString(); if (modifier && modifier !== "*") { value = value.substring(0, parseInt(modifier, 10)); } result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : "")); } else { if (modifier === "*") { if (Array.isArray(value)) { value.filter(isDefined).forEach(function (value) { result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : "")); }); } else { Object.keys(value).forEach(function (k) { if (isDefined(value[k])) { result.push(encodeValue(operator, value[k], k)); } }); } } else { const tmp = []; if (Array.isArray(value)) { value.filter(isDefined).forEach(function (value) { tmp.push(encodeValue(operator, value)); }); } else { Object.keys(value).forEach(function (k) { if (isDefined(value[k])) { tmp.push(encodeUnreserved(k)); tmp.push(encodeValue(operator, value[k].toString())); } }); } if (isKeyOperator(operator)) { result.push(encodeUnreserved(key) + "=" + tmp.join(",")); } else if (tmp.length !== 0) { result.push(tmp.join(",")); } } } } else { if (operator === ";") { if (isDefined(value)) { result.push(encodeUnreserved(key)); } } else if (value === "" && (operator === "&" || operator === "?")) { result.push(encodeUnreserved(key) + "="); } else if (value === "") { result.push(""); } } return result; } function parseUrl(template) { return { expand: expand.bind(null, template) }; } function expand(template, context) { var operators = ["+", "#", ".", "/", ";", "?", "&"]; return template.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g, function (_, expression, literal) { if (expression) { let operator = ""; const values = []; if (operators.indexOf(expression.charAt(0)) !== -1) { operator = expression.charAt(0); expression = expression.substr(1); } expression.split(/,/g).forEach(function (variable) { var tmp = /([^:\*]*)(?::(\d+)|(\*))?/.exec(variable); values.push(getValues(context, operator, tmp[1], tmp[2] || tmp[3])); }); if (operator && operator !== "+") { var separator = ","; if (operator === "?") { separator = "&"; } else if (operator !== "#") { separator = operator; } return (values.length !== 0 ? operator : "") + values.join(separator); } else { return values.join(","); } } else { return encodeReserved(literal); } }); } function parse(options) { // https://fetch.spec.whatwg.org/#methods let method = options.method.toUpperCase(); // replace :varname with {varname} to make it RFC 6570 compatible let url = (options.url || "/").replace(/:([a-z]\w+)/g, "{+$1}"); let headers = Object.assign({}, options.headers); let body; let parameters = omit(options, ["method", "baseUrl", "url", "headers", "request", "mediaType"]); // extract variable names from URL to calculate remaining variables later const urlVariableNames = extractUrlVariableNames(url); url = parseUrl(url).expand(parameters); if (!/^http/.test(url)) { url = options.baseUrl + url; } const omittedParameters = Object.keys(options).filter(option => urlVariableNames.includes(option)).concat("baseUrl"); const remainingParameters = omit(parameters, omittedParameters); const isBinaryRequest = /application\/octet-stream/i.test(headers.accept); if (!isBinaryRequest) { if (options.mediaType.format) { // e.g. application/vnd.github.v3+json => application/vnd.github.v3.raw headers.accept = headers.accept.split(/,/).map(preview => preview.replace(/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/, `application/vnd$1$2.${options.mediaType.format}`)).join(","); } if (options.mediaType.previews.length) { const previewsFromAcceptHeader = headers.accept.match(/[\w-]+(?=-preview)/g) || []; headers.accept = previewsFromAcceptHeader.concat(options.mediaType.previews).map(preview => { const format = options.mediaType.format ? `.${options.mediaType.format}` : "+json"; return `application/vnd.github.${preview}-preview${format}`; }).join(","); } } // for GET/HEAD requests, set URL query parameters from remaining parameters // for PATCH/POST/PUT/DELETE requests, set request body from remaining parameters if (["GET", "HEAD"].includes(method)) { url = addQueryParameters(url, remainingParameters); } else { if ("data" in remainingParameters) { body = remainingParameters.data; } else { if (Object.keys(remainingParameters).length) { body = remainingParameters; } else { headers["content-length"] = 0; } } } // default content-type for JSON if body is set if (!headers["content-type"] && typeof body !== "undefined") { headers["content-type"] = "application/json; charset=utf-8"; } // GitHub expects 'content-length: 0' header for PUT/PATCH requests without body. // fetch does not allow to set `content-length` header, but we can set body to an empty string if (["PATCH", "PUT"].includes(method) && typeof body === "undefined") { body = ""; } // Only return body/request keys if present return Object.assign({ method, url, headers }, typeof body !== "undefined" ? { body } : null, options.request ? { request: options.request } : null); } function endpointWithDefaults(defaults, route, options) { return parse(merge(defaults, route, options)); } function withDefaults(oldDefaults, newDefaults) { const DEFAULTS = merge(oldDefaults, newDefaults); const endpoint = endpointWithDefaults.bind(null, DEFAULTS); return Object.assign(endpoint, { DEFAULTS, defaults: withDefaults.bind(null, DEFAULTS), merge: merge.bind(null, DEFAULTS), parse }); } const VERSION = "6.0.6"; const userAgent = `octokit-endpoint.js/${VERSION} ${universalUserAgent.getUserAgent()}`; // DEFAULTS has all properties set that EndpointOptions has, except url. // So we use RequestParameters and add method as additional required property. const DEFAULTS = { method: "GET", baseUrl: "https://api.github.com", headers: { accept: "application/vnd.github.v3+json", "user-agent": userAgent }, mediaType: { format: "", previews: [] } }; const endpoint = withDefaults(null, DEFAULTS); exports.endpoint = endpoint; //# sourceMappingURL=index.js.map /***/ }), /***/ 558: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); /*! * is-plain-object * * Copyright (c) 2014-2017, Jon Schlinkert. * Released under the MIT License. */ function isObject(o) { return Object.prototype.toString.call(o) === '[object Object]'; } function isPlainObject(o) { var ctor,prot; if (isObject(o) === false) return false; // If has modified constructor ctor = o.constructor; if (ctor === undefined) return true; // If has modified prototype prot = ctor.prototype; if (isObject(prot) === false) return false; // If constructor does not have an Object-specific method if (prot.hasOwnProperty('isPrototypeOf') === false) { return false; } // Most likely a plain Object return true; } exports.isPlainObject = isPlainObject; /***/ }), /***/ 8467: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); var request = __webpack_require__(6234); var universalUserAgent = __webpack_require__(5030); const VERSION = "4.5.6"; class GraphqlError extends Error { constructor(request, response) { const message = response.data.errors[0].message; super(message); Object.assign(this, response.data); Object.assign(this, { headers: response.headers }); this.name = "GraphqlError"; this.request = request; // Maintains proper stack trace (only available on V8) /* istanbul ignore next */ if (Error.captureStackTrace) { Error.captureStackTrace(this, this.constructor); } } } const NON_VARIABLE_OPTIONS = ["method", "baseUrl", "url", "headers", "request", "query", "mediaType"]; const GHES_V3_SUFFIX_REGEX = /\/api\/v3\/?$/; function graphql(request, query, options) { if (typeof query === "string" && options && "query" in options) { return Promise.reject(new Error(`[@octokit/graphql] "query" cannot be used as variable name`)); } const parsedOptions = typeof query === "string" ? Object.assign({ query }, options) : query; const requestOptions = Object.keys(parsedOptions).reduce((result, key) => { if (NON_VARIABLE_OPTIONS.includes(key)) { result[key] = parsedOptions[key]; return result; } if (!result.variables) { result.variables = {}; } result.variables[key] = parsedOptions[key]; return result; }, {}); // workaround for GitHub Enterprise baseUrl set with /api/v3 suffix // https://github.com/octokit/auth-app.js/issues/111#issuecomment-657610451 const baseUrl = parsedOptions.baseUrl || request.endpoint.DEFAULTS.baseUrl; if (GHES_V3_SUFFIX_REGEX.test(baseUrl)) { requestOptions.url = baseUrl.replace(GHES_V3_SUFFIX_REGEX, "/api/graphql"); } return request(requestOptions).then(response => { if (response.data.errors) { const headers = {}; for (const key of Object.keys(response.headers)) { headers[key] = response.headers[key]; } throw new GraphqlError(requestOptions, { headers, data: response.data }); } return response.data.data; }); } function withDefaults(request$1, newDefaults) { const newRequest = request$1.defaults(newDefaults); const newApi = (query, options) => { return graphql(newRequest, query, options); }; return Object.assign(newApi, { defaults: withDefaults.bind(null, newRequest), endpoint: request.request.endpoint }); } const graphql$1 = withDefaults(request.request, { headers: { "user-agent": `octokit-graphql.js/${VERSION} ${universalUserAgent.getUserAgent()}` }, method: "POST", url: "/graphql" }); function withCustomRequest(customRequest) { return withDefaults(customRequest, { method: "POST", url: "/graphql" }); } exports.graphql = graphql$1; exports.withCustomRequest = withCustomRequest; //# sourceMappingURL=index.js.map /***/ }), /***/ 4193: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const VERSION = "2.4.0"; /** * Some “list” response that can be paginated have a different response structure * * They have a `total_count` key in the response (search also has `incomplete_results`, * /installation/repositories also has `repository_selection`), as well as a key with * the list of the items which name varies from endpoint to endpoint. * * Octokit normalizes these responses so that paginated results are always returned following * the same structure. One challenge is that if the list response has only one page, no Link * header is provided, so this header alone is not sufficient to check wether a response is * paginated or not. * * We check if a "total_count" key is present in the response data, but also make sure that * a "url" property is not, as the "Get the combined status for a specific ref" endpoint would * otherwise match: https://developer.github.com/v3/repos/statuses/#get-the-combined-status-for-a-specific-ref */ function normalizePaginatedListResponse(response) { const responseNeedsNormalization = "total_count" in response.data && !("url" in response.data); if (!responseNeedsNormalization) return response; // keep the additional properties intact as there is currently no other way // to retrieve the same information. const incompleteResults = response.data.incomplete_results; const repositorySelection = response.data.repository_selection; const totalCount = response.data.total_count; delete response.data.incomplete_results; delete response.data.repository_selection; delete response.data.total_count; const namespaceKey = Object.keys(response.data)[0]; const data = response.data[namespaceKey]; response.data = data; if (typeof incompleteResults !== "undefined") { response.data.incomplete_results = incompleteResults; } if (typeof repositorySelection !== "undefined") { response.data.repository_selection = repositorySelection; } response.data.total_count = totalCount; return response; } function iterator(octokit, route, parameters) { const options = typeof route === "function" ? route.endpoint(parameters) : octokit.request.endpoint(route, parameters); const requestMethod = typeof route === "function" ? route : octokit.request; const method = options.method; const headers = options.headers; let url = options.url; return { [Symbol.asyncIterator]: () => ({ next() { if (!url) { return Promise.resolve({ done: true }); } return requestMethod({ method, url, headers }).then(normalizePaginatedListResponse).then(response => { // `response.headers.link` format: // '; rel="next", ; rel="last"' // sets `url` to undefined if "next" URL is not present or `link` header is not set url = ((response.headers.link || "").match(/<([^>]+)>;\s*rel="next"/) || [])[1]; return { value: response }; }); } }) }; } function paginate(octokit, route, parameters, mapFn) { if (typeof parameters === "function") { mapFn = parameters; parameters = undefined; } return gather(octokit, [], iterator(octokit, route, parameters)[Symbol.asyncIterator](), mapFn); } function gather(octokit, results, iterator, mapFn) { return iterator.next().then(result => { if (result.done) { return results; } let earlyExit = false; function done() { earlyExit = true; } results = results.concat(mapFn ? mapFn(result.value, done) : result.value.data); if (earlyExit) { return results; } return gather(octokit, results, iterator, mapFn); }); } /** * @param octokit Octokit instance * @param options Options passed to Octokit constructor */ function paginateRest(octokit) { return { paginate: Object.assign(paginate.bind(null, octokit), { iterator: iterator.bind(null, octokit) }) }; } paginateRest.VERSION = VERSION; exports.paginateRest = paginateRest; //# sourceMappingURL=index.js.map /***/ }), /***/ 3044: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const Endpoints = { actions: { addSelectedRepoToOrgSecret: ["PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}"], cancelWorkflowRun: ["POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel"], createOrUpdateOrgSecret: ["PUT /orgs/{org}/actions/secrets/{secret_name}"], createOrUpdateRepoSecret: ["PUT /repos/{owner}/{repo}/actions/secrets/{secret_name}"], createRegistrationTokenForOrg: ["POST /orgs/{org}/actions/runners/registration-token"], createRegistrationTokenForRepo: ["POST /repos/{owner}/{repo}/actions/runners/registration-token"], createRemoveTokenForOrg: ["POST /orgs/{org}/actions/runners/remove-token"], createRemoveTokenForRepo: ["POST /repos/{owner}/{repo}/actions/runners/remove-token"], createWorkflowDispatch: ["POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches"], deleteArtifact: ["DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"], deleteOrgSecret: ["DELETE /orgs/{org}/actions/secrets/{secret_name}"], deleteRepoSecret: ["DELETE /repos/{owner}/{repo}/actions/secrets/{secret_name}"], deleteSelfHostedRunnerFromOrg: ["DELETE /orgs/{org}/actions/runners/{runner_id}"], deleteSelfHostedRunnerFromRepo: ["DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}"], deleteWorkflowRun: ["DELETE /repos/{owner}/{repo}/actions/runs/{run_id}"], deleteWorkflowRunLogs: ["DELETE /repos/{owner}/{repo}/actions/runs/{run_id}/logs"], downloadArtifact: ["GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}"], downloadJobLogsForWorkflowRun: ["GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs"], downloadWorkflowRunLogs: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}/logs"], getArtifact: ["GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"], getJobForWorkflowRun: ["GET /repos/{owner}/{repo}/actions/jobs/{job_id}"], getOrgPublicKey: ["GET /orgs/{org}/actions/secrets/public-key"], getOrgSecret: ["GET /orgs/{org}/actions/secrets/{secret_name}"], getRepoPublicKey: ["GET /repos/{owner}/{repo}/actions/secrets/public-key"], getRepoSecret: ["GET /repos/{owner}/{repo}/actions/secrets/{secret_name}"], getSelfHostedRunnerForOrg: ["GET /orgs/{org}/actions/runners/{runner_id}"], getSelfHostedRunnerForRepo: ["GET /repos/{owner}/{repo}/actions/runners/{runner_id}"], getWorkflow: ["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}"], getWorkflowRun: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}"], getWorkflowRunUsage: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}/timing"], getWorkflowUsage: ["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing"], listArtifactsForRepo: ["GET /repos/{owner}/{repo}/actions/artifacts"], listJobsForWorkflowRun: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs"], listOrgSecrets: ["GET /orgs/{org}/actions/secrets"], listRepoSecrets: ["GET /repos/{owner}/{repo}/actions/secrets"], listRepoWorkflows: ["GET /repos/{owner}/{repo}/actions/workflows"], listRunnerApplicationsForOrg: ["GET /orgs/{org}/actions/runners/downloads"], listRunnerApplicationsForRepo: ["GET /repos/{owner}/{repo}/actions/runners/downloads"], listSelectedReposForOrgSecret: ["GET /orgs/{org}/actions/secrets/{secret_name}/repositories"], listSelfHostedRunnersForOrg: ["GET /orgs/{org}/actions/runners"], listSelfHostedRunnersForRepo: ["GET /repos/{owner}/{repo}/actions/runners"], listWorkflowRunArtifacts: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts"], listWorkflowRuns: ["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs"], listWorkflowRunsForRepo: ["GET /repos/{owner}/{repo}/actions/runs"], reRunWorkflow: ["POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun"], removeSelectedRepoFromOrgSecret: ["DELETE /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}"], setSelectedReposForOrgSecret: ["PUT /orgs/{org}/actions/secrets/{secret_name}/repositories"] }, activity: { checkRepoIsStarredByAuthenticatedUser: ["GET /user/starred/{owner}/{repo}"], deleteRepoSubscription: ["DELETE /repos/{owner}/{repo}/subscription"], deleteThreadSubscription: ["DELETE /notifications/threads/{thread_id}/subscription"], getFeeds: ["GET /feeds"], getRepoSubscription: ["GET /repos/{owner}/{repo}/subscription"], getThread: ["GET /notifications/threads/{thread_id}"], getThreadSubscriptionForAuthenticatedUser: ["GET /notifications/threads/{thread_id}/subscription"], listEventsForAuthenticatedUser: ["GET /users/{username}/events"], listNotificationsForAuthenticatedUser: ["GET /notifications"], listOrgEventsForAuthenticatedUser: ["GET /users/{username}/events/orgs/{org}"], listPublicEvents: ["GET /events"], listPublicEventsForRepoNetwork: ["GET /networks/{owner}/{repo}/events"], listPublicEventsForUser: ["GET /users/{username}/events/public"], listPublicOrgEvents: ["GET /orgs/{org}/events"], listReceivedEventsForUser: ["GET /users/{username}/received_events"], listReceivedPublicEventsForUser: ["GET /users/{username}/received_events/public"], listRepoEvents: ["GET /repos/{owner}/{repo}/events"], listRepoNotificationsForAuthenticatedUser: ["GET /repos/{owner}/{repo}/notifications"], listReposStarredByAuthenticatedUser: ["GET /user/starred"], listReposStarredByUser: ["GET /users/{username}/starred"], listReposWatchedByUser: ["GET /users/{username}/subscriptions"], listStargazersForRepo: ["GET /repos/{owner}/{repo}/stargazers"], listWatchedReposForAuthenticatedUser: ["GET /user/subscriptions"], listWatchersForRepo: ["GET /repos/{owner}/{repo}/subscribers"], markNotificationsAsRead: ["PUT /notifications"], markRepoNotificationsAsRead: ["PUT /repos/{owner}/{repo}/notifications"], markThreadAsRead: ["PATCH /notifications/threads/{thread_id}"], setRepoSubscription: ["PUT /repos/{owner}/{repo}/subscription"], setThreadSubscription: ["PUT /notifications/threads/{thread_id}/subscription"], starRepoForAuthenticatedUser: ["PUT /user/starred/{owner}/{repo}"], unstarRepoForAuthenticatedUser: ["DELETE /user/starred/{owner}/{repo}"] }, apps: { addRepoToInstallation: ["PUT /user/installations/{installation_id}/repositories/{repository_id}"], checkToken: ["POST /applications/{client_id}/token"], createContentAttachment: ["POST /content_references/{content_reference_id}/attachments", { mediaType: { previews: ["corsair"] } }], createFromManifest: ["POST /app-manifests/{code}/conversions"], createInstallationAccessToken: ["POST /app/installations/{installation_id}/access_tokens"], deleteAuthorization: ["DELETE /applications/{client_id}/grant"], deleteInstallation: ["DELETE /app/installations/{installation_id}"], deleteToken: ["DELETE /applications/{client_id}/token"], getAuthenticated: ["GET /app"], getBySlug: ["GET /apps/{app_slug}"], getInstallation: ["GET /app/installations/{installation_id}"], getOrgInstallation: ["GET /orgs/{org}/installation"], getRepoInstallation: ["GET /repos/{owner}/{repo}/installation"], getSubscriptionPlanForAccount: ["GET /marketplace_listing/accounts/{account_id}"], getSubscriptionPlanForAccountStubbed: ["GET /marketplace_listing/stubbed/accounts/{account_id}"], getUserInstallation: ["GET /users/{username}/installation"], listAccountsForPlan: ["GET /marketplace_listing/plans/{plan_id}/accounts"], listAccountsForPlanStubbed: ["GET /marketplace_listing/stubbed/plans/{plan_id}/accounts"], listInstallationReposForAuthenticatedUser: ["GET /user/installations/{installation_id}/repositories"], listInstallations: ["GET /app/installations"], listInstallationsForAuthenticatedUser: ["GET /user/installations"], listPlans: ["GET /marketplace_listing/plans"], listPlansStubbed: ["GET /marketplace_listing/stubbed/plans"], listReposAccessibleToInstallation: ["GET /installation/repositories"], listSubscriptionsForAuthenticatedUser: ["GET /user/marketplace_purchases"], listSubscriptionsForAuthenticatedUserStubbed: ["GET /user/marketplace_purchases/stubbed"], removeRepoFromInstallation: ["DELETE /user/installations/{installation_id}/repositories/{repository_id}"], resetToken: ["PATCH /applications/{client_id}/token"], revokeInstallationAccessToken: ["DELETE /installation/token"], suspendInstallation: ["PUT /app/installations/{installation_id}/suspended"], unsuspendInstallation: ["DELETE /app/installations/{installation_id}/suspended"] }, billing: { getGithubActionsBillingOrg: ["GET /orgs/{org}/settings/billing/actions"], getGithubActionsBillingUser: ["GET /users/{username}/settings/billing/actions"], getGithubPackagesBillingOrg: ["GET /orgs/{org}/settings/billing/packages"], getGithubPackagesBillingUser: ["GET /users/{username}/settings/billing/packages"], getSharedStorageBillingOrg: ["GET /orgs/{org}/settings/billing/shared-storage"], getSharedStorageBillingUser: ["GET /users/{username}/settings/billing/shared-storage"] }, checks: { create: ["POST /repos/{owner}/{repo}/check-runs", { mediaType: { previews: ["antiope"] } }], createSuite: ["POST /repos/{owner}/{repo}/check-suites", { mediaType: { previews: ["antiope"] } }], get: ["GET /repos/{owner}/{repo}/check-runs/{check_run_id}", { mediaType: { previews: ["antiope"] } }], getSuite: ["GET /repos/{owner}/{repo}/check-suites/{check_suite_id}", { mediaType: { previews: ["antiope"] } }], listAnnotations: ["GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations", { mediaType: { previews: ["antiope"] } }], listForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/check-runs", { mediaType: { previews: ["antiope"] } }], listForSuite: ["GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs", { mediaType: { previews: ["antiope"] } }], listSuitesForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/check-suites", { mediaType: { previews: ["antiope"] } }], rerequestSuite: ["POST /repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest", { mediaType: { previews: ["antiope"] } }], setSuitesPreferences: ["PATCH /repos/{owner}/{repo}/check-suites/preferences", { mediaType: { previews: ["antiope"] } }], update: ["PATCH /repos/{owner}/{repo}/check-runs/{check_run_id}", { mediaType: { previews: ["antiope"] } }] }, codeScanning: { getAlert: ["GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}", {}, { renamedParameters: { alert_id: "alert_number" } }], listAlertsForRepo: ["GET /repos/{owner}/{repo}/code-scanning/alerts"], listRecentAnalyses: ["GET /repos/{owner}/{repo}/code-scanning/analyses"], updateAlert: ["PATCH /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}"], uploadSarif: ["POST /repos/{owner}/{repo}/code-scanning/sarifs"] }, codesOfConduct: { getAllCodesOfConduct: ["GET /codes_of_conduct", { mediaType: { previews: ["scarlet-witch"] } }], getConductCode: ["GET /codes_of_conduct/{key}", { mediaType: { previews: ["scarlet-witch"] } }], getForRepo: ["GET /repos/{owner}/{repo}/community/code_of_conduct", { mediaType: { previews: ["scarlet-witch"] } }] }, emojis: { get: ["GET /emojis"] }, gists: { checkIsStarred: ["GET /gists/{gist_id}/star"], create: ["POST /gists"], createComment: ["POST /gists/{gist_id}/comments"], delete: ["DELETE /gists/{gist_id}"], deleteComment: ["DELETE /gists/{gist_id}/comments/{comment_id}"], fork: ["POST /gists/{gist_id}/forks"], get: ["GET /gists/{gist_id}"], getComment: ["GET /gists/{gist_id}/comments/{comment_id}"], getRevision: ["GET /gists/{gist_id}/{sha}"], list: ["GET /gists"], listComments: ["GET /gists/{gist_id}/comments"], listCommits: ["GET /gists/{gist_id}/commits"], listForUser: ["GET /users/{username}/gists"], listForks: ["GET /gists/{gist_id}/forks"], listPublic: ["GET /gists/public"], listStarred: ["GET /gists/starred"], star: ["PUT /gists/{gist_id}/star"], unstar: ["DELETE /gists/{gist_id}/star"], update: ["PATCH /gists/{gist_id}"], updateComment: ["PATCH /gists/{gist_id}/comments/{comment_id}"] }, git: { createBlob: ["POST /repos/{owner}/{repo}/git/blobs"], createCommit: ["POST /repos/{owner}/{repo}/git/commits"], createRef: ["POST /repos/{owner}/{repo}/git/refs"], createTag: ["POST /repos/{owner}/{repo}/git/tags"], createTree: ["POST /repos/{owner}/{repo}/git/trees"], deleteRef: ["DELETE /repos/{owner}/{repo}/git/refs/{ref}"], getBlob: ["GET /repos/{owner}/{repo}/git/blobs/{file_sha}"], getCommit: ["GET /repos/{owner}/{repo}/git/commits/{commit_sha}"], getRef: ["GET /repos/{owner}/{repo}/git/ref/{ref}"], getTag: ["GET /repos/{owner}/{repo}/git/tags/{tag_sha}"], getTree: ["GET /repos/{owner}/{repo}/git/trees/{tree_sha}"], listMatchingRefs: ["GET /repos/{owner}/{repo}/git/matching-refs/{ref}"], updateRef: ["PATCH /repos/{owner}/{repo}/git/refs/{ref}"] }, gitignore: { getAllTemplates: ["GET /gitignore/templates"], getTemplate: ["GET /gitignore/templates/{name}"] }, interactions: { getRestrictionsForOrg: ["GET /orgs/{org}/interaction-limits", { mediaType: { previews: ["sombra"] } }], getRestrictionsForRepo: ["GET /repos/{owner}/{repo}/interaction-limits", { mediaType: { previews: ["sombra"] } }], removeRestrictionsForOrg: ["DELETE /orgs/{org}/interaction-limits", { mediaType: { previews: ["sombra"] } }], removeRestrictionsForRepo: ["DELETE /repos/{owner}/{repo}/interaction-limits", { mediaType: { previews: ["sombra"] } }], setRestrictionsForOrg: ["PUT /orgs/{org}/interaction-limits", { mediaType: { previews: ["sombra"] } }], setRestrictionsForRepo: ["PUT /repos/{owner}/{repo}/interaction-limits", { mediaType: { previews: ["sombra"] } }] }, issues: { addAssignees: ["POST /repos/{owner}/{repo}/issues/{issue_number}/assignees"], addLabels: ["POST /repos/{owner}/{repo}/issues/{issue_number}/labels"], checkUserCanBeAssigned: ["GET /repos/{owner}/{repo}/assignees/{assignee}"], create: ["POST /repos/{owner}/{repo}/issues"], createComment: ["POST /repos/{owner}/{repo}/issues/{issue_number}/comments"], createLabel: ["POST /repos/{owner}/{repo}/labels"], createMilestone: ["POST /repos/{owner}/{repo}/milestones"], deleteComment: ["DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}"], deleteLabel: ["DELETE /repos/{owner}/{repo}/labels/{name}"], deleteMilestone: ["DELETE /repos/{owner}/{repo}/milestones/{milestone_number}"], get: ["GET /repos/{owner}/{repo}/issues/{issue_number}"], getComment: ["GET /repos/{owner}/{repo}/issues/comments/{comment_id}"], getEvent: ["GET /repos/{owner}/{repo}/issues/events/{event_id}"], getLabel: ["GET /repos/{owner}/{repo}/labels/{name}"], getMilestone: ["GET /repos/{owner}/{repo}/milestones/{milestone_number}"], list: ["GET /issues"], listAssignees: ["GET /repos/{owner}/{repo}/assignees"], listComments: ["GET /repos/{owner}/{repo}/issues/{issue_number}/comments"], listCommentsForRepo: ["GET /repos/{owner}/{repo}/issues/comments"], listEvents: ["GET /repos/{owner}/{repo}/issues/{issue_number}/events"], listEventsForRepo: ["GET /repos/{owner}/{repo}/issues/events"], listEventsForTimeline: ["GET /repos/{owner}/{repo}/issues/{issue_number}/timeline", { mediaType: { previews: ["mockingbird"] } }], listForAuthenticatedUser: ["GET /user/issues"], listForOrg: ["GET /orgs/{org}/issues"], listForRepo: ["GET /repos/{owner}/{repo}/issues"], listLabelsForMilestone: ["GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels"], listLabelsForRepo: ["GET /repos/{owner}/{repo}/labels"], listLabelsOnIssue: ["GET /repos/{owner}/{repo}/issues/{issue_number}/labels"], listMilestones: ["GET /repos/{owner}/{repo}/milestones"], lock: ["PUT /repos/{owner}/{repo}/issues/{issue_number}/lock"], removeAllLabels: ["DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels"], removeAssignees: ["DELETE /repos/{owner}/{repo}/issues/{issue_number}/assignees"], removeLabel: ["DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/{name}"], setLabels: ["PUT /repos/{owner}/{repo}/issues/{issue_number}/labels"], unlock: ["DELETE /repos/{owner}/{repo}/issues/{issue_number}/lock"], update: ["PATCH /repos/{owner}/{repo}/issues/{issue_number}"], updateComment: ["PATCH /repos/{owner}/{repo}/issues/comments/{comment_id}"], updateLabel: ["PATCH /repos/{owner}/{repo}/labels/{name}"], updateMilestone: ["PATCH /repos/{owner}/{repo}/milestones/{milestone_number}"] }, licenses: { get: ["GET /licenses/{license}"], getAllCommonlyUsed: ["GET /licenses"], getForRepo: ["GET /repos/{owner}/{repo}/license"] }, markdown: { render: ["POST /markdown"], renderRaw: ["POST /markdown/raw", { headers: { "content-type": "text/plain; charset=utf-8" } }] }, meta: { get: ["GET /meta"] }, migrations: { cancelImport: ["DELETE /repos/{owner}/{repo}/import"], deleteArchiveForAuthenticatedUser: ["DELETE /user/migrations/{migration_id}/archive", { mediaType: { previews: ["wyandotte"] } }], deleteArchiveForOrg: ["DELETE /orgs/{org}/migrations/{migration_id}/archive", { mediaType: { previews: ["wyandotte"] } }], downloadArchiveForOrg: ["GET /orgs/{org}/migrations/{migration_id}/archive", { mediaType: { previews: ["wyandotte"] } }], getArchiveForAuthenticatedUser: ["GET /user/migrations/{migration_id}/archive", { mediaType: { previews: ["wyandotte"] } }], getCommitAuthors: ["GET /repos/{owner}/{repo}/import/authors"], getImportStatus: ["GET /repos/{owner}/{repo}/import"], getLargeFiles: ["GET /repos/{owner}/{repo}/import/large_files"], getStatusForAuthenticatedUser: ["GET /user/migrations/{migration_id}", { mediaType: { previews: ["wyandotte"] } }], getStatusForOrg: ["GET /orgs/{org}/migrations/{migration_id}", { mediaType: { previews: ["wyandotte"] } }], listForAuthenticatedUser: ["GET /user/migrations", { mediaType: { previews: ["wyandotte"] } }], listForOrg: ["GET /orgs/{org}/migrations", { mediaType: { previews: ["wyandotte"] } }], listReposForOrg: ["GET /orgs/{org}/migrations/{migration_id}/repositories", { mediaType: { previews: ["wyandotte"] } }], listReposForUser: ["GET /user/migrations/{migration_id}/repositories", { mediaType: { previews: ["wyandotte"] } }], mapCommitAuthor: ["PATCH /repos/{owner}/{repo}/import/authors/{author_id}"], setLfsPreference: ["PATCH /repos/{owner}/{repo}/import/lfs"], startForAuthenticatedUser: ["POST /user/migrations"], startForOrg: ["POST /orgs/{org}/migrations"], startImport: ["PUT /repos/{owner}/{repo}/import"], unlockRepoForAuthenticatedUser: ["DELETE /user/migrations/{migration_id}/repos/{repo_name}/lock", { mediaType: { previews: ["wyandotte"] } }], unlockRepoForOrg: ["DELETE /orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock", { mediaType: { previews: ["wyandotte"] } }], updateImport: ["PATCH /repos/{owner}/{repo}/import"] }, orgs: { blockUser: ["PUT /orgs/{org}/blocks/{username}"], checkBlockedUser: ["GET /orgs/{org}/blocks/{username}"], checkMembershipForUser: ["GET /orgs/{org}/members/{username}"], checkPublicMembershipForUser: ["GET /orgs/{org}/public_members/{username}"], convertMemberToOutsideCollaborator: ["PUT /orgs/{org}/outside_collaborators/{username}"], createInvitation: ["POST /orgs/{org}/invitations"], createWebhook: ["POST /orgs/{org}/hooks"], deleteWebhook: ["DELETE /orgs/{org}/hooks/{hook_id}"], get: ["GET /orgs/{org}"], getMembershipForAuthenticatedUser: ["GET /user/memberships/orgs/{org}"], getMembershipForUser: ["GET /orgs/{org}/memberships/{username}"], getWebhook: ["GET /orgs/{org}/hooks/{hook_id}"], list: ["GET /organizations"], listAppInstallations: ["GET /orgs/{org}/installations"], listBlockedUsers: ["GET /orgs/{org}/blocks"], listForAuthenticatedUser: ["GET /user/orgs"], listForUser: ["GET /users/{username}/orgs"], listInvitationTeams: ["GET /orgs/{org}/invitations/{invitation_id}/teams"], listMembers: ["GET /orgs/{org}/members"], listMembershipsForAuthenticatedUser: ["GET /user/memberships/orgs"], listOutsideCollaborators: ["GET /orgs/{org}/outside_collaborators"], listPendingInvitations: ["GET /orgs/{org}/invitations"], listPublicMembers: ["GET /orgs/{org}/public_members"], listWebhooks: ["GET /orgs/{org}/hooks"], pingWebhook: ["POST /orgs/{org}/hooks/{hook_id}/pings"], removeMember: ["DELETE /orgs/{org}/members/{username}"], removeMembershipForUser: ["DELETE /orgs/{org}/memberships/{username}"], removeOutsideCollaborator: ["DELETE /orgs/{org}/outside_collaborators/{username}"], removePublicMembershipForAuthenticatedUser: ["DELETE /orgs/{org}/public_members/{username}"], setMembershipForUser: ["PUT /orgs/{org}/memberships/{username}"], setPublicMembershipForAuthenticatedUser: ["PUT /orgs/{org}/public_members/{username}"], unblockUser: ["DELETE /orgs/{org}/blocks/{username}"], update: ["PATCH /orgs/{org}"], updateMembershipForAuthenticatedUser: ["PATCH /user/memberships/orgs/{org}"], updateWebhook: ["PATCH /orgs/{org}/hooks/{hook_id}"] }, projects: { addCollaborator: ["PUT /projects/{project_id}/collaborators/{username}", { mediaType: { previews: ["inertia"] } }], createCard: ["POST /projects/columns/{column_id}/cards", { mediaType: { previews: ["inertia"] } }], createColumn: ["POST /projects/{project_id}/columns", { mediaType: { previews: ["inertia"] } }], createForAuthenticatedUser: ["POST /user/projects", { mediaType: { previews: ["inertia"] } }], createForOrg: ["POST /orgs/{org}/projects", { mediaType: { previews: ["inertia"] } }], createForRepo: ["POST /repos/{owner}/{repo}/projects", { mediaType: { previews: ["inertia"] } }], delete: ["DELETE /projects/{project_id}", { mediaType: { previews: ["inertia"] } }], deleteCard: ["DELETE /projects/columns/cards/{card_id}", { mediaType: { previews: ["inertia"] } }], deleteColumn: ["DELETE /projects/columns/{column_id}", { mediaType: { previews: ["inertia"] } }], get: ["GET /projects/{project_id}", { mediaType: { previews: ["inertia"] } }], getCard: ["GET /projects/columns/cards/{card_id}", { mediaType: { previews: ["inertia"] } }], getColumn: ["GET /projects/columns/{column_id}", { mediaType: { previews: ["inertia"] } }], getPermissionForUser: ["GET /projects/{project_id}/collaborators/{username}/permission", { mediaType: { previews: ["inertia"] } }], listCards: ["GET /projects/columns/{column_id}/cards", { mediaType: { previews: ["inertia"] } }], listCollaborators: ["GET /projects/{project_id}/collaborators", { mediaType: { previews: ["inertia"] } }], listColumns: ["GET /projects/{project_id}/columns", { mediaType: { previews: ["inertia"] } }], listForOrg: ["GET /orgs/{org}/projects", { mediaType: { previews: ["inertia"] } }], listForRepo: ["GET /repos/{owner}/{repo}/projects", { mediaType: { previews: ["inertia"] } }], listForUser: ["GET /users/{username}/projects", { mediaType: { previews: ["inertia"] } }], moveCard: ["POST /projects/columns/cards/{card_id}/moves", { mediaType: { previews: ["inertia"] } }], moveColumn: ["POST /projects/columns/{column_id}/moves", { mediaType: { previews: ["inertia"] } }], removeCollaborator: ["DELETE /projects/{project_id}/collaborators/{username}", { mediaType: { previews: ["inertia"] } }], update: ["PATCH /projects/{project_id}", { mediaType: { previews: ["inertia"] } }], updateCard: ["PATCH /projects/columns/cards/{card_id}", { mediaType: { previews: ["inertia"] } }], updateColumn: ["PATCH /projects/columns/{column_id}", { mediaType: { previews: ["inertia"] } }] }, pulls: { checkIfMerged: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/merge"], create: ["POST /repos/{owner}/{repo}/pulls"], createReplyForReviewComment: ["POST /repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies"], createReview: ["POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews"], createReviewComment: ["POST /repos/{owner}/{repo}/pulls/{pull_number}/comments"], deletePendingReview: ["DELETE /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"], deleteReviewComment: ["DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}"], dismissReview: ["PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals"], get: ["GET /repos/{owner}/{repo}/pulls/{pull_number}"], getReview: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"], getReviewComment: ["GET /repos/{owner}/{repo}/pulls/comments/{comment_id}"], list: ["GET /repos/{owner}/{repo}/pulls"], listCommentsForReview: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments"], listCommits: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/commits"], listFiles: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/files"], listRequestedReviewers: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"], listReviewComments: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/comments"], listReviewCommentsForRepo: ["GET /repos/{owner}/{repo}/pulls/comments"], listReviews: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews"], merge: ["PUT /repos/{owner}/{repo}/pulls/{pull_number}/merge"], removeRequestedReviewers: ["DELETE /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"], requestReviewers: ["POST /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"], submitReview: ["POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events"], update: ["PATCH /repos/{owner}/{repo}/pulls/{pull_number}"], updateBranch: ["PUT /repos/{owner}/{repo}/pulls/{pull_number}/update-branch", { mediaType: { previews: ["lydian"] } }], updateReview: ["PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"], updateReviewComment: ["PATCH /repos/{owner}/{repo}/pulls/comments/{comment_id}"] }, rateLimit: { get: ["GET /rate_limit"] }, reactions: { createForCommitComment: ["POST /repos/{owner}/{repo}/comments/{comment_id}/reactions", { mediaType: { previews: ["squirrel-girl"] } }], createForIssue: ["POST /repos/{owner}/{repo}/issues/{issue_number}/reactions", { mediaType: { previews: ["squirrel-girl"] } }], createForIssueComment: ["POST /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions", { mediaType: { previews: ["squirrel-girl"] } }], createForPullRequestReviewComment: ["POST /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions", { mediaType: { previews: ["squirrel-girl"] } }], createForTeamDiscussionCommentInOrg: ["POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions", { mediaType: { previews: ["squirrel-girl"] } }], createForTeamDiscussionInOrg: ["POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions", { mediaType: { previews: ["squirrel-girl"] } }], deleteForCommitComment: ["DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}", { mediaType: { previews: ["squirrel-girl"] } }], deleteForIssue: ["DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}", { mediaType: { previews: ["squirrel-girl"] } }], deleteForIssueComment: ["DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}", { mediaType: { previews: ["squirrel-girl"] } }], deleteForPullRequestComment: ["DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}", { mediaType: { previews: ["squirrel-girl"] } }], deleteForTeamDiscussion: ["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}", { mediaType: { previews: ["squirrel-girl"] } }], deleteForTeamDiscussionComment: ["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}", { mediaType: { previews: ["squirrel-girl"] } }], deleteLegacy: ["DELETE /reactions/{reaction_id}", { mediaType: { previews: ["squirrel-girl"] } }, { deprecated: "octokit.reactions.deleteLegacy() is deprecated, see https://developer.github.com/v3/reactions/#delete-a-reaction-legacy" }], listForCommitComment: ["GET /repos/{owner}/{repo}/comments/{comment_id}/reactions", { mediaType: { previews: ["squirrel-girl"] } }], listForIssue: ["GET /repos/{owner}/{repo}/issues/{issue_number}/reactions", { mediaType: { previews: ["squirrel-girl"] } }], listForIssueComment: ["GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions", { mediaType: { previews: ["squirrel-girl"] } }], listForPullRequestReviewComment: ["GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions", { mediaType: { previews: ["squirrel-girl"] } }], listForTeamDiscussionCommentInOrg: ["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions", { mediaType: { previews: ["squirrel-girl"] } }], listForTeamDiscussionInOrg: ["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions", { mediaType: { previews: ["squirrel-girl"] } }] }, repos: { acceptInvitation: ["PATCH /user/repository_invitations/{invitation_id}"], addAppAccessRestrictions: ["POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps", {}, { mapToData: "apps" }], addCollaborator: ["PUT /repos/{owner}/{repo}/collaborators/{username}"], addStatusCheckContexts: ["POST /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts", {}, { mapToData: "contexts" }], addTeamAccessRestrictions: ["POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams", {}, { mapToData: "teams" }], addUserAccessRestrictions: ["POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users", {}, { mapToData: "users" }], checkCollaborator: ["GET /repos/{owner}/{repo}/collaborators/{username}"], checkVulnerabilityAlerts: ["GET /repos/{owner}/{repo}/vulnerability-alerts", { mediaType: { previews: ["dorian"] } }], compareCommits: ["GET /repos/{owner}/{repo}/compare/{base}...{head}"], createCommitComment: ["POST /repos/{owner}/{repo}/commits/{commit_sha}/comments"], createCommitSignatureProtection: ["POST /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures", { mediaType: { previews: ["zzzax"] } }], createCommitStatus: ["POST /repos/{owner}/{repo}/statuses/{sha}"], createDeployKey: ["POST /repos/{owner}/{repo}/keys"], createDeployment: ["POST /repos/{owner}/{repo}/deployments"], createDeploymentStatus: ["POST /repos/{owner}/{repo}/deployments/{deployment_id}/statuses"], createDispatchEvent: ["POST /repos/{owner}/{repo}/dispatches"], createForAuthenticatedUser: ["POST /user/repos"], createFork: ["POST /repos/{owner}/{repo}/forks"], createInOrg: ["POST /orgs/{org}/repos"], createOrUpdateFileContents: ["PUT /repos/{owner}/{repo}/contents/{path}"], createPagesSite: ["POST /repos/{owner}/{repo}/pages", { mediaType: { previews: ["switcheroo"] } }], createRelease: ["POST /repos/{owner}/{repo}/releases"], createUsingTemplate: ["POST /repos/{template_owner}/{template_repo}/generate", { mediaType: { previews: ["baptiste"] } }], createWebhook: ["POST /repos/{owner}/{repo}/hooks"], declineInvitation: ["DELETE /user/repository_invitations/{invitation_id}"], delete: ["DELETE /repos/{owner}/{repo}"], deleteAccessRestrictions: ["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions"], deleteAdminBranchProtection: ["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"], deleteBranchProtection: ["DELETE /repos/{owner}/{repo}/branches/{branch}/protection"], deleteCommitComment: ["DELETE /repos/{owner}/{repo}/comments/{comment_id}"], deleteCommitSignatureProtection: ["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures", { mediaType: { previews: ["zzzax"] } }], deleteDeployKey: ["DELETE /repos/{owner}/{repo}/keys/{key_id}"], deleteDeployment: ["DELETE /repos/{owner}/{repo}/deployments/{deployment_id}"], deleteFile: ["DELETE /repos/{owner}/{repo}/contents/{path}"], deleteInvitation: ["DELETE /repos/{owner}/{repo}/invitations/{invitation_id}"], deletePagesSite: ["DELETE /repos/{owner}/{repo}/pages", { mediaType: { previews: ["switcheroo"] } }], deletePullRequestReviewProtection: ["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"], deleteRelease: ["DELETE /repos/{owner}/{repo}/releases/{release_id}"], deleteReleaseAsset: ["DELETE /repos/{owner}/{repo}/releases/assets/{asset_id}"], deleteWebhook: ["DELETE /repos/{owner}/{repo}/hooks/{hook_id}"], disableAutomatedSecurityFixes: ["DELETE /repos/{owner}/{repo}/automated-security-fixes", { mediaType: { previews: ["london"] } }], disableVulnerabilityAlerts: ["DELETE /repos/{owner}/{repo}/vulnerability-alerts", { mediaType: { previews: ["dorian"] } }], downloadArchive: ["GET /repos/{owner}/{repo}/{archive_format}/{ref}"], enableAutomatedSecurityFixes: ["PUT /repos/{owner}/{repo}/automated-security-fixes", { mediaType: { previews: ["london"] } }], enableVulnerabilityAlerts: ["PUT /repos/{owner}/{repo}/vulnerability-alerts", { mediaType: { previews: ["dorian"] } }], get: ["GET /repos/{owner}/{repo}"], getAccessRestrictions: ["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions"], getAdminBranchProtection: ["GET /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"], getAllStatusCheckContexts: ["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts"], getAllTopics: ["GET /repos/{owner}/{repo}/topics", { mediaType: { previews: ["mercy"] } }], getAppsWithAccessToProtectedBranch: ["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps"], getBranch: ["GET /repos/{owner}/{repo}/branches/{branch}"], getBranchProtection: ["GET /repos/{owner}/{repo}/branches/{branch}/protection"], getClones: ["GET /repos/{owner}/{repo}/traffic/clones"], getCodeFrequencyStats: ["GET /repos/{owner}/{repo}/stats/code_frequency"], getCollaboratorPermissionLevel: ["GET /repos/{owner}/{repo}/collaborators/{username}/permission"], getCombinedStatusForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/status"], getCommit: ["GET /repos/{owner}/{repo}/commits/{ref}"], getCommitActivityStats: ["GET /repos/{owner}/{repo}/stats/commit_activity"], getCommitComment: ["GET /repos/{owner}/{repo}/comments/{comment_id}"], getCommitSignatureProtection: ["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures", { mediaType: { previews: ["zzzax"] } }], getCommunityProfileMetrics: ["GET /repos/{owner}/{repo}/community/profile", { mediaType: { previews: ["black-panther"] } }], getContent: ["GET /repos/{owner}/{repo}/contents/{path}"], getContributorsStats: ["GET /repos/{owner}/{repo}/stats/contributors"], getDeployKey: ["GET /repos/{owner}/{repo}/keys/{key_id}"], getDeployment: ["GET /repos/{owner}/{repo}/deployments/{deployment_id}"], getDeploymentStatus: ["GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id}"], getLatestPagesBuild: ["GET /repos/{owner}/{repo}/pages/builds/latest"], getLatestRelease: ["GET /repos/{owner}/{repo}/releases/latest"], getPages: ["GET /repos/{owner}/{repo}/pages"], getPagesBuild: ["GET /repos/{owner}/{repo}/pages/builds/{build_id}"], getParticipationStats: ["GET /repos/{owner}/{repo}/stats/participation"], getPullRequestReviewProtection: ["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"], getPunchCardStats: ["GET /repos/{owner}/{repo}/stats/punch_card"], getReadme: ["GET /repos/{owner}/{repo}/readme"], getRelease: ["GET /repos/{owner}/{repo}/releases/{release_id}"], getReleaseAsset: ["GET /repos/{owner}/{repo}/releases/assets/{asset_id}"], getReleaseByTag: ["GET /repos/{owner}/{repo}/releases/tags/{tag}"], getStatusChecksProtection: ["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"], getTeamsWithAccessToProtectedBranch: ["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams"], getTopPaths: ["GET /repos/{owner}/{repo}/traffic/popular/paths"], getTopReferrers: ["GET /repos/{owner}/{repo}/traffic/popular/referrers"], getUsersWithAccessToProtectedBranch: ["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users"], getViews: ["GET /repos/{owner}/{repo}/traffic/views"], getWebhook: ["GET /repos/{owner}/{repo}/hooks/{hook_id}"], listBranches: ["GET /repos/{owner}/{repo}/branches"], listBranchesForHeadCommit: ["GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head", { mediaType: { previews: ["groot"] } }], listCollaborators: ["GET /repos/{owner}/{repo}/collaborators"], listCommentsForCommit: ["GET /repos/{owner}/{repo}/commits/{commit_sha}/comments"], listCommitCommentsForRepo: ["GET /repos/{owner}/{repo}/comments"], listCommitStatusesForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/statuses"], listCommits: ["GET /repos/{owner}/{repo}/commits"], listContributors: ["GET /repos/{owner}/{repo}/contributors"], listDeployKeys: ["GET /repos/{owner}/{repo}/keys"], listDeploymentStatuses: ["GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses"], listDeployments: ["GET /repos/{owner}/{repo}/deployments"], listForAuthenticatedUser: ["GET /user/repos"], listForOrg: ["GET /orgs/{org}/repos"], listForUser: ["GET /users/{username}/repos"], listForks: ["GET /repos/{owner}/{repo}/forks"], listInvitations: ["GET /repos/{owner}/{repo}/invitations"], listInvitationsForAuthenticatedUser: ["GET /user/repository_invitations"], listLanguages: ["GET /repos/{owner}/{repo}/languages"], listPagesBuilds: ["GET /repos/{owner}/{repo}/pages/builds"], listPublic: ["GET /repositories"], listPullRequestsAssociatedWithCommit: ["GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls", { mediaType: { previews: ["groot"] } }], listReleaseAssets: ["GET /repos/{owner}/{repo}/releases/{release_id}/assets"], listReleases: ["GET /repos/{owner}/{repo}/releases"], listTags: ["GET /repos/{owner}/{repo}/tags"], listTeams: ["GET /repos/{owner}/{repo}/teams"], listWebhooks: ["GET /repos/{owner}/{repo}/hooks"], merge: ["POST /repos/{owner}/{repo}/merges"], pingWebhook: ["POST /repos/{owner}/{repo}/hooks/{hook_id}/pings"], removeAppAccessRestrictions: ["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps", {}, { mapToData: "apps" }], removeCollaborator: ["DELETE /repos/{owner}/{repo}/collaborators/{username}"], removeStatusCheckContexts: ["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts", {}, { mapToData: "contexts" }], removeStatusCheckProtection: ["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"], removeTeamAccessRestrictions: ["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams", {}, { mapToData: "teams" }], removeUserAccessRestrictions: ["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users", {}, { mapToData: "users" }], replaceAllTopics: ["PUT /repos/{owner}/{repo}/topics", { mediaType: { previews: ["mercy"] } }], requestPagesBuild: ["POST /repos/{owner}/{repo}/pages/builds"], setAdminBranchProtection: ["POST /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"], setAppAccessRestrictions: ["PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps", {}, { mapToData: "apps" }], setStatusCheckContexts: ["PUT /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts", {}, { mapToData: "contexts" }], setTeamAccessRestrictions: ["PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams", {}, { mapToData: "teams" }], setUserAccessRestrictions: ["PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users", {}, { mapToData: "users" }], testPushWebhook: ["POST /repos/{owner}/{repo}/hooks/{hook_id}/tests"], transfer: ["POST /repos/{owner}/{repo}/transfer"], update: ["PATCH /repos/{owner}/{repo}"], updateBranchProtection: ["PUT /repos/{owner}/{repo}/branches/{branch}/protection"], updateCommitComment: ["PATCH /repos/{owner}/{repo}/comments/{comment_id}"], updateInformationAboutPagesSite: ["PUT /repos/{owner}/{repo}/pages"], updateInvitation: ["PATCH /repos/{owner}/{repo}/invitations/{invitation_id}"], updatePullRequestReviewProtection: ["PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"], updateRelease: ["PATCH /repos/{owner}/{repo}/releases/{release_id}"], updateReleaseAsset: ["PATCH /repos/{owner}/{repo}/releases/assets/{asset_id}"], updateStatusCheckPotection: ["PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"], updateWebhook: ["PATCH /repos/{owner}/{repo}/hooks/{hook_id}"], uploadReleaseAsset: ["POST /repos/{owner}/{repo}/releases/{release_id}/assets{?name,label}", { baseUrl: "https://uploads.github.com" }] }, search: { code: ["GET /search/code"], commits: ["GET /search/commits", { mediaType: { previews: ["cloak"] } }], issuesAndPullRequests: ["GET /search/issues"], labels: ["GET /search/labels"], repos: ["GET /search/repositories"], topics: ["GET /search/topics", { mediaType: { previews: ["mercy"] } }], users: ["GET /search/users"] }, teams: { addOrUpdateMembershipForUserInOrg: ["PUT /orgs/{org}/teams/{team_slug}/memberships/{username}"], addOrUpdateProjectPermissionsInOrg: ["PUT /orgs/{org}/teams/{team_slug}/projects/{project_id}", { mediaType: { previews: ["inertia"] } }], addOrUpdateRepoPermissionsInOrg: ["PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"], checkPermissionsForProjectInOrg: ["GET /orgs/{org}/teams/{team_slug}/projects/{project_id}", { mediaType: { previews: ["inertia"] } }], checkPermissionsForRepoInOrg: ["GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"], create: ["POST /orgs/{org}/teams"], createDiscussionCommentInOrg: ["POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments"], createDiscussionInOrg: ["POST /orgs/{org}/teams/{team_slug}/discussions"], deleteDiscussionCommentInOrg: ["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"], deleteDiscussionInOrg: ["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"], deleteInOrg: ["DELETE /orgs/{org}/teams/{team_slug}"], getByName: ["GET /orgs/{org}/teams/{team_slug}"], getDiscussionCommentInOrg: ["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"], getDiscussionInOrg: ["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"], getMembershipForUserInOrg: ["GET /orgs/{org}/teams/{team_slug}/memberships/{username}"], list: ["GET /orgs/{org}/teams"], listChildInOrg: ["GET /orgs/{org}/teams/{team_slug}/teams"], listDiscussionCommentsInOrg: ["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments"], listDiscussionsInOrg: ["GET /orgs/{org}/teams/{team_slug}/discussions"], listForAuthenticatedUser: ["GET /user/teams"], listMembersInOrg: ["GET /orgs/{org}/teams/{team_slug}/members"], listPendingInvitationsInOrg: ["GET /orgs/{org}/teams/{team_slug}/invitations"], listProjectsInOrg: ["GET /orgs/{org}/teams/{team_slug}/projects", { mediaType: { previews: ["inertia"] } }], listReposInOrg: ["GET /orgs/{org}/teams/{team_slug}/repos"], removeMembershipForUserInOrg: ["DELETE /orgs/{org}/teams/{team_slug}/memberships/{username}"], removeProjectInOrg: ["DELETE /orgs/{org}/teams/{team_slug}/projects/{project_id}"], removeRepoInOrg: ["DELETE /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"], updateDiscussionCommentInOrg: ["PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"], updateDiscussionInOrg: ["PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"], updateInOrg: ["PATCH /orgs/{org}/teams/{team_slug}"] }, users: { addEmailForAuthenticated: ["POST /user/emails"], block: ["PUT /user/blocks/{username}"], checkBlocked: ["GET /user/blocks/{username}"], checkFollowingForUser: ["GET /users/{username}/following/{target_user}"], checkPersonIsFollowedByAuthenticated: ["GET /user/following/{username}"], createGpgKeyForAuthenticated: ["POST /user/gpg_keys"], createPublicSshKeyForAuthenticated: ["POST /user/keys"], deleteEmailForAuthenticated: ["DELETE /user/emails"], deleteGpgKeyForAuthenticated: ["DELETE /user/gpg_keys/{gpg_key_id}"], deletePublicSshKeyForAuthenticated: ["DELETE /user/keys/{key_id}"], follow: ["PUT /user/following/{username}"], getAuthenticated: ["GET /user"], getByUsername: ["GET /users/{username}"], getContextForUser: ["GET /users/{username}/hovercard"], getGpgKeyForAuthenticated: ["GET /user/gpg_keys/{gpg_key_id}"], getPublicSshKeyForAuthenticated: ["GET /user/keys/{key_id}"], list: ["GET /users"], listBlockedByAuthenticated: ["GET /user/blocks"], listEmailsForAuthenticated: ["GET /user/emails"], listFollowedByAuthenticated: ["GET /user/following"], listFollowersForAuthenticatedUser: ["GET /user/followers"], listFollowersForUser: ["GET /users/{username}/followers"], listFollowingForUser: ["GET /users/{username}/following"], listGpgKeysForAuthenticated: ["GET /user/gpg_keys"], listGpgKeysForUser: ["GET /users/{username}/gpg_keys"], listPublicEmailsForAuthenticated: ["GET /user/public_emails"], listPublicKeysForUser: ["GET /users/{username}/keys"], listPublicSshKeysForAuthenticated: ["GET /user/keys"], setPrimaryEmailVisibilityForAuthenticated: ["PATCH /user/email/visibility"], unblock: ["DELETE /user/blocks/{username}"], unfollow: ["DELETE /user/following/{username}"], updateAuthenticated: ["PATCH /user"] } }; const VERSION = "4.2.0"; function endpointsToMethods(octokit, endpointsMap) { const newMethods = {}; for (const [scope, endpoints] of Object.entries(endpointsMap)) { for (const [methodName, endpoint] of Object.entries(endpoints)) { const [route, defaults, decorations] = endpoint; const [method, url] = route.split(/ /); const endpointDefaults = Object.assign({ method, url }, defaults); if (!newMethods[scope]) { newMethods[scope] = {}; } const scopeMethods = newMethods[scope]; if (decorations) { scopeMethods[methodName] = decorate(octokit, scope, methodName, endpointDefaults, decorations); continue; } scopeMethods[methodName] = octokit.request.defaults(endpointDefaults); } } return newMethods; } function decorate(octokit, scope, methodName, defaults, decorations) { const requestWithDefaults = octokit.request.defaults(defaults); /* istanbul ignore next */ function withDecorations(...args) { // @ts-ignore https://github.com/microsoft/TypeScript/issues/25488 let options = requestWithDefaults.endpoint.merge(...args); // There are currently no other decorations than `.mapToData` if (decorations.mapToData) { options = Object.assign({}, options, { data: options[decorations.mapToData], [decorations.mapToData]: undefined }); return requestWithDefaults(options); } if (decorations.renamed) { const [newScope, newMethodName] = decorations.renamed; octokit.log.warn(`octokit.${scope}.${methodName}() has been renamed to octokit.${newScope}.${newMethodName}()`); } if (decorations.deprecated) { octokit.log.warn(decorations.deprecated); } if (decorations.renamedParameters) { // @ts-ignore https://github.com/microsoft/TypeScript/issues/25488 const options = requestWithDefaults.endpoint.merge(...args); for (const [name, alias] of Object.entries(decorations.renamedParameters)) { if (name in options) { octokit.log.warn(`"${name}" parameter is deprecated for "octokit.${scope}.${methodName}()". Use "${alias}" instead`); if (!(alias in options)) { options[alias] = options[name]; } delete options[name]; } } return requestWithDefaults(options); } // @ts-ignore https://github.com/microsoft/TypeScript/issues/25488 return requestWithDefaults(...args); } return Object.assign(withDecorations, requestWithDefaults); } /** * This plugin is a 1:1 copy of internal @octokit/rest plugins. The primary * goal is to rebuild @octokit/rest on top of @octokit/core. Once that is * done, we will remove the registerEndpoints methods and return the methods * directly as with the other plugins. At that point we will also remove the * legacy workarounds and deprecations. * * See the plan at * https://github.com/octokit/plugin-rest-endpoint-methods.js/pull/1 */ function restEndpointMethods(octokit) { return endpointsToMethods(octokit, Endpoints); } restEndpointMethods.VERSION = VERSION; exports.restEndpointMethods = restEndpointMethods; //# sourceMappingURL=index.js.map /***/ }), /***/ 6298: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } var Bottleneck = _interopDefault(__webpack_require__(1174)); // @ts-ignore async function errorRequest(octokit, state, error, options) { if (!error.request || !error.request.request) { // address https://github.com/octokit/plugin-retry.js/issues/8 throw error; } // retry all >= 400 && not doNotRetry if (error.status >= 400 && !state.doNotRetry.includes(error.status)) { const retries = options.request.retries != null ? options.request.retries : state.retries; const retryAfter = Math.pow((options.request.retryCount || 0) + 1, 2); throw octokit.retry.retryRequest(error, retries, retryAfter); } // Maybe eventually there will be more cases here throw error; } // @ts-ignore async function wrapRequest(state, request, options) { const limiter = new Bottleneck(); // @ts-ignore limiter.on("failed", function (error, info) { const maxRetries = ~~error.request.request.retries; const after = ~~error.request.request.retryAfter; options.request.retryCount = info.retryCount + 1; if (maxRetries > info.retryCount) { // Returning a number instructs the limiter to retry // the request after that number of milliseconds have passed return after * state.retryAfterBaseValue; } }); return limiter.schedule(request, options); } const VERSION = "3.0.3"; function retry(octokit, octokitOptions = {}) { const state = Object.assign({ enabled: true, retryAfterBaseValue: 1000, doNotRetry: [400, 401, 403, 404, 422], retries: 3 }, octokitOptions.retry); octokit.retry = { retryRequest: (error, retries, retryAfter) => { error.request.request = Object.assign({}, error.request.request, { retries: retries, retryAfter: retryAfter }); return error; } }; if (!state.enabled) { return; } octokit.hook.error("request", errorRequest.bind(null, octokit, state)); octokit.hook.wrap("request", wrapRequest.bind(null, state)); } retry.VERSION = VERSION; exports.VERSION = VERSION; exports.retry = retry; //# sourceMappingURL=index.js.map /***/ }), /***/ 537: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } var deprecation = __webpack_require__(8932); var once = _interopDefault(__webpack_require__(1223)); const logOnce = once(deprecation => console.warn(deprecation)); /** * Error with extra properties to help with debugging */ class RequestError extends Error { constructor(message, statusCode, options) { super(message); // Maintains proper stack trace (only available on V8) /* istanbul ignore next */ if (Error.captureStackTrace) { Error.captureStackTrace(this, this.constructor); } this.name = "HttpError"; this.status = statusCode; Object.defineProperty(this, "code", { get() { logOnce(new deprecation.Deprecation("[@octokit/request-error] `error.code` is deprecated, use `error.status`.")); return statusCode; } }); this.headers = options.headers || {}; // redact request credentials without mutating original request options const requestCopy = Object.assign({}, options.request); if (options.request.headers.authorization) { requestCopy.headers = Object.assign({}, options.request.headers, { authorization: options.request.headers.authorization.replace(/ .*$/, " [REDACTED]") }); } requestCopy.url = requestCopy.url // client_id & client_secret can be passed as URL query parameters to increase rate limit // see https://developer.github.com/v3/#increasing-the-unauthenticated-rate-limit-for-oauth-applications .replace(/\bclient_secret=\w+/g, "client_secret=[REDACTED]") // OAuth tokens can be passed as URL query parameters, although it is not recommended // see https://developer.github.com/v3/#oauth2-token-sent-in-a-header .replace(/\baccess_token=\w+/g, "access_token=[REDACTED]"); this.request = requestCopy; } } exports.RequestError = RequestError; //# sourceMappingURL=index.js.map /***/ }), /***/ 6234: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } var endpoint = __webpack_require__(9440); var universalUserAgent = __webpack_require__(5030); var isPlainObject = __webpack_require__(9062); var nodeFetch = _interopDefault(__webpack_require__(467)); var requestError = __webpack_require__(537); const VERSION = "5.4.9"; function getBufferResponse(response) { return response.arrayBuffer(); } function fetchWrapper(requestOptions) { if (isPlainObject.isPlainObject(requestOptions.body) || Array.isArray(requestOptions.body)) { requestOptions.body = JSON.stringify(requestOptions.body); } let headers = {}; let status; let url; const fetch = requestOptions.request && requestOptions.request.fetch || nodeFetch; return fetch(requestOptions.url, Object.assign({ method: requestOptions.method, body: requestOptions.body, headers: requestOptions.headers, redirect: requestOptions.redirect }, requestOptions.request)).then(response => { url = response.url; status = response.status; for (const keyAndValue of response.headers) { headers[keyAndValue[0]] = keyAndValue[1]; } if (status === 204 || status === 205) { return; } // GitHub API returns 200 for HEAD requests if (requestOptions.method === "HEAD") { if (status < 400) { return; } throw new requestError.RequestError(response.statusText, status, { headers, request: requestOptions }); } if (status === 304) { throw new requestError.RequestError("Not modified", status, { headers, request: requestOptions }); } if (status >= 400) { return response.text().then(message => { const error = new requestError.RequestError(message, status, { headers, request: requestOptions }); try { let responseBody = JSON.parse(error.message); Object.assign(error, responseBody); let errors = responseBody.errors; // Assumption `errors` would always be in Array format error.message = error.message + ": " + errors.map(JSON.stringify).join(", "); } catch (e) {// ignore, see octokit/rest.js#684 } throw error; }); } const contentType = response.headers.get("content-type"); if (/application\/json/.test(contentType)) { return response.json(); } if (!contentType || /^text\/|charset=utf-8$/.test(contentType)) { return response.text(); } return getBufferResponse(response); }).then(data => { return { status, url, headers, data }; }).catch(error => { if (error instanceof requestError.RequestError) { throw error; } throw new requestError.RequestError(error.message, 500, { headers, request: requestOptions }); }); } function withDefaults(oldEndpoint, newDefaults) { const endpoint = oldEndpoint.defaults(newDefaults); const newApi = function (route, parameters) { const endpointOptions = endpoint.merge(route, parameters); if (!endpointOptions.request || !endpointOptions.request.hook) { return fetchWrapper(endpoint.parse(endpointOptions)); } const request = (route, parameters) => { return fetchWrapper(endpoint.parse(endpoint.merge(route, parameters))); }; Object.assign(request, { endpoint, defaults: withDefaults.bind(null, endpoint) }); return endpointOptions.request.hook(request, endpointOptions); }; return Object.assign(newApi, { endpoint, defaults: withDefaults.bind(null, endpoint) }); } const request = withDefaults(endpoint.endpoint, { headers: { "user-agent": `octokit-request.js/${VERSION} ${universalUserAgent.getUserAgent()}` } }); exports.request = request; //# sourceMappingURL=index.js.map /***/ }), /***/ 9062: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); /*! * is-plain-object * * Copyright (c) 2014-2017, Jon Schlinkert. * Released under the MIT License. */ function isObject(o) { return Object.prototype.toString.call(o) === '[object Object]'; } function isPlainObject(o) { var ctor,prot; if (isObject(o) === false) return false; // If has modified constructor ctor = o.constructor; if (ctor === undefined) return true; // If has modified prototype prot = ctor.prototype; if (isObject(prot) === false) return false; // If constructor does not have an Object-specific method if (prot.hasOwnProperty('isPrototypeOf') === false) { return false; } // Most likely a plain Object return true; } exports.isPlainObject = isPlainObject; /***/ }), /***/ 3682: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var register = __webpack_require__(4670) var addHook = __webpack_require__(5549) var removeHook = __webpack_require__(6819) // bind with array of arguments: https://stackoverflow.com/a/21792913 var bind = Function.bind var bindable = bind.bind(bind) function bindApi (hook, state, name) { var removeHookRef = bindable(removeHook, null).apply(null, name ? [state, name] : [state]) hook.api = { remove: removeHookRef } hook.remove = removeHookRef ;['before', 'error', 'after', 'wrap'].forEach(function (kind) { var args = name ? [state, kind, name] : [state, kind] hook[kind] = hook.api[kind] = bindable(addHook, null).apply(null, args) }) } function HookSingular () { var singularHookName = 'h' var singularHookState = { registry: {} } var singularHook = register.bind(null, singularHookState, singularHookName) bindApi(singularHook, singularHookState, singularHookName) return singularHook } function HookCollection () { var state = { registry: {} } var hook = register.bind(null, state) bindApi(hook, state) return hook } var collectionHookDeprecationMessageDisplayed = false function Hook () { if (!collectionHookDeprecationMessageDisplayed) { console.warn('[before-after-hook]: "Hook()" repurposing warning, use "Hook.Collection()". Read more: https://git.io/upgrade-before-after-hook-to-1.4') collectionHookDeprecationMessageDisplayed = true } return HookCollection() } Hook.Singular = HookSingular.bind() Hook.Collection = HookCollection.bind() module.exports = Hook // expose constructors as a named property for TypeScript module.exports.Hook = Hook module.exports.Singular = Hook.Singular module.exports.Collection = Hook.Collection /***/ }), /***/ 5549: /***/ ((module) => { module.exports = addHook function addHook (state, kind, name, hook) { var orig = hook if (!state.registry[name]) { state.registry[name] = [] } if (kind === 'before') { hook = function (method, options) { return Promise.resolve() .then(orig.bind(null, options)) .then(method.bind(null, options)) } } if (kind === 'after') { hook = function (method, options) { var result return Promise.resolve() .then(method.bind(null, options)) .then(function (result_) { result = result_ return orig(result, options) }) .then(function () { return result }) } } if (kind === 'error') { hook = function (method, options) { return Promise.resolve() .then(method.bind(null, options)) .catch(function (error) { return orig(error, options) }) } } state.registry[name].push({ hook: hook, orig: orig }) } /***/ }), /***/ 4670: /***/ ((module) => { module.exports = register function register (state, name, method, options) { if (typeof method !== 'function') { throw new Error('method for before hook must be a function') } if (!options) { options = {} } if (Array.isArray(name)) { return name.reverse().reduce(function (callback, name) { return register.bind(null, state, name, callback, options) }, method)() } return Promise.resolve() .then(function () { if (!state.registry[name]) { return method(options) } return (state.registry[name]).reduce(function (method, registered) { return registered.hook.bind(null, method, options) }, method)() }) } /***/ }), /***/ 6819: /***/ ((module) => { module.exports = removeHook function removeHook (state, name, method) { if (!state.registry[name]) { return } var index = state.registry[name] .map(function (registered) { return registered.orig }) .indexOf(method) if (index === -1) { return } state.registry[name].splice(index, 1) } /***/ }), /***/ 1174: /***/ (function(module) { /** * This file contains the Bottleneck library (MIT), compiled to ES2017, and without Clustering support. * https://github.com/SGrondin/bottleneck */ (function (global, factory) { true ? module.exports = factory() : 0; }(this, (function () { 'use strict'; var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; function getCjsExportFromNamespace (n) { return n && n['default'] || n; } var load = function(received, defaults, onto = {}) { var k, ref, v; for (k in defaults) { v = defaults[k]; onto[k] = (ref = received[k]) != null ? ref : v; } return onto; }; var overwrite = function(received, defaults, onto = {}) { var k, v; for (k in received) { v = received[k]; if (defaults[k] !== void 0) { onto[k] = v; } } return onto; }; var parser = { load: load, overwrite: overwrite }; var DLList; DLList = class DLList { constructor(incr, decr) { this.incr = incr; this.decr = decr; this._first = null; this._last = null; this.length = 0; } push(value) { var node; this.length++; if (typeof this.incr === "function") { this.incr(); } node = { value, prev: this._last, next: null }; if (this._last != null) { this._last.next = node; this._last = node; } else { this._first = this._last = node; } return void 0; } shift() { var value; if (this._first == null) { return; } else { this.length--; if (typeof this.decr === "function") { this.decr(); } } value = this._first.value; if ((this._first = this._first.next) != null) { this._first.prev = null; } else { this._last = null; } return value; } first() { if (this._first != null) { return this._first.value; } } getArray() { var node, ref, results; node = this._first; results = []; while (node != null) { results.push((ref = node, node = node.next, ref.value)); } return results; } forEachShift(cb) { var node; node = this.shift(); while (node != null) { (cb(node), node = this.shift()); } return void 0; } debug() { var node, ref, ref1, ref2, results; node = this._first; results = []; while (node != null) { results.push((ref = node, node = node.next, { value: ref.value, prev: (ref1 = ref.prev) != null ? ref1.value : void 0, next: (ref2 = ref.next) != null ? ref2.value : void 0 })); } return results; } }; var DLList_1 = DLList; var Events; Events = class Events { constructor(instance) { this.instance = instance; this._events = {}; if ((this.instance.on != null) || (this.instance.once != null) || (this.instance.removeAllListeners != null)) { throw new Error("An Emitter already exists for this object"); } this.instance.on = (name, cb) => { return this._addListener(name, "many", cb); }; this.instance.once = (name, cb) => { return this._addListener(name, "once", cb); }; this.instance.removeAllListeners = (name = null) => { if (name != null) { return delete this._events[name]; } else { return this._events = {}; } }; } _addListener(name, status, cb) { var base; if ((base = this._events)[name] == null) { base[name] = []; } this._events[name].push({cb, status}); return this.instance; } listenerCount(name) { if (this._events[name] != null) { return this._events[name].length; } else { return 0; } } async trigger(name, ...args) { var e, promises; try { if (name !== "debug") { this.trigger("debug", `Event triggered: ${name}`, args); } if (this._events[name] == null) { return; } this._events[name] = this._events[name].filter(function(listener) { return listener.status !== "none"; }); promises = this._events[name].map(async(listener) => { var e, returned; if (listener.status === "none") { return; } if (listener.status === "once") { listener.status = "none"; } try { returned = typeof listener.cb === "function" ? listener.cb(...args) : void 0; if (typeof (returned != null ? returned.then : void 0) === "function") { return (await returned); } else { return returned; } } catch (error) { e = error; { this.trigger("error", e); } return null; } }); return ((await Promise.all(promises))).find(function(x) { return x != null; }); } catch (error) { e = error; { this.trigger("error", e); } return null; } } }; var Events_1 = Events; var DLList$1, Events$1, Queues; DLList$1 = DLList_1; Events$1 = Events_1; Queues = class Queues { constructor(num_priorities) { var i; this.Events = new Events$1(this); this._length = 0; this._lists = (function() { var j, ref, results; results = []; for (i = j = 1, ref = num_priorities; (1 <= ref ? j <= ref : j >= ref); i = 1 <= ref ? ++j : --j) { results.push(new DLList$1((() => { return this.incr(); }), (() => { return this.decr(); }))); } return results; }).call(this); } incr() { if (this._length++ === 0) { return this.Events.trigger("leftzero"); } } decr() { if (--this._length === 0) { return this.Events.trigger("zero"); } } push(job) { return this._lists[job.options.priority].push(job); } queued(priority) { if (priority != null) { return this._lists[priority].length; } else { return this._length; } } shiftAll(fn) { return this._lists.forEach(function(list) { return list.forEachShift(fn); }); } getFirst(arr = this._lists) { var j, len, list; for (j = 0, len = arr.length; j < len; j++) { list = arr[j]; if (list.length > 0) { return list; } } return []; } shiftLastFrom(priority) { return this.getFirst(this._lists.slice(priority).reverse()).shift(); } }; var Queues_1 = Queues; var BottleneckError; BottleneckError = class BottleneckError extends Error {}; var BottleneckError_1 = BottleneckError; var BottleneckError$1, DEFAULT_PRIORITY, Job, NUM_PRIORITIES, parser$1; NUM_PRIORITIES = 10; DEFAULT_PRIORITY = 5; parser$1 = parser; BottleneckError$1 = BottleneckError_1; Job = class Job { constructor(task, args, options, jobDefaults, rejectOnDrop, Events, _states, Promise) { this.task = task; this.args = args; this.rejectOnDrop = rejectOnDrop; this.Events = Events; this._states = _states; this.Promise = Promise; this.options = parser$1.load(options, jobDefaults); this.options.priority = this._sanitizePriority(this.options.priority); if (this.options.id === jobDefaults.id) { this.options.id = `${this.options.id}-${this._randomIndex()}`; } this.promise = new this.Promise((_resolve, _reject) => { this._resolve = _resolve; this._reject = _reject; }); this.retryCount = 0; } _sanitizePriority(priority) { var sProperty; sProperty = ~~priority !== priority ? DEFAULT_PRIORITY : priority; if (sProperty < 0) { return 0; } else if (sProperty > NUM_PRIORITIES - 1) { return NUM_PRIORITIES - 1; } else { return sProperty; } } _randomIndex() { return Math.random().toString(36).slice(2); } doDrop({error, message = "This job has been dropped by Bottleneck"} = {}) { if (this._states.remove(this.options.id)) { if (this.rejectOnDrop) { this._reject(error != null ? error : new BottleneckError$1(message)); } this.Events.trigger("dropped", {args: this.args, options: this.options, task: this.task, promise: this.promise}); return true; } else { return false; } } _assertStatus(expected) { var status; status = this._states.jobStatus(this.options.id); if (!(status === expected || (expected === "DONE" && status === null))) { throw new BottleneckError$1(`Invalid job status ${status}, expected ${expected}. Please open an issue at https://github.com/SGrondin/bottleneck/issues`); } } doReceive() { this._states.start(this.options.id); return this.Events.trigger("received", {args: this.args, options: this.options}); } doQueue(reachedHWM, blocked) { this._assertStatus("RECEIVED"); this._states.next(this.options.id); return this.Events.trigger("queued", {args: this.args, options: this.options, reachedHWM, blocked}); } doRun() { if (this.retryCount === 0) { this._assertStatus("QUEUED"); this._states.next(this.options.id); } else { this._assertStatus("EXECUTING"); } return this.Events.trigger("scheduled", {args: this.args, options: this.options}); } async doExecute(chained, clearGlobalState, run, free) { var error, eventInfo, passed; if (this.retryCount === 0) { this._assertStatus("RUNNING"); this._states.next(this.options.id); } else { this._assertStatus("EXECUTING"); } eventInfo = {args: this.args, options: this.options, retryCount: this.retryCount}; this.Events.trigger("executing", eventInfo); try { passed = (await (chained != null ? chained.schedule(this.options, this.task, ...this.args) : this.task(...this.args))); if (clearGlobalState()) { this.doDone(eventInfo); await free(this.options, eventInfo); this._assertStatus("DONE"); return this._resolve(passed); } } catch (error1) { error = error1; return this._onFailure(error, eventInfo, clearGlobalState, run, free); } } doExpire(clearGlobalState, run, free) { var error, eventInfo; if (this._states.jobStatus(this.options.id === "RUNNING")) { this._states.next(this.options.id); } this._assertStatus("EXECUTING"); eventInfo = {args: this.args, options: this.options, retryCount: this.retryCount}; error = new BottleneckError$1(`This job timed out after ${this.options.expiration} ms.`); return this._onFailure(error, eventInfo, clearGlobalState, run, free); } async _onFailure(error, eventInfo, clearGlobalState, run, free) { var retry, retryAfter; if (clearGlobalState()) { retry = (await this.Events.trigger("failed", error, eventInfo)); if (retry != null) { retryAfter = ~~retry; this.Events.trigger("retry", `Retrying ${this.options.id} after ${retryAfter} ms`, eventInfo); this.retryCount++; return run(retryAfter); } else { this.doDone(eventInfo); await free(this.options, eventInfo); this._assertStatus("DONE"); return this._reject(error); } } } doDone(eventInfo) { this._assertStatus("EXECUTING"); this._states.next(this.options.id); return this.Events.trigger("done", eventInfo); } }; var Job_1 = Job; var BottleneckError$2, LocalDatastore, parser$2; parser$2 = parser; BottleneckError$2 = BottleneckError_1; LocalDatastore = class LocalDatastore { constructor(instance, storeOptions, storeInstanceOptions) { this.instance = instance; this.storeOptions = storeOptions; this.clientId = this.instance._randomIndex(); parser$2.load(storeInstanceOptions, storeInstanceOptions, this); this._nextRequest = this._lastReservoirRefresh = this._lastReservoirIncrease = Date.now(); this._running = 0; this._done = 0; this._unblockTime = 0; this.ready = this.Promise.resolve(); this.clients = {}; this._startHeartbeat(); } _startHeartbeat() { var base; if ((this.heartbeat == null) && (((this.storeOptions.reservoirRefreshInterval != null) && (this.storeOptions.reservoirRefreshAmount != null)) || ((this.storeOptions.reservoirIncreaseInterval != null) && (this.storeOptions.reservoirIncreaseAmount != null)))) { return typeof (base = (this.heartbeat = setInterval(() => { var amount, incr, maximum, now, reservoir; now = Date.now(); if ((this.storeOptions.reservoirRefreshInterval != null) && now >= this._lastReservoirRefresh + this.storeOptions.reservoirRefreshInterval) { this._lastReservoirRefresh = now; this.storeOptions.reservoir = this.storeOptions.reservoirRefreshAmount; this.instance._drainAll(this.computeCapacity()); } if ((this.storeOptions.reservoirIncreaseInterval != null) && now >= this._lastReservoirIncrease + this.storeOptions.reservoirIncreaseInterval) { ({ reservoirIncreaseAmount: amount, reservoirIncreaseMaximum: maximum, reservoir } = this.storeOptions); this._lastReservoirIncrease = now; incr = maximum != null ? Math.min(amount, maximum - reservoir) : amount; if (incr > 0) { this.storeOptions.reservoir += incr; return this.instance._drainAll(this.computeCapacity()); } } }, this.heartbeatInterval))).unref === "function" ? base.unref() : void 0; } else { return clearInterval(this.heartbeat); } } async __publish__(message) { await this.yieldLoop(); return this.instance.Events.trigger("message", message.toString()); } async __disconnect__(flush) { await this.yieldLoop(); clearInterval(this.heartbeat); return this.Promise.resolve(); } yieldLoop(t = 0) { return new this.Promise(function(resolve, reject) { return setTimeout(resolve, t); }); } computePenalty() { var ref; return (ref = this.storeOptions.penalty) != null ? ref : (15 * this.storeOptions.minTime) || 5000; } async __updateSettings__(options) { await this.yieldLoop(); parser$2.overwrite(options, options, this.storeOptions); this._startHeartbeat(); this.instance._drainAll(this.computeCapacity()); return true; } async __running__() { await this.yieldLoop(); return this._running; } async __queued__() { await this.yieldLoop(); return this.instance.queued(); } async __done__() { await this.yieldLoop(); return this._done; } async __groupCheck__(time) { await this.yieldLoop(); return (this._nextRequest + this.timeout) < time; } computeCapacity() { var maxConcurrent, reservoir; ({maxConcurrent, reservoir} = this.storeOptions); if ((maxConcurrent != null) && (reservoir != null)) { return Math.min(maxConcurrent - this._running, reservoir); } else if (maxConcurrent != null) { return maxConcurrent - this._running; } else if (reservoir != null) { return reservoir; } else { return null; } } conditionsCheck(weight) { var capacity; capacity = this.computeCapacity(); return (capacity == null) || weight <= capacity; } async __incrementReservoir__(incr) { var reservoir; await this.yieldLoop(); reservoir = this.storeOptions.reservoir += incr; this.instance._drainAll(this.computeCapacity()); return reservoir; } async __currentReservoir__() { await this.yieldLoop(); return this.storeOptions.reservoir; } isBlocked(now) { return this._unblockTime >= now; } check(weight, now) { return this.conditionsCheck(weight) && (this._nextRequest - now) <= 0; } async __check__(weight) { var now; await this.yieldLoop(); now = Date.now(); return this.check(weight, now); } async __register__(index, weight, expiration) { var now, wait; await this.yieldLoop(); now = Date.now(); if (this.conditionsCheck(weight)) { this._running += weight; if (this.storeOptions.reservoir != null) { this.storeOptions.reservoir -= weight; } wait = Math.max(this._nextRequest - now, 0); this._nextRequest = now + wait + this.storeOptions.minTime; return { success: true, wait, reservoir: this.storeOptions.reservoir }; } else { return { success: false }; } } strategyIsBlock() { return this.storeOptions.strategy === 3; } async __submit__(queueLength, weight) { var blocked, now, reachedHWM; await this.yieldLoop(); if ((this.storeOptions.maxConcurrent != null) && weight > this.storeOptions.maxConcurrent) { throw new BottleneckError$2(`Impossible to add a job having a weight of ${weight} to a limiter having a maxConcurrent setting of ${this.storeOptions.maxConcurrent}`); } now = Date.now(); reachedHWM = (this.storeOptions.highWater != null) && queueLength === this.storeOptions.highWater && !this.check(weight, now); blocked = this.strategyIsBlock() && (reachedHWM || this.isBlocked(now)); if (blocked) { this._unblockTime = now + this.computePenalty(); this._nextRequest = this._unblockTime + this.storeOptions.minTime; this.instance._dropAllQueued(); } return { reachedHWM, blocked, strategy: this.storeOptions.strategy }; } async __free__(index, weight) { await this.yieldLoop(); this._running -= weight; this._done += weight; this.instance._drainAll(this.computeCapacity()); return { running: this._running }; } }; var LocalDatastore_1 = LocalDatastore; var BottleneckError$3, States; BottleneckError$3 = BottleneckError_1; States = class States { constructor(status1) { this.status = status1; this._jobs = {}; this.counts = this.status.map(function() { return 0; }); } next(id) { var current, next; current = this._jobs[id]; next = current + 1; if ((current != null) && next < this.status.length) { this.counts[current]--; this.counts[next]++; return this._jobs[id]++; } else if (current != null) { this.counts[current]--; return delete this._jobs[id]; } } start(id) { var initial; initial = 0; this._jobs[id] = initial; return this.counts[initial]++; } remove(id) { var current; current = this._jobs[id]; if (current != null) { this.counts[current]--; delete this._jobs[id]; } return current != null; } jobStatus(id) { var ref; return (ref = this.status[this._jobs[id]]) != null ? ref : null; } statusJobs(status) { var k, pos, ref, results, v; if (status != null) { pos = this.status.indexOf(status); if (pos < 0) { throw new BottleneckError$3(`status must be one of ${this.status.join(', ')}`); } ref = this._jobs; results = []; for (k in ref) { v = ref[k]; if (v === pos) { results.push(k); } } return results; } else { return Object.keys(this._jobs); } } statusCounts() { return this.counts.reduce(((acc, v, i) => { acc[this.status[i]] = v; return acc; }), {}); } }; var States_1 = States; var DLList$2, Sync; DLList$2 = DLList_1; Sync = class Sync { constructor(name, Promise) { this.schedule = this.schedule.bind(this); this.name = name; this.Promise = Promise; this._running = 0; this._queue = new DLList$2(); } isEmpty() { return this._queue.length === 0; } async _tryToRun() { var args, cb, error, reject, resolve, returned, task; if ((this._running < 1) && this._queue.length > 0) { this._running++; ({task, args, resolve, reject} = this._queue.shift()); cb = (await (async function() { try { returned = (await task(...args)); return function() { return resolve(returned); }; } catch (error1) { error = error1; return function() { return reject(error); }; } })()); this._running--; this._tryToRun(); return cb(); } } schedule(task, ...args) { var promise, reject, resolve; resolve = reject = null; promise = new this.Promise(function(_resolve, _reject) { resolve = _resolve; return reject = _reject; }); this._queue.push({task, args, resolve, reject}); this._tryToRun(); return promise; } }; var Sync_1 = Sync; var version = "2.19.5"; var version$1 = { version: version }; var version$2 = /*#__PURE__*/Object.freeze({ version: version, default: version$1 }); var require$$2 = () => console.log('You must import the full version of Bottleneck in order to use this feature.'); var require$$3 = () => console.log('You must import the full version of Bottleneck in order to use this feature.'); var require$$4 = () => console.log('You must import the full version of Bottleneck in order to use this feature.'); var Events$2, Group, IORedisConnection$1, RedisConnection$1, Scripts$1, parser$3; parser$3 = parser; Events$2 = Events_1; RedisConnection$1 = require$$2; IORedisConnection$1 = require$$3; Scripts$1 = require$$4; Group = (function() { class Group { constructor(limiterOptions = {}) { this.deleteKey = this.deleteKey.bind(this); this.limiterOptions = limiterOptions; parser$3.load(this.limiterOptions, this.defaults, this); this.Events = new Events$2(this); this.instances = {}; this.Bottleneck = Bottleneck_1; this._startAutoCleanup(); this.sharedConnection = this.connection != null; if (this.connection == null) { if (this.limiterOptions.datastore === "redis") { this.connection = new RedisConnection$1(Object.assign({}, this.limiterOptions, {Events: this.Events})); } else if (this.limiterOptions.datastore === "ioredis") { this.connection = new IORedisConnection$1(Object.assign({}, this.limiterOptions, {Events: this.Events})); } } } key(key = "") { var ref; return (ref = this.instances[key]) != null ? ref : (() => { var limiter; limiter = this.instances[key] = new this.Bottleneck(Object.assign(this.limiterOptions, { id: `${this.id}-${key}`, timeout: this.timeout, connection: this.connection })); this.Events.trigger("created", limiter, key); return limiter; })(); } async deleteKey(key = "") { var deleted, instance; instance = this.instances[key]; if (this.connection) { deleted = (await this.connection.__runCommand__(['del', ...Scripts$1.allKeys(`${this.id}-${key}`)])); } if (instance != null) { delete this.instances[key]; await instance.disconnect(); } return (instance != null) || deleted > 0; } limiters() { var k, ref, results, v; ref = this.instances; results = []; for (k in ref) { v = ref[k]; results.push({ key: k, limiter: v }); } return results; } keys() { return Object.keys(this.instances); } async clusterKeys() { var cursor, end, found, i, k, keys, len, next, start; if (this.connection == null) { return this.Promise.resolve(this.keys()); } keys = []; cursor = null; start = `b_${this.id}-`.length; end = "_settings".length; while (cursor !== 0) { [next, found] = (await this.connection.__runCommand__(["scan", cursor != null ? cursor : 0, "match", `b_${this.id}-*_settings`, "count", 10000])); cursor = ~~next; for (i = 0, len = found.length; i < len; i++) { k = found[i]; keys.push(k.slice(start, -end)); } } return keys; } _startAutoCleanup() { var base; clearInterval(this.interval); return typeof (base = (this.interval = setInterval(async() => { var e, k, ref, results, time, v; time = Date.now(); ref = this.instances; results = []; for (k in ref) { v = ref[k]; try { if ((await v._store.__groupCheck__(time))) { results.push(this.deleteKey(k)); } else { results.push(void 0); } } catch (error) { e = error; results.push(v.Events.trigger("error", e)); } } return results; }, this.timeout / 2))).unref === "function" ? base.unref() : void 0; } updateSettings(options = {}) { parser$3.overwrite(options, this.defaults, this); parser$3.overwrite(options, options, this.limiterOptions); if (options.timeout != null) { return this._startAutoCleanup(); } } disconnect(flush = true) { var ref; if (!this.sharedConnection) { return (ref = this.connection) != null ? ref.disconnect(flush) : void 0; } } } Group.prototype.defaults = { timeout: 1000 * 60 * 5, connection: null, Promise: Promise, id: "group-key" }; return Group; }).call(commonjsGlobal); var Group_1 = Group; var Batcher, Events$3, parser$4; parser$4 = parser; Events$3 = Events_1; Batcher = (function() { class Batcher { constructor(options = {}) { this.options = options; parser$4.load(this.options, this.defaults, this); this.Events = new Events$3(this); this._arr = []; this._resetPromise(); this._lastFlush = Date.now(); } _resetPromise() { return this._promise = new this.Promise((res, rej) => { return this._resolve = res; }); } _flush() { clearTimeout(this._timeout); this._lastFlush = Date.now(); this._resolve(); this.Events.trigger("batch", this._arr); this._arr = []; return this._resetPromise(); } add(data) { var ret; this._arr.push(data); ret = this._promise; if (this._arr.length === this.maxSize) { this._flush(); } else if ((this.maxTime != null) && this._arr.length === 1) { this._timeout = setTimeout(() => { return this._flush(); }, this.maxTime); } return ret; } } Batcher.prototype.defaults = { maxTime: null, maxSize: null, Promise: Promise }; return Batcher; }).call(commonjsGlobal); var Batcher_1 = Batcher; var require$$4$1 = () => console.log('You must import the full version of Bottleneck in order to use this feature.'); var require$$8 = getCjsExportFromNamespace(version$2); var Bottleneck, DEFAULT_PRIORITY$1, Events$4, Job$1, LocalDatastore$1, NUM_PRIORITIES$1, Queues$1, RedisDatastore$1, States$1, Sync$1, parser$5, splice = [].splice; NUM_PRIORITIES$1 = 10; DEFAULT_PRIORITY$1 = 5; parser$5 = parser; Queues$1 = Queues_1; Job$1 = Job_1; LocalDatastore$1 = LocalDatastore_1; RedisDatastore$1 = require$$4$1; Events$4 = Events_1; States$1 = States_1; Sync$1 = Sync_1; Bottleneck = (function() { class Bottleneck { constructor(options = {}, ...invalid) { var storeInstanceOptions, storeOptions; this._addToQueue = this._addToQueue.bind(this); this._validateOptions(options, invalid); parser$5.load(options, this.instanceDefaults, this); this._queues = new Queues$1(NUM_PRIORITIES$1); this._scheduled = {}; this._states = new States$1(["RECEIVED", "QUEUED", "RUNNING", "EXECUTING"].concat(this.trackDoneStatus ? ["DONE"] : [])); this._limiter = null; this.Events = new Events$4(this); this._submitLock = new Sync$1("submit", this.Promise); this._registerLock = new Sync$1("register", this.Promise); storeOptions = parser$5.load(options, this.storeDefaults, {}); this._store = (function() { if (this.datastore === "redis" || this.datastore === "ioredis" || (this.connection != null)) { storeInstanceOptions = parser$5.load(options, this.redisStoreDefaults, {}); return new RedisDatastore$1(this, storeOptions, storeInstanceOptions); } else if (this.datastore === "local") { storeInstanceOptions = parser$5.load(options, this.localStoreDefaults, {}); return new LocalDatastore$1(this, storeOptions, storeInstanceOptions); } else { throw new Bottleneck.prototype.BottleneckError(`Invalid datastore type: ${this.datastore}`); } }).call(this); this._queues.on("leftzero", () => { var ref; return (ref = this._store.heartbeat) != null ? typeof ref.ref === "function" ? ref.ref() : void 0 : void 0; }); this._queues.on("zero", () => { var ref; return (ref = this._store.heartbeat) != null ? typeof ref.unref === "function" ? ref.unref() : void 0 : void 0; }); } _validateOptions(options, invalid) { if (!((options != null) && typeof options === "object" && invalid.length === 0)) { throw new Bottleneck.prototype.BottleneckError("Bottleneck v2 takes a single object argument. Refer to https://github.com/SGrondin/bottleneck#upgrading-to-v2 if you're upgrading from Bottleneck v1."); } } ready() { return this._store.ready; } clients() { return this._store.clients; } channel() { return `b_${this.id}`; } channel_client() { return `b_${this.id}_${this._store.clientId}`; } publish(message) { return this._store.__publish__(message); } disconnect(flush = true) { return this._store.__disconnect__(flush); } chain(_limiter) { this._limiter = _limiter; return this; } queued(priority) { return this._queues.queued(priority); } clusterQueued() { return this._store.__queued__(); } empty() { return this.queued() === 0 && this._submitLock.isEmpty(); } running() { return this._store.__running__(); } done() { return this._store.__done__(); } jobStatus(id) { return this._states.jobStatus(id); } jobs(status) { return this._states.statusJobs(status); } counts() { return this._states.statusCounts(); } _randomIndex() { return Math.random().toString(36).slice(2); } check(weight = 1) { return this._store.__check__(weight); } _clearGlobalState(index) { if (this._scheduled[index] != null) { clearTimeout(this._scheduled[index].expiration); delete this._scheduled[index]; return true; } else { return false; } } async _free(index, job, options, eventInfo) { var e, running; try { ({running} = (await this._store.__free__(index, options.weight))); this.Events.trigger("debug", `Freed ${options.id}`, eventInfo); if (running === 0 && this.empty()) { return this.Events.trigger("idle"); } } catch (error1) { e = error1; return this.Events.trigger("error", e); } } _run(index, job, wait) { var clearGlobalState, free, run; job.doRun(); clearGlobalState = this._clearGlobalState.bind(this, index); run = this._run.bind(this, index, job); free = this._free.bind(this, index, job); return this._scheduled[index] = { timeout: setTimeout(() => { return job.doExecute(this._limiter, clearGlobalState, run, free); }, wait), expiration: job.options.expiration != null ? setTimeout(function() { return job.doExpire(clearGlobalState, run, free); }, wait + job.options.expiration) : void 0, job: job }; } _drainOne(capacity) { return this._registerLock.schedule(() => { var args, index, next, options, queue; if (this.queued() === 0) { return this.Promise.resolve(null); } queue = this._queues.getFirst(); ({options, args} = next = queue.first()); if ((capacity != null) && options.weight > capacity) { return this.Promise.resolve(null); } this.Events.trigger("debug", `Draining ${options.id}`, {args, options}); index = this._randomIndex(); return this._store.__register__(index, options.weight, options.expiration).then(({success, wait, reservoir}) => { var empty; this.Events.trigger("debug", `Drained ${options.id}`, {success, args, options}); if (success) { queue.shift(); empty = this.empty(); if (empty) { this.Events.trigger("empty"); } if (reservoir === 0) { this.Events.trigger("depleted", empty); } this._run(index, next, wait); return this.Promise.resolve(options.weight); } else { return this.Promise.resolve(null); } }); }); } _drainAll(capacity, total = 0) { return this._drainOne(capacity).then((drained) => { var newCapacity; if (drained != null) { newCapacity = capacity != null ? capacity - drained : capacity; return this._drainAll(newCapacity, total + drained); } else { return this.Promise.resolve(total); } }).catch((e) => { return this.Events.trigger("error", e); }); } _dropAllQueued(message) { return this._queues.shiftAll(function(job) { return job.doDrop({message}); }); } stop(options = {}) { var done, waitForExecuting; options = parser$5.load(options, this.stopDefaults); waitForExecuting = (at) => { var finished; finished = () => { var counts; counts = this._states.counts; return (counts[0] + counts[1] + counts[2] + counts[3]) === at; }; return new this.Promise((resolve, reject) => { if (finished()) { return resolve(); } else { return this.on("done", () => { if (finished()) { this.removeAllListeners("done"); return resolve(); } }); } }); }; done = options.dropWaitingJobs ? (this._run = function(index, next) { return next.doDrop({ message: options.dropErrorMessage }); }, this._drainOne = () => { return this.Promise.resolve(null); }, this._registerLock.schedule(() => { return this._submitLock.schedule(() => { var k, ref, v; ref = this._scheduled; for (k in ref) { v = ref[k]; if (this.jobStatus(v.job.options.id) === "RUNNING") { clearTimeout(v.timeout); clearTimeout(v.expiration); v.job.doDrop({ message: options.dropErrorMessage }); } } this._dropAllQueued(options.dropErrorMessage); return waitForExecuting(0); }); })) : this.schedule({ priority: NUM_PRIORITIES$1 - 1, weight: 0 }, () => { return waitForExecuting(1); }); this._receive = function(job) { return job._reject(new Bottleneck.prototype.BottleneckError(options.enqueueErrorMessage)); }; this.stop = () => { return this.Promise.reject(new Bottleneck.prototype.BottleneckError("stop() has already been called")); }; return done; } async _addToQueue(job) { var args, blocked, error, options, reachedHWM, shifted, strategy; ({args, options} = job); try { ({reachedHWM, blocked, strategy} = (await this._store.__submit__(this.queued(), options.weight))); } catch (error1) { error = error1; this.Events.trigger("debug", `Could not queue ${options.id}`, {args, options, error}); job.doDrop({error}); return false; } if (blocked) { job.doDrop(); return true; } else if (reachedHWM) { shifted = strategy === Bottleneck.prototype.strategy.LEAK ? this._queues.shiftLastFrom(options.priority) : strategy === Bottleneck.prototype.strategy.OVERFLOW_PRIORITY ? this._queues.shiftLastFrom(options.priority + 1) : strategy === Bottleneck.prototype.strategy.OVERFLOW ? job : void 0; if (shifted != null) { shifted.doDrop(); } if ((shifted == null) || strategy === Bottleneck.prototype.strategy.OVERFLOW) { if (shifted == null) { job.doDrop(); } return reachedHWM; } } job.doQueue(reachedHWM, blocked); this._queues.push(job); await this._drainAll(); return reachedHWM; } _receive(job) { if (this._states.jobStatus(job.options.id) != null) { job._reject(new Bottleneck.prototype.BottleneckError(`A job with the same id already exists (id=${job.options.id})`)); return false; } else { job.doReceive(); return this._submitLock.schedule(this._addToQueue, job); } } submit(...args) { var cb, fn, job, options, ref, ref1, task; if (typeof args[0] === "function") { ref = args, [fn, ...args] = ref, [cb] = splice.call(args, -1); options = parser$5.load({}, this.jobDefaults); } else { ref1 = args, [options, fn, ...args] = ref1, [cb] = splice.call(args, -1); options = parser$5.load(options, this.jobDefaults); } task = (...args) => { return new this.Promise(function(resolve, reject) { return fn(...args, function(...args) { return (args[0] != null ? reject : resolve)(args); }); }); }; job = new Job$1(task, args, options, this.jobDefaults, this.rejectOnDrop, this.Events, this._states, this.Promise); job.promise.then(function(args) { return typeof cb === "function" ? cb(...args) : void 0; }).catch(function(args) { if (Array.isArray(args)) { return typeof cb === "function" ? cb(...args) : void 0; } else { return typeof cb === "function" ? cb(args) : void 0; } }); return this._receive(job); } schedule(...args) { var job, options, task; if (typeof args[0] === "function") { [task, ...args] = args; options = {}; } else { [options, task, ...args] = args; } job = new Job$1(task, args, options, this.jobDefaults, this.rejectOnDrop, this.Events, this._states, this.Promise); this._receive(job); return job.promise; } wrap(fn) { var schedule, wrapped; schedule = this.schedule.bind(this); wrapped = function(...args) { return schedule(fn.bind(this), ...args); }; wrapped.withOptions = function(options, ...args) { return schedule(options, fn, ...args); }; return wrapped; } async updateSettings(options = {}) { await this._store.__updateSettings__(parser$5.overwrite(options, this.storeDefaults)); parser$5.overwrite(options, this.instanceDefaults, this); return this; } currentReservoir() { return this._store.__currentReservoir__(); } incrementReservoir(incr = 0) { return this._store.__incrementReservoir__(incr); } } Bottleneck.default = Bottleneck; Bottleneck.Events = Events$4; Bottleneck.version = Bottleneck.prototype.version = require$$8.version; Bottleneck.strategy = Bottleneck.prototype.strategy = { LEAK: 1, OVERFLOW: 2, OVERFLOW_PRIORITY: 4, BLOCK: 3 }; Bottleneck.BottleneckError = Bottleneck.prototype.BottleneckError = BottleneckError_1; Bottleneck.Group = Bottleneck.prototype.Group = Group_1; Bottleneck.RedisConnection = Bottleneck.prototype.RedisConnection = require$$2; Bottleneck.IORedisConnection = Bottleneck.prototype.IORedisConnection = require$$3; Bottleneck.Batcher = Bottleneck.prototype.Batcher = Batcher_1; Bottleneck.prototype.jobDefaults = { priority: DEFAULT_PRIORITY$1, weight: 1, expiration: null, id: "" }; Bottleneck.prototype.storeDefaults = { maxConcurrent: null, minTime: 0, highWater: null, strategy: Bottleneck.prototype.strategy.LEAK, penalty: null, reservoir: null, reservoirRefreshInterval: null, reservoirRefreshAmount: null, reservoirIncreaseInterval: null, reservoirIncreaseAmount: null, reservoirIncreaseMaximum: null }; Bottleneck.prototype.localStoreDefaults = { Promise: Promise, timeout: null, heartbeatInterval: 250 }; Bottleneck.prototype.redisStoreDefaults = { Promise: Promise, timeout: null, heartbeatInterval: 5000, clientTimeout: 10000, Redis: null, clientOptions: {}, clusterNodes: null, clearDatastore: false, connection: null }; Bottleneck.prototype.instanceDefaults = { datastore: "local", connection: null, id: "", rejectOnDrop: true, trackDoneStatus: false, Promise: Promise }; Bottleneck.prototype.stopDefaults = { enqueueErrorMessage: "This limiter has been stopped and cannot accept new jobs.", dropWaitingJobs: true, dropErrorMessage: "This limiter has been stopped." }; return Bottleneck; }).call(commonjsGlobal); var Bottleneck_1 = Bottleneck; var lib = Bottleneck_1; return lib; }))); /***/ }), /***/ 385: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var util = __webpack_require__(1669) var levels = ['trace', 'debug', 'info', 'warn', 'error', 'fatal'] var noop = function () {} module.exports = function (opts) { opts = opts || {} opts.level = opts.level || 'info' var logger = {} var shouldLog = function (level) { return levels.indexOf(level) >= levels.indexOf(opts.level) } levels.forEach(function (level) { logger[level] = shouldLog(level) ? log : noop function log () { var prefix = opts.prefix var normalizedLevel if (opts.stderr) { normalizedLevel = 'error' } else { switch (level) { case 'trace': normalizedLevel = 'info'; break case 'debug': normalizedLevel = 'info'; break case 'fatal': normalizedLevel = 'error'; break default: normalizedLevel = level } } if (prefix) { if (typeof prefix === 'function') prefix = prefix(level) arguments[0] = util.format(prefix, arguments[0]) } console[normalizedLevel](util.format.apply(util, arguments)) } }) return logger } /***/ }), /***/ 8932: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); class Deprecation extends Error { constructor(message) { super(message); // Maintains proper stack trace (only available on V8) /* istanbul ignore next */ if (Error.captureStackTrace) { Error.captureStackTrace(this, this.constructor); } this.name = 'Deprecation'; } } exports.Deprecation = Deprecation; /***/ }), /***/ 1589: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const path = __webpack_require__(5622); module.exports = (filePath, options) => { if (typeof filePath !== 'string') { throw new TypeError(`Expected a string, got ${typeof filePath}`); } options = { resolve: true, ...options }; let pathName = filePath; if (options.resolve) { pathName = path.resolve(filePath); } pathName = pathName.replace(/\\/g, '/'); // Windows drive letter must be prefixed with a slash if (pathName[0] !== '/') { pathName = `/${pathName}`; } // Escape required characters for path components // See: https://tools.ietf.org/html/rfc3986#section-3.3 return encodeURI(`file://${pathName}`).replace(/[?#]/g, encodeURIComponent); }; /***/ }), /***/ 1917: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var yaml = __webpack_require__(916); module.exports = yaml; /***/ }), /***/ 916: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var loader = __webpack_require__(5190); var dumper = __webpack_require__(3034); function deprecated(name) { return function () { throw new Error('Function ' + name + ' is deprecated and cannot be used.'); }; } module.exports.Type = __webpack_require__(967); module.exports.Schema = __webpack_require__(6514); module.exports.FAILSAFE_SCHEMA = __webpack_require__(6037); module.exports.JSON_SCHEMA = __webpack_require__(1571); module.exports.CORE_SCHEMA = __webpack_require__(2183); module.exports.DEFAULT_SAFE_SCHEMA = __webpack_require__(8949); module.exports.DEFAULT_FULL_SCHEMA = __webpack_require__(6874); module.exports.load = loader.load; module.exports.loadAll = loader.loadAll; module.exports.safeLoad = loader.safeLoad; module.exports.safeLoadAll = loader.safeLoadAll; module.exports.dump = dumper.dump; module.exports.safeDump = dumper.safeDump; module.exports.YAMLException = __webpack_require__(5199); // Deprecated schema names from JS-YAML 2.0.x module.exports.MINIMAL_SCHEMA = __webpack_require__(6037); module.exports.SAFE_SCHEMA = __webpack_require__(8949); module.exports.DEFAULT_SCHEMA = __webpack_require__(6874); // Deprecated functions from JS-YAML 1.x.x module.exports.scan = deprecated('scan'); module.exports.parse = deprecated('parse'); module.exports.compose = deprecated('compose'); module.exports.addConstructor = deprecated('addConstructor'); /***/ }), /***/ 9136: /***/ ((module) => { "use strict"; function isNothing(subject) { return (typeof subject === 'undefined') || (subject === null); } function isObject(subject) { return (typeof subject === 'object') && (subject !== null); } function toArray(sequence) { if (Array.isArray(sequence)) return sequence; else if (isNothing(sequence)) return []; return [ sequence ]; } function extend(target, source) { var index, length, key, sourceKeys; if (source) { sourceKeys = Object.keys(source); for (index = 0, length = sourceKeys.length; index < length; index += 1) { key = sourceKeys[index]; target[key] = source[key]; } } return target; } function repeat(string, count) { var result = '', cycle; for (cycle = 0; cycle < count; cycle += 1) { result += string; } return result; } function isNegativeZero(number) { return (number === 0) && (Number.NEGATIVE_INFINITY === 1 / number); } module.exports.isNothing = isNothing; module.exports.isObject = isObject; module.exports.toArray = toArray; module.exports.repeat = repeat; module.exports.isNegativeZero = isNegativeZero; module.exports.extend = extend; /***/ }), /***/ 3034: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; /*eslint-disable no-use-before-define*/ var common = __webpack_require__(9136); var YAMLException = __webpack_require__(5199); var DEFAULT_FULL_SCHEMA = __webpack_require__(6874); var DEFAULT_SAFE_SCHEMA = __webpack_require__(8949); var _toString = Object.prototype.toString; var _hasOwnProperty = Object.prototype.hasOwnProperty; var CHAR_TAB = 0x09; /* Tab */ var CHAR_LINE_FEED = 0x0A; /* LF */ var CHAR_SPACE = 0x20; /* Space */ var CHAR_EXCLAMATION = 0x21; /* ! */ var CHAR_DOUBLE_QUOTE = 0x22; /* " */ var CHAR_SHARP = 0x23; /* # */ var CHAR_PERCENT = 0x25; /* % */ var CHAR_AMPERSAND = 0x26; /* & */ var CHAR_SINGLE_QUOTE = 0x27; /* ' */ var CHAR_ASTERISK = 0x2A; /* * */ var CHAR_COMMA = 0x2C; /* , */ var CHAR_MINUS = 0x2D; /* - */ var CHAR_COLON = 0x3A; /* : */ var CHAR_GREATER_THAN = 0x3E; /* > */ var CHAR_QUESTION = 0x3F; /* ? */ var CHAR_COMMERCIAL_AT = 0x40; /* @ */ var CHAR_LEFT_SQUARE_BRACKET = 0x5B; /* [ */ var CHAR_RIGHT_SQUARE_BRACKET = 0x5D; /* ] */ var CHAR_GRAVE_ACCENT = 0x60; /* ` */ var CHAR_LEFT_CURLY_BRACKET = 0x7B; /* { */ var CHAR_VERTICAL_LINE = 0x7C; /* | */ var CHAR_RIGHT_CURLY_BRACKET = 0x7D; /* } */ var ESCAPE_SEQUENCES = {}; ESCAPE_SEQUENCES[0x00] = '\\0'; ESCAPE_SEQUENCES[0x07] = '\\a'; ESCAPE_SEQUENCES[0x08] = '\\b'; ESCAPE_SEQUENCES[0x09] = '\\t'; ESCAPE_SEQUENCES[0x0A] = '\\n'; ESCAPE_SEQUENCES[0x0B] = '\\v'; ESCAPE_SEQUENCES[0x0C] = '\\f'; ESCAPE_SEQUENCES[0x0D] = '\\r'; ESCAPE_SEQUENCES[0x1B] = '\\e'; ESCAPE_SEQUENCES[0x22] = '\\"'; ESCAPE_SEQUENCES[0x5C] = '\\\\'; ESCAPE_SEQUENCES[0x85] = '\\N'; ESCAPE_SEQUENCES[0xA0] = '\\_'; ESCAPE_SEQUENCES[0x2028] = '\\L'; ESCAPE_SEQUENCES[0x2029] = '\\P'; var DEPRECATED_BOOLEANS_SYNTAX = [ 'y', 'Y', 'yes', 'Yes', 'YES', 'on', 'On', 'ON', 'n', 'N', 'no', 'No', 'NO', 'off', 'Off', 'OFF' ]; function compileStyleMap(schema, map) { var result, keys, index, length, tag, style, type; if (map === null) return {}; result = {}; keys = Object.keys(map); for (index = 0, length = keys.length; index < length; index += 1) { tag = keys[index]; style = String(map[tag]); if (tag.slice(0, 2) === '!!') { tag = 'tag:yaml.org,2002:' + tag.slice(2); } type = schema.compiledTypeMap['fallback'][tag]; if (type && _hasOwnProperty.call(type.styleAliases, style)) { style = type.styleAliases[style]; } result[tag] = style; } return result; } function encodeHex(character) { var string, handle, length; string = character.toString(16).toUpperCase(); if (character <= 0xFF) { handle = 'x'; length = 2; } else if (character <= 0xFFFF) { handle = 'u'; length = 4; } else if (character <= 0xFFFFFFFF) { handle = 'U'; length = 8; } else { throw new YAMLException('code point within a string may not be greater than 0xFFFFFFFF'); } return '\\' + handle + common.repeat('0', length - string.length) + string; } function State(options) { this.schema = options['schema'] || DEFAULT_FULL_SCHEMA; this.indent = Math.max(1, (options['indent'] || 2)); this.noArrayIndent = options['noArrayIndent'] || false; this.skipInvalid = options['skipInvalid'] || false; this.flowLevel = (common.isNothing(options['flowLevel']) ? -1 : options['flowLevel']); this.styleMap = compileStyleMap(this.schema, options['styles'] || null); this.sortKeys = options['sortKeys'] || false; this.lineWidth = options['lineWidth'] || 80; this.noRefs = options['noRefs'] || false; this.noCompatMode = options['noCompatMode'] || false; this.condenseFlow = options['condenseFlow'] || false; this.implicitTypes = this.schema.compiledImplicit; this.explicitTypes = this.schema.compiledExplicit; this.tag = null; this.result = ''; this.duplicates = []; this.usedDuplicates = null; } // Indents every line in a string. Empty lines (\n only) are not indented. function indentString(string, spaces) { var ind = common.repeat(' ', spaces), position = 0, next = -1, result = '', line, length = string.length; while (position < length) { next = string.indexOf('\n', position); if (next === -1) { line = string.slice(position); position = length; } else { line = string.slice(position, next + 1); position = next + 1; } if (line.length && line !== '\n') result += ind; result += line; } return result; } function generateNextLine(state, level) { return '\n' + common.repeat(' ', state.indent * level); } function testImplicitResolving(state, str) { var index, length, type; for (index = 0, length = state.implicitTypes.length; index < length; index += 1) { type = state.implicitTypes[index]; if (type.resolve(str)) { return true; } } return false; } // [33] s-white ::= s-space | s-tab function isWhitespace(c) { return c === CHAR_SPACE || c === CHAR_TAB; } // Returns true if the character can be printed without escaping. // From YAML 1.2: "any allowed characters known to be non-printable // should also be escaped. [However,] This isn’t mandatory" // Derived from nb-char - \t - #x85 - #xA0 - #x2028 - #x2029. function isPrintable(c) { return (0x00020 <= c && c <= 0x00007E) || ((0x000A1 <= c && c <= 0x00D7FF) && c !== 0x2028 && c !== 0x2029) || ((0x0E000 <= c && c <= 0x00FFFD) && c !== 0xFEFF /* BOM */) || (0x10000 <= c && c <= 0x10FFFF); } // Simplified test for values allowed after the first character in plain style. function isPlainSafe(c) { // Uses a subset of nb-char - c-flow-indicator - ":" - "#" // where nb-char ::= c-printable - b-char - c-byte-order-mark. return isPrintable(c) && c !== 0xFEFF // - c-flow-indicator && c !== CHAR_COMMA && c !== CHAR_LEFT_SQUARE_BRACKET && c !== CHAR_RIGHT_SQUARE_BRACKET && c !== CHAR_LEFT_CURLY_BRACKET && c !== CHAR_RIGHT_CURLY_BRACKET // - ":" - "#" && c !== CHAR_COLON && c !== CHAR_SHARP; } // Simplified test for values allowed as the first character in plain style. function isPlainSafeFirst(c) { // Uses a subset of ns-char - c-indicator // where ns-char = nb-char - s-white. return isPrintable(c) && c !== 0xFEFF && !isWhitespace(c) // - s-white // - (c-indicator ::= // “-” | “?” | “:” | “,” | “[” | “]” | “{” | “}” && c !== CHAR_MINUS && c !== CHAR_QUESTION && c !== CHAR_COLON && c !== CHAR_COMMA && c !== CHAR_LEFT_SQUARE_BRACKET && c !== CHAR_RIGHT_SQUARE_BRACKET && c !== CHAR_LEFT_CURLY_BRACKET && c !== CHAR_RIGHT_CURLY_BRACKET // | “#” | “&” | “*” | “!” | “|” | “>” | “'” | “"” && c !== CHAR_SHARP && c !== CHAR_AMPERSAND && c !== CHAR_ASTERISK && c !== CHAR_EXCLAMATION && c !== CHAR_VERTICAL_LINE && c !== CHAR_GREATER_THAN && c !== CHAR_SINGLE_QUOTE && c !== CHAR_DOUBLE_QUOTE // | “%” | “@” | “`”) && c !== CHAR_PERCENT && c !== CHAR_COMMERCIAL_AT && c !== CHAR_GRAVE_ACCENT; } // Determines whether block indentation indicator is required. function needIndentIndicator(string) { var leadingSpaceRe = /^\n* /; return leadingSpaceRe.test(string); } var STYLE_PLAIN = 1, STYLE_SINGLE = 2, STYLE_LITERAL = 3, STYLE_FOLDED = 4, STYLE_DOUBLE = 5; // Determines which scalar styles are possible and returns the preferred style. // lineWidth = -1 => no limit. // Pre-conditions: str.length > 0. // Post-conditions: // STYLE_PLAIN or STYLE_SINGLE => no \n are in the string. // STYLE_LITERAL => no lines are suitable for folding (or lineWidth is -1). // STYLE_FOLDED => a line > lineWidth and can be folded (and lineWidth != -1). function chooseScalarStyle(string, singleLineOnly, indentPerLevel, lineWidth, testAmbiguousType) { var i; var char; var hasLineBreak = false; var hasFoldableLine = false; // only checked if shouldTrackWidth var shouldTrackWidth = lineWidth !== -1; var previousLineBreak = -1; // count the first line correctly var plain = isPlainSafeFirst(string.charCodeAt(0)) && !isWhitespace(string.charCodeAt(string.length - 1)); if (singleLineOnly) { // Case: no block styles. // Check for disallowed characters to rule out plain and single. for (i = 0; i < string.length; i++) { char = string.charCodeAt(i); if (!isPrintable(char)) { return STYLE_DOUBLE; } plain = plain && isPlainSafe(char); } } else { // Case: block styles permitted. for (i = 0; i < string.length; i++) { char = string.charCodeAt(i); if (char === CHAR_LINE_FEED) { hasLineBreak = true; // Check if any line can be folded. if (shouldTrackWidth) { hasFoldableLine = hasFoldableLine || // Foldable line = too long, and not more-indented. (i - previousLineBreak - 1 > lineWidth && string[previousLineBreak + 1] !== ' '); previousLineBreak = i; } } else if (!isPrintable(char)) { return STYLE_DOUBLE; } plain = plain && isPlainSafe(char); } // in case the end is missing a \n hasFoldableLine = hasFoldableLine || (shouldTrackWidth && (i - previousLineBreak - 1 > lineWidth && string[previousLineBreak + 1] !== ' ')); } // Although every style can represent \n without escaping, prefer block styles // for multiline, since they're more readable and they don't add empty lines. // Also prefer folding a super-long line. if (!hasLineBreak && !hasFoldableLine) { // Strings interpretable as another type have to be quoted; // e.g. the string 'true' vs. the boolean true. return plain && !testAmbiguousType(string) ? STYLE_PLAIN : STYLE_SINGLE; } // Edge case: block indentation indicator can only have one digit. if (indentPerLevel > 9 && needIndentIndicator(string)) { return STYLE_DOUBLE; } // At this point we know block styles are valid. // Prefer literal style unless we want to fold. return hasFoldableLine ? STYLE_FOLDED : STYLE_LITERAL; } // Note: line breaking/folding is implemented for only the folded style. // NB. We drop the last trailing newline (if any) of a returned block scalar // since the dumper adds its own newline. This always works: // • No ending newline => unaffected; already using strip "-" chomping. // • Ending newline => removed then restored. // Importantly, this keeps the "+" chomp indicator from gaining an extra line. function writeScalar(state, string, level, iskey) { state.dump = (function () { if (string.length === 0) { return "''"; } if (!state.noCompatMode && DEPRECATED_BOOLEANS_SYNTAX.indexOf(string) !== -1) { return "'" + string + "'"; } var indent = state.indent * Math.max(1, level); // no 0-indent scalars // As indentation gets deeper, let the width decrease monotonically // to the lower bound min(state.lineWidth, 40). // Note that this implies // state.lineWidth ≤ 40 + state.indent: width is fixed at the lower bound. // state.lineWidth > 40 + state.indent: width decreases until the lower bound. // This behaves better than a constant minimum width which disallows narrower options, // or an indent threshold which causes the width to suddenly increase. var lineWidth = state.lineWidth === -1 ? -1 : Math.max(Math.min(state.lineWidth, 40), state.lineWidth - indent); // Without knowing if keys are implicit/explicit, assume implicit for safety. var singleLineOnly = iskey // No block styles in flow mode. || (state.flowLevel > -1 && level >= state.flowLevel); function testAmbiguity(string) { return testImplicitResolving(state, string); } switch (chooseScalarStyle(string, singleLineOnly, state.indent, lineWidth, testAmbiguity)) { case STYLE_PLAIN: return string; case STYLE_SINGLE: return "'" + string.replace(/'/g, "''") + "'"; case STYLE_LITERAL: return '|' + blockHeader(string, state.indent) + dropEndingNewline(indentString(string, indent)); case STYLE_FOLDED: return '>' + blockHeader(string, state.indent) + dropEndingNewline(indentString(foldString(string, lineWidth), indent)); case STYLE_DOUBLE: return '"' + escapeString(string, lineWidth) + '"'; default: throw new YAMLException('impossible error: invalid scalar style'); } }()); } // Pre-conditions: string is valid for a block scalar, 1 <= indentPerLevel <= 9. function blockHeader(string, indentPerLevel) { var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : ''; // note the special case: the string '\n' counts as a "trailing" empty line. var clip = string[string.length - 1] === '\n'; var keep = clip && (string[string.length - 2] === '\n' || string === '\n'); var chomp = keep ? '+' : (clip ? '' : '-'); return indentIndicator + chomp + '\n'; } // (See the note for writeScalar.) function dropEndingNewline(string) { return string[string.length - 1] === '\n' ? string.slice(0, -1) : string; } // Note: a long line without a suitable break point will exceed the width limit. // Pre-conditions: every char in str isPrintable, str.length > 0, width > 0. function foldString(string, width) { // In folded style, $k$ consecutive newlines output as $k+1$ newlines— // unless they're before or after a more-indented line, or at the very // beginning or end, in which case $k$ maps to $k$. // Therefore, parse each chunk as newline(s) followed by a content line. var lineRe = /(\n+)([^\n]*)/g; // first line (possibly an empty line) var result = (function () { var nextLF = string.indexOf('\n'); nextLF = nextLF !== -1 ? nextLF : string.length; lineRe.lastIndex = nextLF; return foldLine(string.slice(0, nextLF), width); }()); // If we haven't reached the first content line yet, don't add an extra \n. var prevMoreIndented = string[0] === '\n' || string[0] === ' '; var moreIndented; // rest of the lines var match; while ((match = lineRe.exec(string))) { var prefix = match[1], line = match[2]; moreIndented = (line[0] === ' '); result += prefix + (!prevMoreIndented && !moreIndented && line !== '' ? '\n' : '') + foldLine(line, width); prevMoreIndented = moreIndented; } return result; } // Greedy line breaking. // Picks the longest line under the limit each time, // otherwise settles for the shortest line over the limit. // NB. More-indented lines *cannot* be folded, as that would add an extra \n. function foldLine(line, width) { if (line === '' || line[0] === ' ') return line; // Since a more-indented line adds a \n, breaks can't be followed by a space. var breakRe = / [^ ]/g; // note: the match index will always be <= length-2. var match; // start is an inclusive index. end, curr, and next are exclusive. var start = 0, end, curr = 0, next = 0; var result = ''; // Invariants: 0 <= start <= length-1. // 0 <= curr <= next <= max(0, length-2). curr - start <= width. // Inside the loop: // A match implies length >= 2, so curr and next are <= length-2. while ((match = breakRe.exec(line))) { next = match.index; // maintain invariant: curr - start <= width if (next - start > width) { end = (curr > start) ? curr : next; // derive end <= length-2 result += '\n' + line.slice(start, end); // skip the space that was output as \n start = end + 1; // derive start <= length-1 } curr = next; } // By the invariants, start <= length-1, so there is something left over. // It is either the whole string or a part starting from non-whitespace. result += '\n'; // Insert a break if the remainder is too long and there is a break available. if (line.length - start > width && curr > start) { result += line.slice(start, curr) + '\n' + line.slice(curr + 1); } else { result += line.slice(start); } return result.slice(1); // drop extra \n joiner } // Escapes a double-quoted string. function escapeString(string) { var result = ''; var char, nextChar; var escapeSeq; for (var i = 0; i < string.length; i++) { char = string.charCodeAt(i); // Check for surrogate pairs (reference Unicode 3.0 section "3.7 Surrogates"). if (char >= 0xD800 && char <= 0xDBFF/* high surrogate */) { nextChar = string.charCodeAt(i + 1); if (nextChar >= 0xDC00 && nextChar <= 0xDFFF/* low surrogate */) { // Combine the surrogate pair and store it escaped. result += encodeHex((char - 0xD800) * 0x400 + nextChar - 0xDC00 + 0x10000); // Advance index one extra since we already used that char here. i++; continue; } } escapeSeq = ESCAPE_SEQUENCES[char]; result += !escapeSeq && isPrintable(char) ? string[i] : escapeSeq || encodeHex(char); } return result; } function writeFlowSequence(state, level, object) { var _result = '', _tag = state.tag, index, length; for (index = 0, length = object.length; index < length; index += 1) { // Write only valid elements. if (writeNode(state, level, object[index], false, false)) { if (index !== 0) _result += ',' + (!state.condenseFlow ? ' ' : ''); _result += state.dump; } } state.tag = _tag; state.dump = '[' + _result + ']'; } function writeBlockSequence(state, level, object, compact) { var _result = '', _tag = state.tag, index, length; for (index = 0, length = object.length; index < length; index += 1) { // Write only valid elements. if (writeNode(state, level + 1, object[index], true, true)) { if (!compact || index !== 0) { _result += generateNextLine(state, level); } if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) { _result += '-'; } else { _result += '- '; } _result += state.dump; } } state.tag = _tag; state.dump = _result || '[]'; // Empty sequence if no valid values. } function writeFlowMapping(state, level, object) { var _result = '', _tag = state.tag, objectKeyList = Object.keys(object), index, length, objectKey, objectValue, pairBuffer; for (index = 0, length = objectKeyList.length; index < length; index += 1) { pairBuffer = state.condenseFlow ? '"' : ''; if (index !== 0) pairBuffer += ', '; objectKey = objectKeyList[index]; objectValue = object[objectKey]; if (!writeNode(state, level, objectKey, false, false)) { continue; // Skip this pair because of invalid key; } if (state.dump.length > 1024) pairBuffer += '? '; pairBuffer += state.dump + (state.condenseFlow ? '"' : '') + ':' + (state.condenseFlow ? '' : ' '); if (!writeNode(state, level, objectValue, false, false)) { continue; // Skip this pair because of invalid value. } pairBuffer += state.dump; // Both key and value are valid. _result += pairBuffer; } state.tag = _tag; state.dump = '{' + _result + '}'; } function writeBlockMapping(state, level, object, compact) { var _result = '', _tag = state.tag, objectKeyList = Object.keys(object), index, length, objectKey, objectValue, explicitPair, pairBuffer; // Allow sorting keys so that the output file is deterministic if (state.sortKeys === true) { // Default sorting objectKeyList.sort(); } else if (typeof state.sortKeys === 'function') { // Custom sort function objectKeyList.sort(state.sortKeys); } else if (state.sortKeys) { // Something is wrong throw new YAMLException('sortKeys must be a boolean or a function'); } for (index = 0, length = objectKeyList.length; index < length; index += 1) { pairBuffer = ''; if (!compact || index !== 0) { pairBuffer += generateNextLine(state, level); } objectKey = objectKeyList[index]; objectValue = object[objectKey]; if (!writeNode(state, level + 1, objectKey, true, true, true)) { continue; // Skip this pair because of invalid key. } explicitPair = (state.tag !== null && state.tag !== '?') || (state.dump && state.dump.length > 1024); if (explicitPair) { if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) { pairBuffer += '?'; } else { pairBuffer += '? '; } } pairBuffer += state.dump; if (explicitPair) { pairBuffer += generateNextLine(state, level); } if (!writeNode(state, level + 1, objectValue, true, explicitPair)) { continue; // Skip this pair because of invalid value. } if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) { pairBuffer += ':'; } else { pairBuffer += ': '; } pairBuffer += state.dump; // Both key and value are valid. _result += pairBuffer; } state.tag = _tag; state.dump = _result || '{}'; // Empty mapping if no valid pairs. } function detectType(state, object, explicit) { var _result, typeList, index, length, type, style; typeList = explicit ? state.explicitTypes : state.implicitTypes; for (index = 0, length = typeList.length; index < length; index += 1) { type = typeList[index]; if ((type.instanceOf || type.predicate) && (!type.instanceOf || ((typeof object === 'object') && (object instanceof type.instanceOf))) && (!type.predicate || type.predicate(object))) { state.tag = explicit ? type.tag : '?'; if (type.represent) { style = state.styleMap[type.tag] || type.defaultStyle; if (_toString.call(type.represent) === '[object Function]') { _result = type.represent(object, style); } else if (_hasOwnProperty.call(type.represent, style)) { _result = type.represent[style](object, style); } else { throw new YAMLException('!<' + type.tag + '> tag resolver accepts not "' + style + '" style'); } state.dump = _result; } return true; } } return false; } // Serializes `object` and writes it to global `result`. // Returns true on success, or false on invalid object. // function writeNode(state, level, object, block, compact, iskey) { state.tag = null; state.dump = object; if (!detectType(state, object, false)) { detectType(state, object, true); } var type = _toString.call(state.dump); if (block) { block = (state.flowLevel < 0 || state.flowLevel > level); } var objectOrArray = type === '[object Object]' || type === '[object Array]', duplicateIndex, duplicate; if (objectOrArray) { duplicateIndex = state.duplicates.indexOf(object); duplicate = duplicateIndex !== -1; } if ((state.tag !== null && state.tag !== '?') || duplicate || (state.indent !== 2 && level > 0)) { compact = false; } if (duplicate && state.usedDuplicates[duplicateIndex]) { state.dump = '*ref_' + duplicateIndex; } else { if (objectOrArray && duplicate && !state.usedDuplicates[duplicateIndex]) { state.usedDuplicates[duplicateIndex] = true; } if (type === '[object Object]') { if (block && (Object.keys(state.dump).length !== 0)) { writeBlockMapping(state, level, state.dump, compact); if (duplicate) { state.dump = '&ref_' + duplicateIndex + state.dump; } } else { writeFlowMapping(state, level, state.dump); if (duplicate) { state.dump = '&ref_' + duplicateIndex + ' ' + state.dump; } } } else if (type === '[object Array]') { var arrayLevel = (state.noArrayIndent && (level > 0)) ? level - 1 : level; if (block && (state.dump.length !== 0)) { writeBlockSequence(state, arrayLevel, state.dump, compact); if (duplicate) { state.dump = '&ref_' + duplicateIndex + state.dump; } } else { writeFlowSequence(state, arrayLevel, state.dump); if (duplicate) { state.dump = '&ref_' + duplicateIndex + ' ' + state.dump; } } } else if (type === '[object String]') { if (state.tag !== '?') { writeScalar(state, state.dump, level, iskey); } } else { if (state.skipInvalid) return false; throw new YAMLException('unacceptable kind of an object to dump ' + type); } if (state.tag !== null && state.tag !== '?') { state.dump = '!<' + state.tag + '> ' + state.dump; } } return true; } function getDuplicateReferences(object, state) { var objects = [], duplicatesIndexes = [], index, length; inspectNode(object, objects, duplicatesIndexes); for (index = 0, length = duplicatesIndexes.length; index < length; index += 1) { state.duplicates.push(objects[duplicatesIndexes[index]]); } state.usedDuplicates = new Array(length); } function inspectNode(object, objects, duplicatesIndexes) { var objectKeyList, index, length; if (object !== null && typeof object === 'object') { index = objects.indexOf(object); if (index !== -1) { if (duplicatesIndexes.indexOf(index) === -1) { duplicatesIndexes.push(index); } } else { objects.push(object); if (Array.isArray(object)) { for (index = 0, length = object.length; index < length; index += 1) { inspectNode(object[index], objects, duplicatesIndexes); } } else { objectKeyList = Object.keys(object); for (index = 0, length = objectKeyList.length; index < length; index += 1) { inspectNode(object[objectKeyList[index]], objects, duplicatesIndexes); } } } } } function dump(input, options) { options = options || {}; var state = new State(options); if (!state.noRefs) getDuplicateReferences(input, state); if (writeNode(state, 0, input, true, true)) return state.dump + '\n'; return ''; } function safeDump(input, options) { return dump(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options)); } module.exports.dump = dump; module.exports.safeDump = safeDump; /***/ }), /***/ 5199: /***/ ((module) => { "use strict"; // YAML error class. http://stackoverflow.com/questions/8458984 // function YAMLException(reason, mark) { // Super constructor Error.call(this); this.name = 'YAMLException'; this.reason = reason; this.mark = mark; this.message = (this.reason || '(unknown reason)') + (this.mark ? ' ' + this.mark.toString() : ''); // Include stack trace in error object if (Error.captureStackTrace) { // Chrome and NodeJS Error.captureStackTrace(this, this.constructor); } else { // FF, IE 10+ and Safari 6+. Fallback for others this.stack = (new Error()).stack || ''; } } // Inherit from Error YAMLException.prototype = Object.create(Error.prototype); YAMLException.prototype.constructor = YAMLException; YAMLException.prototype.toString = function toString(compact) { var result = this.name + ': '; result += this.reason || '(unknown reason)'; if (!compact && this.mark) { result += ' ' + this.mark.toString(); } return result; }; module.exports = YAMLException; /***/ }), /***/ 5190: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; /*eslint-disable max-len,no-use-before-define*/ var common = __webpack_require__(9136); var YAMLException = __webpack_require__(5199); var Mark = __webpack_require__(5426); var DEFAULT_SAFE_SCHEMA = __webpack_require__(8949); var DEFAULT_FULL_SCHEMA = __webpack_require__(6874); var _hasOwnProperty = Object.prototype.hasOwnProperty; var CONTEXT_FLOW_IN = 1; var CONTEXT_FLOW_OUT = 2; var CONTEXT_BLOCK_IN = 3; var CONTEXT_BLOCK_OUT = 4; var CHOMPING_CLIP = 1; var CHOMPING_STRIP = 2; var CHOMPING_KEEP = 3; var PATTERN_NON_PRINTABLE = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/; var PATTERN_NON_ASCII_LINE_BREAKS = /[\x85\u2028\u2029]/; var PATTERN_FLOW_INDICATORS = /[,\[\]\{\}]/; var PATTERN_TAG_HANDLE = /^(?:!|!!|![a-z\-]+!)$/i; var PATTERN_TAG_URI = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i; function _class(obj) { return Object.prototype.toString.call(obj); } function is_EOL(c) { return (c === 0x0A/* LF */) || (c === 0x0D/* CR */); } function is_WHITE_SPACE(c) { return (c === 0x09/* Tab */) || (c === 0x20/* Space */); } function is_WS_OR_EOL(c) { return (c === 0x09/* Tab */) || (c === 0x20/* Space */) || (c === 0x0A/* LF */) || (c === 0x0D/* CR */); } function is_FLOW_INDICATOR(c) { return c === 0x2C/* , */ || c === 0x5B/* [ */ || c === 0x5D/* ] */ || c === 0x7B/* { */ || c === 0x7D/* } */; } function fromHexCode(c) { var lc; if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) { return c - 0x30; } /*eslint-disable no-bitwise*/ lc = c | 0x20; if ((0x61/* a */ <= lc) && (lc <= 0x66/* f */)) { return lc - 0x61 + 10; } return -1; } function escapedHexLen(c) { if (c === 0x78/* x */) { return 2; } if (c === 0x75/* u */) { return 4; } if (c === 0x55/* U */) { return 8; } return 0; } function fromDecimalCode(c) { if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) { return c - 0x30; } return -1; } function simpleEscapeSequence(c) { /* eslint-disable indent */ return (c === 0x30/* 0 */) ? '\x00' : (c === 0x61/* a */) ? '\x07' : (c === 0x62/* b */) ? '\x08' : (c === 0x74/* t */) ? '\x09' : (c === 0x09/* Tab */) ? '\x09' : (c === 0x6E/* n */) ? '\x0A' : (c === 0x76/* v */) ? '\x0B' : (c === 0x66/* f */) ? '\x0C' : (c === 0x72/* r */) ? '\x0D' : (c === 0x65/* e */) ? '\x1B' : (c === 0x20/* Space */) ? ' ' : (c === 0x22/* " */) ? '\x22' : (c === 0x2F/* / */) ? '/' : (c === 0x5C/* \ */) ? '\x5C' : (c === 0x4E/* N */) ? '\x85' : (c === 0x5F/* _ */) ? '\xA0' : (c === 0x4C/* L */) ? '\u2028' : (c === 0x50/* P */) ? '\u2029' : ''; } function charFromCodepoint(c) { if (c <= 0xFFFF) { return String.fromCharCode(c); } // Encode UTF-16 surrogate pair // https://en.wikipedia.org/wiki/UTF-16#Code_points_U.2B010000_to_U.2B10FFFF return String.fromCharCode( ((c - 0x010000) >> 10) + 0xD800, ((c - 0x010000) & 0x03FF) + 0xDC00 ); } var simpleEscapeCheck = new Array(256); // integer, for fast access var simpleEscapeMap = new Array(256); for (var i = 0; i < 256; i++) { simpleEscapeCheck[i] = simpleEscapeSequence(i) ? 1 : 0; simpleEscapeMap[i] = simpleEscapeSequence(i); } function State(input, options) { this.input = input; this.filename = options['filename'] || null; this.schema = options['schema'] || DEFAULT_FULL_SCHEMA; this.onWarning = options['onWarning'] || null; this.legacy = options['legacy'] || false; this.json = options['json'] || false; this.listener = options['listener'] || null; this.implicitTypes = this.schema.compiledImplicit; this.typeMap = this.schema.compiledTypeMap; this.length = input.length; this.position = 0; this.line = 0; this.lineStart = 0; this.lineIndent = 0; this.documents = []; /* this.version; this.checkLineBreaks; this.tagMap; this.anchorMap; this.tag; this.anchor; this.kind; this.result;*/ } function generateError(state, message) { return new YAMLException( message, new Mark(state.filename, state.input, state.position, state.line, (state.position - state.lineStart))); } function throwError(state, message) { throw generateError(state, message); } function throwWarning(state, message) { if (state.onWarning) { state.onWarning.call(null, generateError(state, message)); } } var directiveHandlers = { YAML: function handleYamlDirective(state, name, args) { var match, major, minor; if (state.version !== null) { throwError(state, 'duplication of %YAML directive'); } if (args.length !== 1) { throwError(state, 'YAML directive accepts exactly one argument'); } match = /^([0-9]+)\.([0-9]+)$/.exec(args[0]); if (match === null) { throwError(state, 'ill-formed argument of the YAML directive'); } major = parseInt(match[1], 10); minor = parseInt(match[2], 10); if (major !== 1) { throwError(state, 'unacceptable YAML version of the document'); } state.version = args[0]; state.checkLineBreaks = (minor < 2); if (minor !== 1 && minor !== 2) { throwWarning(state, 'unsupported YAML version of the document'); } }, TAG: function handleTagDirective(state, name, args) { var handle, prefix; if (args.length !== 2) { throwError(state, 'TAG directive accepts exactly two arguments'); } handle = args[0]; prefix = args[1]; if (!PATTERN_TAG_HANDLE.test(handle)) { throwError(state, 'ill-formed tag handle (first argument) of the TAG directive'); } if (_hasOwnProperty.call(state.tagMap, handle)) { throwError(state, 'there is a previously declared suffix for "' + handle + '" tag handle'); } if (!PATTERN_TAG_URI.test(prefix)) { throwError(state, 'ill-formed tag prefix (second argument) of the TAG directive'); } state.tagMap[handle] = prefix; } }; function captureSegment(state, start, end, checkJson) { var _position, _length, _character, _result; if (start < end) { _result = state.input.slice(start, end); if (checkJson) { for (_position = 0, _length = _result.length; _position < _length; _position += 1) { _character = _result.charCodeAt(_position); if (!(_character === 0x09 || (0x20 <= _character && _character <= 0x10FFFF))) { throwError(state, 'expected valid JSON character'); } } } else if (PATTERN_NON_PRINTABLE.test(_result)) { throwError(state, 'the stream contains non-printable characters'); } state.result += _result; } } function mergeMappings(state, destination, source, overridableKeys) { var sourceKeys, key, index, quantity; if (!common.isObject(source)) { throwError(state, 'cannot merge mappings; the provided source object is unacceptable'); } sourceKeys = Object.keys(source); for (index = 0, quantity = sourceKeys.length; index < quantity; index += 1) { key = sourceKeys[index]; if (!_hasOwnProperty.call(destination, key)) { destination[key] = source[key]; overridableKeys[key] = true; } } } function storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, startLine, startPos) { var index, quantity; // The output is a plain object here, so keys can only be strings. // We need to convert keyNode to a string, but doing so can hang the process // (deeply nested arrays that explode exponentially using aliases). if (Array.isArray(keyNode)) { keyNode = Array.prototype.slice.call(keyNode); for (index = 0, quantity = keyNode.length; index < quantity; index += 1) { if (Array.isArray(keyNode[index])) { throwError(state, 'nested arrays are not supported inside keys'); } if (typeof keyNode === 'object' && _class(keyNode[index]) === '[object Object]') { keyNode[index] = '[object Object]'; } } } // Avoid code execution in load() via toString property // (still use its own toString for arrays, timestamps, // and whatever user schema extensions happen to have @@toStringTag) if (typeof keyNode === 'object' && _class(keyNode) === '[object Object]') { keyNode = '[object Object]'; } keyNode = String(keyNode); if (_result === null) { _result = {}; } if (keyTag === 'tag:yaml.org,2002:merge') { if (Array.isArray(valueNode)) { for (index = 0, quantity = valueNode.length; index < quantity; index += 1) { mergeMappings(state, _result, valueNode[index], overridableKeys); } } else { mergeMappings(state, _result, valueNode, overridableKeys); } } else { if (!state.json && !_hasOwnProperty.call(overridableKeys, keyNode) && _hasOwnProperty.call(_result, keyNode)) { state.line = startLine || state.line; state.position = startPos || state.position; throwError(state, 'duplicated mapping key'); } _result[keyNode] = valueNode; delete overridableKeys[keyNode]; } return _result; } function readLineBreak(state) { var ch; ch = state.input.charCodeAt(state.position); if (ch === 0x0A/* LF */) { state.position++; } else if (ch === 0x0D/* CR */) { state.position++; if (state.input.charCodeAt(state.position) === 0x0A/* LF */) { state.position++; } } else { throwError(state, 'a line break is expected'); } state.line += 1; state.lineStart = state.position; } function skipSeparationSpace(state, allowComments, checkIndent) { var lineBreaks = 0, ch = state.input.charCodeAt(state.position); while (ch !== 0) { while (is_WHITE_SPACE(ch)) { ch = state.input.charCodeAt(++state.position); } if (allowComments && ch === 0x23/* # */) { do { ch = state.input.charCodeAt(++state.position); } while (ch !== 0x0A/* LF */ && ch !== 0x0D/* CR */ && ch !== 0); } if (is_EOL(ch)) { readLineBreak(state); ch = state.input.charCodeAt(state.position); lineBreaks++; state.lineIndent = 0; while (ch === 0x20/* Space */) { state.lineIndent++; ch = state.input.charCodeAt(++state.position); } } else { break; } } if (checkIndent !== -1 && lineBreaks !== 0 && state.lineIndent < checkIndent) { throwWarning(state, 'deficient indentation'); } return lineBreaks; } function testDocumentSeparator(state) { var _position = state.position, ch; ch = state.input.charCodeAt(_position); // Condition state.position === state.lineStart is tested // in parent on each call, for efficiency. No needs to test here again. if ((ch === 0x2D/* - */ || ch === 0x2E/* . */) && ch === state.input.charCodeAt(_position + 1) && ch === state.input.charCodeAt(_position + 2)) { _position += 3; ch = state.input.charCodeAt(_position); if (ch === 0 || is_WS_OR_EOL(ch)) { return true; } } return false; } function writeFoldedLines(state, count) { if (count === 1) { state.result += ' '; } else if (count > 1) { state.result += common.repeat('\n', count - 1); } } function readPlainScalar(state, nodeIndent, withinFlowCollection) { var preceding, following, captureStart, captureEnd, hasPendingContent, _line, _lineStart, _lineIndent, _kind = state.kind, _result = state.result, ch; ch = state.input.charCodeAt(state.position); if (is_WS_OR_EOL(ch) || is_FLOW_INDICATOR(ch) || ch === 0x23/* # */ || ch === 0x26/* & */ || ch === 0x2A/* * */ || ch === 0x21/* ! */ || ch === 0x7C/* | */ || ch === 0x3E/* > */ || ch === 0x27/* ' */ || ch === 0x22/* " */ || ch === 0x25/* % */ || ch === 0x40/* @ */ || ch === 0x60/* ` */) { return false; } if (ch === 0x3F/* ? */ || ch === 0x2D/* - */) { following = state.input.charCodeAt(state.position + 1); if (is_WS_OR_EOL(following) || withinFlowCollection && is_FLOW_INDICATOR(following)) { return false; } } state.kind = 'scalar'; state.result = ''; captureStart = captureEnd = state.position; hasPendingContent = false; while (ch !== 0) { if (ch === 0x3A/* : */) { following = state.input.charCodeAt(state.position + 1); if (is_WS_OR_EOL(following) || withinFlowCollection && is_FLOW_INDICATOR(following)) { break; } } else if (ch === 0x23/* # */) { preceding = state.input.charCodeAt(state.position - 1); if (is_WS_OR_EOL(preceding)) { break; } } else if ((state.position === state.lineStart && testDocumentSeparator(state)) || withinFlowCollection && is_FLOW_INDICATOR(ch)) { break; } else if (is_EOL(ch)) { _line = state.line; _lineStart = state.lineStart; _lineIndent = state.lineIndent; skipSeparationSpace(state, false, -1); if (state.lineIndent >= nodeIndent) { hasPendingContent = true; ch = state.input.charCodeAt(state.position); continue; } else { state.position = captureEnd; state.line = _line; state.lineStart = _lineStart; state.lineIndent = _lineIndent; break; } } if (hasPendingContent) { captureSegment(state, captureStart, captureEnd, false); writeFoldedLines(state, state.line - _line); captureStart = captureEnd = state.position; hasPendingContent = false; } if (!is_WHITE_SPACE(ch)) { captureEnd = state.position + 1; } ch = state.input.charCodeAt(++state.position); } captureSegment(state, captureStart, captureEnd, false); if (state.result) { return true; } state.kind = _kind; state.result = _result; return false; } function readSingleQuotedScalar(state, nodeIndent) { var ch, captureStart, captureEnd; ch = state.input.charCodeAt(state.position); if (ch !== 0x27/* ' */) { return false; } state.kind = 'scalar'; state.result = ''; state.position++; captureStart = captureEnd = state.position; while ((ch = state.input.charCodeAt(state.position)) !== 0) { if (ch === 0x27/* ' */) { captureSegment(state, captureStart, state.position, true); ch = state.input.charCodeAt(++state.position); if (ch === 0x27/* ' */) { captureStart = state.position; state.position++; captureEnd = state.position; } else { return true; } } else if (is_EOL(ch)) { captureSegment(state, captureStart, captureEnd, true); writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent)); captureStart = captureEnd = state.position; } else if (state.position === state.lineStart && testDocumentSeparator(state)) { throwError(state, 'unexpected end of the document within a single quoted scalar'); } else { state.position++; captureEnd = state.position; } } throwError(state, 'unexpected end of the stream within a single quoted scalar'); } function readDoubleQuotedScalar(state, nodeIndent) { var captureStart, captureEnd, hexLength, hexResult, tmp, ch; ch = state.input.charCodeAt(state.position); if (ch !== 0x22/* " */) { return false; } state.kind = 'scalar'; state.result = ''; state.position++; captureStart = captureEnd = state.position; while ((ch = state.input.charCodeAt(state.position)) !== 0) { if (ch === 0x22/* " */) { captureSegment(state, captureStart, state.position, true); state.position++; return true; } else if (ch === 0x5C/* \ */) { captureSegment(state, captureStart, state.position, true); ch = state.input.charCodeAt(++state.position); if (is_EOL(ch)) { skipSeparationSpace(state, false, nodeIndent); // TODO: rework to inline fn with no type cast? } else if (ch < 256 && simpleEscapeCheck[ch]) { state.result += simpleEscapeMap[ch]; state.position++; } else if ((tmp = escapedHexLen(ch)) > 0) { hexLength = tmp; hexResult = 0; for (; hexLength > 0; hexLength--) { ch = state.input.charCodeAt(++state.position); if ((tmp = fromHexCode(ch)) >= 0) { hexResult = (hexResult << 4) + tmp; } else { throwError(state, 'expected hexadecimal character'); } } state.result += charFromCodepoint(hexResult); state.position++; } else { throwError(state, 'unknown escape sequence'); } captureStart = captureEnd = state.position; } else if (is_EOL(ch)) { captureSegment(state, captureStart, captureEnd, true); writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent)); captureStart = captureEnd = state.position; } else if (state.position === state.lineStart && testDocumentSeparator(state)) { throwError(state, 'unexpected end of the document within a double quoted scalar'); } else { state.position++; captureEnd = state.position; } } throwError(state, 'unexpected end of the stream within a double quoted scalar'); } function readFlowCollection(state, nodeIndent) { var readNext = true, _line, _tag = state.tag, _result, _anchor = state.anchor, following, terminator, isPair, isExplicitPair, isMapping, overridableKeys = {}, keyNode, keyTag, valueNode, ch; ch = state.input.charCodeAt(state.position); if (ch === 0x5B/* [ */) { terminator = 0x5D;/* ] */ isMapping = false; _result = []; } else if (ch === 0x7B/* { */) { terminator = 0x7D;/* } */ isMapping = true; _result = {}; } else { return false; } if (state.anchor !== null) { state.anchorMap[state.anchor] = _result; } ch = state.input.charCodeAt(++state.position); while (ch !== 0) { skipSeparationSpace(state, true, nodeIndent); ch = state.input.charCodeAt(state.position); if (ch === terminator) { state.position++; state.tag = _tag; state.anchor = _anchor; state.kind = isMapping ? 'mapping' : 'sequence'; state.result = _result; return true; } else if (!readNext) { throwError(state, 'missed comma between flow collection entries'); } keyTag = keyNode = valueNode = null; isPair = isExplicitPair = false; if (ch === 0x3F/* ? */) { following = state.input.charCodeAt(state.position + 1); if (is_WS_OR_EOL(following)) { isPair = isExplicitPair = true; state.position++; skipSeparationSpace(state, true, nodeIndent); } } _line = state.line; composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true); keyTag = state.tag; keyNode = state.result; skipSeparationSpace(state, true, nodeIndent); ch = state.input.charCodeAt(state.position); if ((isExplicitPair || state.line === _line) && ch === 0x3A/* : */) { isPair = true; ch = state.input.charCodeAt(++state.position); skipSeparationSpace(state, true, nodeIndent); composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true); valueNode = state.result; } if (isMapping) { storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode); } else if (isPair) { _result.push(storeMappingPair(state, null, overridableKeys, keyTag, keyNode, valueNode)); } else { _result.push(keyNode); } skipSeparationSpace(state, true, nodeIndent); ch = state.input.charCodeAt(state.position); if (ch === 0x2C/* , */) { readNext = true; ch = state.input.charCodeAt(++state.position); } else { readNext = false; } } throwError(state, 'unexpected end of the stream within a flow collection'); } function readBlockScalar(state, nodeIndent) { var captureStart, folding, chomping = CHOMPING_CLIP, didReadContent = false, detectedIndent = false, textIndent = nodeIndent, emptyLines = 0, atMoreIndented = false, tmp, ch; ch = state.input.charCodeAt(state.position); if (ch === 0x7C/* | */) { folding = false; } else if (ch === 0x3E/* > */) { folding = true; } else { return false; } state.kind = 'scalar'; state.result = ''; while (ch !== 0) { ch = state.input.charCodeAt(++state.position); if (ch === 0x2B/* + */ || ch === 0x2D/* - */) { if (CHOMPING_CLIP === chomping) { chomping = (ch === 0x2B/* + */) ? CHOMPING_KEEP : CHOMPING_STRIP; } else { throwError(state, 'repeat of a chomping mode identifier'); } } else if ((tmp = fromDecimalCode(ch)) >= 0) { if (tmp === 0) { throwError(state, 'bad explicit indentation width of a block scalar; it cannot be less than one'); } else if (!detectedIndent) { textIndent = nodeIndent + tmp - 1; detectedIndent = true; } else { throwError(state, 'repeat of an indentation width identifier'); } } else { break; } } if (is_WHITE_SPACE(ch)) { do { ch = state.input.charCodeAt(++state.position); } while (is_WHITE_SPACE(ch)); if (ch === 0x23/* # */) { do { ch = state.input.charCodeAt(++state.position); } while (!is_EOL(ch) && (ch !== 0)); } } while (ch !== 0) { readLineBreak(state); state.lineIndent = 0; ch = state.input.charCodeAt(state.position); while ((!detectedIndent || state.lineIndent < textIndent) && (ch === 0x20/* Space */)) { state.lineIndent++; ch = state.input.charCodeAt(++state.position); } if (!detectedIndent && state.lineIndent > textIndent) { textIndent = state.lineIndent; } if (is_EOL(ch)) { emptyLines++; continue; } // End of the scalar. if (state.lineIndent < textIndent) { // Perform the chomping. if (chomping === CHOMPING_KEEP) { state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines); } else if (chomping === CHOMPING_CLIP) { if (didReadContent) { // i.e. only if the scalar is not empty. state.result += '\n'; } } // Break this `while` cycle and go to the funciton's epilogue. break; } // Folded style: use fancy rules to handle line breaks. if (folding) { // Lines starting with white space characters (more-indented lines) are not folded. if (is_WHITE_SPACE(ch)) { atMoreIndented = true; // except for the first content line (cf. Example 8.1) state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines); // End of more-indented block. } else if (atMoreIndented) { atMoreIndented = false; state.result += common.repeat('\n', emptyLines + 1); // Just one line break - perceive as the same line. } else if (emptyLines === 0) { if (didReadContent) { // i.e. only if we have already read some scalar content. state.result += ' '; } // Several line breaks - perceive as different lines. } else { state.result += common.repeat('\n', emptyLines); } // Literal style: just add exact number of line breaks between content lines. } else { // Keep all line breaks except the header line break. state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines); } didReadContent = true; detectedIndent = true; emptyLines = 0; captureStart = state.position; while (!is_EOL(ch) && (ch !== 0)) { ch = state.input.charCodeAt(++state.position); } captureSegment(state, captureStart, state.position, false); } return true; } function readBlockSequence(state, nodeIndent) { var _line, _tag = state.tag, _anchor = state.anchor, _result = [], following, detected = false, ch; if (state.anchor !== null) { state.anchorMap[state.anchor] = _result; } ch = state.input.charCodeAt(state.position); while (ch !== 0) { if (ch !== 0x2D/* - */) { break; } following = state.input.charCodeAt(state.position + 1); if (!is_WS_OR_EOL(following)) { break; } detected = true; state.position++; if (skipSeparationSpace(state, true, -1)) { if (state.lineIndent <= nodeIndent) { _result.push(null); ch = state.input.charCodeAt(state.position); continue; } } _line = state.line; composeNode(state, nodeIndent, CONTEXT_BLOCK_IN, false, true); _result.push(state.result); skipSeparationSpace(state, true, -1); ch = state.input.charCodeAt(state.position); if ((state.line === _line || state.lineIndent > nodeIndent) && (ch !== 0)) { throwError(state, 'bad indentation of a sequence entry'); } else if (state.lineIndent < nodeIndent) { break; } } if (detected) { state.tag = _tag; state.anchor = _anchor; state.kind = 'sequence'; state.result = _result; return true; } return false; } function readBlockMapping(state, nodeIndent, flowIndent) { var following, allowCompact, _line, _pos, _tag = state.tag, _anchor = state.anchor, _result = {}, overridableKeys = {}, keyTag = null, keyNode = null, valueNode = null, atExplicitKey = false, detected = false, ch; if (state.anchor !== null) { state.anchorMap[state.anchor] = _result; } ch = state.input.charCodeAt(state.position); while (ch !== 0) { following = state.input.charCodeAt(state.position + 1); _line = state.line; // Save the current line. _pos = state.position; // // Explicit notation case. There are two separate blocks: // first for the key (denoted by "?") and second for the value (denoted by ":") // if ((ch === 0x3F/* ? */ || ch === 0x3A/* : */) && is_WS_OR_EOL(following)) { if (ch === 0x3F/* ? */) { if (atExplicitKey) { storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null); keyTag = keyNode = valueNode = null; } detected = true; atExplicitKey = true; allowCompact = true; } else if (atExplicitKey) { // i.e. 0x3A/* : */ === character after the explicit key. atExplicitKey = false; allowCompact = true; } else { throwError(state, 'incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line'); } state.position += 1; ch = following; // // Implicit notation case. Flow-style node as the key first, then ":", and the value. // } else if (composeNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)) { if (state.line === _line) { ch = state.input.charCodeAt(state.position); while (is_WHITE_SPACE(ch)) { ch = state.input.charCodeAt(++state.position); } if (ch === 0x3A/* : */) { ch = state.input.charCodeAt(++state.position); if (!is_WS_OR_EOL(ch)) { throwError(state, 'a whitespace character is expected after the key-value separator within a block mapping'); } if (atExplicitKey) { storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null); keyTag = keyNode = valueNode = null; } detected = true; atExplicitKey = false; allowCompact = false; keyTag = state.tag; keyNode = state.result; } else if (detected) { throwError(state, 'can not read an implicit mapping pair; a colon is missed'); } else { state.tag = _tag; state.anchor = _anchor; return true; // Keep the result of `composeNode`. } } else if (detected) { throwError(state, 'can not read a block mapping entry; a multiline key may not be an implicit key'); } else { state.tag = _tag; state.anchor = _anchor; return true; // Keep the result of `composeNode`. } } else { break; // Reading is done. Go to the epilogue. } // // Common reading code for both explicit and implicit notations. // if (state.line === _line || state.lineIndent > nodeIndent) { if (composeNode(state, nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) { if (atExplicitKey) { keyNode = state.result; } else { valueNode = state.result; } } if (!atExplicitKey) { storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _line, _pos); keyTag = keyNode = valueNode = null; } skipSeparationSpace(state, true, -1); ch = state.input.charCodeAt(state.position); } if (state.lineIndent > nodeIndent && (ch !== 0)) { throwError(state, 'bad indentation of a mapping entry'); } else if (state.lineIndent < nodeIndent) { break; } } // // Epilogue. // // Special case: last mapping's node contains only the key in explicit notation. if (atExplicitKey) { storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null); } // Expose the resulting mapping. if (detected) { state.tag = _tag; state.anchor = _anchor; state.kind = 'mapping'; state.result = _result; } return detected; } function readTagProperty(state) { var _position, isVerbatim = false, isNamed = false, tagHandle, tagName, ch; ch = state.input.charCodeAt(state.position); if (ch !== 0x21/* ! */) return false; if (state.tag !== null) { throwError(state, 'duplication of a tag property'); } ch = state.input.charCodeAt(++state.position); if (ch === 0x3C/* < */) { isVerbatim = true; ch = state.input.charCodeAt(++state.position); } else if (ch === 0x21/* ! */) { isNamed = true; tagHandle = '!!'; ch = state.input.charCodeAt(++state.position); } else { tagHandle = '!'; } _position = state.position; if (isVerbatim) { do { ch = state.input.charCodeAt(++state.position); } while (ch !== 0 && ch !== 0x3E/* > */); if (state.position < state.length) { tagName = state.input.slice(_position, state.position); ch = state.input.charCodeAt(++state.position); } else { throwError(state, 'unexpected end of the stream within a verbatim tag'); } } else { while (ch !== 0 && !is_WS_OR_EOL(ch)) { if (ch === 0x21/* ! */) { if (!isNamed) { tagHandle = state.input.slice(_position - 1, state.position + 1); if (!PATTERN_TAG_HANDLE.test(tagHandle)) { throwError(state, 'named tag handle cannot contain such characters'); } isNamed = true; _position = state.position + 1; } else { throwError(state, 'tag suffix cannot contain exclamation marks'); } } ch = state.input.charCodeAt(++state.position); } tagName = state.input.slice(_position, state.position); if (PATTERN_FLOW_INDICATORS.test(tagName)) { throwError(state, 'tag suffix cannot contain flow indicator characters'); } } if (tagName && !PATTERN_TAG_URI.test(tagName)) { throwError(state, 'tag name cannot contain such characters: ' + tagName); } if (isVerbatim) { state.tag = tagName; } else if (_hasOwnProperty.call(state.tagMap, tagHandle)) { state.tag = state.tagMap[tagHandle] + tagName; } else if (tagHandle === '!') { state.tag = '!' + tagName; } else if (tagHandle === '!!') { state.tag = 'tag:yaml.org,2002:' + tagName; } else { throwError(state, 'undeclared tag handle "' + tagHandle + '"'); } return true; } function readAnchorProperty(state) { var _position, ch; ch = state.input.charCodeAt(state.position); if (ch !== 0x26/* & */) return false; if (state.anchor !== null) { throwError(state, 'duplication of an anchor property'); } ch = state.input.charCodeAt(++state.position); _position = state.position; while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) { ch = state.input.charCodeAt(++state.position); } if (state.position === _position) { throwError(state, 'name of an anchor node must contain at least one character'); } state.anchor = state.input.slice(_position, state.position); return true; } function readAlias(state) { var _position, alias, ch; ch = state.input.charCodeAt(state.position); if (ch !== 0x2A/* * */) return false; ch = state.input.charCodeAt(++state.position); _position = state.position; while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) { ch = state.input.charCodeAt(++state.position); } if (state.position === _position) { throwError(state, 'name of an alias node must contain at least one character'); } alias = state.input.slice(_position, state.position); if (!state.anchorMap.hasOwnProperty(alias)) { throwError(state, 'unidentified alias "' + alias + '"'); } state.result = state.anchorMap[alias]; skipSeparationSpace(state, true, -1); return true; } function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact) { var allowBlockStyles, allowBlockScalars, allowBlockCollections, indentStatus = 1, // 1: this>parent, 0: this=parent, -1: this parentIndent) { indentStatus = 1; } else if (state.lineIndent === parentIndent) { indentStatus = 0; } else if (state.lineIndent < parentIndent) { indentStatus = -1; } } } if (indentStatus === 1) { while (readTagProperty(state) || readAnchorProperty(state)) { if (skipSeparationSpace(state, true, -1)) { atNewLine = true; allowBlockCollections = allowBlockStyles; if (state.lineIndent > parentIndent) { indentStatus = 1; } else if (state.lineIndent === parentIndent) { indentStatus = 0; } else if (state.lineIndent < parentIndent) { indentStatus = -1; } } else { allowBlockCollections = false; } } } if (allowBlockCollections) { allowBlockCollections = atNewLine || allowCompact; } if (indentStatus === 1 || CONTEXT_BLOCK_OUT === nodeContext) { if (CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext) { flowIndent = parentIndent; } else { flowIndent = parentIndent + 1; } blockIndent = state.position - state.lineStart; if (indentStatus === 1) { if (allowBlockCollections && (readBlockSequence(state, blockIndent) || readBlockMapping(state, blockIndent, flowIndent)) || readFlowCollection(state, flowIndent)) { hasContent = true; } else { if ((allowBlockScalars && readBlockScalar(state, flowIndent)) || readSingleQuotedScalar(state, flowIndent) || readDoubleQuotedScalar(state, flowIndent)) { hasContent = true; } else if (readAlias(state)) { hasContent = true; if (state.tag !== null || state.anchor !== null) { throwError(state, 'alias node should not have any properties'); } } else if (readPlainScalar(state, flowIndent, CONTEXT_FLOW_IN === nodeContext)) { hasContent = true; if (state.tag === null) { state.tag = '?'; } } if (state.anchor !== null) { state.anchorMap[state.anchor] = state.result; } } } else if (indentStatus === 0) { // Special case: block sequences are allowed to have same indentation level as the parent. // http://www.yaml.org/spec/1.2/spec.html#id2799784 hasContent = allowBlockCollections && readBlockSequence(state, blockIndent); } } if (state.tag !== null && state.tag !== '!') { if (state.tag === '?') { for (typeIndex = 0, typeQuantity = state.implicitTypes.length; typeIndex < typeQuantity; typeIndex += 1) { type = state.implicitTypes[typeIndex]; // Implicit resolving is not allowed for non-scalar types, and '?' // non-specific tag is only assigned to plain scalars. So, it isn't // needed to check for 'kind' conformity. if (type.resolve(state.result)) { // `state.result` updated in resolver if matched state.result = type.construct(state.result); state.tag = type.tag; if (state.anchor !== null) { state.anchorMap[state.anchor] = state.result; } break; } } } else if (_hasOwnProperty.call(state.typeMap[state.kind || 'fallback'], state.tag)) { type = state.typeMap[state.kind || 'fallback'][state.tag]; if (state.result !== null && type.kind !== state.kind) { throwError(state, 'unacceptable node kind for !<' + state.tag + '> tag; it should be "' + type.kind + '", not "' + state.kind + '"'); } if (!type.resolve(state.result)) { // `state.result` updated in resolver if matched throwError(state, 'cannot resolve a node with !<' + state.tag + '> explicit tag'); } else { state.result = type.construct(state.result); if (state.anchor !== null) { state.anchorMap[state.anchor] = state.result; } } } else { throwError(state, 'unknown tag !<' + state.tag + '>'); } } if (state.listener !== null) { state.listener('close', state); } return state.tag !== null || state.anchor !== null || hasContent; } function readDocument(state) { var documentStart = state.position, _position, directiveName, directiveArgs, hasDirectives = false, ch; state.version = null; state.checkLineBreaks = state.legacy; state.tagMap = {}; state.anchorMap = {}; while ((ch = state.input.charCodeAt(state.position)) !== 0) { skipSeparationSpace(state, true, -1); ch = state.input.charCodeAt(state.position); if (state.lineIndent > 0 || ch !== 0x25/* % */) { break; } hasDirectives = true; ch = state.input.charCodeAt(++state.position); _position = state.position; while (ch !== 0 && !is_WS_OR_EOL(ch)) { ch = state.input.charCodeAt(++state.position); } directiveName = state.input.slice(_position, state.position); directiveArgs = []; if (directiveName.length < 1) { throwError(state, 'directive name must not be less than one character in length'); } while (ch !== 0) { while (is_WHITE_SPACE(ch)) { ch = state.input.charCodeAt(++state.position); } if (ch === 0x23/* # */) { do { ch = state.input.charCodeAt(++state.position); } while (ch !== 0 && !is_EOL(ch)); break; } if (is_EOL(ch)) break; _position = state.position; while (ch !== 0 && !is_WS_OR_EOL(ch)) { ch = state.input.charCodeAt(++state.position); } directiveArgs.push(state.input.slice(_position, state.position)); } if (ch !== 0) readLineBreak(state); if (_hasOwnProperty.call(directiveHandlers, directiveName)) { directiveHandlers[directiveName](state, directiveName, directiveArgs); } else { throwWarning(state, 'unknown document directive "' + directiveName + '"'); } } skipSeparationSpace(state, true, -1); if (state.lineIndent === 0 && state.input.charCodeAt(state.position) === 0x2D/* - */ && state.input.charCodeAt(state.position + 1) === 0x2D/* - */ && state.input.charCodeAt(state.position + 2) === 0x2D/* - */) { state.position += 3; skipSeparationSpace(state, true, -1); } else if (hasDirectives) { throwError(state, 'directives end mark is expected'); } composeNode(state, state.lineIndent - 1, CONTEXT_BLOCK_OUT, false, true); skipSeparationSpace(state, true, -1); if (state.checkLineBreaks && PATTERN_NON_ASCII_LINE_BREAKS.test(state.input.slice(documentStart, state.position))) { throwWarning(state, 'non-ASCII line breaks are interpreted as content'); } state.documents.push(state.result); if (state.position === state.lineStart && testDocumentSeparator(state)) { if (state.input.charCodeAt(state.position) === 0x2E/* . */) { state.position += 3; skipSeparationSpace(state, true, -1); } return; } if (state.position < (state.length - 1)) { throwError(state, 'end of the stream or a document separator is expected'); } else { return; } } function loadDocuments(input, options) { input = String(input); options = options || {}; if (input.length !== 0) { // Add tailing `\n` if not exists if (input.charCodeAt(input.length - 1) !== 0x0A/* LF */ && input.charCodeAt(input.length - 1) !== 0x0D/* CR */) { input += '\n'; } // Strip BOM if (input.charCodeAt(0) === 0xFEFF) { input = input.slice(1); } } var state = new State(input, options); // Use 0 as string terminator. That significantly simplifies bounds check. state.input += '\0'; while (state.input.charCodeAt(state.position) === 0x20/* Space */) { state.lineIndent += 1; state.position += 1; } while (state.position < (state.length - 1)) { readDocument(state); } return state.documents; } function loadAll(input, iterator, options) { var documents = loadDocuments(input, options), index, length; if (typeof iterator !== 'function') { return documents; } for (index = 0, length = documents.length; index < length; index += 1) { iterator(documents[index]); } } function load(input, options) { var documents = loadDocuments(input, options); if (documents.length === 0) { /*eslint-disable no-undefined*/ return undefined; } else if (documents.length === 1) { return documents[0]; } throw new YAMLException('expected a single document in the stream, but found more'); } function safeLoadAll(input, output, options) { if (typeof output === 'function') { loadAll(input, output, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options)); } else { return loadAll(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options)); } } function safeLoad(input, options) { return load(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options)); } module.exports.loadAll = loadAll; module.exports.load = load; module.exports.safeLoadAll = safeLoadAll; module.exports.safeLoad = safeLoad; /***/ }), /***/ 5426: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var common = __webpack_require__(9136); function Mark(name, buffer, position, line, column) { this.name = name; this.buffer = buffer; this.position = position; this.line = line; this.column = column; } Mark.prototype.getSnippet = function getSnippet(indent, maxLength) { var head, start, tail, end, snippet; if (!this.buffer) return null; indent = indent || 4; maxLength = maxLength || 75; head = ''; start = this.position; while (start > 0 && '\x00\r\n\x85\u2028\u2029'.indexOf(this.buffer.charAt(start - 1)) === -1) { start -= 1; if (this.position - start > (maxLength / 2 - 1)) { head = ' ... '; start += 5; break; } } tail = ''; end = this.position; while (end < this.buffer.length && '\x00\r\n\x85\u2028\u2029'.indexOf(this.buffer.charAt(end)) === -1) { end += 1; if (end - this.position > (maxLength / 2 - 1)) { tail = ' ... '; end -= 5; break; } } snippet = this.buffer.slice(start, end); return common.repeat(' ', indent) + head + snippet + tail + '\n' + common.repeat(' ', indent + this.position - start + head.length) + '^'; }; Mark.prototype.toString = function toString(compact) { var snippet, where = ''; if (this.name) { where += 'in "' + this.name + '" '; } where += 'at line ' + (this.line + 1) + ', column ' + (this.column + 1); if (!compact) { snippet = this.getSnippet(); if (snippet) { where += ':\n' + snippet; } } return where; }; module.exports = Mark; /***/ }), /***/ 6514: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; /*eslint-disable max-len*/ var common = __webpack_require__(9136); var YAMLException = __webpack_require__(5199); var Type = __webpack_require__(967); function compileList(schema, name, result) { var exclude = []; schema.include.forEach(function (includedSchema) { result = compileList(includedSchema, name, result); }); schema[name].forEach(function (currentType) { result.forEach(function (previousType, previousIndex) { if (previousType.tag === currentType.tag && previousType.kind === currentType.kind) { exclude.push(previousIndex); } }); result.push(currentType); }); return result.filter(function (type, index) { return exclude.indexOf(index) === -1; }); } function compileMap(/* lists... */) { var result = { scalar: {}, sequence: {}, mapping: {}, fallback: {} }, index, length; function collectType(type) { result[type.kind][type.tag] = result['fallback'][type.tag] = type; } for (index = 0, length = arguments.length; index < length; index += 1) { arguments[index].forEach(collectType); } return result; } function Schema(definition) { this.include = definition.include || []; this.implicit = definition.implicit || []; this.explicit = definition.explicit || []; this.implicit.forEach(function (type) { if (type.loadKind && type.loadKind !== 'scalar') { throw new YAMLException('There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.'); } }); this.compiledImplicit = compileList(this, 'implicit', []); this.compiledExplicit = compileList(this, 'explicit', []); this.compiledTypeMap = compileMap(this.compiledImplicit, this.compiledExplicit); } Schema.DEFAULT = null; Schema.create = function createSchema() { var schemas, types; switch (arguments.length) { case 1: schemas = Schema.DEFAULT; types = arguments[0]; break; case 2: schemas = arguments[0]; types = arguments[1]; break; default: throw new YAMLException('Wrong number of arguments for Schema.create function'); } schemas = common.toArray(schemas); types = common.toArray(types); if (!schemas.every(function (schema) { return schema instanceof Schema; })) { throw new YAMLException('Specified list of super schemas (or a single Schema object) contains a non-Schema object.'); } if (!types.every(function (type) { return type instanceof Type; })) { throw new YAMLException('Specified list of YAML types (or a single Type object) contains a non-Type object.'); } return new Schema({ include: schemas, explicit: types }); }; module.exports = Schema; /***/ }), /***/ 2183: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; // Standard YAML's Core schema. // http://www.yaml.org/spec/1.2/spec.html#id2804923 // // NOTE: JS-YAML does not support schema-specific tag resolution restrictions. // So, Core schema has no distinctions from JSON schema is JS-YAML. var Schema = __webpack_require__(6514); module.exports = new Schema({ include: [ __webpack_require__(1571) ] }); /***/ }), /***/ 6874: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; // JS-YAML's default schema for `load` function. // It is not described in the YAML specification. // // This schema is based on JS-YAML's default safe schema and includes // JavaScript-specific types: !!js/undefined, !!js/regexp and !!js/function. // // Also this schema is used as default base schema at `Schema.create` function. var Schema = __webpack_require__(6514); module.exports = Schema.DEFAULT = new Schema({ include: [ __webpack_require__(8949) ], explicit: [ __webpack_require__(5914), __webpack_require__(9242), __webpack_require__(7278) ] }); /***/ }), /***/ 8949: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; // JS-YAML's default schema for `safeLoad` function. // It is not described in the YAML specification. // // This schema is based on standard YAML's Core schema and includes most of // extra types described at YAML tag repository. (http://yaml.org/type/) var Schema = __webpack_require__(6514); module.exports = new Schema({ include: [ __webpack_require__(2183) ], implicit: [ __webpack_require__(3714), __webpack_require__(1393) ], explicit: [ __webpack_require__(2551), __webpack_require__(6668), __webpack_require__(6039), __webpack_require__(9237) ] }); /***/ }), /***/ 6037: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; // Standard YAML's Failsafe schema. // http://www.yaml.org/spec/1.2/spec.html#id2802346 var Schema = __webpack_require__(6514); module.exports = new Schema({ explicit: [ __webpack_require__(2672), __webpack_require__(5490), __webpack_require__(1173) ] }); /***/ }), /***/ 1571: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; // Standard YAML's JSON schema. // http://www.yaml.org/spec/1.2/spec.html#id2803231 // // NOTE: JS-YAML does not support schema-specific tag resolution restrictions. // So, this schema is not such strict as defined in the YAML specification. // It allows numbers in binary notaion, use `Null` and `NULL` as `null`, etc. var Schema = __webpack_require__(6514); module.exports = new Schema({ include: [ __webpack_require__(6037) ], implicit: [ __webpack_require__(2671), __webpack_require__(4675), __webpack_require__(9963), __webpack_require__(5564) ] }); /***/ }), /***/ 967: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var YAMLException = __webpack_require__(5199); var TYPE_CONSTRUCTOR_OPTIONS = [ 'kind', 'resolve', 'construct', 'instanceOf', 'predicate', 'represent', 'defaultStyle', 'styleAliases' ]; var YAML_NODE_KINDS = [ 'scalar', 'sequence', 'mapping' ]; function compileStyleAliases(map) { var result = {}; if (map !== null) { Object.keys(map).forEach(function (style) { map[style].forEach(function (alias) { result[String(alias)] = style; }); }); } return result; } function Type(tag, options) { options = options || {}; Object.keys(options).forEach(function (name) { if (TYPE_CONSTRUCTOR_OPTIONS.indexOf(name) === -1) { throw new YAMLException('Unknown option "' + name + '" is met in definition of "' + tag + '" YAML type.'); } }); // TODO: Add tag format check. this.tag = tag; this.kind = options['kind'] || null; this.resolve = options['resolve'] || function () { return true; }; this.construct = options['construct'] || function (data) { return data; }; this.instanceOf = options['instanceOf'] || null; this.predicate = options['predicate'] || null; this.represent = options['represent'] || null; this.defaultStyle = options['defaultStyle'] || null; this.styleAliases = compileStyleAliases(options['styleAliases'] || null); if (YAML_NODE_KINDS.indexOf(this.kind) === -1) { throw new YAMLException('Unknown kind "' + this.kind + '" is specified for "' + tag + '" YAML type.'); } } module.exports = Type; /***/ }), /***/ 2551: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; /*eslint-disable no-bitwise*/ var NodeBuffer; try { // A trick for browserified version, to not include `Buffer` shim var _require = require; NodeBuffer = _require('buffer').Buffer; } catch (__) {} var Type = __webpack_require__(967); // [ 64, 65, 66 ] -> [ padding, CR, LF ] var BASE64_MAP = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r'; function resolveYamlBinary(data) { if (data === null) return false; var code, idx, bitlen = 0, max = data.length, map = BASE64_MAP; // Convert one by one. for (idx = 0; idx < max; idx++) { code = map.indexOf(data.charAt(idx)); // Skip CR/LF if (code > 64) continue; // Fail on illegal characters if (code < 0) return false; bitlen += 6; } // If there are any bits left, source was corrupted return (bitlen % 8) === 0; } function constructYamlBinary(data) { var idx, tailbits, input = data.replace(/[\r\n=]/g, ''), // remove CR/LF & padding to simplify scan max = input.length, map = BASE64_MAP, bits = 0, result = []; // Collect by 6*4 bits (3 bytes) for (idx = 0; idx < max; idx++) { if ((idx % 4 === 0) && idx) { result.push((bits >> 16) & 0xFF); result.push((bits >> 8) & 0xFF); result.push(bits & 0xFF); } bits = (bits << 6) | map.indexOf(input.charAt(idx)); } // Dump tail tailbits = (max % 4) * 6; if (tailbits === 0) { result.push((bits >> 16) & 0xFF); result.push((bits >> 8) & 0xFF); result.push(bits & 0xFF); } else if (tailbits === 18) { result.push((bits >> 10) & 0xFF); result.push((bits >> 2) & 0xFF); } else if (tailbits === 12) { result.push((bits >> 4) & 0xFF); } // Wrap into Buffer for NodeJS and leave Array for browser if (NodeBuffer) { // Support node 6.+ Buffer API when available return NodeBuffer.from ? NodeBuffer.from(result) : new NodeBuffer(result); } return result; } function representYamlBinary(object /*, style*/) { var result = '', bits = 0, idx, tail, max = object.length, map = BASE64_MAP; // Convert every three bytes to 4 ASCII characters. for (idx = 0; idx < max; idx++) { if ((idx % 3 === 0) && idx) { result += map[(bits >> 18) & 0x3F]; result += map[(bits >> 12) & 0x3F]; result += map[(bits >> 6) & 0x3F]; result += map[bits & 0x3F]; } bits = (bits << 8) + object[idx]; } // Dump tail tail = max % 3; if (tail === 0) { result += map[(bits >> 18) & 0x3F]; result += map[(bits >> 12) & 0x3F]; result += map[(bits >> 6) & 0x3F]; result += map[bits & 0x3F]; } else if (tail === 2) { result += map[(bits >> 10) & 0x3F]; result += map[(bits >> 4) & 0x3F]; result += map[(bits << 2) & 0x3F]; result += map[64]; } else if (tail === 1) { result += map[(bits >> 2) & 0x3F]; result += map[(bits << 4) & 0x3F]; result += map[64]; result += map[64]; } return result; } function isBinary(object) { return NodeBuffer && NodeBuffer.isBuffer(object); } module.exports = new Type('tag:yaml.org,2002:binary', { kind: 'scalar', resolve: resolveYamlBinary, construct: constructYamlBinary, predicate: isBinary, represent: representYamlBinary }); /***/ }), /***/ 4675: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var Type = __webpack_require__(967); function resolveYamlBoolean(data) { if (data === null) return false; var max = data.length; return (max === 4 && (data === 'true' || data === 'True' || data === 'TRUE')) || (max === 5 && (data === 'false' || data === 'False' || data === 'FALSE')); } function constructYamlBoolean(data) { return data === 'true' || data === 'True' || data === 'TRUE'; } function isBoolean(object) { return Object.prototype.toString.call(object) === '[object Boolean]'; } module.exports = new Type('tag:yaml.org,2002:bool', { kind: 'scalar', resolve: resolveYamlBoolean, construct: constructYamlBoolean, predicate: isBoolean, represent: { lowercase: function (object) { return object ? 'true' : 'false'; }, uppercase: function (object) { return object ? 'TRUE' : 'FALSE'; }, camelcase: function (object) { return object ? 'True' : 'False'; } }, defaultStyle: 'lowercase' }); /***/ }), /***/ 5564: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var common = __webpack_require__(9136); var Type = __webpack_require__(967); var YAML_FLOAT_PATTERN = new RegExp( // 2.5e4, 2.5 and integers '^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?' + // .2e4, .2 // special case, seems not from spec '|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?' + // 20:59 '|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*' + // .inf '|[-+]?\\.(?:inf|Inf|INF)' + // .nan '|\\.(?:nan|NaN|NAN))$'); function resolveYamlFloat(data) { if (data === null) return false; if (!YAML_FLOAT_PATTERN.test(data) || // Quick hack to not allow integers end with `_` // Probably should update regexp & check speed data[data.length - 1] === '_') { return false; } return true; } function constructYamlFloat(data) { var value, sign, base, digits; value = data.replace(/_/g, '').toLowerCase(); sign = value[0] === '-' ? -1 : 1; digits = []; if ('+-'.indexOf(value[0]) >= 0) { value = value.slice(1); } if (value === '.inf') { return (sign === 1) ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY; } else if (value === '.nan') { return NaN; } else if (value.indexOf(':') >= 0) { value.split(':').forEach(function (v) { digits.unshift(parseFloat(v, 10)); }); value = 0.0; base = 1; digits.forEach(function (d) { value += d * base; base *= 60; }); return sign * value; } return sign * parseFloat(value, 10); } var SCIENTIFIC_WITHOUT_DOT = /^[-+]?[0-9]+e/; function representYamlFloat(object, style) { var res; if (isNaN(object)) { switch (style) { case 'lowercase': return '.nan'; case 'uppercase': return '.NAN'; case 'camelcase': return '.NaN'; } } else if (Number.POSITIVE_INFINITY === object) { switch (style) { case 'lowercase': return '.inf'; case 'uppercase': return '.INF'; case 'camelcase': return '.Inf'; } } else if (Number.NEGATIVE_INFINITY === object) { switch (style) { case 'lowercase': return '-.inf'; case 'uppercase': return '-.INF'; case 'camelcase': return '-.Inf'; } } else if (common.isNegativeZero(object)) { return '-0.0'; } res = object.toString(10); // JS stringifier can build scientific format without dots: 5e-100, // while YAML requres dot: 5.e-100. Fix it with simple hack return SCIENTIFIC_WITHOUT_DOT.test(res) ? res.replace('e', '.e') : res; } function isFloat(object) { return (Object.prototype.toString.call(object) === '[object Number]') && (object % 1 !== 0 || common.isNegativeZero(object)); } module.exports = new Type('tag:yaml.org,2002:float', { kind: 'scalar', resolve: resolveYamlFloat, construct: constructYamlFloat, predicate: isFloat, represent: representYamlFloat, defaultStyle: 'lowercase' }); /***/ }), /***/ 9963: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var common = __webpack_require__(9136); var Type = __webpack_require__(967); function isHexCode(c) { return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) || ((0x41/* A */ <= c) && (c <= 0x46/* F */)) || ((0x61/* a */ <= c) && (c <= 0x66/* f */)); } function isOctCode(c) { return ((0x30/* 0 */ <= c) && (c <= 0x37/* 7 */)); } function isDecCode(c) { return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)); } function resolveYamlInteger(data) { if (data === null) return false; var max = data.length, index = 0, hasDigits = false, ch; if (!max) return false; ch = data[index]; // sign if (ch === '-' || ch === '+') { ch = data[++index]; } if (ch === '0') { // 0 if (index + 1 === max) return true; ch = data[++index]; // base 2, base 8, base 16 if (ch === 'b') { // base 2 index++; for (; index < max; index++) { ch = data[index]; if (ch === '_') continue; if (ch !== '0' && ch !== '1') return false; hasDigits = true; } return hasDigits && ch !== '_'; } if (ch === 'x') { // base 16 index++; for (; index < max; index++) { ch = data[index]; if (ch === '_') continue; if (!isHexCode(data.charCodeAt(index))) return false; hasDigits = true; } return hasDigits && ch !== '_'; } // base 8 for (; index < max; index++) { ch = data[index]; if (ch === '_') continue; if (!isOctCode(data.charCodeAt(index))) return false; hasDigits = true; } return hasDigits && ch !== '_'; } // base 10 (except 0) or base 60 // value should not start with `_`; if (ch === '_') return false; for (; index < max; index++) { ch = data[index]; if (ch === '_') continue; if (ch === ':') break; if (!isDecCode(data.charCodeAt(index))) { return false; } hasDigits = true; } // Should have digits and should not end with `_` if (!hasDigits || ch === '_') return false; // if !base60 - done; if (ch !== ':') return true; // base60 almost not used, no needs to optimize return /^(:[0-5]?[0-9])+$/.test(data.slice(index)); } function constructYamlInteger(data) { var value = data, sign = 1, ch, base, digits = []; if (value.indexOf('_') !== -1) { value = value.replace(/_/g, ''); } ch = value[0]; if (ch === '-' || ch === '+') { if (ch === '-') sign = -1; value = value.slice(1); ch = value[0]; } if (value === '0') return 0; if (ch === '0') { if (value[1] === 'b') return sign * parseInt(value.slice(2), 2); if (value[1] === 'x') return sign * parseInt(value, 16); return sign * parseInt(value, 8); } if (value.indexOf(':') !== -1) { value.split(':').forEach(function (v) { digits.unshift(parseInt(v, 10)); }); value = 0; base = 1; digits.forEach(function (d) { value += (d * base); base *= 60; }); return sign * value; } return sign * parseInt(value, 10); } function isInteger(object) { return (Object.prototype.toString.call(object)) === '[object Number]' && (object % 1 === 0 && !common.isNegativeZero(object)); } module.exports = new Type('tag:yaml.org,2002:int', { kind: 'scalar', resolve: resolveYamlInteger, construct: constructYamlInteger, predicate: isInteger, represent: { binary: function (obj) { return obj >= 0 ? '0b' + obj.toString(2) : '-0b' + obj.toString(2).slice(1); }, octal: function (obj) { return obj >= 0 ? '0' + obj.toString(8) : '-0' + obj.toString(8).slice(1); }, decimal: function (obj) { return obj.toString(10); }, /* eslint-disable max-len */ hexadecimal: function (obj) { return obj >= 0 ? '0x' + obj.toString(16).toUpperCase() : '-0x' + obj.toString(16).toUpperCase().slice(1); } }, defaultStyle: 'decimal', styleAliases: { binary: [ 2, 'bin' ], octal: [ 8, 'oct' ], decimal: [ 10, 'dec' ], hexadecimal: [ 16, 'hex' ] } }); /***/ }), /***/ 7278: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var esprima; // Browserified version does not have esprima // // 1. For node.js just require module as deps // 2. For browser try to require mudule via external AMD system. // If not found - try to fallback to window.esprima. If not // found too - then fail to parse. // try { // workaround to exclude package from browserify list. var _require = require; esprima = _require('esprima'); } catch (_) { /*global window */ if (typeof window !== 'undefined') esprima = window.esprima; } var Type = __webpack_require__(967); function resolveJavascriptFunction(data) { if (data === null) return false; try { var source = '(' + data + ')', ast = esprima.parse(source, { range: true }); if (ast.type !== 'Program' || ast.body.length !== 1 || ast.body[0].type !== 'ExpressionStatement' || (ast.body[0].expression.type !== 'ArrowFunctionExpression' && ast.body[0].expression.type !== 'FunctionExpression')) { return false; } return true; } catch (err) { return false; } } function constructJavascriptFunction(data) { /*jslint evil:true*/ var source = '(' + data + ')', ast = esprima.parse(source, { range: true }), params = [], body; if (ast.type !== 'Program' || ast.body.length !== 1 || ast.body[0].type !== 'ExpressionStatement' || (ast.body[0].expression.type !== 'ArrowFunctionExpression' && ast.body[0].expression.type !== 'FunctionExpression')) { throw new Error('Failed to resolve function'); } ast.body[0].expression.params.forEach(function (param) { params.push(param.name); }); body = ast.body[0].expression.body.range; // Esprima's ranges include the first '{' and the last '}' characters on // function expressions. So cut them out. if (ast.body[0].expression.body.type === 'BlockStatement') { /*eslint-disable no-new-func*/ return new Function(params, source.slice(body[0] + 1, body[1] - 1)); } // ES6 arrow functions can omit the BlockStatement. In that case, just return // the body. /*eslint-disable no-new-func*/ return new Function(params, 'return ' + source.slice(body[0], body[1])); } function representJavascriptFunction(object /*, style*/) { return object.toString(); } function isFunction(object) { return Object.prototype.toString.call(object) === '[object Function]'; } module.exports = new Type('tag:yaml.org,2002:js/function', { kind: 'scalar', resolve: resolveJavascriptFunction, construct: constructJavascriptFunction, predicate: isFunction, represent: representJavascriptFunction }); /***/ }), /***/ 9242: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var Type = __webpack_require__(967); function resolveJavascriptRegExp(data) { if (data === null) return false; if (data.length === 0) return false; var regexp = data, tail = /\/([gim]*)$/.exec(data), modifiers = ''; // if regexp starts with '/' it can have modifiers and must be properly closed // `/foo/gim` - modifiers tail can be maximum 3 chars if (regexp[0] === '/') { if (tail) modifiers = tail[1]; if (modifiers.length > 3) return false; // if expression starts with /, is should be properly terminated if (regexp[regexp.length - modifiers.length - 1] !== '/') return false; } return true; } function constructJavascriptRegExp(data) { var regexp = data, tail = /\/([gim]*)$/.exec(data), modifiers = ''; // `/foo/gim` - tail can be maximum 4 chars if (regexp[0] === '/') { if (tail) modifiers = tail[1]; regexp = regexp.slice(1, regexp.length - modifiers.length - 1); } return new RegExp(regexp, modifiers); } function representJavascriptRegExp(object /*, style*/) { var result = '/' + object.source + '/'; if (object.global) result += 'g'; if (object.multiline) result += 'm'; if (object.ignoreCase) result += 'i'; return result; } function isRegExp(object) { return Object.prototype.toString.call(object) === '[object RegExp]'; } module.exports = new Type('tag:yaml.org,2002:js/regexp', { kind: 'scalar', resolve: resolveJavascriptRegExp, construct: constructJavascriptRegExp, predicate: isRegExp, represent: representJavascriptRegExp }); /***/ }), /***/ 5914: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var Type = __webpack_require__(967); function resolveJavascriptUndefined() { return true; } function constructJavascriptUndefined() { /*eslint-disable no-undefined*/ return undefined; } function representJavascriptUndefined() { return ''; } function isUndefined(object) { return typeof object === 'undefined'; } module.exports = new Type('tag:yaml.org,2002:js/undefined', { kind: 'scalar', resolve: resolveJavascriptUndefined, construct: constructJavascriptUndefined, predicate: isUndefined, represent: representJavascriptUndefined }); /***/ }), /***/ 1173: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var Type = __webpack_require__(967); module.exports = new Type('tag:yaml.org,2002:map', { kind: 'mapping', construct: function (data) { return data !== null ? data : {}; } }); /***/ }), /***/ 1393: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var Type = __webpack_require__(967); function resolveYamlMerge(data) { return data === '<<' || data === null; } module.exports = new Type('tag:yaml.org,2002:merge', { kind: 'scalar', resolve: resolveYamlMerge }); /***/ }), /***/ 2671: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var Type = __webpack_require__(967); function resolveYamlNull(data) { if (data === null) return true; var max = data.length; return (max === 1 && data === '~') || (max === 4 && (data === 'null' || data === 'Null' || data === 'NULL')); } function constructYamlNull() { return null; } function isNull(object) { return object === null; } module.exports = new Type('tag:yaml.org,2002:null', { kind: 'scalar', resolve: resolveYamlNull, construct: constructYamlNull, predicate: isNull, represent: { canonical: function () { return '~'; }, lowercase: function () { return 'null'; }, uppercase: function () { return 'NULL'; }, camelcase: function () { return 'Null'; } }, defaultStyle: 'lowercase' }); /***/ }), /***/ 6668: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var Type = __webpack_require__(967); var _hasOwnProperty = Object.prototype.hasOwnProperty; var _toString = Object.prototype.toString; function resolveYamlOmap(data) { if (data === null) return true; var objectKeys = [], index, length, pair, pairKey, pairHasKey, object = data; for (index = 0, length = object.length; index < length; index += 1) { pair = object[index]; pairHasKey = false; if (_toString.call(pair) !== '[object Object]') return false; for (pairKey in pair) { if (_hasOwnProperty.call(pair, pairKey)) { if (!pairHasKey) pairHasKey = true; else return false; } } if (!pairHasKey) return false; if (objectKeys.indexOf(pairKey) === -1) objectKeys.push(pairKey); else return false; } return true; } function constructYamlOmap(data) { return data !== null ? data : []; } module.exports = new Type('tag:yaml.org,2002:omap', { kind: 'sequence', resolve: resolveYamlOmap, construct: constructYamlOmap }); /***/ }), /***/ 6039: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var Type = __webpack_require__(967); var _toString = Object.prototype.toString; function resolveYamlPairs(data) { if (data === null) return true; var index, length, pair, keys, result, object = data; result = new Array(object.length); for (index = 0, length = object.length; index < length; index += 1) { pair = object[index]; if (_toString.call(pair) !== '[object Object]') return false; keys = Object.keys(pair); if (keys.length !== 1) return false; result[index] = [ keys[0], pair[keys[0]] ]; } return true; } function constructYamlPairs(data) { if (data === null) return []; var index, length, pair, keys, result, object = data; result = new Array(object.length); for (index = 0, length = object.length; index < length; index += 1) { pair = object[index]; keys = Object.keys(pair); result[index] = [ keys[0], pair[keys[0]] ]; } return result; } module.exports = new Type('tag:yaml.org,2002:pairs', { kind: 'sequence', resolve: resolveYamlPairs, construct: constructYamlPairs }); /***/ }), /***/ 5490: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var Type = __webpack_require__(967); module.exports = new Type('tag:yaml.org,2002:seq', { kind: 'sequence', construct: function (data) { return data !== null ? data : []; } }); /***/ }), /***/ 9237: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var Type = __webpack_require__(967); var _hasOwnProperty = Object.prototype.hasOwnProperty; function resolveYamlSet(data) { if (data === null) return true; var key, object = data; for (key in object) { if (_hasOwnProperty.call(object, key)) { if (object[key] !== null) return false; } } return true; } function constructYamlSet(data) { return data !== null ? data : {}; } module.exports = new Type('tag:yaml.org,2002:set', { kind: 'mapping', resolve: resolveYamlSet, construct: constructYamlSet }); /***/ }), /***/ 2672: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var Type = __webpack_require__(967); module.exports = new Type('tag:yaml.org,2002:str', { kind: 'scalar', construct: function (data) { return data !== null ? data : ''; } }); /***/ }), /***/ 3714: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var Type = __webpack_require__(967); var YAML_DATE_REGEXP = new RegExp( '^([0-9][0-9][0-9][0-9])' + // [1] year '-([0-9][0-9])' + // [2] month '-([0-9][0-9])$'); // [3] day var YAML_TIMESTAMP_REGEXP = new RegExp( '^([0-9][0-9][0-9][0-9])' + // [1] year '-([0-9][0-9]?)' + // [2] month '-([0-9][0-9]?)' + // [3] day '(?:[Tt]|[ \\t]+)' + // ... '([0-9][0-9]?)' + // [4] hour ':([0-9][0-9])' + // [5] minute ':([0-9][0-9])' + // [6] second '(?:\\.([0-9]*))?' + // [7] fraction '(?:[ \\t]*(Z|([-+])([0-9][0-9]?)' + // [8] tz [9] tz_sign [10] tz_hour '(?::([0-9][0-9]))?))?$'); // [11] tz_minute function resolveYamlTimestamp(data) { if (data === null) return false; if (YAML_DATE_REGEXP.exec(data) !== null) return true; if (YAML_TIMESTAMP_REGEXP.exec(data) !== null) return true; return false; } function constructYamlTimestamp(data) { var match, year, month, day, hour, minute, second, fraction = 0, delta = null, tz_hour, tz_minute, date; match = YAML_DATE_REGEXP.exec(data); if (match === null) match = YAML_TIMESTAMP_REGEXP.exec(data); if (match === null) throw new Error('Date resolve error'); // match: [1] year [2] month [3] day year = +(match[1]); month = +(match[2]) - 1; // JS month starts with 0 day = +(match[3]); if (!match[4]) { // no hour return new Date(Date.UTC(year, month, day)); } // match: [4] hour [5] minute [6] second [7] fraction hour = +(match[4]); minute = +(match[5]); second = +(match[6]); if (match[7]) { fraction = match[7].slice(0, 3); while (fraction.length < 3) { // milli-seconds fraction += '0'; } fraction = +fraction; } // match: [8] tz [9] tz_sign [10] tz_hour [11] tz_minute if (match[9]) { tz_hour = +(match[10]); tz_minute = +(match[11] || 0); delta = (tz_hour * 60 + tz_minute) * 60000; // delta in mili-seconds if (match[9] === '-') delta = -delta; } date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction)); if (delta) date.setTime(date.getTime() - delta); return date; } function representYamlTimestamp(object /*, style*/) { return object.toISOString(); } module.exports = new Type('tag:yaml.org,2002:timestamp', { kind: 'scalar', resolve: resolveYamlTimestamp, construct: constructYamlTimestamp, instanceOf: Date, represent: representYamlTimestamp }); /***/ }), /***/ 1568: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var helpers = __webpack_require__(4801); /** @type ValidatorResult */ var ValidatorResult = helpers.ValidatorResult; /** @type SchemaError */ var SchemaError = helpers.SchemaError; var attribute = {}; attribute.ignoreProperties = { // informative properties 'id': true, 'default': true, 'description': true, 'title': true, // arguments to other properties 'exclusiveMinimum': true, 'exclusiveMaximum': true, 'additionalItems': true, // special-handled properties '$schema': true, '$ref': true, 'extends': true }; /** * @name validators */ var validators = attribute.validators = {}; /** * Validates whether the instance if of a certain type * @param instance * @param schema * @param options * @param ctx * @return {ValidatorResult|null} */ validators.type = function validateType (instance, schema, options, ctx) { // Ignore undefined instances if (instance === undefined) { return null; } var result = new ValidatorResult(instance, schema, options, ctx); var types = Array.isArray(schema.type) ? schema.type : [schema.type]; if (!types.some(this.testType.bind(this, instance, schema, options, ctx))) { var list = types.map(function (v) { return v.id && ('<' + v.id + '>') || (v+''); }); result.addError({ name: 'type', argument: list, message: "is not of a type(s) " + list, }); } return result; }; function testSchemaNoThrow(instance, options, ctx, callback, schema){ var throwError = options.throwError; options.throwError = false; var res = this.validateSchema(instance, schema, options, ctx); options.throwError = throwError; if (!res.valid && callback instanceof Function) { callback(res); } return res.valid; } /** * Validates whether the instance matches some of the given schemas * @param instance * @param schema * @param options * @param ctx * @return {ValidatorResult|null} */ validators.anyOf = function validateAnyOf (instance, schema, options, ctx) { // Ignore undefined instances if (instance === undefined) { return null; } var result = new ValidatorResult(instance, schema, options, ctx); var inner = new ValidatorResult(instance, schema, options, ctx); if (!Array.isArray(schema.anyOf)){ throw new SchemaError("anyOf must be an array"); } if (!schema.anyOf.some( testSchemaNoThrow.bind( this, instance, options, ctx, function(res){inner.importErrors(res);} ))) { var list = schema.anyOf.map(function (v, i) { return (v.id && ('<' + v.id + '>')) || (v.title && JSON.stringify(v.title)) || (v['$ref'] && ('<' + v['$ref'] + '>')) || '[subschema '+i+']'; }); if (options.nestedErrors) { result.importErrors(inner); } result.addError({ name: 'anyOf', argument: list, message: "is not any of " + list.join(','), }); } return result; }; /** * Validates whether the instance matches every given schema * @param instance * @param schema * @param options * @param ctx * @return {String|null} */ validators.allOf = function validateAllOf (instance, schema, options, ctx) { // Ignore undefined instances if (instance === undefined) { return null; } if (!Array.isArray(schema.allOf)){ throw new SchemaError("allOf must be an array"); } var result = new ValidatorResult(instance, schema, options, ctx); var self = this; schema.allOf.forEach(function(v, i){ var valid = self.validateSchema(instance, v, options, ctx); if(!valid.valid){ var msg = (v.id && ('<' + v.id + '>')) || (v.title && JSON.stringify(v.title)) || (v['$ref'] && ('<' + v['$ref'] + '>')) || '[subschema '+i+']'; result.addError({ name: 'allOf', argument: { id: msg, length: valid.errors.length, valid: valid }, message: 'does not match allOf schema ' + msg + ' with ' + valid.errors.length + ' error[s]:', }); result.importErrors(valid); } }); return result; }; /** * Validates whether the instance matches exactly one of the given schemas * @param instance * @param schema * @param options * @param ctx * @return {String|null} */ validators.oneOf = function validateOneOf (instance, schema, options, ctx) { // Ignore undefined instances if (instance === undefined) { return null; } if (!Array.isArray(schema.oneOf)){ throw new SchemaError("oneOf must be an array"); } var result = new ValidatorResult(instance, schema, options, ctx); var inner = new ValidatorResult(instance, schema, options, ctx); var count = schema.oneOf.filter( testSchemaNoThrow.bind( this, instance, options, ctx, function(res) {inner.importErrors(res);} ) ).length; var list = schema.oneOf.map(function (v, i) { return (v.id && ('<' + v.id + '>')) || (v.title && JSON.stringify(v.title)) || (v['$ref'] && ('<' + v['$ref'] + '>')) || '[subschema '+i+']'; }); if (count!==1) { if (options.nestedErrors) { result.importErrors(inner); } result.addError({ name: 'oneOf', argument: list, message: "is not exactly one from " + list.join(','), }); } return result; }; /** * Validates properties * @param instance * @param schema * @param options * @param ctx * @return {String|null|ValidatorResult} */ validators.properties = function validateProperties (instance, schema, options, ctx) { if(!this.types.object(instance)) return; var result = new ValidatorResult(instance, schema, options, ctx); var properties = schema.properties || {}; for (var property in properties) { if (typeof options.preValidateProperty == 'function') { options.preValidateProperty(instance, property, properties[property], options, ctx); } var prop = Object.hasOwnProperty.call(instance, property) ? instance[property] : undefined; var res = this.validateSchema(prop, properties[property], options, ctx.makeChild(properties[property], property)); if(res.instance !== result.instance[property]) result.instance[property] = res.instance; result.importErrors(res); } return result; }; /** * Test a specific property within in instance against the additionalProperties schema attribute * This ignores properties with definitions in the properties schema attribute, but no other attributes. * If too many more types of property-existance tests pop up they may need their own class of tests (like `type` has) * @private * @return {boolean} */ function testAdditionalProperty (instance, schema, options, ctx, property, result) { if(!this.types.object(instance)) return; if (schema.properties && schema.properties[property] !== undefined) { return; } if (schema.additionalProperties === false) { result.addError({ name: 'additionalProperties', argument: property, message: "additionalProperty " + JSON.stringify(property) + " exists in instance when not allowed", }); } else { var additionalProperties = schema.additionalProperties || {}; if (typeof options.preValidateProperty == 'function') { options.preValidateProperty(instance, property, additionalProperties, options, ctx); } var res = this.validateSchema(instance[property], additionalProperties, options, ctx.makeChild(additionalProperties, property)); if(res.instance !== result.instance[property]) result.instance[property] = res.instance; result.importErrors(res); } } /** * Validates patternProperties * @param instance * @param schema * @param options * @param ctx * @return {String|null|ValidatorResult} */ validators.patternProperties = function validatePatternProperties (instance, schema, options, ctx) { if(!this.types.object(instance)) return; var result = new ValidatorResult(instance, schema, options, ctx); var patternProperties = schema.patternProperties || {}; for (var property in instance) { var test = true; for (var pattern in patternProperties) { var expr = new RegExp(pattern); if (!expr.test(property)) { continue; } test = false; if (typeof options.preValidateProperty == 'function') { options.preValidateProperty(instance, property, patternProperties[pattern], options, ctx); } var res = this.validateSchema(instance[property], patternProperties[pattern], options, ctx.makeChild(patternProperties[pattern], property)); if(res.instance !== result.instance[property]) result.instance[property] = res.instance; result.importErrors(res); } if (test) { testAdditionalProperty.call(this, instance, schema, options, ctx, property, result); } } return result; }; /** * Validates additionalProperties * @param instance * @param schema * @param options * @param ctx * @return {String|null|ValidatorResult} */ validators.additionalProperties = function validateAdditionalProperties (instance, schema, options, ctx) { if(!this.types.object(instance)) return; // if patternProperties is defined then we'll test when that one is called instead if (schema.patternProperties) { return null; } var result = new ValidatorResult(instance, schema, options, ctx); for (var property in instance) { testAdditionalProperty.call(this, instance, schema, options, ctx, property, result); } return result; }; /** * Validates whether the instance value is at least of a certain length, when the instance value is a string. * @param instance * @param schema * @return {String|null} */ validators.minProperties = function validateMinProperties (instance, schema, options, ctx) { if (!this.types.object(instance)) return; var result = new ValidatorResult(instance, schema, options, ctx); var keys = Object.keys(instance); if (!(keys.length >= schema.minProperties)) { result.addError({ name: 'minProperties', argument: schema.minProperties, message: "does not meet minimum property length of " + schema.minProperties, }) } return result; }; /** * Validates whether the instance value is at most of a certain length, when the instance value is a string. * @param instance * @param schema * @return {String|null} */ validators.maxProperties = function validateMaxProperties (instance, schema, options, ctx) { if (!this.types.object(instance)) return; var result = new ValidatorResult(instance, schema, options, ctx); var keys = Object.keys(instance); if (!(keys.length <= schema.maxProperties)) { result.addError({ name: 'maxProperties', argument: schema.maxProperties, message: "does not meet maximum property length of " + schema.maxProperties, }); } return result; }; /** * Validates items when instance is an array * @param instance * @param schema * @param options * @param ctx * @return {String|null|ValidatorResult} */ validators.items = function validateItems (instance, schema, options, ctx) { var self = this; if (!this.types.array(instance)) return; if (!schema.items) return; var result = new ValidatorResult(instance, schema, options, ctx); instance.every(function (value, i) { var items = Array.isArray(schema.items) ? (schema.items[i] || schema.additionalItems) : schema.items; if (items === undefined) { return true; } if (items === false) { result.addError({ name: 'items', message: "additionalItems not permitted", }); return false; } var res = self.validateSchema(value, items, options, ctx.makeChild(items, i)); if(res.instance !== result.instance[i]) result.instance[i] = res.instance; result.importErrors(res); return true; }); return result; }; /** * Validates minimum and exclusiveMinimum when the type of the instance value is a number. * @param instance * @param schema * @return {String|null} */ validators.minimum = function validateMinimum (instance, schema, options, ctx) { if (!this.types.number(instance)) return; var result = new ValidatorResult(instance, schema, options, ctx); var valid = true; if (schema.exclusiveMinimum && schema.exclusiveMinimum === true) { valid = instance > schema.minimum; } else { valid = instance >= schema.minimum; } if (!valid) { result.addError({ name: 'minimum', argument: schema.minimum, message: "must have a minimum value of " + schema.minimum, }); } return result; }; /** * Validates maximum and exclusiveMaximum when the type of the instance value is a number. * @param instance * @param schema * @return {String|null} */ validators.maximum = function validateMaximum (instance, schema, options, ctx) { if (!this.types.number(instance)) return; var result = new ValidatorResult(instance, schema, options, ctx); var valid; if (schema.exclusiveMaximum && schema.exclusiveMaximum === true) { valid = instance < schema.maximum; } else { valid = instance <= schema.maximum; } if (!valid) { result.addError({ name: 'maximum', argument: schema.maximum, message: "must have a maximum value of " + schema.maximum, }); } return result; }; /** * Perform validation for multipleOf and divisibleBy, which are essentially the same. * @param instance * @param schema * @param validationType * @param errorMessage * @returns {String|null} */ var validateMultipleOfOrDivisbleBy = function validateMultipleOfOrDivisbleBy (instance, schema, options, ctx, validationType, errorMessage) { if (!this.types.number(instance)) return; var validationArgument = schema[validationType]; if (validationArgument == 0) { throw new SchemaError(validationType + " cannot be zero"); } var result = new ValidatorResult(instance, schema, options, ctx); var instanceDecimals = helpers.getDecimalPlaces(instance); var divisorDecimals = helpers.getDecimalPlaces(validationArgument); var maxDecimals = Math.max(instanceDecimals , divisorDecimals); var multiplier = Math.pow(10, maxDecimals); if (Math.round(instance * multiplier) % Math.round(validationArgument * multiplier) !== 0) { result.addError({ name: validationType, argument: validationArgument, message: errorMessage + JSON.stringify(validationArgument) }); } return result; }; /** * Validates divisibleBy when the type of the instance value is a number. * @param instance * @param schema * @return {String|null} */ validators.multipleOf = function validateMultipleOf (instance, schema, options, ctx) { return validateMultipleOfOrDivisbleBy.call(this, instance, schema, options, ctx, "multipleOf", "is not a multiple of (divisible by) "); }; /** * Validates multipleOf when the type of the instance value is a number. * @param instance * @param schema * @return {String|null} */ validators.divisibleBy = function validateDivisibleBy (instance, schema, options, ctx) { return validateMultipleOfOrDivisbleBy.call(this, instance, schema, options, ctx, "divisibleBy", "is not divisible by (multiple of) "); }; /** * Validates whether the instance value is present. * @param instance * @param schema * @return {String|null} */ validators.required = function validateRequired (instance, schema, options, ctx) { var result = new ValidatorResult(instance, schema, options, ctx); if (instance === undefined && schema.required === true) { // A boolean form is implemented for reverse-compatability with schemas written against older drafts result.addError({ name: 'required', message: "is required" }); } else if (this.types.object(instance) && Array.isArray(schema.required)) { schema.required.forEach(function(n){ if(instance[n]===undefined){ result.addError({ name: 'required', argument: n, message: "requires property " + JSON.stringify(n), }); } }); } return result; }; /** * Validates whether the instance value matches the regular expression, when the instance value is a string. * @param instance * @param schema * @return {String|null} */ validators.pattern = function validatePattern (instance, schema, options, ctx) { if (!this.types.string(instance)) return; var result = new ValidatorResult(instance, schema, options, ctx); if (!instance.match(schema.pattern)) { result.addError({ name: 'pattern', argument: schema.pattern, message: "does not match pattern " + JSON.stringify(schema.pattern.toString()), }); } return result; }; /** * Validates whether the instance value is of a certain defined format or a custom * format. * The following formats are supported for string types: * - date-time * - date * - time * - ip-address * - ipv6 * - uri * - color * - host-name * - alpha * - alpha-numeric * - utc-millisec * @param instance * @param schema * @param [options] * @param [ctx] * @return {String|null} */ validators.format = function validateFormat (instance, schema, options, ctx) { if (instance===undefined) return; var result = new ValidatorResult(instance, schema, options, ctx); if (!result.disableFormat && !helpers.isFormat(instance, schema.format, this)) { result.addError({ name: 'format', argument: schema.format, message: "does not conform to the " + JSON.stringify(schema.format) + " format", }); } return result; }; /** * Validates whether the instance value is at least of a certain length, when the instance value is a string. * @param instance * @param schema * @return {String|null} */ validators.minLength = function validateMinLength (instance, schema, options, ctx) { if (!this.types.string(instance)) return; var result = new ValidatorResult(instance, schema, options, ctx); var hsp = instance.match(/[\uDC00-\uDFFF]/g); var length = instance.length - (hsp ? hsp.length : 0); if (!(length >= schema.minLength)) { result.addError({ name: 'minLength', argument: schema.minLength, message: "does not meet minimum length of " + schema.minLength, }); } return result; }; /** * Validates whether the instance value is at most of a certain length, when the instance value is a string. * @param instance * @param schema * @return {String|null} */ validators.maxLength = function validateMaxLength (instance, schema, options, ctx) { if (!this.types.string(instance)) return; var result = new ValidatorResult(instance, schema, options, ctx); // TODO if this was already computed in "minLength", use that value instead of re-computing var hsp = instance.match(/[\uDC00-\uDFFF]/g); var length = instance.length - (hsp ? hsp.length : 0); if (!(length <= schema.maxLength)) { result.addError({ name: 'maxLength', argument: schema.maxLength, message: "does not meet maximum length of " + schema.maxLength, }); } return result; }; /** * Validates whether instance contains at least a minimum number of items, when the instance is an Array. * @param instance * @param schema * @return {String|null} */ validators.minItems = function validateMinItems (instance, schema, options, ctx) { if (!this.types.array(instance)) return; var result = new ValidatorResult(instance, schema, options, ctx); if (!(instance.length >= schema.minItems)) { result.addError({ name: 'minItems', argument: schema.minItems, message: "does not meet minimum length of " + schema.minItems, }); } return result; }; /** * Validates whether instance contains no more than a maximum number of items, when the instance is an Array. * @param instance * @param schema * @return {String|null} */ validators.maxItems = function validateMaxItems (instance, schema, options, ctx) { if (!this.types.array(instance)) return; var result = new ValidatorResult(instance, schema, options, ctx); if (!(instance.length <= schema.maxItems)) { result.addError({ name: 'maxItems', argument: schema.maxItems, message: "does not meet maximum length of " + schema.maxItems, }); } return result; }; /** * Validates that every item in an instance array is unique, when instance is an array * @param instance * @param schema * @param options * @param ctx * @return {String|null|ValidatorResult} */ validators.uniqueItems = function validateUniqueItems (instance, schema, options, ctx) { if (!this.types.array(instance)) return; var result = new ValidatorResult(instance, schema, options, ctx); function testArrays (v, i, a) { for (var j = i + 1; j < a.length; j++) if (helpers.deepCompareStrict(v, a[j])) { return false; } return true; } if (!instance.every(testArrays)) { result.addError({ name: 'uniqueItems', message: "contains duplicate item", }); } return result; }; /** * Deep compares arrays for duplicates * @param v * @param i * @param a * @private * @return {boolean} */ function testArrays (v, i, a) { var j, len = a.length; for (j = i + 1, len; j < len; j++) { if (helpers.deepCompareStrict(v, a[j])) { return false; } } return true; } /** * Validates whether there are no duplicates, when the instance is an Array. * @param instance * @return {String|null} */ validators.uniqueItems = function validateUniqueItems (instance, schema, options, ctx) { if (!this.types.array(instance)) return; var result = new ValidatorResult(instance, schema, options, ctx); if (!instance.every(testArrays)) { result.addError({ name: 'uniqueItems', message: "contains duplicate item", }); } return result; }; /** * Validate for the presence of dependency properties, if the instance is an object. * @param instance * @param schema * @param options * @param ctx * @return {null|ValidatorResult} */ validators.dependencies = function validateDependencies (instance, schema, options, ctx) { if (!this.types.object(instance)) return; var result = new ValidatorResult(instance, schema, options, ctx); for (var property in schema.dependencies) { if (instance[property] === undefined) { continue; } var dep = schema.dependencies[property]; var childContext = ctx.makeChild(dep, property); if (typeof dep == 'string') { dep = [dep]; } if (Array.isArray(dep)) { dep.forEach(function (prop) { if (instance[prop] === undefined) { result.addError({ // FIXME there's two different "dependencies" errors here with slightly different outputs // Can we make these the same? Or should we create different error types? name: 'dependencies', argument: childContext.propertyPath, message: "property " + prop + " not found, required by " + childContext.propertyPath, }); } }); } else { var res = this.validateSchema(instance, dep, options, childContext); if(result.instance !== res.instance) result.instance = res.instance; if (res && res.errors.length) { result.addError({ name: 'dependencies', argument: childContext.propertyPath, message: "does not meet dependency required by " + childContext.propertyPath, }); result.importErrors(res); } } } return result; }; /** * Validates whether the instance value is one of the enumerated values. * * @param instance * @param schema * @return {ValidatorResult|null} */ validators['enum'] = function validateEnum (instance, schema, options, ctx) { if (instance === undefined) { return null; } if (!Array.isArray(schema['enum'])) { throw new SchemaError("enum expects an array", schema); } var result = new ValidatorResult(instance, schema, options, ctx); if (!schema['enum'].some(helpers.deepCompareStrict.bind(null, instance))) { result.addError({ name: 'enum', argument: schema['enum'], message: "is not one of enum values: " + schema['enum'].map(String).join(','), }); } return result; }; /** * Validates whether the instance exactly matches a given value * * @param instance * @param schema * @return {ValidatorResult|null} */ validators['const'] = function validateEnum (instance, schema, options, ctx) { if (instance === undefined) { return null; } var result = new ValidatorResult(instance, schema, options, ctx); if (!helpers.deepCompareStrict(schema['const'], instance)) { result.addError({ name: 'const', argument: schema['const'], message: "does not exactly match expected constant: " + schema['const'], }); } return result; }; /** * Validates whether the instance if of a prohibited type. * @param instance * @param schema * @param options * @param ctx * @return {null|ValidatorResult} */ validators.not = validators.disallow = function validateNot (instance, schema, options, ctx) { var self = this; if(instance===undefined) return null; var result = new ValidatorResult(instance, schema, options, ctx); var notTypes = schema.not || schema.disallow; if(!notTypes) return null; if(!Array.isArray(notTypes)) notTypes=[notTypes]; notTypes.forEach(function (type) { if (self.testType(instance, schema, options, ctx, type)) { var schemaId = type && type.id && ('<' + type.id + '>') || type; result.addError({ name: 'not', argument: schemaId, message: "is of prohibited type " + schemaId, }); } }); return result; }; module.exports = attribute; /***/ }), /***/ 4801: /***/ ((module, exports, __webpack_require__) => { "use strict"; var uri = __webpack_require__(8835); var ValidationError = exports.ValidationError = function ValidationError (message, instance, schema, propertyPath, name, argument) { if (propertyPath) { this.property = propertyPath; } if (message) { this.message = message; } if (schema) { if (schema.id) { this.schema = schema.id; } else { this.schema = schema; } } if (instance) { this.instance = instance; } this.name = name; this.argument = argument; this.stack = this.toString(); }; ValidationError.prototype.toString = function toString() { return this.property + ' ' + this.message; }; var ValidatorResult = exports.ValidatorResult = function ValidatorResult(instance, schema, options, ctx) { this.instance = instance; this.schema = schema; this.propertyPath = ctx.propertyPath; this.errors = []; this.throwError = options && options.throwError; this.disableFormat = options && options.disableFormat === true; }; ValidatorResult.prototype.addError = function addError(detail) { var err; if (typeof detail == 'string') { err = new ValidationError(detail, this.instance, this.schema, this.propertyPath); } else { if (!detail) throw new Error('Missing error detail'); if (!detail.message) throw new Error('Missing error message'); if (!detail.name) throw new Error('Missing validator type'); err = new ValidationError(detail.message, this.instance, this.schema, this.propertyPath, detail.name, detail.argument); } if (this.throwError) { throw err; } this.errors.push(err); return err; }; ValidatorResult.prototype.importErrors = function importErrors(res) { if (typeof res == 'string' || (res && res.validatorType)) { this.addError(res); } else if (res && res.errors) { Array.prototype.push.apply(this.errors, res.errors); } }; function stringizer (v,i){ return i+': '+v.toString()+'\n'; } ValidatorResult.prototype.toString = function toString(res) { return this.errors.map(stringizer).join(''); }; Object.defineProperty(ValidatorResult.prototype, "valid", { get: function() { return !this.errors.length; } }); /** * Describes a problem with a Schema which prevents validation of an instance * @name SchemaError * @constructor */ var SchemaError = exports.SchemaError = function SchemaError (msg, schema) { this.message = msg; this.schema = schema; Error.call(this, msg); Error.captureStackTrace(this, SchemaError); }; SchemaError.prototype = Object.create(Error.prototype, { constructor: {value: SchemaError, enumerable: false} , name: {value: 'SchemaError', enumerable: false} }); var SchemaContext = exports.SchemaContext = function SchemaContext (schema, options, propertyPath, base, schemas) { this.schema = schema; this.options = options; this.propertyPath = propertyPath; this.base = base; this.schemas = schemas; }; SchemaContext.prototype.resolve = function resolve (target) { return uri.resolve(this.base, target); }; SchemaContext.prototype.makeChild = function makeChild(schema, propertyName){ var propertyPath = (propertyName===undefined) ? this.propertyPath : this.propertyPath+makeSuffix(propertyName); var base = uri.resolve(this.base, schema.id||''); var ctx = new SchemaContext(schema, this.options, propertyPath, base, Object.create(this.schemas)); if(schema.id && !ctx.schemas[base]){ ctx.schemas[base] = schema; } return ctx; } var FORMAT_REGEXPS = exports.FORMAT_REGEXPS = { 'date-time': /^\d{4}-(?:0[0-9]{1}|1[0-2]{1})-(3[01]|0[1-9]|[12][0-9])[tT ](2[0-4]|[01][0-9]):([0-5][0-9]):(60|[0-5][0-9])(\.\d+)?([zZ]|[+-]([0-5][0-9]):(60|[0-5][0-9]))$/, 'date': /^\d{4}-(?:0[0-9]{1}|1[0-2]{1})-(3[01]|0[1-9]|[12][0-9])$/, 'time': /^(2[0-4]|[01][0-9]):([0-5][0-9]):(60|[0-5][0-9])$/, 'email': /^(?:[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+\.)*[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+@(?:(?:(?:[a-zA-Z0-9](?:[a-zA-Z0-9\-](?!\.)){0,61}[a-zA-Z0-9]?\.)+[a-zA-Z0-9](?:[a-zA-Z0-9\-](?!$)){0,61}[a-zA-Z0-9]?)|(?:\[(?:(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\.){3}(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\]))$/, 'ip-address': /^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/, 'ipv6': /^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/, 'uri': /^[a-zA-Z][a-zA-Z0-9+-.]*:[^\s]*$/, 'color': /^(#?([0-9A-Fa-f]{3}){1,2}\b|aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow|(rgb\(\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*\))|(rgb\(\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*\)))$/, // hostname regex from: http://stackoverflow.com/a/1420225/5628 'hostname': /^(?=.{1,255}$)[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?(?:\.[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?)*\.?$/, 'host-name': /^(?=.{1,255}$)[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?(?:\.[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?)*\.?$/, 'alpha': /^[a-zA-Z]+$/, 'alphanumeric': /^[a-zA-Z0-9]+$/, 'utc-millisec': function (input) { return (typeof input === 'string') && parseFloat(input) === parseInt(input, 10) && !isNaN(input); }, 'regex': function (input) { var result = true; try { new RegExp(input); } catch (e) { result = false; } return result; }, 'style': /\s*(.+?):\s*([^;]+);?/, 'phone': /^\+(?:[0-9] ?){6,14}[0-9]$/ }; FORMAT_REGEXPS.regexp = FORMAT_REGEXPS.regex; FORMAT_REGEXPS.pattern = FORMAT_REGEXPS.regex; FORMAT_REGEXPS.ipv4 = FORMAT_REGEXPS['ip-address']; exports.isFormat = function isFormat (input, format, validator) { if (typeof input === 'string' && FORMAT_REGEXPS[format] !== undefined) { if (FORMAT_REGEXPS[format] instanceof RegExp) { return FORMAT_REGEXPS[format].test(input); } if (typeof FORMAT_REGEXPS[format] === 'function') { return FORMAT_REGEXPS[format](input); } } else if (validator && validator.customFormats && typeof validator.customFormats[format] === 'function') { return validator.customFormats[format](input); } return true; }; var makeSuffix = exports.makeSuffix = function makeSuffix (key) { key = key.toString(); // This function could be capable of outputting valid a ECMAScript string, but the // resulting code for testing which form to use would be tens of thousands of characters long // That means this will use the name form for some illegal forms if (!key.match(/[.\s\[\]]/) && !key.match(/^[\d]/)) { return '.' + key; } if (key.match(/^\d+$/)) { return '[' + key + ']'; } return '[' + JSON.stringify(key) + ']'; }; exports.deepCompareStrict = function deepCompareStrict (a, b) { if (typeof a !== typeof b) { return false; } if (Array.isArray(a)) { if (!Array.isArray(b)) { return false; } if (a.length !== b.length) { return false; } return a.every(function (v, i) { return deepCompareStrict(a[i], b[i]); }); } if (typeof a === 'object') { if (!a || !b) { return a === b; } var aKeys = Object.keys(a); var bKeys = Object.keys(b); if (aKeys.length !== bKeys.length) { return false; } return aKeys.every(function (v) { return deepCompareStrict(a[v], b[v]); }); } return a === b; }; function deepMerger (target, dst, e, i) { if (typeof e === 'object') { dst[i] = deepMerge(target[i], e) } else { if (target.indexOf(e) === -1) { dst.push(e) } } } function copyist (src, dst, key) { dst[key] = src[key]; } function copyistWithDeepMerge (target, src, dst, key) { if (typeof src[key] !== 'object' || !src[key]) { dst[key] = src[key]; } else { if (!target[key]) { dst[key] = src[key]; } else { dst[key] = deepMerge(target[key], src[key]) } } } function deepMerge (target, src) { var array = Array.isArray(src); var dst = array && [] || {}; if (array) { target = target || []; dst = dst.concat(target); src.forEach(deepMerger.bind(null, target, dst)); } else { if (target && typeof target === 'object') { Object.keys(target).forEach(copyist.bind(null, target, dst)); } Object.keys(src).forEach(copyistWithDeepMerge.bind(null, target, src, dst)); } return dst; }; module.exports.deepMerge = deepMerge; /** * Validates instance against the provided schema * Implements URI+JSON Pointer encoding, e.g. "%7e"="~0"=>"~", "~1"="%2f"=>"/" * @param o * @param s The path to walk o along * @return any */ exports.objectGetPath = function objectGetPath(o, s) { var parts = s.split('/').slice(1); var k; while (typeof (k=parts.shift()) == 'string') { var n = decodeURIComponent(k.replace(/~0/,'~').replace(/~1/g,'/')); if (!(n in o)) return; o = o[n]; } return o; }; function pathEncoder (v) { return '/'+encodeURIComponent(v).replace(/~/g,'%7E'); } /** * Accept an Array of property names and return a JSON Pointer URI fragment * @param Array a * @return {String} */ exports.encodePath = function encodePointer(a){ // ~ must be encoded explicitly because hacks // the slash is encoded by encodeURIComponent return a.map(pathEncoder).join(''); }; /** * Calculate the number of decimal places a number uses * We need this to get correct results out of multipleOf and divisibleBy * when either figure is has decimal places, due to IEEE-754 float issues. * @param number * @returns {number} */ exports.getDecimalPlaces = function getDecimalPlaces(number) { var decimalPlaces = 0; if (isNaN(number)) return decimalPlaces; if (typeof number !== 'number') { number = Number(number); } var parts = number.toString().split('e'); if (parts.length === 2) { if (parts[1][0] !== '-') { return decimalPlaces; } else { decimalPlaces = Number(parts[1].slice(1)); } } var decimalParts = parts[0].split('.'); if (decimalParts.length === 2) { decimalPlaces += decimalParts[1].length; } return decimalPlaces; }; /***/ }), /***/ 3978: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var Validator = module.exports.Validator = __webpack_require__(8669); module.exports.ValidatorResult = __webpack_require__(4801).ValidatorResult; module.exports.ValidationError = __webpack_require__(4801).ValidationError; module.exports.SchemaError = __webpack_require__(4801).SchemaError; module.exports.SchemaScanResult = __webpack_require__(9534).SchemaScanResult; module.exports.scan = __webpack_require__(9534).scan; module.exports.validate = function (instance, schema, options) { var v = new Validator(); return v.validate(instance, schema, options); }; /***/ }), /***/ 9534: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var urilib = __webpack_require__(8835); var helpers = __webpack_require__(4801); module.exports.SchemaScanResult = SchemaScanResult; function SchemaScanResult(found, ref){ this.id = found; this.ref = ref; } /** * Adds a schema with a certain urn to the Validator instance. * @param string uri * @param object schema * @return {Object} */ module.exports.scan = function scan(base, schema){ function scanSchema(baseuri, schema){ if(!schema || typeof schema!='object') return; // Mark all referenced schemas so we can tell later which schemas are referred to, but never defined if(schema.$ref){ var resolvedUri = urilib.resolve(baseuri, schema.$ref); ref[resolvedUri] = ref[resolvedUri] ? ref[resolvedUri]+1 : 0; return; } var ourBase = schema.id ? urilib.resolve(baseuri, schema.id) : baseuri; if (ourBase) { // If there's no fragment, append an empty one if(ourBase.indexOf('#')<0) ourBase += '#'; if(found[ourBase]){ if(!helpers.deepCompareStrict(found[ourBase], schema)){ throw new Error('Schema <'+schema+'> already exists with different definition'); } return found[ourBase]; } found[ourBase] = schema; // strip trailing fragment if(ourBase[ourBase.length-1]=='#'){ found[ourBase.substring(0, ourBase.length-1)] = schema; } } scanArray(ourBase+'/items', (Array.isArray(schema.items)?schema.items:[schema.items])); scanArray(ourBase+'/extends', (Array.isArray(schema.extends)?schema.extends:[schema.extends])); scanSchema(ourBase+'/additionalItems', schema.additionalItems); scanObject(ourBase+'/properties', schema.properties); scanSchema(ourBase+'/additionalProperties', schema.additionalProperties); scanObject(ourBase+'/definitions', schema.definitions); scanObject(ourBase+'/patternProperties', schema.patternProperties); scanObject(ourBase+'/dependencies', schema.dependencies); scanArray(ourBase+'/disallow', schema.disallow); scanArray(ourBase+'/allOf', schema.allOf); scanArray(ourBase+'/anyOf', schema.anyOf); scanArray(ourBase+'/oneOf', schema.oneOf); scanSchema(ourBase+'/not', schema.not); } function scanArray(baseuri, schemas){ if(!Array.isArray(schemas)) return; for(var i=0; i { "use strict"; var urilib = __webpack_require__(8835); var attribute = __webpack_require__(1568); var helpers = __webpack_require__(4801); var scanSchema = __webpack_require__(9534).scan; var ValidatorResult = helpers.ValidatorResult; var SchemaError = helpers.SchemaError; var SchemaContext = helpers.SchemaContext; //var anonymousBase = 'vnd.jsonschema:///'; var anonymousBase = '/'; /** * Creates a new Validator object * @name Validator * @constructor */ var Validator = function Validator () { // Allow a validator instance to override global custom formats or to have their // own custom formats. this.customFormats = Object.create(Validator.prototype.customFormats); this.schemas = {}; this.unresolvedRefs = []; // Use Object.create to make this extensible without Validator instances stepping on each other's toes. this.types = Object.create(types); this.attributes = Object.create(attribute.validators); }; // Allow formats to be registered globally. Validator.prototype.customFormats = {}; // Hint at the presence of a property Validator.prototype.schemas = null; Validator.prototype.types = null; Validator.prototype.attributes = null; Validator.prototype.unresolvedRefs = null; /** * Adds a schema with a certain urn to the Validator instance. * @param schema * @param urn * @return {Object} */ Validator.prototype.addSchema = function addSchema (schema, base) { var self = this; if (!schema) { return null; } var scan = scanSchema(base||anonymousBase, schema); var ourUri = base || schema.id; for(var uri in scan.id){ this.schemas[uri] = scan.id[uri]; } for(var uri in scan.ref){ this.unresolvedRefs.push(uri); } this.unresolvedRefs = this.unresolvedRefs.filter(function(uri){ return typeof self.schemas[uri]==='undefined'; }); return this.schemas[ourUri]; }; Validator.prototype.addSubSchemaArray = function addSubSchemaArray(baseuri, schemas) { if(!Array.isArray(schemas)) return; for(var i=0; i", schema); } var subschema = helpers.objectGetPath(ctx.schemas[document], fragment.substr(1)); if(subschema===undefined){ throw new SchemaError("no such schema " + fragment + " located in <" + document + ">", schema); } return {subschema: subschema, switchSchema: switchSchema}; }; /** * Tests whether the instance if of a certain type. * @private * @param instance * @param schema * @param options * @param ctx * @param type * @return {boolean} */ Validator.prototype.testType = function validateType (instance, schema, options, ctx, type) { if (typeof this.types[type] == 'function') { return this.types[type].call(this, instance); } if (type && typeof type == 'object') { var res = this.validateSchema(instance, type, options, ctx); return res === undefined || !(res && res.errors.length); } // Undefined or properties not on the list are acceptable, same as not being defined return true; }; var types = Validator.prototype.types = {}; types.string = function testString (instance) { return typeof instance == 'string'; }; types.number = function testNumber (instance) { // isFinite returns false for NaN, Infinity, and -Infinity return typeof instance == 'number' && isFinite(instance); }; types.integer = function testInteger (instance) { return (typeof instance == 'number') && instance % 1 === 0; }; types.boolean = function testBoolean (instance) { return typeof instance == 'boolean'; }; types.array = function testArray (instance) { return Array.isArray(instance); }; types['null'] = function testNull (instance) { return instance === null; }; types.date = function testDate (instance) { return instance instanceof Date; }; types.any = function testAny (instance) { return true; }; types.object = function testObject (instance) { // TODO: fix this - see #15 return instance && (typeof instance === 'object') && !(Array.isArray(instance)) && !(instance instanceof Date); }; module.exports = Validator; /***/ }), /***/ 3482: /***/ ((module) => { module.exports = Long; /** * wasm optimizations, to do native i64 multiplication and divide */ var wasm = null; try { wasm = new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([ 0, 97, 115, 109, 1, 0, 0, 0, 1, 13, 2, 96, 0, 1, 127, 96, 4, 127, 127, 127, 127, 1, 127, 3, 7, 6, 0, 1, 1, 1, 1, 1, 6, 6, 1, 127, 1, 65, 0, 11, 7, 50, 6, 3, 109, 117, 108, 0, 1, 5, 100, 105, 118, 95, 115, 0, 2, 5, 100, 105, 118, 95, 117, 0, 3, 5, 114, 101, 109, 95, 115, 0, 4, 5, 114, 101, 109, 95, 117, 0, 5, 8, 103, 101, 116, 95, 104, 105, 103, 104, 0, 0, 10, 191, 1, 6, 4, 0, 35, 0, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 126, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 127, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 128, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 129, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 130, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11 ])), {}).exports; } catch (e) { // no wasm support :( } /** * Constructs a 64 bit two's-complement integer, given its low and high 32 bit values as *signed* integers. * See the from* functions below for more convenient ways of constructing Longs. * @exports Long * @class A Long class for representing a 64 bit two's-complement integer value. * @param {number} low The low (signed) 32 bits of the long * @param {number} high The high (signed) 32 bits of the long * @param {boolean=} unsigned Whether unsigned or not, defaults to signed * @constructor */ function Long(low, high, unsigned) { /** * The low 32 bits as a signed value. * @type {number} */ this.low = low | 0; /** * The high 32 bits as a signed value. * @type {number} */ this.high = high | 0; /** * Whether unsigned or not. * @type {boolean} */ this.unsigned = !!unsigned; } // The internal representation of a long is the two given signed, 32-bit values. // We use 32-bit pieces because these are the size of integers on which // Javascript performs bit-operations. For operations like addition and // multiplication, we split each number into 16 bit pieces, which can easily be // multiplied within Javascript's floating-point representation without overflow // or change in sign. // // In the algorithms below, we frequently reduce the negative case to the // positive case by negating the input(s) and then post-processing the result. // Note that we must ALWAYS check specially whether those values are MIN_VALUE // (-2^63) because -MIN_VALUE == MIN_VALUE (since 2^63 cannot be represented as // a positive number, it overflows back into a negative). Not handling this // case would often result in infinite recursion. // // Common constant values ZERO, ONE, NEG_ONE, etc. are defined below the from* // methods on which they depend. /** * An indicator used to reliably determine if an object is a Long or not. * @type {boolean} * @const * @private */ Long.prototype.__isLong__; Object.defineProperty(Long.prototype, "__isLong__", { value: true }); /** * @function * @param {*} obj Object * @returns {boolean} * @inner */ function isLong(obj) { return (obj && obj["__isLong__"]) === true; } /** * Tests if the specified object is a Long. * @function * @param {*} obj Object * @returns {boolean} */ Long.isLong = isLong; /** * A cache of the Long representations of small integer values. * @type {!Object} * @inner */ var INT_CACHE = {}; /** * A cache of the Long representations of small unsigned integer values. * @type {!Object} * @inner */ var UINT_CACHE = {}; /** * @param {number} value * @param {boolean=} unsigned * @returns {!Long} * @inner */ function fromInt(value, unsigned) { var obj, cachedObj, cache; if (unsigned) { value >>>= 0; if (cache = (0 <= value && value < 256)) { cachedObj = UINT_CACHE[value]; if (cachedObj) return cachedObj; } obj = fromBits(value, (value | 0) < 0 ? -1 : 0, true); if (cache) UINT_CACHE[value] = obj; return obj; } else { value |= 0; if (cache = (-128 <= value && value < 128)) { cachedObj = INT_CACHE[value]; if (cachedObj) return cachedObj; } obj = fromBits(value, value < 0 ? -1 : 0, false); if (cache) INT_CACHE[value] = obj; return obj; } } /** * Returns a Long representing the given 32 bit integer value. * @function * @param {number} value The 32 bit integer in question * @param {boolean=} unsigned Whether unsigned or not, defaults to signed * @returns {!Long} The corresponding Long value */ Long.fromInt = fromInt; /** * @param {number} value * @param {boolean=} unsigned * @returns {!Long} * @inner */ function fromNumber(value, unsigned) { if (isNaN(value)) return unsigned ? UZERO : ZERO; if (unsigned) { if (value < 0) return UZERO; if (value >= TWO_PWR_64_DBL) return MAX_UNSIGNED_VALUE; } else { if (value <= -TWO_PWR_63_DBL) return MIN_VALUE; if (value + 1 >= TWO_PWR_63_DBL) return MAX_VALUE; } if (value < 0) return fromNumber(-value, unsigned).neg(); return fromBits((value % TWO_PWR_32_DBL) | 0, (value / TWO_PWR_32_DBL) | 0, unsigned); } /** * Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned. * @function * @param {number} value The number in question * @param {boolean=} unsigned Whether unsigned or not, defaults to signed * @returns {!Long} The corresponding Long value */ Long.fromNumber = fromNumber; /** * @param {number} lowBits * @param {number} highBits * @param {boolean=} unsigned * @returns {!Long} * @inner */ function fromBits(lowBits, highBits, unsigned) { return new Long(lowBits, highBits, unsigned); } /** * Returns a Long representing the 64 bit integer that comes by concatenating the given low and high bits. Each is * assumed to use 32 bits. * @function * @param {number} lowBits The low 32 bits * @param {number} highBits The high 32 bits * @param {boolean=} unsigned Whether unsigned or not, defaults to signed * @returns {!Long} The corresponding Long value */ Long.fromBits = fromBits; /** * @function * @param {number} base * @param {number} exponent * @returns {number} * @inner */ var pow_dbl = Math.pow; // Used 4 times (4*8 to 15+4) /** * @param {string} str * @param {(boolean|number)=} unsigned * @param {number=} radix * @returns {!Long} * @inner */ function fromString(str, unsigned, radix) { if (str.length === 0) throw Error('empty string'); if (str === "NaN" || str === "Infinity" || str === "+Infinity" || str === "-Infinity") return ZERO; if (typeof unsigned === 'number') { // For goog.math.long compatibility radix = unsigned, unsigned = false; } else { unsigned = !! unsigned; } radix = radix || 10; if (radix < 2 || 36 < radix) throw RangeError('radix'); var p; if ((p = str.indexOf('-')) > 0) throw Error('interior hyphen'); else if (p === 0) { return fromString(str.substring(1), unsigned, radix).neg(); } // Do several (8) digits each time through the loop, so as to // minimize the calls to the very expensive emulated div. var radixToPower = fromNumber(pow_dbl(radix, 8)); var result = ZERO; for (var i = 0; i < str.length; i += 8) { var size = Math.min(8, str.length - i), value = parseInt(str.substring(i, i + size), radix); if (size < 8) { var power = fromNumber(pow_dbl(radix, size)); result = result.mul(power).add(fromNumber(value)); } else { result = result.mul(radixToPower); result = result.add(fromNumber(value)); } } result.unsigned = unsigned; return result; } /** * Returns a Long representation of the given string, written using the specified radix. * @function * @param {string} str The textual representation of the Long * @param {(boolean|number)=} unsigned Whether unsigned or not, defaults to signed * @param {number=} radix The radix in which the text is written (2-36), defaults to 10 * @returns {!Long} The corresponding Long value */ Long.fromString = fromString; /** * @function * @param {!Long|number|string|!{low: number, high: number, unsigned: boolean}} val * @param {boolean=} unsigned * @returns {!Long} * @inner */ function fromValue(val, unsigned) { if (typeof val === 'number') return fromNumber(val, unsigned); if (typeof val === 'string') return fromString(val, unsigned); // Throws for non-objects, converts non-instanceof Long: return fromBits(val.low, val.high, typeof unsigned === 'boolean' ? unsigned : val.unsigned); } /** * Converts the specified value to a Long using the appropriate from* function for its type. * @function * @param {!Long|number|string|!{low: number, high: number, unsigned: boolean}} val Value * @param {boolean=} unsigned Whether unsigned or not, defaults to signed * @returns {!Long} */ Long.fromValue = fromValue; // NOTE: the compiler should inline these constant values below and then remove these variables, so there should be // no runtime penalty for these. /** * @type {number} * @const * @inner */ var TWO_PWR_16_DBL = 1 << 16; /** * @type {number} * @const * @inner */ var TWO_PWR_24_DBL = 1 << 24; /** * @type {number} * @const * @inner */ var TWO_PWR_32_DBL = TWO_PWR_16_DBL * TWO_PWR_16_DBL; /** * @type {number} * @const * @inner */ var TWO_PWR_64_DBL = TWO_PWR_32_DBL * TWO_PWR_32_DBL; /** * @type {number} * @const * @inner */ var TWO_PWR_63_DBL = TWO_PWR_64_DBL / 2; /** * @type {!Long} * @const * @inner */ var TWO_PWR_24 = fromInt(TWO_PWR_24_DBL); /** * @type {!Long} * @inner */ var ZERO = fromInt(0); /** * Signed zero. * @type {!Long} */ Long.ZERO = ZERO; /** * @type {!Long} * @inner */ var UZERO = fromInt(0, true); /** * Unsigned zero. * @type {!Long} */ Long.UZERO = UZERO; /** * @type {!Long} * @inner */ var ONE = fromInt(1); /** * Signed one. * @type {!Long} */ Long.ONE = ONE; /** * @type {!Long} * @inner */ var UONE = fromInt(1, true); /** * Unsigned one. * @type {!Long} */ Long.UONE = UONE; /** * @type {!Long} * @inner */ var NEG_ONE = fromInt(-1); /** * Signed negative one. * @type {!Long} */ Long.NEG_ONE = NEG_ONE; /** * @type {!Long} * @inner */ var MAX_VALUE = fromBits(0xFFFFFFFF|0, 0x7FFFFFFF|0, false); /** * Maximum signed value. * @type {!Long} */ Long.MAX_VALUE = MAX_VALUE; /** * @type {!Long} * @inner */ var MAX_UNSIGNED_VALUE = fromBits(0xFFFFFFFF|0, 0xFFFFFFFF|0, true); /** * Maximum unsigned value. * @type {!Long} */ Long.MAX_UNSIGNED_VALUE = MAX_UNSIGNED_VALUE; /** * @type {!Long} * @inner */ var MIN_VALUE = fromBits(0, 0x80000000|0, false); /** * Minimum signed value. * @type {!Long} */ Long.MIN_VALUE = MIN_VALUE; /** * @alias Long.prototype * @inner */ var LongPrototype = Long.prototype; /** * Converts the Long to a 32 bit integer, assuming it is a 32 bit integer. * @returns {number} */ LongPrototype.toInt = function toInt() { return this.unsigned ? this.low >>> 0 : this.low; }; /** * Converts the Long to a the nearest floating-point representation of this value (double, 53 bit mantissa). * @returns {number} */ LongPrototype.toNumber = function toNumber() { if (this.unsigned) return ((this.high >>> 0) * TWO_PWR_32_DBL) + (this.low >>> 0); return this.high * TWO_PWR_32_DBL + (this.low >>> 0); }; /** * Converts the Long to a string written in the specified radix. * @param {number=} radix Radix (2-36), defaults to 10 * @returns {string} * @override * @throws {RangeError} If `radix` is out of range */ LongPrototype.toString = function toString(radix) { radix = radix || 10; if (radix < 2 || 36 < radix) throw RangeError('radix'); if (this.isZero()) return '0'; if (this.isNegative()) { // Unsigned Longs are never negative if (this.eq(MIN_VALUE)) { // We need to change the Long value before it can be negated, so we remove // the bottom-most digit in this base and then recurse to do the rest. var radixLong = fromNumber(radix), div = this.div(radixLong), rem1 = div.mul(radixLong).sub(this); return div.toString(radix) + rem1.toInt().toString(radix); } else return '-' + this.neg().toString(radix); } // Do several (6) digits each time through the loop, so as to // minimize the calls to the very expensive emulated div. var radixToPower = fromNumber(pow_dbl(radix, 6), this.unsigned), rem = this; var result = ''; while (true) { var remDiv = rem.div(radixToPower), intval = rem.sub(remDiv.mul(radixToPower)).toInt() >>> 0, digits = intval.toString(radix); rem = remDiv; if (rem.isZero()) return digits + result; else { while (digits.length < 6) digits = '0' + digits; result = '' + digits + result; } } }; /** * Gets the high 32 bits as a signed integer. * @returns {number} Signed high bits */ LongPrototype.getHighBits = function getHighBits() { return this.high; }; /** * Gets the high 32 bits as an unsigned integer. * @returns {number} Unsigned high bits */ LongPrototype.getHighBitsUnsigned = function getHighBitsUnsigned() { return this.high >>> 0; }; /** * Gets the low 32 bits as a signed integer. * @returns {number} Signed low bits */ LongPrototype.getLowBits = function getLowBits() { return this.low; }; /** * Gets the low 32 bits as an unsigned integer. * @returns {number} Unsigned low bits */ LongPrototype.getLowBitsUnsigned = function getLowBitsUnsigned() { return this.low >>> 0; }; /** * Gets the number of bits needed to represent the absolute value of this Long. * @returns {number} */ LongPrototype.getNumBitsAbs = function getNumBitsAbs() { if (this.isNegative()) // Unsigned Longs are never negative return this.eq(MIN_VALUE) ? 64 : this.neg().getNumBitsAbs(); var val = this.high != 0 ? this.high : this.low; for (var bit = 31; bit > 0; bit--) if ((val & (1 << bit)) != 0) break; return this.high != 0 ? bit + 33 : bit + 1; }; /** * Tests if this Long's value equals zero. * @returns {boolean} */ LongPrototype.isZero = function isZero() { return this.high === 0 && this.low === 0; }; /** * Tests if this Long's value equals zero. This is an alias of {@link Long#isZero}. * @returns {boolean} */ LongPrototype.eqz = LongPrototype.isZero; /** * Tests if this Long's value is negative. * @returns {boolean} */ LongPrototype.isNegative = function isNegative() { return !this.unsigned && this.high < 0; }; /** * Tests if this Long's value is positive. * @returns {boolean} */ LongPrototype.isPositive = function isPositive() { return this.unsigned || this.high >= 0; }; /** * Tests if this Long's value is odd. * @returns {boolean} */ LongPrototype.isOdd = function isOdd() { return (this.low & 1) === 1; }; /** * Tests if this Long's value is even. * @returns {boolean} */ LongPrototype.isEven = function isEven() { return (this.low & 1) === 0; }; /** * Tests if this Long's value equals the specified's. * @param {!Long|number|string} other Other value * @returns {boolean} */ LongPrototype.equals = function equals(other) { if (!isLong(other)) other = fromValue(other); if (this.unsigned !== other.unsigned && (this.high >>> 31) === 1 && (other.high >>> 31) === 1) return false; return this.high === other.high && this.low === other.low; }; /** * Tests if this Long's value equals the specified's. This is an alias of {@link Long#equals}. * @function * @param {!Long|number|string} other Other value * @returns {boolean} */ LongPrototype.eq = LongPrototype.equals; /** * Tests if this Long's value differs from the specified's. * @param {!Long|number|string} other Other value * @returns {boolean} */ LongPrototype.notEquals = function notEquals(other) { return !this.eq(/* validates */ other); }; /** * Tests if this Long's value differs from the specified's. This is an alias of {@link Long#notEquals}. * @function * @param {!Long|number|string} other Other value * @returns {boolean} */ LongPrototype.neq = LongPrototype.notEquals; /** * Tests if this Long's value differs from the specified's. This is an alias of {@link Long#notEquals}. * @function * @param {!Long|number|string} other Other value * @returns {boolean} */ LongPrototype.ne = LongPrototype.notEquals; /** * Tests if this Long's value is less than the specified's. * @param {!Long|number|string} other Other value * @returns {boolean} */ LongPrototype.lessThan = function lessThan(other) { return this.comp(/* validates */ other) < 0; }; /** * Tests if this Long's value is less than the specified's. This is an alias of {@link Long#lessThan}. * @function * @param {!Long|number|string} other Other value * @returns {boolean} */ LongPrototype.lt = LongPrototype.lessThan; /** * Tests if this Long's value is less than or equal the specified's. * @param {!Long|number|string} other Other value * @returns {boolean} */ LongPrototype.lessThanOrEqual = function lessThanOrEqual(other) { return this.comp(/* validates */ other) <= 0; }; /** * Tests if this Long's value is less than or equal the specified's. This is an alias of {@link Long#lessThanOrEqual}. * @function * @param {!Long|number|string} other Other value * @returns {boolean} */ LongPrototype.lte = LongPrototype.lessThanOrEqual; /** * Tests if this Long's value is less than or equal the specified's. This is an alias of {@link Long#lessThanOrEqual}. * @function * @param {!Long|number|string} other Other value * @returns {boolean} */ LongPrototype.le = LongPrototype.lessThanOrEqual; /** * Tests if this Long's value is greater than the specified's. * @param {!Long|number|string} other Other value * @returns {boolean} */ LongPrototype.greaterThan = function greaterThan(other) { return this.comp(/* validates */ other) > 0; }; /** * Tests if this Long's value is greater than the specified's. This is an alias of {@link Long#greaterThan}. * @function * @param {!Long|number|string} other Other value * @returns {boolean} */ LongPrototype.gt = LongPrototype.greaterThan; /** * Tests if this Long's value is greater than or equal the specified's. * @param {!Long|number|string} other Other value * @returns {boolean} */ LongPrototype.greaterThanOrEqual = function greaterThanOrEqual(other) { return this.comp(/* validates */ other) >= 0; }; /** * Tests if this Long's value is greater than or equal the specified's. This is an alias of {@link Long#greaterThanOrEqual}. * @function * @param {!Long|number|string} other Other value * @returns {boolean} */ LongPrototype.gte = LongPrototype.greaterThanOrEqual; /** * Tests if this Long's value is greater than or equal the specified's. This is an alias of {@link Long#greaterThanOrEqual}. * @function * @param {!Long|number|string} other Other value * @returns {boolean} */ LongPrototype.ge = LongPrototype.greaterThanOrEqual; /** * Compares this Long's value with the specified's. * @param {!Long|number|string} other Other value * @returns {number} 0 if they are the same, 1 if the this is greater and -1 * if the given one is greater */ LongPrototype.compare = function compare(other) { if (!isLong(other)) other = fromValue(other); if (this.eq(other)) return 0; var thisNeg = this.isNegative(), otherNeg = other.isNegative(); if (thisNeg && !otherNeg) return -1; if (!thisNeg && otherNeg) return 1; // At this point the sign bits are the same if (!this.unsigned) return this.sub(other).isNegative() ? -1 : 1; // Both are positive if at least one is unsigned return (other.high >>> 0) > (this.high >>> 0) || (other.high === this.high && (other.low >>> 0) > (this.low >>> 0)) ? -1 : 1; }; /** * Compares this Long's value with the specified's. This is an alias of {@link Long#compare}. * @function * @param {!Long|number|string} other Other value * @returns {number} 0 if they are the same, 1 if the this is greater and -1 * if the given one is greater */ LongPrototype.comp = LongPrototype.compare; /** * Negates this Long's value. * @returns {!Long} Negated Long */ LongPrototype.negate = function negate() { if (!this.unsigned && this.eq(MIN_VALUE)) return MIN_VALUE; return this.not().add(ONE); }; /** * Negates this Long's value. This is an alias of {@link Long#negate}. * @function * @returns {!Long} Negated Long */ LongPrototype.neg = LongPrototype.negate; /** * Returns the sum of this and the specified Long. * @param {!Long|number|string} addend Addend * @returns {!Long} Sum */ LongPrototype.add = function add(addend) { if (!isLong(addend)) addend = fromValue(addend); // Divide each number into 4 chunks of 16 bits, and then sum the chunks. var a48 = this.high >>> 16; var a32 = this.high & 0xFFFF; var a16 = this.low >>> 16; var a00 = this.low & 0xFFFF; var b48 = addend.high >>> 16; var b32 = addend.high & 0xFFFF; var b16 = addend.low >>> 16; var b00 = addend.low & 0xFFFF; var c48 = 0, c32 = 0, c16 = 0, c00 = 0; c00 += a00 + b00; c16 += c00 >>> 16; c00 &= 0xFFFF; c16 += a16 + b16; c32 += c16 >>> 16; c16 &= 0xFFFF; c32 += a32 + b32; c48 += c32 >>> 16; c32 &= 0xFFFF; c48 += a48 + b48; c48 &= 0xFFFF; return fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned); }; /** * Returns the difference of this and the specified Long. * @param {!Long|number|string} subtrahend Subtrahend * @returns {!Long} Difference */ LongPrototype.subtract = function subtract(subtrahend) { if (!isLong(subtrahend)) subtrahend = fromValue(subtrahend); return this.add(subtrahend.neg()); }; /** * Returns the difference of this and the specified Long. This is an alias of {@link Long#subtract}. * @function * @param {!Long|number|string} subtrahend Subtrahend * @returns {!Long} Difference */ LongPrototype.sub = LongPrototype.subtract; /** * Returns the product of this and the specified Long. * @param {!Long|number|string} multiplier Multiplier * @returns {!Long} Product */ LongPrototype.multiply = function multiply(multiplier) { if (this.isZero()) return ZERO; if (!isLong(multiplier)) multiplier = fromValue(multiplier); // use wasm support if present if (wasm) { var low = wasm.mul(this.low, this.high, multiplier.low, multiplier.high); return fromBits(low, wasm.get_high(), this.unsigned); } if (multiplier.isZero()) return ZERO; if (this.eq(MIN_VALUE)) return multiplier.isOdd() ? MIN_VALUE : ZERO; if (multiplier.eq(MIN_VALUE)) return this.isOdd() ? MIN_VALUE : ZERO; if (this.isNegative()) { if (multiplier.isNegative()) return this.neg().mul(multiplier.neg()); else return this.neg().mul(multiplier).neg(); } else if (multiplier.isNegative()) return this.mul(multiplier.neg()).neg(); // If both longs are small, use float multiplication if (this.lt(TWO_PWR_24) && multiplier.lt(TWO_PWR_24)) return fromNumber(this.toNumber() * multiplier.toNumber(), this.unsigned); // Divide each long into 4 chunks of 16 bits, and then add up 4x4 products. // We can skip products that would overflow. var a48 = this.high >>> 16; var a32 = this.high & 0xFFFF; var a16 = this.low >>> 16; var a00 = this.low & 0xFFFF; var b48 = multiplier.high >>> 16; var b32 = multiplier.high & 0xFFFF; var b16 = multiplier.low >>> 16; var b00 = multiplier.low & 0xFFFF; var c48 = 0, c32 = 0, c16 = 0, c00 = 0; c00 += a00 * b00; c16 += c00 >>> 16; c00 &= 0xFFFF; c16 += a16 * b00; c32 += c16 >>> 16; c16 &= 0xFFFF; c16 += a00 * b16; c32 += c16 >>> 16; c16 &= 0xFFFF; c32 += a32 * b00; c48 += c32 >>> 16; c32 &= 0xFFFF; c32 += a16 * b16; c48 += c32 >>> 16; c32 &= 0xFFFF; c32 += a00 * b32; c48 += c32 >>> 16; c32 &= 0xFFFF; c48 += a48 * b00 + a32 * b16 + a16 * b32 + a00 * b48; c48 &= 0xFFFF; return fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned); }; /** * Returns the product of this and the specified Long. This is an alias of {@link Long#multiply}. * @function * @param {!Long|number|string} multiplier Multiplier * @returns {!Long} Product */ LongPrototype.mul = LongPrototype.multiply; /** * Returns this Long divided by the specified. The result is signed if this Long is signed or * unsigned if this Long is unsigned. * @param {!Long|number|string} divisor Divisor * @returns {!Long} Quotient */ LongPrototype.divide = function divide(divisor) { if (!isLong(divisor)) divisor = fromValue(divisor); if (divisor.isZero()) throw Error('division by zero'); // use wasm support if present if (wasm) { // guard against signed division overflow: the largest // negative number / -1 would be 1 larger than the largest // positive number, due to two's complement. if (!this.unsigned && this.high === -0x80000000 && divisor.low === -1 && divisor.high === -1) { // be consistent with non-wasm code path return this; } var low = (this.unsigned ? wasm.div_u : wasm.div_s)( this.low, this.high, divisor.low, divisor.high ); return fromBits(low, wasm.get_high(), this.unsigned); } if (this.isZero()) return this.unsigned ? UZERO : ZERO; var approx, rem, res; if (!this.unsigned) { // This section is only relevant for signed longs and is derived from the // closure library as a whole. if (this.eq(MIN_VALUE)) { if (divisor.eq(ONE) || divisor.eq(NEG_ONE)) return MIN_VALUE; // recall that -MIN_VALUE == MIN_VALUE else if (divisor.eq(MIN_VALUE)) return ONE; else { // At this point, we have |other| >= 2, so |this/other| < |MIN_VALUE|. var halfThis = this.shr(1); approx = halfThis.div(divisor).shl(1); if (approx.eq(ZERO)) { return divisor.isNegative() ? ONE : NEG_ONE; } else { rem = this.sub(divisor.mul(approx)); res = approx.add(rem.div(divisor)); return res; } } } else if (divisor.eq(MIN_VALUE)) return this.unsigned ? UZERO : ZERO; if (this.isNegative()) { if (divisor.isNegative()) return this.neg().div(divisor.neg()); return this.neg().div(divisor).neg(); } else if (divisor.isNegative()) return this.div(divisor.neg()).neg(); res = ZERO; } else { // The algorithm below has not been made for unsigned longs. It's therefore // required to take special care of the MSB prior to running it. if (!divisor.unsigned) divisor = divisor.toUnsigned(); if (divisor.gt(this)) return UZERO; if (divisor.gt(this.shru(1))) // 15 >>> 1 = 7 ; with divisor = 8 ; true return UONE; res = UZERO; } // Repeat the following until the remainder is less than other: find a // floating-point that approximates remainder / other *from below*, add this // into the result, and subtract it from the remainder. It is critical that // the approximate value is less than or equal to the real value so that the // remainder never becomes negative. rem = this; while (rem.gte(divisor)) { // Approximate the result of division. This may be a little greater or // smaller than the actual value. approx = Math.max(1, Math.floor(rem.toNumber() / divisor.toNumber())); // We will tweak the approximate result by changing it in the 48-th digit or // the smallest non-fractional digit, whichever is larger. var log2 = Math.ceil(Math.log(approx) / Math.LN2), delta = (log2 <= 48) ? 1 : pow_dbl(2, log2 - 48), // Decrease the approximation until it is smaller than the remainder. Note // that if it is too large, the product overflows and is negative. approxRes = fromNumber(approx), approxRem = approxRes.mul(divisor); while (approxRem.isNegative() || approxRem.gt(rem)) { approx -= delta; approxRes = fromNumber(approx, this.unsigned); approxRem = approxRes.mul(divisor); } // We know the answer can't be zero... and actually, zero would cause // infinite recursion since we would make no progress. if (approxRes.isZero()) approxRes = ONE; res = res.add(approxRes); rem = rem.sub(approxRem); } return res; }; /** * Returns this Long divided by the specified. This is an alias of {@link Long#divide}. * @function * @param {!Long|number|string} divisor Divisor * @returns {!Long} Quotient */ LongPrototype.div = LongPrototype.divide; /** * Returns this Long modulo the specified. * @param {!Long|number|string} divisor Divisor * @returns {!Long} Remainder */ LongPrototype.modulo = function modulo(divisor) { if (!isLong(divisor)) divisor = fromValue(divisor); // use wasm support if present if (wasm) { var low = (this.unsigned ? wasm.rem_u : wasm.rem_s)( this.low, this.high, divisor.low, divisor.high ); return fromBits(low, wasm.get_high(), this.unsigned); } return this.sub(this.div(divisor).mul(divisor)); }; /** * Returns this Long modulo the specified. This is an alias of {@link Long#modulo}. * @function * @param {!Long|number|string} divisor Divisor * @returns {!Long} Remainder */ LongPrototype.mod = LongPrototype.modulo; /** * Returns this Long modulo the specified. This is an alias of {@link Long#modulo}. * @function * @param {!Long|number|string} divisor Divisor * @returns {!Long} Remainder */ LongPrototype.rem = LongPrototype.modulo; /** * Returns the bitwise NOT of this Long. * @returns {!Long} */ LongPrototype.not = function not() { return fromBits(~this.low, ~this.high, this.unsigned); }; /** * Returns the bitwise AND of this Long and the specified. * @param {!Long|number|string} other Other Long * @returns {!Long} */ LongPrototype.and = function and(other) { if (!isLong(other)) other = fromValue(other); return fromBits(this.low & other.low, this.high & other.high, this.unsigned); }; /** * Returns the bitwise OR of this Long and the specified. * @param {!Long|number|string} other Other Long * @returns {!Long} */ LongPrototype.or = function or(other) { if (!isLong(other)) other = fromValue(other); return fromBits(this.low | other.low, this.high | other.high, this.unsigned); }; /** * Returns the bitwise XOR of this Long and the given one. * @param {!Long|number|string} other Other Long * @returns {!Long} */ LongPrototype.xor = function xor(other) { if (!isLong(other)) other = fromValue(other); return fromBits(this.low ^ other.low, this.high ^ other.high, this.unsigned); }; /** * Returns this Long with bits shifted to the left by the given amount. * @param {number|!Long} numBits Number of bits * @returns {!Long} Shifted Long */ LongPrototype.shiftLeft = function shiftLeft(numBits) { if (isLong(numBits)) numBits = numBits.toInt(); if ((numBits &= 63) === 0) return this; else if (numBits < 32) return fromBits(this.low << numBits, (this.high << numBits) | (this.low >>> (32 - numBits)), this.unsigned); else return fromBits(0, this.low << (numBits - 32), this.unsigned); }; /** * Returns this Long with bits shifted to the left by the given amount. This is an alias of {@link Long#shiftLeft}. * @function * @param {number|!Long} numBits Number of bits * @returns {!Long} Shifted Long */ LongPrototype.shl = LongPrototype.shiftLeft; /** * Returns this Long with bits arithmetically shifted to the right by the given amount. * @param {number|!Long} numBits Number of bits * @returns {!Long} Shifted Long */ LongPrototype.shiftRight = function shiftRight(numBits) { if (isLong(numBits)) numBits = numBits.toInt(); if ((numBits &= 63) === 0) return this; else if (numBits < 32) return fromBits((this.low >>> numBits) | (this.high << (32 - numBits)), this.high >> numBits, this.unsigned); else return fromBits(this.high >> (numBits - 32), this.high >= 0 ? 0 : -1, this.unsigned); }; /** * Returns this Long with bits arithmetically shifted to the right by the given amount. This is an alias of {@link Long#shiftRight}. * @function * @param {number|!Long} numBits Number of bits * @returns {!Long} Shifted Long */ LongPrototype.shr = LongPrototype.shiftRight; /** * Returns this Long with bits logically shifted to the right by the given amount. * @param {number|!Long} numBits Number of bits * @returns {!Long} Shifted Long */ LongPrototype.shiftRightUnsigned = function shiftRightUnsigned(numBits) { if (isLong(numBits)) numBits = numBits.toInt(); numBits &= 63; if (numBits === 0) return this; else { var high = this.high; if (numBits < 32) { var low = this.low; return fromBits((low >>> numBits) | (high << (32 - numBits)), high >>> numBits, this.unsigned); } else if (numBits === 32) return fromBits(high, 0, this.unsigned); else return fromBits(high >>> (numBits - 32), 0, this.unsigned); } }; /** * Returns this Long with bits logically shifted to the right by the given amount. This is an alias of {@link Long#shiftRightUnsigned}. * @function * @param {number|!Long} numBits Number of bits * @returns {!Long} Shifted Long */ LongPrototype.shru = LongPrototype.shiftRightUnsigned; /** * Returns this Long with bits logically shifted to the right by the given amount. This is an alias of {@link Long#shiftRightUnsigned}. * @function * @param {number|!Long} numBits Number of bits * @returns {!Long} Shifted Long */ LongPrototype.shr_u = LongPrototype.shiftRightUnsigned; /** * Converts this Long to signed. * @returns {!Long} Signed long */ LongPrototype.toSigned = function toSigned() { if (!this.unsigned) return this; return fromBits(this.low, this.high, false); }; /** * Converts this Long to unsigned. * @returns {!Long} Unsigned long */ LongPrototype.toUnsigned = function toUnsigned() { if (this.unsigned) return this; return fromBits(this.low, this.high, true); }; /** * Converts this Long to its byte representation. * @param {boolean=} le Whether little or big endian, defaults to big endian * @returns {!Array.} Byte representation */ LongPrototype.toBytes = function toBytes(le) { return le ? this.toBytesLE() : this.toBytesBE(); }; /** * Converts this Long to its little endian byte representation. * @returns {!Array.} Little endian byte representation */ LongPrototype.toBytesLE = function toBytesLE() { var hi = this.high, lo = this.low; return [ lo & 0xff, lo >>> 8 & 0xff, lo >>> 16 & 0xff, lo >>> 24 , hi & 0xff, hi >>> 8 & 0xff, hi >>> 16 & 0xff, hi >>> 24 ]; }; /** * Converts this Long to its big endian byte representation. * @returns {!Array.} Big endian byte representation */ LongPrototype.toBytesBE = function toBytesBE() { var hi = this.high, lo = this.low; return [ hi >>> 24 , hi >>> 16 & 0xff, hi >>> 8 & 0xff, hi & 0xff, lo >>> 24 , lo >>> 16 & 0xff, lo >>> 8 & 0xff, lo & 0xff ]; }; /** * Creates a Long from its byte representation. * @param {!Array.} bytes Byte representation * @param {boolean=} unsigned Whether unsigned or not, defaults to signed * @param {boolean=} le Whether little or big endian, defaults to big endian * @returns {Long} The corresponding Long value */ Long.fromBytes = function fromBytes(bytes, unsigned, le) { return le ? Long.fromBytesLE(bytes, unsigned) : Long.fromBytesBE(bytes, unsigned); }; /** * Creates a Long from its little endian byte representation. * @param {!Array.} bytes Little endian byte representation * @param {boolean=} unsigned Whether unsigned or not, defaults to signed * @returns {Long} The corresponding Long value */ Long.fromBytesLE = function fromBytesLE(bytes, unsigned) { return new Long( bytes[0] | bytes[1] << 8 | bytes[2] << 16 | bytes[3] << 24, bytes[4] | bytes[5] << 8 | bytes[6] << 16 | bytes[7] << 24, unsigned ); }; /** * Creates a Long from its big endian byte representation. * @param {!Array.} bytes Big endian byte representation * @param {boolean=} unsigned Whether unsigned or not, defaults to signed * @returns {Long} The corresponding Long value */ Long.fromBytesBE = function fromBytesBE(bytes, unsigned) { return new Long( bytes[4] << 24 | bytes[5] << 16 | bytes[6] << 8 | bytes[7], bytes[0] << 24 | bytes[1] << 16 | bytes[2] << 8 | bytes[3], unsigned ); }; /***/ }), /***/ 467: /***/ ((module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } var Stream = _interopDefault(__webpack_require__(2413)); var http = _interopDefault(__webpack_require__(8605)); var Url = _interopDefault(__webpack_require__(8835)); var https = _interopDefault(__webpack_require__(7211)); var zlib = _interopDefault(__webpack_require__(8761)); // Based on https://github.com/tmpvar/jsdom/blob/aa85b2abf07766ff7bf5c1f6daafb3726f2f2db5/lib/jsdom/living/blob.js // fix for "Readable" isn't a named export issue const Readable = Stream.Readable; const BUFFER = Symbol('buffer'); const TYPE = Symbol('type'); class Blob { constructor() { this[TYPE] = ''; const blobParts = arguments[0]; const options = arguments[1]; const buffers = []; let size = 0; if (blobParts) { const a = blobParts; const length = Number(a.length); for (let i = 0; i < length; i++) { const element = a[i]; let buffer; if (element instanceof Buffer) { buffer = element; } else if (ArrayBuffer.isView(element)) { buffer = Buffer.from(element.buffer, element.byteOffset, element.byteLength); } else if (element instanceof ArrayBuffer) { buffer = Buffer.from(element); } else if (element instanceof Blob) { buffer = element[BUFFER]; } else { buffer = Buffer.from(typeof element === 'string' ? element : String(element)); } size += buffer.length; buffers.push(buffer); } } this[BUFFER] = Buffer.concat(buffers); let type = options && options.type !== undefined && String(options.type).toLowerCase(); if (type && !/[^\u0020-\u007E]/.test(type)) { this[TYPE] = type; } } get size() { return this[BUFFER].length; } get type() { return this[TYPE]; } text() { return Promise.resolve(this[BUFFER].toString()); } arrayBuffer() { const buf = this[BUFFER]; const ab = buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength); return Promise.resolve(ab); } stream() { const readable = new Readable(); readable._read = function () {}; readable.push(this[BUFFER]); readable.push(null); return readable; } toString() { return '[object Blob]'; } slice() { const size = this.size; const start = arguments[0]; const end = arguments[1]; let relativeStart, relativeEnd; if (start === undefined) { relativeStart = 0; } else if (start < 0) { relativeStart = Math.max(size + start, 0); } else { relativeStart = Math.min(start, size); } if (end === undefined) { relativeEnd = size; } else if (end < 0) { relativeEnd = Math.max(size + end, 0); } else { relativeEnd = Math.min(end, size); } const span = Math.max(relativeEnd - relativeStart, 0); const buffer = this[BUFFER]; const slicedBuffer = buffer.slice(relativeStart, relativeStart + span); const blob = new Blob([], { type: arguments[2] }); blob[BUFFER] = slicedBuffer; return blob; } } Object.defineProperties(Blob.prototype, { size: { enumerable: true }, type: { enumerable: true }, slice: { enumerable: true } }); Object.defineProperty(Blob.prototype, Symbol.toStringTag, { value: 'Blob', writable: false, enumerable: false, configurable: true }); /** * fetch-error.js * * FetchError interface for operational errors */ /** * Create FetchError instance * * @param String message Error message for human * @param String type Error type for machine * @param String systemError For Node.js system error * @return FetchError */ function FetchError(message, type, systemError) { Error.call(this, message); this.message = message; this.type = type; // when err.type is `system`, err.code contains system error code if (systemError) { this.code = this.errno = systemError.code; } // hide custom error implementation details from end-users Error.captureStackTrace(this, this.constructor); } FetchError.prototype = Object.create(Error.prototype); FetchError.prototype.constructor = FetchError; FetchError.prototype.name = 'FetchError'; let convert; try { convert = __webpack_require__(2877).convert; } catch (e) {} const INTERNALS = Symbol('Body internals'); // fix an issue where "PassThrough" isn't a named export for node <10 const PassThrough = Stream.PassThrough; /** * Body mixin * * Ref: https://fetch.spec.whatwg.org/#body * * @param Stream body Readable stream * @param Object opts Response options * @return Void */ function Body(body) { var _this = this; var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, _ref$size = _ref.size; let size = _ref$size === undefined ? 0 : _ref$size; var _ref$timeout = _ref.timeout; let timeout = _ref$timeout === undefined ? 0 : _ref$timeout; if (body == null) { // body is undefined or null body = null; } else if (isURLSearchParams(body)) { // body is a URLSearchParams body = Buffer.from(body.toString()); } else if (isBlob(body)) ; else if (Buffer.isBuffer(body)) ; else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') { // body is ArrayBuffer body = Buffer.from(body); } else if (ArrayBuffer.isView(body)) { // body is ArrayBufferView body = Buffer.from(body.buffer, body.byteOffset, body.byteLength); } else if (body instanceof Stream) ; else { // none of the above // coerce to string then buffer body = Buffer.from(String(body)); } this[INTERNALS] = { body, disturbed: false, error: null }; this.size = size; this.timeout = timeout; if (body instanceof Stream) { body.on('error', function (err) { const error = err.name === 'AbortError' ? err : new FetchError(`Invalid response body while trying to fetch ${_this.url}: ${err.message}`, 'system', err); _this[INTERNALS].error = error; }); } } Body.prototype = { get body() { return this[INTERNALS].body; }, get bodyUsed() { return this[INTERNALS].disturbed; }, /** * Decode response as ArrayBuffer * * @return Promise */ arrayBuffer() { return consumeBody.call(this).then(function (buf) { return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength); }); }, /** * Return raw response as Blob * * @return Promise */ blob() { let ct = this.headers && this.headers.get('content-type') || ''; return consumeBody.call(this).then(function (buf) { return Object.assign( // Prevent copying new Blob([], { type: ct.toLowerCase() }), { [BUFFER]: buf }); }); }, /** * Decode response as json * * @return Promise */ json() { var _this2 = this; return consumeBody.call(this).then(function (buffer) { try { return JSON.parse(buffer.toString()); } catch (err) { return Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, 'invalid-json')); } }); }, /** * Decode response as text * * @return Promise */ text() { return consumeBody.call(this).then(function (buffer) { return buffer.toString(); }); }, /** * Decode response as buffer (non-spec api) * * @return Promise */ buffer() { return consumeBody.call(this); }, /** * Decode response as text, while automatically detecting the encoding and * trying to decode to UTF-8 (non-spec api) * * @return Promise */ textConverted() { var _this3 = this; return consumeBody.call(this).then(function (buffer) { return convertBody(buffer, _this3.headers); }); } }; // In browsers, all properties are enumerable. Object.defineProperties(Body.prototype, { body: { enumerable: true }, bodyUsed: { enumerable: true }, arrayBuffer: { enumerable: true }, blob: { enumerable: true }, json: { enumerable: true }, text: { enumerable: true } }); Body.mixIn = function (proto) { for (const name of Object.getOwnPropertyNames(Body.prototype)) { // istanbul ignore else: future proof if (!(name in proto)) { const desc = Object.getOwnPropertyDescriptor(Body.prototype, name); Object.defineProperty(proto, name, desc); } } }; /** * Consume and convert an entire Body to a Buffer. * * Ref: https://fetch.spec.whatwg.org/#concept-body-consume-body * * @return Promise */ function consumeBody() { var _this4 = this; if (this[INTERNALS].disturbed) { return Body.Promise.reject(new TypeError(`body used already for: ${this.url}`)); } this[INTERNALS].disturbed = true; if (this[INTERNALS].error) { return Body.Promise.reject(this[INTERNALS].error); } let body = this.body; // body is null if (body === null) { return Body.Promise.resolve(Buffer.alloc(0)); } // body is blob if (isBlob(body)) { body = body.stream(); } // body is buffer if (Buffer.isBuffer(body)) { return Body.Promise.resolve(body); } // istanbul ignore if: should never happen if (!(body instanceof Stream)) { return Body.Promise.resolve(Buffer.alloc(0)); } // body is stream // get ready to actually consume the body let accum = []; let accumBytes = 0; let abort = false; return new Body.Promise(function (resolve, reject) { let resTimeout; // allow timeout on slow response body if (_this4.timeout) { resTimeout = setTimeout(function () { abort = true; reject(new FetchError(`Response timeout while trying to fetch ${_this4.url} (over ${_this4.timeout}ms)`, 'body-timeout')); }, _this4.timeout); } // handle stream errors body.on('error', function (err) { if (err.name === 'AbortError') { // if the request was aborted, reject with this Error abort = true; reject(err); } else { // other errors, such as incorrect content-encoding reject(new FetchError(`Invalid response body while trying to fetch ${_this4.url}: ${err.message}`, 'system', err)); } }); body.on('data', function (chunk) { if (abort || chunk === null) { return; } if (_this4.size && accumBytes + chunk.length > _this4.size) { abort = true; reject(new FetchError(`content size at ${_this4.url} over limit: ${_this4.size}`, 'max-size')); return; } accumBytes += chunk.length; accum.push(chunk); }); body.on('end', function () { if (abort) { return; } clearTimeout(resTimeout); try { resolve(Buffer.concat(accum, accumBytes)); } catch (err) { // handle streams that have accumulated too much data (issue #414) reject(new FetchError(`Could not create Buffer from response body for ${_this4.url}: ${err.message}`, 'system', err)); } }); }); } /** * Detect buffer encoding and convert to target encoding * ref: http://www.w3.org/TR/2011/WD-html5-20110113/parsing.html#determining-the-character-encoding * * @param Buffer buffer Incoming buffer * @param String encoding Target encoding * @return String */ function convertBody(buffer, headers) { if (typeof convert !== 'function') { throw new Error('The package `encoding` must be installed to use the textConverted() function'); } const ct = headers.get('content-type'); let charset = 'utf-8'; let res, str; // header if (ct) { res = /charset=([^;]*)/i.exec(ct); } // no charset in content type, peek at response body for at most 1024 bytes str = buffer.slice(0, 1024).toString(); // html5 if (!res && str) { res = / 0 && arguments[0] !== undefined ? arguments[0] : undefined; this[MAP] = Object.create(null); if (init instanceof Headers) { const rawHeaders = init.raw(); const headerNames = Object.keys(rawHeaders); for (const headerName of headerNames) { for (const value of rawHeaders[headerName]) { this.append(headerName, value); } } return; } // We don't worry about converting prop to ByteString here as append() // will handle it. if (init == null) ; else if (typeof init === 'object') { const method = init[Symbol.iterator]; if (method != null) { if (typeof method !== 'function') { throw new TypeError('Header pairs must be iterable'); } // sequence> // Note: per spec we have to first exhaust the lists then process them const pairs = []; for (const pair of init) { if (typeof pair !== 'object' || typeof pair[Symbol.iterator] !== 'function') { throw new TypeError('Each header pair must be iterable'); } pairs.push(Array.from(pair)); } for (const pair of pairs) { if (pair.length !== 2) { throw new TypeError('Each header pair must be a name/value tuple'); } this.append(pair[0], pair[1]); } } else { // record for (const key of Object.keys(init)) { const value = init[key]; this.append(key, value); } } } else { throw new TypeError('Provided initializer must be an object'); } } /** * Return combined header value given name * * @param String name Header name * @return Mixed */ get(name) { name = `${name}`; validateName(name); const key = find(this[MAP], name); if (key === undefined) { return null; } return this[MAP][key].join(', '); } /** * Iterate over all headers * * @param Function callback Executed for each item with parameters (value, name, thisArg) * @param Boolean thisArg `this` context for callback function * @return Void */ forEach(callback) { let thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined; let pairs = getHeaders(this); let i = 0; while (i < pairs.length) { var _pairs$i = pairs[i]; const name = _pairs$i[0], value = _pairs$i[1]; callback.call(thisArg, value, name, this); pairs = getHeaders(this); i++; } } /** * Overwrite header values given name * * @param String name Header name * @param String value Header value * @return Void */ set(name, value) { name = `${name}`; value = `${value}`; validateName(name); validateValue(value); const key = find(this[MAP], name); this[MAP][key !== undefined ? key : name] = [value]; } /** * Append a value onto existing header * * @param String name Header name * @param String value Header value * @return Void */ append(name, value) { name = `${name}`; value = `${value}`; validateName(name); validateValue(value); const key = find(this[MAP], name); if (key !== undefined) { this[MAP][key].push(value); } else { this[MAP][name] = [value]; } } /** * Check for header name existence * * @param String name Header name * @return Boolean */ has(name) { name = `${name}`; validateName(name); return find(this[MAP], name) !== undefined; } /** * Delete all header values given name * * @param String name Header name * @return Void */ delete(name) { name = `${name}`; validateName(name); const key = find(this[MAP], name); if (key !== undefined) { delete this[MAP][key]; } } /** * Return raw headers (non-spec api) * * @return Object */ raw() { return this[MAP]; } /** * Get an iterator on keys. * * @return Iterator */ keys() { return createHeadersIterator(this, 'key'); } /** * Get an iterator on values. * * @return Iterator */ values() { return createHeadersIterator(this, 'value'); } /** * Get an iterator on entries. * * This is the default iterator of the Headers object. * * @return Iterator */ [Symbol.iterator]() { return createHeadersIterator(this, 'key+value'); } } Headers.prototype.entries = Headers.prototype[Symbol.iterator]; Object.defineProperty(Headers.prototype, Symbol.toStringTag, { value: 'Headers', writable: false, enumerable: false, configurable: true }); Object.defineProperties(Headers.prototype, { get: { enumerable: true }, forEach: { enumerable: true }, set: { enumerable: true }, append: { enumerable: true }, has: { enumerable: true }, delete: { enumerable: true }, keys: { enumerable: true }, values: { enumerable: true }, entries: { enumerable: true } }); function getHeaders(headers) { let kind = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'key+value'; const keys = Object.keys(headers[MAP]).sort(); return keys.map(kind === 'key' ? function (k) { return k.toLowerCase(); } : kind === 'value' ? function (k) { return headers[MAP][k].join(', '); } : function (k) { return [k.toLowerCase(), headers[MAP][k].join(', ')]; }); } const INTERNAL = Symbol('internal'); function createHeadersIterator(target, kind) { const iterator = Object.create(HeadersIteratorPrototype); iterator[INTERNAL] = { target, kind, index: 0 }; return iterator; } const HeadersIteratorPrototype = Object.setPrototypeOf({ next() { // istanbul ignore if if (!this || Object.getPrototypeOf(this) !== HeadersIteratorPrototype) { throw new TypeError('Value of `this` is not a HeadersIterator'); } var _INTERNAL = this[INTERNAL]; const target = _INTERNAL.target, kind = _INTERNAL.kind, index = _INTERNAL.index; const values = getHeaders(target, kind); const len = values.length; if (index >= len) { return { value: undefined, done: true }; } this[INTERNAL].index = index + 1; return { value: values[index], done: false }; } }, Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()))); Object.defineProperty(HeadersIteratorPrototype, Symbol.toStringTag, { value: 'HeadersIterator', writable: false, enumerable: false, configurable: true }); /** * Export the Headers object in a form that Node.js can consume. * * @param Headers headers * @return Object */ function exportNodeCompatibleHeaders(headers) { const obj = Object.assign({ __proto__: null }, headers[MAP]); // http.request() only supports string as Host header. This hack makes // specifying custom Host header possible. const hostHeaderKey = find(headers[MAP], 'Host'); if (hostHeaderKey !== undefined) { obj[hostHeaderKey] = obj[hostHeaderKey][0]; } return obj; } /** * Create a Headers object from an object of headers, ignoring those that do * not conform to HTTP grammar productions. * * @param Object obj Object of headers * @return Headers */ function createHeadersLenient(obj) { const headers = new Headers(); for (const name of Object.keys(obj)) { if (invalidTokenRegex.test(name)) { continue; } if (Array.isArray(obj[name])) { for (const val of obj[name]) { if (invalidHeaderCharRegex.test(val)) { continue; } if (headers[MAP][name] === undefined) { headers[MAP][name] = [val]; } else { headers[MAP][name].push(val); } } } else if (!invalidHeaderCharRegex.test(obj[name])) { headers[MAP][name] = [obj[name]]; } } return headers; } const INTERNALS$1 = Symbol('Response internals'); // fix an issue where "STATUS_CODES" aren't a named export for node <10 const STATUS_CODES = http.STATUS_CODES; /** * Response class * * @param Stream body Readable stream * @param Object opts Response options * @return Void */ class Response { constructor() { let body = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; Body.call(this, body, opts); const status = opts.status || 200; const headers = new Headers(opts.headers); if (body != null && !headers.has('Content-Type')) { const contentType = extractContentType(body); if (contentType) { headers.append('Content-Type', contentType); } } this[INTERNALS$1] = { url: opts.url, status, statusText: opts.statusText || STATUS_CODES[status], headers, counter: opts.counter }; } get url() { return this[INTERNALS$1].url || ''; } get status() { return this[INTERNALS$1].status; } /** * Convenience property representing if the request ended normally */ get ok() { return this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300; } get redirected() { return this[INTERNALS$1].counter > 0; } get statusText() { return this[INTERNALS$1].statusText; } get headers() { return this[INTERNALS$1].headers; } /** * Clone this response * * @return Response */ clone() { return new Response(clone(this), { url: this.url, status: this.status, statusText: this.statusText, headers: this.headers, ok: this.ok, redirected: this.redirected }); } } Body.mixIn(Response.prototype); Object.defineProperties(Response.prototype, { url: { enumerable: true }, status: { enumerable: true }, ok: { enumerable: true }, redirected: { enumerable: true }, statusText: { enumerable: true }, headers: { enumerable: true }, clone: { enumerable: true } }); Object.defineProperty(Response.prototype, Symbol.toStringTag, { value: 'Response', writable: false, enumerable: false, configurable: true }); const INTERNALS$2 = Symbol('Request internals'); // fix an issue where "format", "parse" aren't a named export for node <10 const parse_url = Url.parse; const format_url = Url.format; const streamDestructionSupported = 'destroy' in Stream.Readable.prototype; /** * Check if a value is an instance of Request. * * @param Mixed input * @return Boolean */ function isRequest(input) { return typeof input === 'object' && typeof input[INTERNALS$2] === 'object'; } function isAbortSignal(signal) { const proto = signal && typeof signal === 'object' && Object.getPrototypeOf(signal); return !!(proto && proto.constructor.name === 'AbortSignal'); } /** * Request class * * @param Mixed input Url or Request instance * @param Object init Custom options * @return Void */ class Request { constructor(input) { let init = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; let parsedURL; // normalize input if (!isRequest(input)) { if (input && input.href) { // in order to support Node.js' Url objects; though WHATWG's URL objects // will fall into this branch also (since their `toString()` will return // `href` property anyway) parsedURL = parse_url(input.href); } else { // coerce input to a string before attempting to parse parsedURL = parse_url(`${input}`); } input = {}; } else { parsedURL = parse_url(input.url); } let method = init.method || input.method || 'GET'; method = method.toUpperCase(); if ((init.body != null || isRequest(input) && input.body !== null) && (method === 'GET' || method === 'HEAD')) { throw new TypeError('Request with GET/HEAD method cannot have body'); } let inputBody = init.body != null ? init.body : isRequest(input) && input.body !== null ? clone(input) : null; Body.call(this, inputBody, { timeout: init.timeout || input.timeout || 0, size: init.size || input.size || 0 }); const headers = new Headers(init.headers || input.headers || {}); if (inputBody != null && !headers.has('Content-Type')) { const contentType = extractContentType(inputBody); if (contentType) { headers.append('Content-Type', contentType); } } let signal = isRequest(input) ? input.signal : null; if ('signal' in init) signal = init.signal; if (signal != null && !isAbortSignal(signal)) { throw new TypeError('Expected signal to be an instanceof AbortSignal'); } this[INTERNALS$2] = { method, redirect: init.redirect || input.redirect || 'follow', headers, parsedURL, signal }; // node-fetch-only options this.follow = init.follow !== undefined ? init.follow : input.follow !== undefined ? input.follow : 20; this.compress = init.compress !== undefined ? init.compress : input.compress !== undefined ? input.compress : true; this.counter = init.counter || input.counter || 0; this.agent = init.agent || input.agent; } get method() { return this[INTERNALS$2].method; } get url() { return format_url(this[INTERNALS$2].parsedURL); } get headers() { return this[INTERNALS$2].headers; } get redirect() { return this[INTERNALS$2].redirect; } get signal() { return this[INTERNALS$2].signal; } /** * Clone this request * * @return Request */ clone() { return new Request(this); } } Body.mixIn(Request.prototype); Object.defineProperty(Request.prototype, Symbol.toStringTag, { value: 'Request', writable: false, enumerable: false, configurable: true }); Object.defineProperties(Request.prototype, { method: { enumerable: true }, url: { enumerable: true }, headers: { enumerable: true }, redirect: { enumerable: true }, clone: { enumerable: true }, signal: { enumerable: true } }); /** * Convert a Request to Node.js http request options. * * @param Request A Request instance * @return Object The options object to be passed to http.request */ function getNodeRequestOptions(request) { const parsedURL = request[INTERNALS$2].parsedURL; const headers = new Headers(request[INTERNALS$2].headers); // fetch step 1.3 if (!headers.has('Accept')) { headers.set('Accept', '*/*'); } // Basic fetch if (!parsedURL.protocol || !parsedURL.hostname) { throw new TypeError('Only absolute URLs are supported'); } if (!/^https?:$/.test(parsedURL.protocol)) { throw new TypeError('Only HTTP(S) protocols are supported'); } if (request.signal && request.body instanceof Stream.Readable && !streamDestructionSupported) { throw new Error('Cancellation of streamed requests with AbortSignal is not supported in node < 8'); } // HTTP-network-or-cache fetch steps 2.4-2.7 let contentLengthValue = null; if (request.body == null && /^(POST|PUT)$/i.test(request.method)) { contentLengthValue = '0'; } if (request.body != null) { const totalBytes = getTotalBytes(request); if (typeof totalBytes === 'number') { contentLengthValue = String(totalBytes); } } if (contentLengthValue) { headers.set('Content-Length', contentLengthValue); } // HTTP-network-or-cache fetch step 2.11 if (!headers.has('User-Agent')) { headers.set('User-Agent', 'node-fetch/1.0 (+https://github.com/bitinn/node-fetch)'); } // HTTP-network-or-cache fetch step 2.15 if (request.compress && !headers.has('Accept-Encoding')) { headers.set('Accept-Encoding', 'gzip,deflate'); } let agent = request.agent; if (typeof agent === 'function') { agent = agent(parsedURL); } if (!headers.has('Connection') && !agent) { headers.set('Connection', 'close'); } // HTTP-network fetch step 4.2 // chunked encoding is handled by Node.js return Object.assign({}, parsedURL, { method: request.method, headers: exportNodeCompatibleHeaders(headers), agent }); } /** * abort-error.js * * AbortError interface for cancelled requests */ /** * Create AbortError instance * * @param String message Error message for human * @return AbortError */ function AbortError(message) { Error.call(this, message); this.type = 'aborted'; this.message = message; // hide custom error implementation details from end-users Error.captureStackTrace(this, this.constructor); } AbortError.prototype = Object.create(Error.prototype); AbortError.prototype.constructor = AbortError; AbortError.prototype.name = 'AbortError'; // fix an issue where "PassThrough", "resolve" aren't a named export for node <10 const PassThrough$1 = Stream.PassThrough; const resolve_url = Url.resolve; /** * Fetch function * * @param Mixed url Absolute url or Request instance * @param Object opts Fetch options * @return Promise */ function fetch(url, opts) { // allow custom promise if (!fetch.Promise) { throw new Error('native promise missing, set fetch.Promise to your favorite alternative'); } Body.Promise = fetch.Promise; // wrap http.request into fetch return new fetch.Promise(function (resolve, reject) { // build request object const request = new Request(url, opts); const options = getNodeRequestOptions(request); const send = (options.protocol === 'https:' ? https : http).request; const signal = request.signal; let response = null; const abort = function abort() { let error = new AbortError('The user aborted a request.'); reject(error); if (request.body && request.body instanceof Stream.Readable) { request.body.destroy(error); } if (!response || !response.body) return; response.body.emit('error', error); }; if (signal && signal.aborted) { abort(); return; } const abortAndFinalize = function abortAndFinalize() { abort(); finalize(); }; // send request const req = send(options); let reqTimeout; if (signal) { signal.addEventListener('abort', abortAndFinalize); } function finalize() { req.abort(); if (signal) signal.removeEventListener('abort', abortAndFinalize); clearTimeout(reqTimeout); } if (request.timeout) { req.once('socket', function (socket) { reqTimeout = setTimeout(function () { reject(new FetchError(`network timeout at: ${request.url}`, 'request-timeout')); finalize(); }, request.timeout); }); } req.on('error', function (err) { reject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, 'system', err)); finalize(); }); req.on('response', function (res) { clearTimeout(reqTimeout); const headers = createHeadersLenient(res.headers); // HTTP fetch step 5 if (fetch.isRedirect(res.statusCode)) { // HTTP fetch step 5.2 const location = headers.get('Location'); // HTTP fetch step 5.3 const locationURL = location === null ? null : resolve_url(request.url, location); // HTTP fetch step 5.5 switch (request.redirect) { case 'error': reject(new FetchError(`uri requested responds with a redirect, redirect mode is set to error: ${request.url}`, 'no-redirect')); finalize(); return; case 'manual': // node-fetch-specific step: make manual redirect a bit easier to use by setting the Location header value to the resolved URL. if (locationURL !== null) { // handle corrupted header try { headers.set('Location', locationURL); } catch (err) { // istanbul ignore next: nodejs server prevent invalid response headers, we can't test this through normal request reject(err); } } break; case 'follow': // HTTP-redirect fetch step 2 if (locationURL === null) { break; } // HTTP-redirect fetch step 5 if (request.counter >= request.follow) { reject(new FetchError(`maximum redirect reached at: ${request.url}`, 'max-redirect')); finalize(); return; } // HTTP-redirect fetch step 6 (counter increment) // Create a new Request object. const requestOpts = { headers: new Headers(request.headers), follow: request.follow, counter: request.counter + 1, agent: request.agent, compress: request.compress, method: request.method, body: request.body, signal: request.signal, timeout: request.timeout, size: request.size }; // HTTP-redirect fetch step 9 if (res.statusCode !== 303 && request.body && getTotalBytes(request) === null) { reject(new FetchError('Cannot follow redirect with body being a readable stream', 'unsupported-redirect')); finalize(); return; } // HTTP-redirect fetch step 11 if (res.statusCode === 303 || (res.statusCode === 301 || res.statusCode === 302) && request.method === 'POST') { requestOpts.method = 'GET'; requestOpts.body = undefined; requestOpts.headers.delete('content-length'); } // HTTP-redirect fetch step 15 resolve(fetch(new Request(locationURL, requestOpts))); finalize(); return; } } // prepare response res.once('end', function () { if (signal) signal.removeEventListener('abort', abortAndFinalize); }); let body = res.pipe(new PassThrough$1()); const response_options = { url: request.url, status: res.statusCode, statusText: res.statusMessage, headers: headers, size: request.size, timeout: request.timeout, counter: request.counter }; // HTTP-network fetch step 12.1.1.3 const codings = headers.get('Content-Encoding'); // HTTP-network fetch step 12.1.1.4: handle content codings // in following scenarios we ignore compression support // 1. compression support is disabled // 2. HEAD request // 3. no Content-Encoding header // 4. no content response (204) // 5. content not modified response (304) if (!request.compress || request.method === 'HEAD' || codings === null || res.statusCode === 204 || res.statusCode === 304) { response = new Response(body, response_options); resolve(response); return; } // For Node v6+ // Be less strict when decoding compressed responses, since sometimes // servers send slightly invalid responses that are still accepted // by common browsers. // Always using Z_SYNC_FLUSH is what cURL does. const zlibOptions = { flush: zlib.Z_SYNC_FLUSH, finishFlush: zlib.Z_SYNC_FLUSH }; // for gzip if (codings == 'gzip' || codings == 'x-gzip') { body = body.pipe(zlib.createGunzip(zlibOptions)); response = new Response(body, response_options); resolve(response); return; } // for deflate if (codings == 'deflate' || codings == 'x-deflate') { // handle the infamous raw deflate response from old servers // a hack for old IIS and Apache servers const raw = res.pipe(new PassThrough$1()); raw.once('data', function (chunk) { // see http://stackoverflow.com/questions/37519828 if ((chunk[0] & 0x0F) === 0x08) { body = body.pipe(zlib.createInflate()); } else { body = body.pipe(zlib.createInflateRaw()); } response = new Response(body, response_options); resolve(response); }); return; } // for br if (codings == 'br' && typeof zlib.createBrotliDecompress === 'function') { body = body.pipe(zlib.createBrotliDecompress()); response = new Response(body, response_options); resolve(response); return; } // otherwise, use response as-is response = new Response(body, response_options); resolve(response); }); writeToStream(req, request); }); } /** * Redirect code matching * * @param Number code Status code * @return Boolean */ fetch.isRedirect = function (code) { return code === 301 || code === 302 || code === 303 || code === 307 || code === 308; }; // expose Promise fetch.Promise = global.Promise; module.exports = exports = fetch; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.default = exports; exports.Headers = Headers; exports.Request = Request; exports.Response = Response; exports.FetchError = FetchError; /***/ }), /***/ 1223: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var wrappy = __webpack_require__(2940) module.exports = wrappy(once) module.exports.strict = wrappy(onceStrict) once.proto = once(function () { Object.defineProperty(Function.prototype, 'once', { value: function () { return once(this) }, configurable: true }) Object.defineProperty(Function.prototype, 'onceStrict', { value: function () { return onceStrict(this) }, configurable: true }) }) function once (fn) { var f = function () { if (f.called) return f.value f.called = true return f.value = fn.apply(this, arguments) } f.called = false return f } function onceStrict (fn) { var f = function () { if (f.called) throw new Error(f.onceError) f.called = true return f.value = fn.apply(this, arguments) } var name = fn.name || 'Function wrapped with `once`' f.onceError = name + " shouldn't be called more than once" f.called = false return f } /***/ }), /***/ 1532: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const ANY = Symbol('SemVer ANY') // hoisted class for cyclic dependency class Comparator { static get ANY () { return ANY } constructor (comp, options) { if (!options || typeof options !== 'object') { options = { loose: !!options, includePrerelease: false } } if (comp instanceof Comparator) { if (comp.loose === !!options.loose) { return comp } else { comp = comp.value } } debug('comparator', comp, options) this.options = options this.loose = !!options.loose this.parse(comp) if (this.semver === ANY) { this.value = '' } else { this.value = this.operator + this.semver.version } debug('comp', this) } parse (comp) { const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR] const m = comp.match(r) if (!m) { throw new TypeError(`Invalid comparator: ${comp}`) } this.operator = m[1] !== undefined ? m[1] : '' if (this.operator === '=') { this.operator = '' } // if it literally is just '>' or '' then allow anything. if (!m[2]) { this.semver = ANY } else { this.semver = new SemVer(m[2], this.options.loose) } } toString () { return this.value } test (version) { debug('Comparator.test', version, this.options.loose) if (this.semver === ANY || version === ANY) { return true } if (typeof version === 'string') { try { version = new SemVer(version, this.options) } catch (er) { return false } } return cmp(version, this.operator, this.semver, this.options) } intersects (comp, options) { if (!(comp instanceof Comparator)) { throw new TypeError('a Comparator is required') } if (!options || typeof options !== 'object') { options = { loose: !!options, includePrerelease: false } } if (this.operator === '') { if (this.value === '') { return true } return new Range(comp.value, options).test(this.value) } else if (comp.operator === '') { if (comp.value === '') { return true } return new Range(this.value, options).test(comp.semver) } const sameDirectionIncreasing = (this.operator === '>=' || this.operator === '>') && (comp.operator === '>=' || comp.operator === '>') const sameDirectionDecreasing = (this.operator === '<=' || this.operator === '<') && (comp.operator === '<=' || comp.operator === '<') const sameSemVer = this.semver.version === comp.semver.version const differentDirectionsInclusive = (this.operator === '>=' || this.operator === '<=') && (comp.operator === '>=' || comp.operator === '<=') const oppositeDirectionsLessThan = cmp(this.semver, '<', comp.semver, options) && (this.operator === '>=' || this.operator === '>') && (comp.operator === '<=' || comp.operator === '<') const oppositeDirectionsGreaterThan = cmp(this.semver, '>', comp.semver, options) && (this.operator === '<=' || this.operator === '<') && (comp.operator === '>=' || comp.operator === '>') return ( sameDirectionIncreasing || sameDirectionDecreasing || (sameSemVer && differentDirectionsInclusive) || oppositeDirectionsLessThan || oppositeDirectionsGreaterThan ) } } module.exports = Comparator const {re, t} = __webpack_require__(9523) const cmp = __webpack_require__(5098) const debug = __webpack_require__(427) const SemVer = __webpack_require__(8088) const Range = __webpack_require__(9828) /***/ }), /***/ 9828: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // hoisted class for cyclic dependency class Range { constructor (range, options) { if (!options || typeof options !== 'object') { options = { loose: !!options, includePrerelease: false } } if (range instanceof Range) { if ( range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease ) { return range } else { return new Range(range.raw, options) } } if (range instanceof Comparator) { // just put it in the set and return this.raw = range.value this.set = [[range]] this.format() return this } this.options = options this.loose = !!options.loose this.includePrerelease = !!options.includePrerelease // First, split based on boolean or || this.raw = range this.set = range .split(/\s*\|\|\s*/) // map the range to a 2d array of comparators .map(range => this.parseRange(range.trim())) // throw out any comparator lists that are empty // this generally means that it was not a valid range, which is allowed // in loose mode, but will still throw if the WHOLE range is invalid. .filter(c => c.length) if (!this.set.length) { throw new TypeError(`Invalid SemVer Range: ${range}`) } this.format() } format () { this.range = this.set .map((comps) => { return comps.join(' ').trim() }) .join('||') .trim() return this.range } toString () { return this.range } parseRange (range) { const loose = this.options.loose range = range.trim() // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4` const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE] range = range.replace(hr, hyphenReplace(this.options.includePrerelease)) debug('hyphen replace', range) // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5` range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace) debug('comparator trim', range, re[t.COMPARATORTRIM]) // `~ 1.2.3` => `~1.2.3` range = range.replace(re[t.TILDETRIM], tildeTrimReplace) // `^ 1.2.3` => `^1.2.3` range = range.replace(re[t.CARETTRIM], caretTrimReplace) // normalize spaces range = range.split(/\s+/).join(' ') // At this point, the range is completely trimmed and // ready to be split into comparators. const compRe = loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR] return range .split(' ') .map(comp => parseComparator(comp, this.options)) .join(' ') .split(/\s+/) .map(comp => replaceGTE0(comp, this.options)) // in loose mode, throw out any that are not valid comparators .filter(this.options.loose ? comp => !!comp.match(compRe) : () => true) .map(comp => new Comparator(comp, this.options)) } intersects (range, options) { if (!(range instanceof Range)) { throw new TypeError('a Range is required') } return this.set.some((thisComparators) => { return ( isSatisfiable(thisComparators, options) && range.set.some((rangeComparators) => { return ( isSatisfiable(rangeComparators, options) && thisComparators.every((thisComparator) => { return rangeComparators.every((rangeComparator) => { return thisComparator.intersects(rangeComparator, options) }) }) ) }) ) }) } // if ANY of the sets match ALL of its comparators, then pass test (version) { if (!version) { return false } if (typeof version === 'string') { try { version = new SemVer(version, this.options) } catch (er) { return false } } for (let i = 0; i < this.set.length; i++) { if (testSet(this.set[i], version, this.options)) { return true } } return false } } module.exports = Range const Comparator = __webpack_require__(1532) const debug = __webpack_require__(427) const SemVer = __webpack_require__(8088) const { re, t, comparatorTrimReplace, tildeTrimReplace, caretTrimReplace } = __webpack_require__(9523) // take a set of comparators and determine whether there // exists a version which can satisfy it const isSatisfiable = (comparators, options) => { let result = true const remainingComparators = comparators.slice() let testComparator = remainingComparators.pop() while (result && remainingComparators.length) { result = remainingComparators.every((otherComparator) => { return testComparator.intersects(otherComparator, options) }) testComparator = remainingComparators.pop() } return result } // comprised of xranges, tildes, stars, and gtlt's at this point. // already replaced the hyphen ranges // turn into a set of JUST comparators. const parseComparator = (comp, options) => { debug('comp', comp, options) comp = replaceCarets(comp, options) debug('caret', comp) comp = replaceTildes(comp, options) debug('tildes', comp) comp = replaceXRanges(comp, options) debug('xrange', comp) comp = replaceStars(comp, options) debug('stars', comp) return comp } const isX = id => !id || id.toLowerCase() === 'x' || id === '*' // ~, ~> --> * (any, kinda silly) // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0-0 // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0-0 // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0-0 // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0-0 // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0-0 const replaceTildes = (comp, options) => comp.trim().split(/\s+/).map((comp) => { return replaceTilde(comp, options) }).join(' ') const replaceTilde = (comp, options) => { const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE] return comp.replace(r, (_, M, m, p, pr) => { debug('tilde', comp, _, M, m, p, pr) let ret if (isX(M)) { ret = '' } else if (isX(m)) { ret = `>=${M}.0.0 <${+M + 1}.0.0-0` } else if (isX(p)) { // ~1.2 == >=1.2.0 <1.3.0-0 ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0` } else if (pr) { debug('replaceTilde pr', pr) ret = `>=${M}.${m}.${p}-${pr } <${M}.${+m + 1}.0-0` } else { // ~1.2.3 == >=1.2.3 <1.3.0-0 ret = `>=${M}.${m}.${p } <${M}.${+m + 1}.0-0` } debug('tilde return', ret) return ret }) } // ^ --> * (any, kinda silly) // ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0-0 // ^2.0, ^2.0.x --> >=2.0.0 <3.0.0-0 // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0-0 // ^1.2.3 --> >=1.2.3 <2.0.0-0 // ^1.2.0 --> >=1.2.0 <2.0.0-0 const replaceCarets = (comp, options) => comp.trim().split(/\s+/).map((comp) => { return replaceCaret(comp, options) }).join(' ') const replaceCaret = (comp, options) => { debug('caret', comp, options) const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET] const z = options.includePrerelease ? '-0' : '' return comp.replace(r, (_, M, m, p, pr) => { debug('caret', comp, _, M, m, p, pr) let ret if (isX(M)) { ret = '' } else if (isX(m)) { ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0` } else if (isX(p)) { if (M === '0') { ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0` } else { ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0` } } else if (pr) { debug('replaceCaret pr', pr) if (M === '0') { if (m === '0') { ret = `>=${M}.${m}.${p}-${pr } <${M}.${m}.${+p + 1}-0` } else { ret = `>=${M}.${m}.${p}-${pr } <${M}.${+m + 1}.0-0` } } else { ret = `>=${M}.${m}.${p}-${pr } <${+M + 1}.0.0-0` } } else { debug('no pr') if (M === '0') { if (m === '0') { ret = `>=${M}.${m}.${p }${z} <${M}.${m}.${+p + 1}-0` } else { ret = `>=${M}.${m}.${p }${z} <${M}.${+m + 1}.0-0` } } else { ret = `>=${M}.${m}.${p } <${+M + 1}.0.0-0` } } debug('caret return', ret) return ret }) } const replaceXRanges = (comp, options) => { debug('replaceXRanges', comp, options) return comp.split(/\s+/).map((comp) => { return replaceXRange(comp, options) }).join(' ') } const replaceXRange = (comp, options) => { comp = comp.trim() const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE] return comp.replace(r, (ret, gtlt, M, m, p, pr) => { debug('xRange', comp, ret, gtlt, M, m, p, pr) const xM = isX(M) const xm = xM || isX(m) const xp = xm || isX(p) const anyX = xp if (gtlt === '=' && anyX) { gtlt = '' } // if we're including prereleases in the match, then we need // to fix this to -0, the lowest possible prerelease value pr = options.includePrerelease ? '-0' : '' if (xM) { if (gtlt === '>' || gtlt === '<') { // nothing is allowed ret = '<0.0.0-0' } else { // nothing is forbidden ret = '*' } } else if (gtlt && anyX) { // we know patch is an x, because we have any x at all. // replace X with 0 if (xm) { m = 0 } p = 0 if (gtlt === '>') { // >1 => >=2.0.0 // >1.2 => >=1.3.0 gtlt = '>=' if (xm) { M = +M + 1 m = 0 p = 0 } else { m = +m + 1 p = 0 } } else if (gtlt === '<=') { // <=0.7.x is actually <0.8.0, since any 0.7.x should // pass. Similarly, <=7.x is actually <8.0.0, etc. gtlt = '<' if (xm) { M = +M + 1 } else { m = +m + 1 } } if (gtlt === '<') pr = '-0' ret = `${gtlt + M}.${m}.${p}${pr}` } else if (xm) { ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0` } else if (xp) { ret = `>=${M}.${m}.0${pr } <${M}.${+m + 1}.0-0` } debug('xRange return', ret) return ret }) } // Because * is AND-ed with everything else in the comparator, // and '' means "any version", just remove the *s entirely. const replaceStars = (comp, options) => { debug('replaceStars', comp, options) // Looseness is ignored here. star is always as loose as it gets! return comp.trim().replace(re[t.STAR], '') } const replaceGTE0 = (comp, options) => { debug('replaceGTE0', comp, options) return comp.trim() .replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], '') } // This function is passed to string.replace(re[t.HYPHENRANGE]) // M, m, patch, prerelease, build // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5 // 1.2.3 - 3.4 => >=1.2.0 <3.5.0-0 Any 3.4.x will do // 1.2 - 3.4 => >=1.2.0 <3.5.0-0 const hyphenReplace = incPr => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr, tb) => { if (isX(fM)) { from = '' } else if (isX(fm)) { from = `>=${fM}.0.0${incPr ? '-0' : ''}` } else if (isX(fp)) { from = `>=${fM}.${fm}.0${incPr ? '-0' : ''}` } else if (fpr) { from = `>=${from}` } else { from = `>=${from}${incPr ? '-0' : ''}` } if (isX(tM)) { to = '' } else if (isX(tm)) { to = `<${+tM + 1}.0.0-0` } else if (isX(tp)) { to = `<${tM}.${+tm + 1}.0-0` } else if (tpr) { to = `<=${tM}.${tm}.${tp}-${tpr}` } else if (incPr) { to = `<${tM}.${tm}.${+tp + 1}-0` } else { to = `<=${to}` } return (`${from} ${to}`).trim() } const testSet = (set, version, options) => { for (let i = 0; i < set.length; i++) { if (!set[i].test(version)) { return false } } if (version.prerelease.length && !options.includePrerelease) { // Find the set of versions that are allowed to have prereleases // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0 // That should allow `1.2.3-pr.2` to pass. // However, `1.2.4-alpha.notready` should NOT be allowed, // even though it's within the range set by the comparators. for (let i = 0; i < set.length; i++) { debug(set[i].semver) if (set[i].semver === Comparator.ANY) { continue } if (set[i].semver.prerelease.length > 0) { const allowed = set[i].semver if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) { return true } } } // Version has a -pre, but it's not one of the ones we like. return false } return true } /***/ }), /***/ 8088: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const debug = __webpack_require__(427) const { MAX_LENGTH, MAX_SAFE_INTEGER } = __webpack_require__(2293) const { re, t } = __webpack_require__(9523) const { compareIdentifiers } = __webpack_require__(2463) class SemVer { constructor (version, options) { if (!options || typeof options !== 'object') { options = { loose: !!options, includePrerelease: false } } if (version instanceof SemVer) { if (version.loose === !!options.loose && version.includePrerelease === !!options.includePrerelease) { return version } else { version = version.version } } else if (typeof version !== 'string') { throw new TypeError(`Invalid Version: ${version}`) } if (version.length > MAX_LENGTH) { throw new TypeError( `version is longer than ${MAX_LENGTH} characters` ) } debug('SemVer', version, options) this.options = options this.loose = !!options.loose // this isn't actually relevant for versions, but keep it so that we // don't run into trouble passing this.options around. this.includePrerelease = !!options.includePrerelease const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]) if (!m) { throw new TypeError(`Invalid Version: ${version}`) } this.raw = version // these are actually numbers this.major = +m[1] this.minor = +m[2] this.patch = +m[3] if (this.major > MAX_SAFE_INTEGER || this.major < 0) { throw new TypeError('Invalid major version') } if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) { throw new TypeError('Invalid minor version') } if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) { throw new TypeError('Invalid patch version') } // numberify any prerelease numeric ids if (!m[4]) { this.prerelease = [] } else { this.prerelease = m[4].split('.').map((id) => { if (/^[0-9]+$/.test(id)) { const num = +id if (num >= 0 && num < MAX_SAFE_INTEGER) { return num } } return id }) } this.build = m[5] ? m[5].split('.') : [] this.format() } format () { this.version = `${this.major}.${this.minor}.${this.patch}` if (this.prerelease.length) { this.version += `-${this.prerelease.join('.')}` } return this.version } toString () { return this.version } compare (other) { debug('SemVer.compare', this.version, this.options, other) if (!(other instanceof SemVer)) { if (typeof other === 'string' && other === this.version) { return 0 } other = new SemVer(other, this.options) } if (other.version === this.version) { return 0 } return this.compareMain(other) || this.comparePre(other) } compareMain (other) { if (!(other instanceof SemVer)) { other = new SemVer(other, this.options) } return ( compareIdentifiers(this.major, other.major) || compareIdentifiers(this.minor, other.minor) || compareIdentifiers(this.patch, other.patch) ) } comparePre (other) { if (!(other instanceof SemVer)) { other = new SemVer(other, this.options) } // NOT having a prerelease is > having one if (this.prerelease.length && !other.prerelease.length) { return -1 } else if (!this.prerelease.length && other.prerelease.length) { return 1 } else if (!this.prerelease.length && !other.prerelease.length) { return 0 } let i = 0 do { const a = this.prerelease[i] const b = other.prerelease[i] debug('prerelease compare', i, a, b) if (a === undefined && b === undefined) { return 0 } else if (b === undefined) { return 1 } else if (a === undefined) { return -1 } else if (a === b) { continue } else { return compareIdentifiers(a, b) } } while (++i) } compareBuild (other) { if (!(other instanceof SemVer)) { other = new SemVer(other, this.options) } let i = 0 do { const a = this.build[i] const b = other.build[i] debug('prerelease compare', i, a, b) if (a === undefined && b === undefined) { return 0 } else if (b === undefined) { return 1 } else if (a === undefined) { return -1 } else if (a === b) { continue } else { return compareIdentifiers(a, b) } } while (++i) } // preminor will bump the version up to the next minor release, and immediately // down to pre-release. premajor and prepatch work the same way. inc (release, identifier) { switch (release) { case 'premajor': this.prerelease.length = 0 this.patch = 0 this.minor = 0 this.major++ this.inc('pre', identifier) break case 'preminor': this.prerelease.length = 0 this.patch = 0 this.minor++ this.inc('pre', identifier) break case 'prepatch': // If this is already a prerelease, it will bump to the next version // drop any prereleases that might already exist, since they are not // relevant at this point. this.prerelease.length = 0 this.inc('patch', identifier) this.inc('pre', identifier) break // If the input is a non-prerelease version, this acts the same as // prepatch. case 'prerelease': if (this.prerelease.length === 0) { this.inc('patch', identifier) } this.inc('pre', identifier) break case 'major': // If this is a pre-major version, bump up to the same major version. // Otherwise increment major. // 1.0.0-5 bumps to 1.0.0 // 1.1.0 bumps to 2.0.0 if ( this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0 ) { this.major++ } this.minor = 0 this.patch = 0 this.prerelease = [] break case 'minor': // If this is a pre-minor version, bump up to the same minor version. // Otherwise increment minor. // 1.2.0-5 bumps to 1.2.0 // 1.2.1 bumps to 1.3.0 if (this.patch !== 0 || this.prerelease.length === 0) { this.minor++ } this.patch = 0 this.prerelease = [] break case 'patch': // If this is not a pre-release version, it will increment the patch. // If it is a pre-release it will bump up to the same patch version. // 1.2.0-5 patches to 1.2.0 // 1.2.0 patches to 1.2.1 if (this.prerelease.length === 0) { this.patch++ } this.prerelease = [] break // This probably shouldn't be used publicly. // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction. case 'pre': if (this.prerelease.length === 0) { this.prerelease = [0] } else { let i = this.prerelease.length while (--i >= 0) { if (typeof this.prerelease[i] === 'number') { this.prerelease[i]++ i = -2 } } if (i === -1) { // didn't increment anything this.prerelease.push(0) } } if (identifier) { // 1.2.0-beta.1 bumps to 1.2.0-beta.2, // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0 if (this.prerelease[0] === identifier) { if (isNaN(this.prerelease[1])) { this.prerelease = [identifier, 0] } } else { this.prerelease = [identifier, 0] } } break default: throw new Error(`invalid increment argument: ${release}`) } this.format() this.raw = this.version return this } } module.exports = SemVer /***/ }), /***/ 8848: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const parse = __webpack_require__(5925) const clean = (version, options) => { const s = parse(version.trim().replace(/^[=v]+/, ''), options) return s ? s.version : null } module.exports = clean /***/ }), /***/ 5098: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const eq = __webpack_require__(1898) const neq = __webpack_require__(6017) const gt = __webpack_require__(4123) const gte = __webpack_require__(5522) const lt = __webpack_require__(194) const lte = __webpack_require__(7520) const cmp = (a, op, b, loose) => { switch (op) { case '===': if (typeof a === 'object') a = a.version if (typeof b === 'object') b = b.version return a === b case '!==': if (typeof a === 'object') a = a.version if (typeof b === 'object') b = b.version return a !== b case '': case '=': case '==': return eq(a, b, loose) case '!=': return neq(a, b, loose) case '>': return gt(a, b, loose) case '>=': return gte(a, b, loose) case '<': return lt(a, b, loose) case '<=': return lte(a, b, loose) default: throw new TypeError(`Invalid operator: ${op}`) } } module.exports = cmp /***/ }), /***/ 3466: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const SemVer = __webpack_require__(8088) const parse = __webpack_require__(5925) const {re, t} = __webpack_require__(9523) const coerce = (version, options) => { if (version instanceof SemVer) { return version } if (typeof version === 'number') { version = String(version) } if (typeof version !== 'string') { return null } options = options || {} let match = null if (!options.rtl) { match = version.match(re[t.COERCE]) } else { // Find the right-most coercible string that does not share // a terminus with a more left-ward coercible string. // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4' // // Walk through the string checking with a /g regexp // Manually set the index so as to pick up overlapping matches. // Stop when we get a match that ends at the string end, since no // coercible string can be more right-ward without the same terminus. let next while ((next = re[t.COERCERTL].exec(version)) && (!match || match.index + match[0].length !== version.length) ) { if (!match || next.index + next[0].length !== match.index + match[0].length) { match = next } re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length } // leave it in a clean state re[t.COERCERTL].lastIndex = -1 } if (match === null) return null return parse(`${match[2]}.${match[3] || '0'}.${match[4] || '0'}`, options) } module.exports = coerce /***/ }), /***/ 2156: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const SemVer = __webpack_require__(8088) const compareBuild = (a, b, loose) => { const versionA = new SemVer(a, loose) const versionB = new SemVer(b, loose) return versionA.compare(versionB) || versionA.compareBuild(versionB) } module.exports = compareBuild /***/ }), /***/ 2804: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const compare = __webpack_require__(4309) const compareLoose = (a, b) => compare(a, b, true) module.exports = compareLoose /***/ }), /***/ 4309: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const SemVer = __webpack_require__(8088) const compare = (a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose)) module.exports = compare /***/ }), /***/ 4297: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const parse = __webpack_require__(5925) const eq = __webpack_require__(1898) const diff = (version1, version2) => { if (eq(version1, version2)) { return null } else { const v1 = parse(version1) const v2 = parse(version2) const hasPre = v1.prerelease.length || v2.prerelease.length const prefix = hasPre ? 'pre' : '' const defaultResult = hasPre ? 'prerelease' : '' for (const key in v1) { if (key === 'major' || key === 'minor' || key === 'patch') { if (v1[key] !== v2[key]) { return prefix + key } } } return defaultResult // may be undefined } } module.exports = diff /***/ }), /***/ 1898: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const compare = __webpack_require__(4309) const eq = (a, b, loose) => compare(a, b, loose) === 0 module.exports = eq /***/ }), /***/ 4123: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const compare = __webpack_require__(4309) const gt = (a, b, loose) => compare(a, b, loose) > 0 module.exports = gt /***/ }), /***/ 5522: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const compare = __webpack_require__(4309) const gte = (a, b, loose) => compare(a, b, loose) >= 0 module.exports = gte /***/ }), /***/ 900: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const SemVer = __webpack_require__(8088) const inc = (version, release, options, identifier) => { if (typeof (options) === 'string') { identifier = options options = undefined } try { return new SemVer(version, options).inc(release, identifier).version } catch (er) { return null } } module.exports = inc /***/ }), /***/ 194: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const compare = __webpack_require__(4309) const lt = (a, b, loose) => compare(a, b, loose) < 0 module.exports = lt /***/ }), /***/ 7520: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const compare = __webpack_require__(4309) const lte = (a, b, loose) => compare(a, b, loose) <= 0 module.exports = lte /***/ }), /***/ 6688: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const SemVer = __webpack_require__(8088) const major = (a, loose) => new SemVer(a, loose).major module.exports = major /***/ }), /***/ 8447: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const SemVer = __webpack_require__(8088) const minor = (a, loose) => new SemVer(a, loose).minor module.exports = minor /***/ }), /***/ 6017: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const compare = __webpack_require__(4309) const neq = (a, b, loose) => compare(a, b, loose) !== 0 module.exports = neq /***/ }), /***/ 5925: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const {MAX_LENGTH} = __webpack_require__(2293) const { re, t } = __webpack_require__(9523) const SemVer = __webpack_require__(8088) const parse = (version, options) => { if (!options || typeof options !== 'object') { options = { loose: !!options, includePrerelease: false } } if (version instanceof SemVer) { return version } if (typeof version !== 'string') { return null } if (version.length > MAX_LENGTH) { return null } const r = options.loose ? re[t.LOOSE] : re[t.FULL] if (!r.test(version)) { return null } try { return new SemVer(version, options) } catch (er) { return null } } module.exports = parse /***/ }), /***/ 2866: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const SemVer = __webpack_require__(8088) const patch = (a, loose) => new SemVer(a, loose).patch module.exports = patch /***/ }), /***/ 6014: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const parse = __webpack_require__(5925) const prerelease = (version, options) => { const parsed = parse(version, options) return (parsed && parsed.prerelease.length) ? parsed.prerelease : null } module.exports = prerelease /***/ }), /***/ 7499: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const compare = __webpack_require__(4309) const rcompare = (a, b, loose) => compare(b, a, loose) module.exports = rcompare /***/ }), /***/ 8701: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const compareBuild = __webpack_require__(2156) const rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose)) module.exports = rsort /***/ }), /***/ 6055: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const Range = __webpack_require__(9828) const satisfies = (version, range, options) => { try { range = new Range(range, options) } catch (er) { return false } return range.test(version) } module.exports = satisfies /***/ }), /***/ 1426: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const compareBuild = __webpack_require__(2156) const sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose)) module.exports = sort /***/ }), /***/ 9601: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const parse = __webpack_require__(5925) const valid = (version, options) => { const v = parse(version, options) return v ? v.version : null } module.exports = valid /***/ }), /***/ 1383: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // just pre-load all the stuff that index.js lazily exports const internalRe = __webpack_require__(9523) module.exports = { re: internalRe.re, src: internalRe.src, tokens: internalRe.t, SEMVER_SPEC_VERSION: __webpack_require__(2293).SEMVER_SPEC_VERSION, SemVer: __webpack_require__(8088), compareIdentifiers: __webpack_require__(2463).compareIdentifiers, rcompareIdentifiers: __webpack_require__(2463).rcompareIdentifiers, parse: __webpack_require__(5925), valid: __webpack_require__(9601), clean: __webpack_require__(8848), inc: __webpack_require__(900), diff: __webpack_require__(4297), major: __webpack_require__(6688), minor: __webpack_require__(8447), patch: __webpack_require__(2866), prerelease: __webpack_require__(6014), compare: __webpack_require__(4309), rcompare: __webpack_require__(7499), compareLoose: __webpack_require__(2804), compareBuild: __webpack_require__(2156), sort: __webpack_require__(1426), rsort: __webpack_require__(8701), gt: __webpack_require__(4123), lt: __webpack_require__(194), eq: __webpack_require__(1898), neq: __webpack_require__(6017), gte: __webpack_require__(5522), lte: __webpack_require__(7520), cmp: __webpack_require__(5098), coerce: __webpack_require__(3466), Comparator: __webpack_require__(1532), Range: __webpack_require__(9828), satisfies: __webpack_require__(6055), toComparators: __webpack_require__(2706), maxSatisfying: __webpack_require__(579), minSatisfying: __webpack_require__(832), minVersion: __webpack_require__(4179), validRange: __webpack_require__(2098), outside: __webpack_require__(420), gtr: __webpack_require__(9380), ltr: __webpack_require__(3323), intersects: __webpack_require__(7008), simplifyRange: __webpack_require__(5297), subset: __webpack_require__(7863), } /***/ }), /***/ 2293: /***/ ((module) => { // Note: this is the semver.org version of the spec that it implements // Not necessarily the package version of this code. const SEMVER_SPEC_VERSION = '2.0.0' const MAX_LENGTH = 256 const MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */ 9007199254740991 // Max safe segment length for coercion. const MAX_SAFE_COMPONENT_LENGTH = 16 module.exports = { SEMVER_SPEC_VERSION, MAX_LENGTH, MAX_SAFE_INTEGER, MAX_SAFE_COMPONENT_LENGTH } /***/ }), /***/ 427: /***/ ((module) => { const debug = ( typeof process === 'object' && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ) ? (...args) => console.error('SEMVER', ...args) : () => {} module.exports = debug /***/ }), /***/ 2463: /***/ ((module) => { const numeric = /^[0-9]+$/ const compareIdentifiers = (a, b) => { const anum = numeric.test(a) const bnum = numeric.test(b) if (anum && bnum) { a = +a b = +b } return a === b ? 0 : (anum && !bnum) ? -1 : (bnum && !anum) ? 1 : a < b ? -1 : 1 } const rcompareIdentifiers = (a, b) => compareIdentifiers(b, a) module.exports = { compareIdentifiers, rcompareIdentifiers } /***/ }), /***/ 9523: /***/ ((module, exports, __webpack_require__) => { const { MAX_SAFE_COMPONENT_LENGTH } = __webpack_require__(2293) const debug = __webpack_require__(427) exports = module.exports = {} // The actual regexps go on exports.re const re = exports.re = [] const src = exports.src = [] const t = exports.t = {} let R = 0 const createToken = (name, value, isGlobal) => { const index = R++ debug(index, value) t[name] = index src[index] = value re[index] = new RegExp(value, isGlobal ? 'g' : undefined) } // The following Regular Expressions can be used for tokenizing, // validating, and parsing SemVer version strings. // ## Numeric Identifier // A single `0`, or a non-zero digit followed by zero or more digits. createToken('NUMERICIDENTIFIER', '0|[1-9]\\d*') createToken('NUMERICIDENTIFIERLOOSE', '[0-9]+') // ## Non-numeric Identifier // Zero or more digits, followed by a letter or hyphen, and then zero or // more letters, digits, or hyphens. createToken('NONNUMERICIDENTIFIER', '\\d*[a-zA-Z-][a-zA-Z0-9-]*') // ## Main Version // Three dot-separated numeric identifiers. createToken('MAINVERSION', `(${src[t.NUMERICIDENTIFIER]})\\.` + `(${src[t.NUMERICIDENTIFIER]})\\.` + `(${src[t.NUMERICIDENTIFIER]})`) createToken('MAINVERSIONLOOSE', `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` + `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` + `(${src[t.NUMERICIDENTIFIERLOOSE]})`) // ## Pre-release Version Identifier // A numeric identifier, or a non-numeric identifier. createToken('PRERELEASEIDENTIFIER', `(?:${src[t.NUMERICIDENTIFIER] }|${src[t.NONNUMERICIDENTIFIER]})`) createToken('PRERELEASEIDENTIFIERLOOSE', `(?:${src[t.NUMERICIDENTIFIERLOOSE] }|${src[t.NONNUMERICIDENTIFIER]})`) // ## Pre-release Version // Hyphen, followed by one or more dot-separated pre-release version // identifiers. createToken('PRERELEASE', `(?:-(${src[t.PRERELEASEIDENTIFIER] }(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`) createToken('PRERELEASELOOSE', `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE] }(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`) // ## Build Metadata Identifier // Any combination of digits, letters, or hyphens. createToken('BUILDIDENTIFIER', '[0-9A-Za-z-]+') // ## Build Metadata // Plus sign, followed by one or more period-separated build metadata // identifiers. createToken('BUILD', `(?:\\+(${src[t.BUILDIDENTIFIER] }(?:\\.${src[t.BUILDIDENTIFIER]})*))`) // ## Full Version String // A main version, followed optionally by a pre-release version and // build metadata. // Note that the only major, minor, patch, and pre-release sections of // the version string are capturing groups. The build metadata is not a // capturing group, because it should not ever be used in version // comparison. createToken('FULLPLAIN', `v?${src[t.MAINVERSION] }${src[t.PRERELEASE]}?${ src[t.BUILD]}?`) createToken('FULL', `^${src[t.FULLPLAIN]}$`) // like full, but allows v1.2.3 and =1.2.3, which people do sometimes. // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty // common in the npm registry. createToken('LOOSEPLAIN', `[v=\\s]*${src[t.MAINVERSIONLOOSE] }${src[t.PRERELEASELOOSE]}?${ src[t.BUILD]}?`) createToken('LOOSE', `^${src[t.LOOSEPLAIN]}$`) createToken('GTLT', '((?:<|>)?=?)') // Something like "2.*" or "1.2.x". // Note that "x.x" is a valid xRange identifer, meaning "any version" // Only the first item is strictly required. createToken('XRANGEIDENTIFIERLOOSE', `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`) createToken('XRANGEIDENTIFIER', `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`) createToken('XRANGEPLAIN', `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})` + `(?:\\.(${src[t.XRANGEIDENTIFIER]})` + `(?:\\.(${src[t.XRANGEIDENTIFIER]})` + `(?:${src[t.PRERELEASE]})?${ src[t.BUILD]}?` + `)?)?`) createToken('XRANGEPLAINLOOSE', `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})` + `(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` + `(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` + `(?:${src[t.PRERELEASELOOSE]})?${ src[t.BUILD]}?` + `)?)?`) createToken('XRANGE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`) createToken('XRANGELOOSE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`) // Coercion. // Extract anything that could conceivably be a part of a valid semver createToken('COERCE', `${'(^|[^\\d])' + '(\\d{1,'}${MAX_SAFE_COMPONENT_LENGTH}})` + `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` + `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` + `(?:$|[^\\d])`) createToken('COERCERTL', src[t.COERCE], true) // Tilde ranges. // Meaning is "reasonably at or greater than" createToken('LONETILDE', '(?:~>?)') createToken('TILDETRIM', `(\\s*)${src[t.LONETILDE]}\\s+`, true) exports.tildeTrimReplace = '$1~' createToken('TILDE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`) createToken('TILDELOOSE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`) // Caret ranges. // Meaning is "at least and backwards compatible with" createToken('LONECARET', '(?:\\^)') createToken('CARETTRIM', `(\\s*)${src[t.LONECARET]}\\s+`, true) exports.caretTrimReplace = '$1^' createToken('CARET', `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`) createToken('CARETLOOSE', `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`) // A simple gt/lt/eq thing, or just "" to indicate "any version" createToken('COMPARATORLOOSE', `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`) createToken('COMPARATOR', `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`) // An expression to strip any whitespace between the gtlt and the thing // it modifies, so that `> 1.2.3` ==> `>1.2.3` createToken('COMPARATORTRIM', `(\\s*)${src[t.GTLT] }\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true) exports.comparatorTrimReplace = '$1$2$3' // Something like `1.2.3 - 1.2.4` // Note that these all use the loose form, because they'll be // checked against either the strict or loose comparator form // later. createToken('HYPHENRANGE', `^\\s*(${src[t.XRANGEPLAIN]})` + `\\s+-\\s+` + `(${src[t.XRANGEPLAIN]})` + `\\s*$`) createToken('HYPHENRANGELOOSE', `^\\s*(${src[t.XRANGEPLAINLOOSE]})` + `\\s+-\\s+` + `(${src[t.XRANGEPLAINLOOSE]})` + `\\s*$`) // Star ranges basically just allow anything at all. createToken('STAR', '(<|>)?=?\\s*\\*') // >=0.0.0 is like a star createToken('GTE0', '^\\s*>=\\s*0\.0\.0\\s*$') createToken('GTE0PRE', '^\\s*>=\\s*0\.0\.0-0\\s*$') /***/ }), /***/ 9380: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // Determine if version is greater than all the versions possible in the range. const outside = __webpack_require__(420) const gtr = (version, range, options) => outside(version, range, '>', options) module.exports = gtr /***/ }), /***/ 7008: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const Range = __webpack_require__(9828) const intersects = (r1, r2, options) => { r1 = new Range(r1, options) r2 = new Range(r2, options) return r1.intersects(r2) } module.exports = intersects /***/ }), /***/ 3323: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const outside = __webpack_require__(420) // Determine if version is less than all the versions possible in the range const ltr = (version, range, options) => outside(version, range, '<', options) module.exports = ltr /***/ }), /***/ 579: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const SemVer = __webpack_require__(8088) const Range = __webpack_require__(9828) const maxSatisfying = (versions, range, options) => { let max = null let maxSV = null let rangeObj = null try { rangeObj = new Range(range, options) } catch (er) { return null } versions.forEach((v) => { if (rangeObj.test(v)) { // satisfies(v, range, options) if (!max || maxSV.compare(v) === -1) { // compare(max, v, true) max = v maxSV = new SemVer(max, options) } } }) return max } module.exports = maxSatisfying /***/ }), /***/ 832: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const SemVer = __webpack_require__(8088) const Range = __webpack_require__(9828) const minSatisfying = (versions, range, options) => { let min = null let minSV = null let rangeObj = null try { rangeObj = new Range(range, options) } catch (er) { return null } versions.forEach((v) => { if (rangeObj.test(v)) { // satisfies(v, range, options) if (!min || minSV.compare(v) === 1) { // compare(min, v, true) min = v minSV = new SemVer(min, options) } } }) return min } module.exports = minSatisfying /***/ }), /***/ 4179: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const SemVer = __webpack_require__(8088) const Range = __webpack_require__(9828) const gt = __webpack_require__(4123) const minVersion = (range, loose) => { range = new Range(range, loose) let minver = new SemVer('0.0.0') if (range.test(minver)) { return minver } minver = new SemVer('0.0.0-0') if (range.test(minver)) { return minver } minver = null for (let i = 0; i < range.set.length; ++i) { const comparators = range.set[i] comparators.forEach((comparator) => { // Clone to avoid manipulating the comparator's semver object. const compver = new SemVer(comparator.semver.version) switch (comparator.operator) { case '>': if (compver.prerelease.length === 0) { compver.patch++ } else { compver.prerelease.push(0) } compver.raw = compver.format() /* fallthrough */ case '': case '>=': if (!minver || gt(minver, compver)) { minver = compver } break case '<': case '<=': /* Ignore maximum versions */ break /* istanbul ignore next */ default: throw new Error(`Unexpected operation: ${comparator.operator}`) } }) } if (minver && range.test(minver)) { return minver } return null } module.exports = minVersion /***/ }), /***/ 420: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const SemVer = __webpack_require__(8088) const Comparator = __webpack_require__(1532) const {ANY} = Comparator const Range = __webpack_require__(9828) const satisfies = __webpack_require__(6055) const gt = __webpack_require__(4123) const lt = __webpack_require__(194) const lte = __webpack_require__(7520) const gte = __webpack_require__(5522) const outside = (version, range, hilo, options) => { version = new SemVer(version, options) range = new Range(range, options) let gtfn, ltefn, ltfn, comp, ecomp switch (hilo) { case '>': gtfn = gt ltefn = lte ltfn = lt comp = '>' ecomp = '>=' break case '<': gtfn = lt ltefn = gte ltfn = gt comp = '<' ecomp = '<=' break default: throw new TypeError('Must provide a hilo val of "<" or ">"') } // If it satisifes the range it is not outside if (satisfies(version, range, options)) { return false } // From now on, variable terms are as if we're in "gtr" mode. // but note that everything is flipped for the "ltr" function. for (let i = 0; i < range.set.length; ++i) { const comparators = range.set[i] let high = null let low = null comparators.forEach((comparator) => { if (comparator.semver === ANY) { comparator = new Comparator('>=0.0.0') } high = high || comparator low = low || comparator if (gtfn(comparator.semver, high.semver, options)) { high = comparator } else if (ltfn(comparator.semver, low.semver, options)) { low = comparator } }) // If the edge version comparator has a operator then our version // isn't outside it if (high.operator === comp || high.operator === ecomp) { return false } // If the lowest version comparator has an operator and our version // is less than it then it isn't higher than the range if ((!low.operator || low.operator === comp) && ltefn(version, low.semver)) { return false } else if (low.operator === ecomp && ltfn(version, low.semver)) { return false } } return true } module.exports = outside /***/ }), /***/ 5297: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // given a set of versions and a range, create a "simplified" range // that includes the same versions that the original range does // If the original range is shorter than the simplified one, return that. const satisfies = __webpack_require__(6055) const compare = __webpack_require__(4309) module.exports = (versions, range, options) => { const set = [] let min = null let prev = null const v = versions.sort((a, b) => compare(a, b, options)) for (const version of v) { const included = satisfies(version, range, options) if (included) { prev = version if (!min) min = version } else { if (prev) { set.push([min, prev]) } prev = null min = null } } if (min) set.push([min, null]) const ranges = [] for (const [min, max] of set) { if (min === max) ranges.push(min) else if (!max && min === v[0]) ranges.push('*') else if (!max) ranges.push(`>=${min}`) else if (min === v[0]) ranges.push(`<=${max}`) else ranges.push(`${min} - ${max}`) } const simplified = ranges.join(' || ') const original = typeof range.raw === 'string' ? range.raw : String(range) return simplified.length < original.length ? simplified : range } /***/ }), /***/ 7863: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const Range = __webpack_require__(9828) const { ANY } = __webpack_require__(1532) const satisfies = __webpack_require__(6055) const compare = __webpack_require__(4309) // Complex range `r1 || r2 || ...` is a subset of `R1 || R2 || ...` iff: // - Every simple range `r1, r2, ...` is a subset of some `R1, R2, ...` // // Simple range `c1 c2 ...` is a subset of simple range `C1 C2 ...` iff: // - If c is only the ANY comparator // - If C is only the ANY comparator, return true // - Else return false // - Let EQ be the set of = comparators in c // - If EQ is more than one, return true (null set) // - Let GT be the highest > or >= comparator in c // - Let LT be the lowest < or <= comparator in c // - If GT and LT, and GT.semver > LT.semver, return true (null set) // - If EQ // - If GT, and EQ does not satisfy GT, return true (null set) // - If LT, and EQ does not satisfy LT, return true (null set) // - If EQ satisfies every C, return true // - Else return false // - If GT // - If GT is lower than any > or >= comp in C, return false // - If GT is >=, and GT.semver does not satisfy every C, return false // - If LT // - If LT.semver is greater than that of any > comp in C, return false // - If LT is <=, and LT.semver does not satisfy every C, return false // - If any C is a = range, and GT or LT are set, return false // - Else return true const subset = (sub, dom, options) => { sub = new Range(sub, options) dom = new Range(dom, options) let sawNonNull = false OUTER: for (const simpleSub of sub.set) { for (const simpleDom of dom.set) { const isSub = simpleSubset(simpleSub, simpleDom, options) sawNonNull = sawNonNull || isSub !== null if (isSub) continue OUTER } // the null set is a subset of everything, but null simple ranges in // a complex range should be ignored. so if we saw a non-null range, // then we know this isn't a subset, but if EVERY simple range was null, // then it is a subset. if (sawNonNull) return false } return true } const simpleSubset = (sub, dom, options) => { if (sub.length === 1 && sub[0].semver === ANY) return dom.length === 1 && dom[0].semver === ANY const eqSet = new Set() let gt, lt for (const c of sub) { if (c.operator === '>' || c.operator === '>=') gt = higherGT(gt, c, options) else if (c.operator === '<' || c.operator === '<=') lt = lowerLT(lt, c, options) else eqSet.add(c.semver) } if (eqSet.size > 1) return null let gtltComp if (gt && lt) { gtltComp = compare(gt.semver, lt.semver, options) if (gtltComp > 0) return null else if (gtltComp === 0 && (gt.operator !== '>=' || lt.operator !== '<=')) return null } // will iterate one or zero times for (const eq of eqSet) { if (gt && !satisfies(eq, String(gt), options)) return null if (lt && !satisfies(eq, String(lt), options)) return null for (const c of dom) { if (!satisfies(eq, String(c), options)) return false } return true } let higher, lower let hasDomLT, hasDomGT for (const c of dom) { hasDomGT = hasDomGT || c.operator === '>' || c.operator === '>=' hasDomLT = hasDomLT || c.operator === '<' || c.operator === '<=' if (gt) { if (c.operator === '>' || c.operator === '>=') { higher = higherGT(gt, c, options) if (higher === c) return false } else if (gt.operator === '>=' && !satisfies(gt.semver, String(c), options)) return false } if (lt) { if (c.operator === '<' || c.operator === '<=') { lower = lowerLT(lt, c, options) if (lower === c) return false } else if (lt.operator === '<=' && !satisfies(lt.semver, String(c), options)) return false } if (!c.operator && (lt || gt) && gtltComp !== 0) return false } // if there was a < or >, and nothing in the dom, then must be false // UNLESS it was limited by another range in the other direction. // Eg, >1.0.0 <1.0.1 is still a subset of <2.0.0 if (gt && hasDomLT && !lt && gtltComp !== 0) return false if (lt && hasDomGT && !gt && gtltComp !== 0) return false return true } // >=1.2.3 is lower than >1.2.3 const higherGT = (a, b, options) => { if (!a) return b const comp = compare(a.semver, b.semver, options) return comp > 0 ? a : comp < 0 ? b : b.operator === '>' && a.operator === '>=' ? b : a } // <=1.2.3 is higher than <1.2.3 const lowerLT = (a, b, options) => { if (!a) return b const comp = compare(a.semver, b.semver, options) return comp < 0 ? a : comp > 0 ? b : b.operator === '<' && a.operator === '<=' ? b : a } module.exports = subset /***/ }), /***/ 2706: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const Range = __webpack_require__(9828) // Mostly just for testing and legacy API reasons const toComparators = (range, options) => new Range(range, options).set .map(comp => comp.map(c => c.value).join(' ').trim().split(' ')) module.exports = toComparators /***/ }), /***/ 2098: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const Range = __webpack_require__(9828) const validRange = (range, options) => { try { // Return '*' instead of '' so that truthiness works. // This will throw if it's invalid anyway return new Range(range, options).range || '*' } catch (er) { return null } } module.exports = validRange /***/ }), /***/ 5030: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); function getUserAgent() { if (typeof navigator === "object" && "userAgent" in navigator) { return navigator.userAgent; } if (typeof process === "object" && "version" in process) { return `Node.js/${process.version.substr(1)} (${process.platform}; ${process.arch})`; } return ""; } exports.getUserAgent = getUserAgent; //# sourceMappingURL=index.js.map /***/ }), /***/ 4552: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { "v1": () => /* reexport */ esm_node_v1, "v3": () => /* reexport */ esm_node_v3, "v4": () => /* reexport */ esm_node_v4, "v5": () => /* reexport */ esm_node_v5, "NIL": () => /* reexport */ nil, "version": () => /* reexport */ esm_node_version, "validate": () => /* reexport */ esm_node_validate, "stringify": () => /* reexport */ esm_node_stringify, "parse": () => /* reexport */ esm_node_parse }); // EXTERNAL MODULE: external "crypto" var external_crypto_ = __webpack_require__(6417); var external_crypto_default = /*#__PURE__*/__webpack_require__.n(external_crypto_); // CONCATENATED MODULE: ./node_modules/uuid/dist/esm-node/rng.js const rnds8 = new Uint8Array(16); function rng() { return external_crypto_default().randomFillSync(rnds8); } // 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 */ const byteToHex = []; for (let i = 0; i < 256; ++i) { byteToHex.push((i + 0x100).toString(16).substr(1)); } function stringify(arr, offset = 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 const 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 let _nodeId; let _clockseq; // Previous uuid creation time let _lastMSecs = 0; let _lastNSecs = 0; // See https://github.com/uuidjs/uuid for API details function v1(options, buf, offset) { let i = buf && offset || 0; const b = buf || new Array(16); options = options || {}; let node = options.node || _nodeId; let 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) { const 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. let 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 let nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs) const 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` const 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` const 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 (let 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'); } let v; const 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 const bytes = []; for (let i = 0; i < str.length; ++i) { bytes.push(str.charCodeAt(i)); } return bytes; } const DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8'; const 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])` let 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 (let 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 const 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 || {}; const 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 (let 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 const 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 /***/ }), /***/ 2940: /***/ ((module) => { // Returns a wrapper function that returns a wrapped callback // The wrapper function should do some stuff, and return a // presumably different callback function. // This makes sure that own properties are retained, so that // decorations and such are not lost along the way. module.exports = wrappy function wrappy (fn, cb) { if (fn && cb) return wrappy(fn)(cb) if (typeof fn !== 'function') throw new TypeError('need wrapper function') Object.keys(fn).forEach(function (k) { wrapper[k] = fn[k] }) return wrapper function wrapper() { var args = new Array(arguments.length) for (var i = 0; i < args.length; i++) { args[i] = arguments[i] } var ret = fn.apply(this, args) var cb = args[args.length-1] if (typeof ret === 'function' && ret !== cb) { Object.keys(cb).forEach(function (k) { ret[k] = cb[k] }) } return ret } } /***/ }), /***/ 2877: /***/ ((module) => { module.exports = eval("require")("encoding"); /***/ }), /***/ 2182: /***/ ((module) => { "use strict"; module.exports = JSON.parse("{\"$schema\":\"http://json-schema.org/draft-07/schema#\",\"title\":\"Static Analysis Results Format (SARIF) Version 2.1.0 JSON Schema\",\"$id\":\"https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json\",\"description\":\"Static Analysis Results Format (SARIF) Version 2.1.0 JSON Schema: a standard format for the output of static analysis tools.\",\"additionalProperties\":false,\"type\":\"object\",\"properties\":{\"$schema\":{\"description\":\"The URI of the JSON schema corresponding to the version.\",\"type\":\"string\",\"format\":\"uri\"},\"version\":{\"description\":\"The SARIF format version of this log file.\",\"enum\":[\"2.1.0\"]},\"runs\":{\"description\":\"The set of runs contained in this log file.\",\"type\":\"array\",\"minItems\":0,\"items\":{\"$ref\":\"#/definitions/run\"}},\"inlineExternalProperties\":{\"description\":\"References to external property files that share data between runs.\",\"type\":\"array\",\"minItems\":0,\"uniqueItems\":true,\"items\":{\"$ref\":\"#/definitions/externalProperties\"}},\"properties\":{\"description\":\"Key/value pairs that provide additional information about the log file.\",\"$ref\":\"#/definitions/propertyBag\"}},\"required\":[\"version\",\"runs\"],\"definitions\":{\"address\":{\"description\":\"A physical or virtual address, or a range of addresses, in an 'addressable region' (memory or a binary file).\",\"additionalProperties\":false,\"type\":\"object\",\"properties\":{\"absoluteAddress\":{\"description\":\"The address expressed as a byte offset from the start of the addressable region.\",\"type\":\"integer\",\"minimum\":-1,\"default\":-1},\"relativeAddress\":{\"description\":\"The address expressed as a byte offset from the absolute address of the top-most parent object.\",\"type\":\"integer\"},\"length\":{\"description\":\"The number of bytes in this range of addresses.\",\"type\":\"integer\"},\"kind\":{\"description\":\"An open-ended string that identifies the address kind. 'data', 'function', 'header','instruction', 'module', 'page', 'section', 'segment', 'stack', 'stackFrame', 'table' are well-known values.\",\"type\":\"string\"},\"name\":{\"description\":\"A name that is associated with the address, e.g., '.text'.\",\"type\":\"string\"},\"fullyQualifiedName\":{\"description\":\"A human-readable fully qualified name that is associated with the address.\",\"type\":\"string\"},\"offsetFromParent\":{\"description\":\"The byte offset of this address from the absolute or relative address of the parent object.\",\"type\":\"integer\"},\"index\":{\"description\":\"The index within run.addresses of the cached object for this address.\",\"type\":\"integer\",\"default\":-1,\"minimum\":-1},\"parentIndex\":{\"description\":\"The index within run.addresses of the parent object.\",\"type\":\"integer\",\"default\":-1,\"minimum\":-1},\"properties\":{\"description\":\"Key/value pairs that provide additional information about the address.\",\"$ref\":\"#/definitions/propertyBag\"}}},\"artifact\":{\"description\":\"A single artifact. In some cases, this artifact might be nested within another artifact.\",\"additionalProperties\":false,\"type\":\"object\",\"properties\":{\"description\":{\"description\":\"A short description of the artifact.\",\"$ref\":\"#/definitions/message\"},\"location\":{\"description\":\"The location of the artifact.\",\"$ref\":\"#/definitions/artifactLocation\"},\"parentIndex\":{\"description\":\"Identifies the index of the immediate parent of the artifact, if this artifact is nested.\",\"type\":\"integer\",\"default\":-1,\"minimum\":-1},\"offset\":{\"description\":\"The offset in bytes of the artifact within its containing artifact.\",\"type\":\"integer\",\"minimum\":0},\"length\":{\"description\":\"The length of the artifact in bytes.\",\"type\":\"integer\",\"default\":-1,\"minimum\":-1},\"roles\":{\"description\":\"The role or roles played by the artifact in the analysis.\",\"type\":\"array\",\"minItems\":0,\"uniqueItems\":true,\"default\":[],\"items\":{\"enum\":[\"analysisTarget\",\"attachment\",\"responseFile\",\"resultFile\",\"standardStream\",\"tracedFile\",\"unmodified\",\"modified\",\"added\",\"deleted\",\"renamed\",\"uncontrolled\",\"driver\",\"extension\",\"translation\",\"taxonomy\",\"policy\",\"referencedOnCommandLine\",\"memoryContents\",\"directory\",\"userSpecifiedConfiguration\",\"toolSpecifiedConfiguration\",\"debugOutputFile\"]}},\"mimeType\":{\"description\":\"The MIME type (RFC 2045) of the artifact.\",\"type\":\"string\",\"pattern\":\"[^/]+/.+\"},\"contents\":{\"description\":\"The contents of the artifact.\",\"$ref\":\"#/definitions/artifactContent\"},\"encoding\":{\"description\":\"Specifies the encoding for an artifact object that refers to a text file.\",\"type\":\"string\"},\"sourceLanguage\":{\"description\":\"Specifies the source language for any artifact object that refers to a text file that contains source code.\",\"type\":\"string\"},\"hashes\":{\"description\":\"A dictionary, each of whose keys is the name of a hash function and each of whose values is the hashed value of the artifact produced by the specified hash function.\",\"type\":\"object\",\"additionalProperties\":{\"type\":\"string\"}},\"lastModifiedTimeUtc\":{\"description\":\"The Coordinated Universal Time (UTC) date and time at which the artifact was most recently modified. See \\\"Date/time properties\\\" in the SARIF spec for the required format.\",\"type\":\"string\",\"format\":\"date-time\"},\"properties\":{\"description\":\"Key/value pairs that provide additional information about the artifact.\",\"$ref\":\"#/definitions/propertyBag\"}}},\"artifactChange\":{\"description\":\"A change to a single artifact.\",\"additionalProperties\":false,\"type\":\"object\",\"properties\":{\"artifactLocation\":{\"description\":\"The location of the artifact to change.\",\"$ref\":\"#/definitions/artifactLocation\"},\"replacements\":{\"description\":\"An array of replacement objects, each of which represents the replacement of a single region in a single artifact specified by 'artifactLocation'.\",\"type\":\"array\",\"minItems\":1,\"items\":{\"$ref\":\"#/definitions/replacement\"}},\"properties\":{\"description\":\"Key/value pairs that provide additional information about the change.\",\"$ref\":\"#/definitions/propertyBag\"}},\"required\":[\"artifactLocation\",\"replacements\"]},\"artifactContent\":{\"description\":\"Represents the contents of an artifact.\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"text\":{\"description\":\"UTF-8-encoded content from a text artifact.\",\"type\":\"string\"},\"binary\":{\"description\":\"MIME Base64-encoded content from a binary artifact, or from a text artifact in its original encoding.\",\"type\":\"string\"},\"rendered\":{\"description\":\"An alternate rendered representation of the artifact (e.g., a decompiled representation of a binary region).\",\"$ref\":\"#/definitions/multiformatMessageString\"},\"properties\":{\"description\":\"Key/value pairs that provide additional information about the artifact content.\",\"$ref\":\"#/definitions/propertyBag\"}}},\"artifactLocation\":{\"description\":\"Specifies the location of an artifact.\",\"additionalProperties\":false,\"type\":\"object\",\"properties\":{\"uri\":{\"description\":\"A string containing a valid relative or absolute URI.\",\"type\":\"string\",\"format\":\"uri-reference\"},\"uriBaseId\":{\"description\":\"A string which indirectly specifies the absolute URI with respect to which a relative URI in the \\\"uri\\\" property is interpreted.\",\"type\":\"string\"},\"index\":{\"description\":\"The index within the run artifacts array of the artifact object associated with the artifact location.\",\"type\":\"integer\",\"default\":-1,\"minimum\":-1},\"description\":{\"description\":\"A short description of the artifact location.\",\"$ref\":\"#/definitions/message\"},\"properties\":{\"description\":\"Key/value pairs that provide additional information about the artifact location.\",\"$ref\":\"#/definitions/propertyBag\"}}},\"attachment\":{\"description\":\"An artifact relevant to a result.\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"description\":{\"description\":\"A message describing the role played by the attachment.\",\"$ref\":\"#/definitions/message\"},\"artifactLocation\":{\"description\":\"The location of the attachment.\",\"$ref\":\"#/definitions/artifactLocation\"},\"regions\":{\"description\":\"An array of regions of interest within the attachment.\",\"type\":\"array\",\"minItems\":0,\"uniqueItems\":true,\"default\":[],\"items\":{\"$ref\":\"#/definitions/region\"}},\"rectangles\":{\"description\":\"An array of rectangles specifying areas of interest within the image.\",\"type\":\"array\",\"minItems\":0,\"uniqueItems\":true,\"default\":[],\"items\":{\"$ref\":\"#/definitions/rectangle\"}},\"properties\":{\"description\":\"Key/value pairs that provide additional information about the attachment.\",\"$ref\":\"#/definitions/propertyBag\"}},\"required\":[\"artifactLocation\"]},\"codeFlow\":{\"description\":\"A set of threadFlows which together describe a pattern of code execution relevant to detecting a result.\",\"additionalProperties\":false,\"type\":\"object\",\"properties\":{\"message\":{\"description\":\"A message relevant to the code flow.\",\"$ref\":\"#/definitions/message\"},\"threadFlows\":{\"description\":\"An array of one or more unique threadFlow objects, each of which describes the progress of a program through a thread of execution.\",\"type\":\"array\",\"minItems\":1,\"items\":{\"$ref\":\"#/definitions/threadFlow\"}},\"properties\":{\"description\":\"Key/value pairs that provide additional information about the code flow.\",\"$ref\":\"#/definitions/propertyBag\"}},\"required\":[\"threadFlows\"]},\"configurationOverride\":{\"description\":\"Information about how a specific rule or notification was reconfigured at runtime.\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"configuration\":{\"description\":\"Specifies how the rule or notification was configured during the scan.\",\"$ref\":\"#/definitions/reportingConfiguration\"},\"descriptor\":{\"description\":\"A reference used to locate the descriptor whose configuration was overridden.\",\"$ref\":\"#/definitions/reportingDescriptorReference\"},\"properties\":{\"description\":\"Key/value pairs that provide additional information about the configuration override.\",\"$ref\":\"#/definitions/propertyBag\"}},\"required\":[\"configuration\",\"descriptor\"]},\"conversion\":{\"description\":\"Describes how a converter transformed the output of a static analysis tool from the analysis tool's native output format into the SARIF format.\",\"additionalProperties\":false,\"type\":\"object\",\"properties\":{\"tool\":{\"description\":\"A tool object that describes the converter.\",\"$ref\":\"#/definitions/tool\"},\"invocation\":{\"description\":\"An invocation object that describes the invocation of the converter.\",\"$ref\":\"#/definitions/invocation\"},\"analysisToolLogFiles\":{\"description\":\"The locations of the analysis tool's per-run log files.\",\"type\":\"array\",\"minItems\":0,\"uniqueItems\":true,\"default\":[],\"items\":{\"$ref\":\"#/definitions/artifactLocation\"}},\"properties\":{\"description\":\"Key/value pairs that provide additional information about the conversion.\",\"$ref\":\"#/definitions/propertyBag\"}},\"required\":[\"tool\"]},\"edge\":{\"description\":\"Represents a directed edge in a graph.\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"id\":{\"description\":\"A string that uniquely identifies the edge within its graph.\",\"type\":\"string\"},\"label\":{\"description\":\"A short description of the edge.\",\"$ref\":\"#/definitions/message\"},\"sourceNodeId\":{\"description\":\"Identifies the source node (the node at which the edge starts).\",\"type\":\"string\"},\"targetNodeId\":{\"description\":\"Identifies the target node (the node at which the edge ends).\",\"type\":\"string\"},\"properties\":{\"description\":\"Key/value pairs that provide additional information about the edge.\",\"$ref\":\"#/definitions/propertyBag\"}},\"required\":[\"id\",\"sourceNodeId\",\"targetNodeId\"]},\"edgeTraversal\":{\"description\":\"Represents the traversal of a single edge during a graph traversal.\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"edgeId\":{\"description\":\"Identifies the edge being traversed.\",\"type\":\"string\"},\"message\":{\"description\":\"A message to display to the user as the edge is traversed.\",\"$ref\":\"#/definitions/message\"},\"finalState\":{\"description\":\"The values of relevant expressions after the edge has been traversed.\",\"type\":\"object\",\"additionalProperties\":{\"$ref\":\"#/definitions/multiformatMessageString\"}},\"stepOverEdgeCount\":{\"description\":\"The number of edge traversals necessary to return from a nested graph.\",\"type\":\"integer\",\"minimum\":0},\"properties\":{\"description\":\"Key/value pairs that provide additional information about the edge traversal.\",\"$ref\":\"#/definitions/propertyBag\"}},\"required\":[\"edgeId\"]},\"exception\":{\"description\":\"Describes a runtime exception encountered during the execution of an analysis tool.\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"kind\":{\"type\":\"string\",\"description\":\"A string that identifies the kind of exception, for example, the fully qualified type name of an object that was thrown, or the symbolic name of a signal.\"},\"message\":{\"description\":\"A message that describes the exception.\",\"type\":\"string\"},\"stack\":{\"description\":\"The sequence of function calls leading to the exception.\",\"$ref\":\"#/definitions/stack\"},\"innerExceptions\":{\"description\":\"An array of exception objects each of which is considered a cause of this exception.\",\"type\":\"array\",\"minItems\":0,\"default\":[],\"items\":{\"$ref\":\"#/definitions/exception\"}},\"properties\":{\"description\":\"Key/value pairs that provide additional information about the exception.\",\"$ref\":\"#/definitions/propertyBag\"}}},\"externalProperties\":{\"description\":\"The top-level element of an external property file.\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"schema\":{\"description\":\"The URI of the JSON schema corresponding to the version of the external property file format.\",\"type\":\"string\",\"format\":\"uri\"},\"version\":{\"description\":\"The SARIF format version of this external properties object.\",\"enum\":[\"2.1.0\"]},\"guid\":{\"description\":\"A stable, unique identifer for this external properties object, in the form of a GUID.\",\"type\":\"string\",\"pattern\":\"^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$\"},\"runGuid\":{\"description\":\"A stable, unique identifer for the run associated with this external properties object, in the form of a GUID.\",\"type\":\"string\",\"pattern\":\"^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$\"},\"conversion\":{\"description\":\"A conversion object that will be merged with a separate run.\",\"$ref\":\"#/definitions/conversion\"},\"graphs\":{\"description\":\"An array of graph objects that will be merged with a separate run.\",\"type\":\"array\",\"minItems\":0,\"default\":[],\"uniqueItems\":true,\"items\":{\"$ref\":\"#/definitions/graph\"}},\"externalizedProperties\":{\"description\":\"Key/value pairs that provide additional information that will be merged with a separate run.\",\"$ref\":\"#/definitions/propertyBag\"},\"artifacts\":{\"description\":\"An array of artifact objects that will be merged with a separate run.\",\"type\":\"array\",\"minItems\":0,\"uniqueItems\":true,\"items\":{\"$ref\":\"#/definitions/artifact\"}},\"invocations\":{\"description\":\"Describes the invocation of the analysis tool that will be merged with a separate run.\",\"type\":\"array\",\"minItems\":0,\"default\":[],\"items\":{\"$ref\":\"#/definitions/invocation\"}},\"logicalLocations\":{\"description\":\"An array of logical locations such as namespaces, types or functions that will be merged with a separate run.\",\"type\":\"array\",\"minItems\":0,\"uniqueItems\":true,\"default\":[],\"items\":{\"$ref\":\"#/definitions/logicalLocation\"}},\"threadFlowLocations\":{\"description\":\"An array of threadFlowLocation objects that will be merged with a separate run.\",\"type\":\"array\",\"minItems\":0,\"uniqueItems\":true,\"default\":[],\"items\":{\"$ref\":\"#/definitions/threadFlowLocation\"}},\"results\":{\"description\":\"An array of result objects that will be merged with a separate run.\",\"type\":\"array\",\"minItems\":0,\"default\":[],\"items\":{\"$ref\":\"#/definitions/result\"}},\"taxonomies\":{\"description\":\"Tool taxonomies that will be merged with a separate run.\",\"type\":\"array\",\"minItems\":0,\"uniqueItems\":true,\"default\":[],\"items\":{\"$ref\":\"#/definitions/toolComponent\"}},\"driver\":{\"description\":\"The analysis tool object that will be merged with a separate run.\",\"$ref\":\"#/definitions/toolComponent\"},\"extensions\":{\"description\":\"Tool extensions that will be merged with a separate run.\",\"type\":\"array\",\"minItems\":0,\"uniqueItems\":true,\"default\":[],\"items\":{\"$ref\":\"#/definitions/toolComponent\"}},\"policies\":{\"description\":\"Tool policies that will be merged with a separate run.\",\"type\":\"array\",\"minItems\":0,\"uniqueItems\":true,\"default\":[],\"items\":{\"$ref\":\"#/definitions/toolComponent\"}},\"translations\":{\"description\":\"Tool translations that will be merged with a separate run.\",\"type\":\"array\",\"minItems\":0,\"uniqueItems\":true,\"default\":[],\"items\":{\"$ref\":\"#/definitions/toolComponent\"}},\"addresses\":{\"description\":\"Addresses that will be merged with a separate run.\",\"type\":\"array\",\"minItems\":0,\"default\":[],\"items\":{\"$ref\":\"#/definitions/address\"}},\"webRequests\":{\"description\":\"Requests that will be merged with a separate run.\",\"type\":\"array\",\"minItems\":0,\"uniqueItems\":true,\"default\":[],\"items\":{\"$ref\":\"#/definitions/webRequest\"}},\"webResponses\":{\"description\":\"Responses that will be merged with a separate run.\",\"type\":\"array\",\"minItems\":0,\"uniqueItems\":true,\"default\":[],\"items\":{\"$ref\":\"#/definitions/webResponse\"}},\"properties\":{\"description\":\"Key/value pairs that provide additional information about the external properties.\",\"$ref\":\"#/definitions/propertyBag\"}}},\"externalPropertyFileReference\":{\"description\":\"Contains information that enables a SARIF consumer to locate the external property file that contains the value of an externalized property associated with the run.\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"location\":{\"description\":\"The location of the external property file.\",\"$ref\":\"#/definitions/artifactLocation\"},\"guid\":{\"description\":\"A stable, unique identifer for the external property file in the form of a GUID.\",\"type\":\"string\",\"pattern\":\"^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$\"},\"itemCount\":{\"description\":\"A non-negative integer specifying the number of items contained in the external property file.\",\"type\":\"integer\",\"default\":-1,\"minimum\":-1},\"properties\":{\"description\":\"Key/value pairs that provide additional information about the external property file.\",\"$ref\":\"#/definitions/propertyBag\"}},\"anyOf\":[{\"required\":[\"location\"]},{\"required\":[\"guid\"]}]},\"externalPropertyFileReferences\":{\"description\":\"References to external property files that should be inlined with the content of a root log file.\",\"additionalProperties\":false,\"type\":\"object\",\"properties\":{\"conversion\":{\"description\":\"An external property file containing a run.conversion object to be merged with the root log file.\",\"$ref\":\"#/definitions/externalPropertyFileReference\"},\"graphs\":{\"description\":\"An array of external property files containing a run.graphs object to be merged with the root log file.\",\"type\":\"array\",\"minItems\":0,\"uniqueItems\":true,\"default\":[],\"items\":{\"$ref\":\"#/definitions/externalPropertyFileReference\"}},\"externalizedProperties\":{\"description\":\"An external property file containing a run.properties object to be merged with the root log file.\",\"$ref\":\"#/definitions/externalPropertyFileReference\"},\"artifacts\":{\"description\":\"An array of external property files containing run.artifacts arrays to be merged with the root log file.\",\"type\":\"array\",\"minItems\":0,\"uniqueItems\":true,\"default\":[],\"items\":{\"$ref\":\"#/definitions/externalPropertyFileReference\"}},\"invocations\":{\"description\":\"An array of external property files containing run.invocations arrays to be merged with the root log file.\",\"type\":\"array\",\"minItems\":0,\"uniqueItems\":true,\"default\":[],\"items\":{\"$ref\":\"#/definitions/externalPropertyFileReference\"}},\"logicalLocations\":{\"description\":\"An array of external property files containing run.logicalLocations arrays to be merged with the root log file.\",\"type\":\"array\",\"minItems\":0,\"uniqueItems\":true,\"default\":[],\"items\":{\"$ref\":\"#/definitions/externalPropertyFileReference\"}},\"threadFlowLocations\":{\"description\":\"An array of external property files containing run.threadFlowLocations arrays to be merged with the root log file.\",\"type\":\"array\",\"minItems\":0,\"uniqueItems\":true,\"default\":[],\"items\":{\"$ref\":\"#/definitions/externalPropertyFileReference\"}},\"results\":{\"description\":\"An array of external property files containing run.results arrays to be merged with the root log file.\",\"type\":\"array\",\"minItems\":0,\"uniqueItems\":true,\"default\":[],\"items\":{\"$ref\":\"#/definitions/externalPropertyFileReference\"}},\"taxonomies\":{\"description\":\"An array of external property files containing run.taxonomies arrays to be merged with the root log file.\",\"type\":\"array\",\"minItems\":0,\"uniqueItems\":true,\"default\":[],\"items\":{\"$ref\":\"#/definitions/externalPropertyFileReference\"}},\"addresses\":{\"description\":\"An array of external property files containing run.addresses arrays to be merged with the root log file.\",\"type\":\"array\",\"minItems\":0,\"uniqueItems\":true,\"default\":[],\"items\":{\"$ref\":\"#/definitions/externalPropertyFileReference\"}},\"driver\":{\"description\":\"An external property file containing a run.driver object to be merged with the root log file.\",\"$ref\":\"#/definitions/externalPropertyFileReference\"},\"extensions\":{\"description\":\"An array of external property files containing run.extensions arrays to be merged with the root log file.\",\"type\":\"array\",\"minItems\":0,\"uniqueItems\":true,\"default\":[],\"items\":{\"$ref\":\"#/definitions/externalPropertyFileReference\"}},\"policies\":{\"description\":\"An array of external property files containing run.policies arrays to be merged with the root log file.\",\"type\":\"array\",\"minItems\":0,\"uniqueItems\":true,\"default\":[],\"items\":{\"$ref\":\"#/definitions/externalPropertyFileReference\"}},\"translations\":{\"description\":\"An array of external property files containing run.translations arrays to be merged with the root log file.\",\"type\":\"array\",\"minItems\":0,\"uniqueItems\":true,\"default\":[],\"items\":{\"$ref\":\"#/definitions/externalPropertyFileReference\"}},\"webRequests\":{\"description\":\"An array of external property files containing run.requests arrays to be merged with the root log file.\",\"type\":\"array\",\"minItems\":0,\"uniqueItems\":true,\"default\":[],\"items\":{\"$ref\":\"#/definitions/externalPropertyFileReference\"}},\"webResponses\":{\"description\":\"An array of external property files containing run.responses arrays to be merged with the root log file.\",\"type\":\"array\",\"minItems\":0,\"uniqueItems\":true,\"default\":[],\"items\":{\"$ref\":\"#/definitions/externalPropertyFileReference\"}},\"properties\":{\"description\":\"Key/value pairs that provide additional information about the external property files.\",\"$ref\":\"#/definitions/propertyBag\"}}},\"fix\":{\"description\":\"A proposed fix for the problem represented by a result object. A fix specifies a set of artifacts to modify. For each artifact, it specifies a set of bytes to remove, and provides a set of new bytes to replace them.\",\"additionalProperties\":false,\"type\":\"object\",\"properties\":{\"description\":{\"description\":\"A message that describes the proposed fix, enabling viewers to present the proposed change to an end user.\",\"$ref\":\"#/definitions/message\"},\"artifactChanges\":{\"description\":\"One or more artifact changes that comprise a fix for a result.\",\"type\":\"array\",\"minItems\":1,\"uniqueItems\":true,\"items\":{\"$ref\":\"#/definitions/artifactChange\"}},\"properties\":{\"description\":\"Key/value pairs that provide additional information about the fix.\",\"$ref\":\"#/definitions/propertyBag\"}},\"required\":[\"artifactChanges\"]},\"graph\":{\"description\":\"A network of nodes and directed edges that describes some aspect of the structure of the code (for example, a call graph).\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"description\":{\"description\":\"A description of the graph.\",\"$ref\":\"#/definitions/message\"},\"nodes\":{\"description\":\"An array of node objects representing the nodes of the graph.\",\"type\":\"array\",\"minItems\":0,\"uniqueItems\":true,\"default\":[],\"items\":{\"$ref\":\"#/definitions/node\"}},\"edges\":{\"description\":\"An array of edge objects representing the edges of the graph.\",\"type\":\"array\",\"minItems\":0,\"uniqueItems\":true,\"default\":[],\"items\":{\"$ref\":\"#/definitions/edge\"}},\"properties\":{\"description\":\"Key/value pairs that provide additional information about the graph.\",\"$ref\":\"#/definitions/propertyBag\"}}},\"graphTraversal\":{\"description\":\"Represents a path through a graph.\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"runGraphIndex\":{\"description\":\"The index within the run.graphs to be associated with the result.\",\"type\":\"integer\",\"default\":-1,\"minimum\":-1},\"resultGraphIndex\":{\"description\":\"The index within the result.graphs to be associated with the result.\",\"type\":\"integer\",\"default\":-1,\"minimum\":-1},\"description\":{\"description\":\"A description of this graph traversal.\",\"$ref\":\"#/definitions/message\"},\"initialState\":{\"description\":\"Values of relevant expressions at the start of the graph traversal that may change during graph traversal.\",\"type\":\"object\",\"additionalProperties\":{\"$ref\":\"#/definitions/multiformatMessageString\"}},\"immutableState\":{\"description\":\"Values of relevant expressions at the start of the graph traversal that remain constant for the graph traversal.\",\"type\":\"object\",\"additionalProperties\":{\"$ref\":\"#/definitions/multiformatMessageString\"}},\"edgeTraversals\":{\"description\":\"The sequences of edges traversed by this graph traversal.\",\"type\":\"array\",\"minItems\":0,\"default\":[],\"items\":{\"$ref\":\"#/definitions/edgeTraversal\"}},\"properties\":{\"description\":\"Key/value pairs that provide additional information about the graph traversal.\",\"$ref\":\"#/definitions/propertyBag\"}},\"oneOf\":[{\"required\":[\"runGraphIndex\"]},{\"required\":[\"resultGraphIndex\"]}]},\"invocation\":{\"description\":\"The runtime environment of the analysis tool run.\",\"additionalProperties\":false,\"type\":\"object\",\"properties\":{\"commandLine\":{\"description\":\"The command line used to invoke the tool.\",\"type\":\"string\"},\"arguments\":{\"description\":\"An array of strings, containing in order the command line arguments passed to the tool from the operating system.\",\"type\":\"array\",\"minItems\":0,\"items\":{\"type\":\"string\"}},\"responseFiles\":{\"description\":\"The locations of any response files specified on the tool's command line.\",\"type\":\"array\",\"minItems\":0,\"uniqueItems\":true,\"items\":{\"$ref\":\"#/definitions/artifactLocation\"}},\"startTimeUtc\":{\"description\":\"The Coordinated Universal Time (UTC) date and time at which the run started. See \\\"Date/time properties\\\" in the SARIF spec for the required format.\",\"type\":\"string\",\"format\":\"date-time\"},\"endTimeUtc\":{\"description\":\"The Coordinated Universal Time (UTC) date and time at which the run ended. See \\\"Date/time properties\\\" in the SARIF spec for the required format.\",\"type\":\"string\",\"format\":\"date-time\"},\"exitCode\":{\"description\":\"The process exit code.\",\"type\":\"integer\"},\"ruleConfigurationOverrides\":{\"description\":\"An array of configurationOverride objects that describe rules related runtime overrides.\",\"type\":\"array\",\"minItems\":0,\"default\":[],\"uniqueItems\":true,\"items\":{\"$ref\":\"#/definitions/configurationOverride\"}},\"notificationConfigurationOverrides\":{\"description\":\"An array of configurationOverride objects that describe notifications related runtime overrides.\",\"type\":\"array\",\"minItems\":0,\"default\":[],\"uniqueItems\":true,\"items\":{\"$ref\":\"#/definitions/configurationOverride\"}},\"toolExecutionNotifications\":{\"description\":\"A list of runtime conditions detected by the tool during the analysis.\",\"type\":\"array\",\"minItems\":0,\"default\":[],\"items\":{\"$ref\":\"#/definitions/notification\"}},\"toolConfigurationNotifications\":{\"description\":\"A list of conditions detected by the tool that are relevant to the tool's configuration.\",\"type\":\"array\",\"minItems\":0,\"default\":[],\"items\":{\"$ref\":\"#/definitions/notification\"}},\"exitCodeDescription\":{\"description\":\"The reason for the process exit.\",\"type\":\"string\"},\"exitSignalName\":{\"description\":\"The name of the signal that caused the process to exit.\",\"type\":\"string\"},\"exitSignalNumber\":{\"description\":\"The numeric value of the signal that caused the process to exit.\",\"type\":\"integer\"},\"processStartFailureMessage\":{\"description\":\"The reason given by the operating system that the process failed to start.\",\"type\":\"string\"},\"executionSuccessful\":{\"description\":\"Specifies whether the tool's execution completed successfully.\",\"type\":\"boolean\"},\"machine\":{\"description\":\"The machine that hosted the analysis tool run.\",\"type\":\"string\"},\"account\":{\"description\":\"The account that ran the analysis tool.\",\"type\":\"string\"},\"processId\":{\"description\":\"The process id for the analysis tool run.\",\"type\":\"integer\"},\"executableLocation\":{\"description\":\"An absolute URI specifying the location of the analysis tool's executable.\",\"$ref\":\"#/definitions/artifactLocation\"},\"workingDirectory\":{\"description\":\"The working directory for the analysis tool run.\",\"$ref\":\"#/definitions/artifactLocation\"},\"environmentVariables\":{\"description\":\"The environment variables associated with the analysis tool process, expressed as key/value pairs.\",\"type\":\"object\",\"additionalProperties\":{\"type\":\"string\"}},\"stdin\":{\"description\":\"A file containing the standard input stream to the process that was invoked.\",\"$ref\":\"#/definitions/artifactLocation\"},\"stdout\":{\"description\":\"A file containing the standard output stream from the process that was invoked.\",\"$ref\":\"#/definitions/artifactLocation\"},\"stderr\":{\"description\":\"A file containing the standard error stream from the process that was invoked.\",\"$ref\":\"#/definitions/artifactLocation\"},\"stdoutStderr\":{\"description\":\"A file containing the interleaved standard output and standard error stream from the process that was invoked.\",\"$ref\":\"#/definitions/artifactLocation\"},\"properties\":{\"description\":\"Key/value pairs that provide additional information about the invocation.\",\"$ref\":\"#/definitions/propertyBag\"}},\"required\":[\"executionSuccessful\"]},\"location\":{\"description\":\"A location within a programming artifact.\",\"additionalProperties\":false,\"type\":\"object\",\"properties\":{\"id\":{\"description\":\"Value that distinguishes this location from all other locations within a single result object.\",\"type\":\"integer\",\"minimum\":-1,\"default\":-1},\"physicalLocation\":{\"description\":\"Identifies the artifact and region.\",\"$ref\":\"#/definitions/physicalLocation\"},\"logicalLocations\":{\"description\":\"The logical locations associated with the result.\",\"type\":\"array\",\"minItems\":0,\"uniqueItems\":true,\"default\":[],\"items\":{\"$ref\":\"#/definitions/logicalLocation\"}},\"message\":{\"description\":\"A message relevant to the location.\",\"$ref\":\"#/definitions/message\"},\"annotations\":{\"description\":\"A set of regions relevant to the location.\",\"type\":\"array\",\"minItems\":0,\"uniqueItems\":true,\"default\":[],\"items\":{\"$ref\":\"#/definitions/region\"}},\"relationships\":{\"description\":\"An array of objects that describe relationships between this location and others.\",\"type\":\"array\",\"default\":[],\"minItems\":0,\"uniqueItems\":true,\"items\":{\"$ref\":\"#/definitions/locationRelationship\"}},\"properties\":{\"description\":\"Key/value pairs that provide additional information about the location.\",\"$ref\":\"#/definitions/propertyBag\"}}},\"locationRelationship\":{\"description\":\"Information about the relation of one location to another.\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"target\":{\"description\":\"A reference to the related location.\",\"type\":\"integer\",\"minimum\":0},\"kinds\":{\"description\":\"A set of distinct strings that categorize the relationship. Well-known kinds include 'includes', 'isIncludedBy' and 'relevant'.\",\"type\":\"array\",\"default\":[\"relevant\"],\"uniqueItems\":true,\"items\":{\"type\":\"string\"}},\"description\":{\"description\":\"A description of the location relationship.\",\"$ref\":\"#/definitions/message\"},\"properties\":{\"description\":\"Key/value pairs that provide additional information about the location relationship.\",\"$ref\":\"#/definitions/propertyBag\"}},\"required\":[\"target\"]},\"logicalLocation\":{\"description\":\"A logical location of a construct that produced a result.\",\"additionalProperties\":false,\"type\":\"object\",\"properties\":{\"name\":{\"description\":\"Identifies the construct in which the result occurred. For example, this property might contain the name of a class or a method.\",\"type\":\"string\"},\"index\":{\"description\":\"The index within the logical locations array.\",\"type\":\"integer\",\"default\":-1,\"minimum\":-1},\"fullyQualifiedName\":{\"description\":\"The human-readable fully qualified name of the logical location.\",\"type\":\"string\"},\"decoratedName\":{\"description\":\"The machine-readable name for the logical location, such as a mangled function name provided by a C++ compiler that encodes calling convention, return type and other details along with the function name.\",\"type\":\"string\"},\"parentIndex\":{\"description\":\"Identifies the index of the immediate parent of the construct in which the result was detected. For example, this property might point to a logical location that represents the namespace that holds a type.\",\"type\":\"integer\",\"default\":-1,\"minimum\":-1},\"kind\":{\"description\":\"The type of construct this logical location component refers to. Should be one of 'function', 'member', 'module', 'namespace', 'parameter', 'resource', 'returnType', 'type', 'variable', 'object', 'array', 'property', 'value', 'element', 'text', 'attribute', 'comment', 'declaration', 'dtd' or 'processingInstruction', if any of those accurately describe the construct.\",\"type\":\"string\"},\"properties\":{\"description\":\"Key/value pairs that provide additional information about the logical location.\",\"$ref\":\"#/definitions/propertyBag\"}}},\"message\":{\"description\":\"Encapsulates a message intended to be read by the end user.\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"text\":{\"description\":\"A plain text message string.\",\"type\":\"string\"},\"markdown\":{\"description\":\"A Markdown message string.\",\"type\":\"string\"},\"id\":{\"description\":\"The identifier for this message.\",\"type\":\"string\"},\"arguments\":{\"description\":\"An array of strings to substitute into the message string.\",\"type\":\"array\",\"minItems\":0,\"default\":[],\"items\":{\"type\":\"string\"}},\"properties\":{\"description\":\"Key/value pairs that provide additional information about the message.\",\"$ref\":\"#/definitions/propertyBag\"}},\"anyOf\":[{\"required\":[\"text\"]},{\"required\":[\"id\"]}]},\"multiformatMessageString\":{\"description\":\"A message string or message format string rendered in multiple formats.\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"text\":{\"description\":\"A plain text message string or format string.\",\"type\":\"string\"},\"markdown\":{\"description\":\"A Markdown message string or format string.\",\"type\":\"string\"},\"properties\":{\"description\":\"Key/value pairs that provide additional information about the message.\",\"$ref\":\"#/definitions/propertyBag\"}},\"required\":[\"text\"]},\"node\":{\"description\":\"Represents a node in a graph.\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"id\":{\"description\":\"A string that uniquely identifies the node within its graph.\",\"type\":\"string\"},\"label\":{\"description\":\"A short description of the node.\",\"$ref\":\"#/definitions/message\"},\"location\":{\"description\":\"A code location associated with the node.\",\"$ref\":\"#/definitions/location\"},\"children\":{\"description\":\"Array of child nodes.\",\"type\":\"array\",\"minItems\":0,\"uniqueItems\":true,\"default\":[],\"items\":{\"$ref\":\"#/definitions/node\"}},\"properties\":{\"description\":\"Key/value pairs that provide additional information about the node.\",\"$ref\":\"#/definitions/propertyBag\"}},\"required\":[\"id\"]},\"notification\":{\"description\":\"Describes a condition relevant to the tool itself, as opposed to being relevant to a target being analyzed by the tool.\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"locations\":{\"description\":\"The locations relevant to this notification.\",\"type\":\"array\",\"minItems\":0,\"uniqueItems\":true,\"default\":[],\"items\":{\"$ref\":\"#/definitions/location\"}},\"message\":{\"description\":\"A message that describes the condition that was encountered.\",\"$ref\":\"#/definitions/message\"},\"level\":{\"description\":\"A value specifying the severity level of the notification.\",\"default\":\"warning\",\"enum\":[\"none\",\"note\",\"warning\",\"error\"]},\"threadId\":{\"description\":\"The thread identifier of the code that generated the notification.\",\"type\":\"integer\"},\"timeUtc\":{\"description\":\"The Coordinated Universal Time (UTC) date and time at which the analysis tool generated the notification.\",\"type\":\"string\",\"format\":\"date-time\"},\"exception\":{\"description\":\"The runtime exception, if any, relevant to this notification.\",\"$ref\":\"#/definitions/exception\"},\"descriptor\":{\"description\":\"A reference used to locate the descriptor relevant to this notification.\",\"$ref\":\"#/definitions/reportingDescriptorReference\"},\"associatedRule\":{\"description\":\"A reference used to locate the rule descriptor associated with this notification.\",\"$ref\":\"#/definitions/reportingDescriptorReference\"},\"properties\":{\"description\":\"Key/value pairs that provide additional information about the notification.\",\"$ref\":\"#/definitions/propertyBag\"}},\"required\":[\"message\"]},\"physicalLocation\":{\"description\":\"A physical location relevant to a result. Specifies a reference to a programming artifact together with a range of bytes or characters within that artifact.\",\"additionalProperties\":false,\"type\":\"object\",\"properties\":{\"address\":{\"description\":\"The address of the location.\",\"$ref\":\"#/definitions/address\"},\"artifactLocation\":{\"description\":\"The location of the artifact.\",\"$ref\":\"#/definitions/artifactLocation\"},\"region\":{\"description\":\"Specifies a portion of the artifact.\",\"$ref\":\"#/definitions/region\"},\"contextRegion\":{\"description\":\"Specifies a portion of the artifact that encloses the region. Allows a viewer to display additional context around the region.\",\"$ref\":\"#/definitions/region\"},\"properties\":{\"description\":\"Key/value pairs that provide additional information about the physical location.\",\"$ref\":\"#/definitions/propertyBag\"}},\"anyOf\":[{\"required\":[\"address\"]},{\"required\":[\"artifactLocation\"]}]},\"propertyBag\":{\"description\":\"Key/value pairs that provide additional information about the object.\",\"type\":\"object\",\"additionalProperties\":true,\"properties\":{\"tags\":{\"description\":\"A set of distinct strings that provide additional information.\",\"type\":\"array\",\"minItems\":0,\"uniqueItems\":true,\"default\":[],\"items\":{\"type\":\"string\"}}}},\"rectangle\":{\"description\":\"An area within an image.\",\"additionalProperties\":false,\"type\":\"object\",\"properties\":{\"top\":{\"description\":\"The Y coordinate of the top edge of the rectangle, measured in the image's natural units.\",\"type\":\"number\"},\"left\":{\"description\":\"The X coordinate of the left edge of the rectangle, measured in the image's natural units.\",\"type\":\"number\"},\"bottom\":{\"description\":\"The Y coordinate of the bottom edge of the rectangle, measured in the image's natural units.\",\"type\":\"number\"},\"right\":{\"description\":\"The X coordinate of the right edge of the rectangle, measured in the image's natural units.\",\"type\":\"number\"},\"message\":{\"description\":\"A message relevant to the rectangle.\",\"$ref\":\"#/definitions/message\"},\"properties\":{\"description\":\"Key/value pairs that provide additional information about the rectangle.\",\"$ref\":\"#/definitions/propertyBag\"}}},\"region\":{\"description\":\"A region within an artifact where a result was detected.\",\"additionalProperties\":false,\"type\":\"object\",\"properties\":{\"startLine\":{\"description\":\"The line number of the first character in the region.\",\"type\":\"integer\",\"minimum\":1},\"startColumn\":{\"description\":\"The column number of the first character in the region.\",\"type\":\"integer\",\"minimum\":1},\"endLine\":{\"description\":\"The line number of the last character in the region.\",\"type\":\"integer\",\"minimum\":1},\"endColumn\":{\"description\":\"The column number of the character following the end of the region.\",\"type\":\"integer\",\"minimum\":1},\"charOffset\":{\"description\":\"The zero-based offset from the beginning of the artifact of the first character in the region.\",\"type\":\"integer\",\"default\":-1,\"minimum\":-1},\"charLength\":{\"description\":\"The length of the region in characters.\",\"type\":\"integer\",\"minimum\":0},\"byteOffset\":{\"description\":\"The zero-based offset from the beginning of the artifact of the first byte in the region.\",\"type\":\"integer\",\"default\":-1,\"minimum\":-1},\"byteLength\":{\"description\":\"The length of the region in bytes.\",\"type\":\"integer\",\"minimum\":0},\"snippet\":{\"description\":\"The portion of the artifact contents within the specified region.\",\"$ref\":\"#/definitions/artifactContent\"},\"message\":{\"description\":\"A message relevant to the region.\",\"$ref\":\"#/definitions/message\"},\"sourceLanguage\":{\"description\":\"Specifies the source language, if any, of the portion of the artifact specified by the region object.\",\"type\":\"string\"},\"properties\":{\"description\":\"Key/value pairs that provide additional information about the region.\",\"$ref\":\"#/definitions/propertyBag\"}}},\"replacement\":{\"description\":\"The replacement of a single region of an artifact.\",\"additionalProperties\":false,\"type\":\"object\",\"properties\":{\"deletedRegion\":{\"description\":\"The region of the artifact to delete.\",\"$ref\":\"#/definitions/region\"},\"insertedContent\":{\"description\":\"The content to insert at the location specified by the 'deletedRegion' property.\",\"$ref\":\"#/definitions/artifactContent\"},\"properties\":{\"description\":\"Key/value pairs that provide additional information about the replacement.\",\"$ref\":\"#/definitions/propertyBag\"}},\"required\":[\"deletedRegion\"]},\"reportingDescriptor\":{\"description\":\"Metadata that describes a specific report produced by the tool, as part of the analysis it provides or its runtime reporting.\",\"additionalProperties\":false,\"type\":\"object\",\"properties\":{\"id\":{\"description\":\"A stable, opaque identifier for the report.\",\"type\":\"string\"},\"deprecatedIds\":{\"description\":\"An array of stable, opaque identifiers by which this report was known in some previous version of the analysis tool.\",\"type\":\"array\",\"minItems\":0,\"uniqueItems\":true,\"items\":{\"type\":\"string\"}},\"guid\":{\"description\":\"A unique identifer for the reporting descriptor in the form of a GUID.\",\"type\":\"string\",\"pattern\":\"^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$\"},\"deprecatedGuids\":{\"description\":\"An array of unique identifies in the form of a GUID by which this report was known in some previous version of the analysis tool.\",\"type\":\"array\",\"minItems\":0,\"uniqueItems\":true,\"items\":{\"type\":\"string\",\"pattern\":\"^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$\"}},\"name\":{\"description\":\"A report identifier that is understandable to an end user.\",\"type\":\"string\"},\"deprecatedNames\":{\"description\":\"An array of readable identifiers by which this report was known in some previous version of the analysis tool.\",\"type\":\"array\",\"minItems\":0,\"uniqueItems\":true,\"items\":{\"type\":\"string\"}},\"shortDescription\":{\"description\":\"A concise description of the report. Should be a single sentence that is understandable when visible space is limited to a single line of text.\",\"$ref\":\"#/definitions/multiformatMessageString\"},\"fullDescription\":{\"description\":\"A description of the report. Should, as far as possible, provide details sufficient to enable resolution of any problem indicated by the result.\",\"$ref\":\"#/definitions/multiformatMessageString\"},\"messageStrings\":{\"description\":\"A set of name/value pairs with arbitrary names. Each value is a multiformatMessageString object, which holds message strings in plain text and (optionally) Markdown format. The strings can include placeholders, which can be used to construct a message in combination with an arbitrary number of additional string arguments.\",\"type\":\"object\",\"additionalProperties\":{\"$ref\":\"#/definitions/multiformatMessageString\"}},\"defaultConfiguration\":{\"description\":\"Default reporting configuration information.\",\"$ref\":\"#/definitions/reportingConfiguration\"},\"helpUri\":{\"description\":\"A URI where the primary documentation for the report can be found.\",\"type\":\"string\",\"format\":\"uri\"},\"help\":{\"description\":\"Provides the primary documentation for the report, useful when there is no online documentation.\",\"$ref\":\"#/definitions/multiformatMessageString\"},\"relationships\":{\"description\":\"An array of objects that describe relationships between this reporting descriptor and others.\",\"type\":\"array\",\"default\":[],\"minItems\":0,\"uniqueItems\":true,\"items\":{\"$ref\":\"#/definitions/reportingDescriptorRelationship\"}},\"properties\":{\"description\":\"Key/value pairs that provide additional information about the report.\",\"$ref\":\"#/definitions/propertyBag\"}},\"required\":[\"id\"]},\"reportingConfiguration\":{\"description\":\"Information about a rule or notification that can be configured at runtime.\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"enabled\":{\"description\":\"Specifies whether the report may be produced during the scan.\",\"type\":\"boolean\",\"default\":true},\"level\":{\"description\":\"Specifies the failure level for the report.\",\"default\":\"warning\",\"enum\":[\"none\",\"note\",\"warning\",\"error\"]},\"rank\":{\"description\":\"Specifies the relative priority of the report. Used for analysis output only.\",\"type\":\"number\",\"default\":-1,\"minimum\":-1,\"maximum\":100},\"parameters\":{\"description\":\"Contains configuration information specific to a report.\",\"$ref\":\"#/definitions/propertyBag\"},\"properties\":{\"description\":\"Key/value pairs that provide additional information about the reporting configuration.\",\"$ref\":\"#/definitions/propertyBag\"}}},\"reportingDescriptorReference\":{\"description\":\"Information about how to locate a relevant reporting descriptor.\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"id\":{\"description\":\"The id of the descriptor.\",\"type\":\"string\"},\"index\":{\"description\":\"The index into an array of descriptors in toolComponent.ruleDescriptors, toolComponent.notificationDescriptors, or toolComponent.taxonomyDescriptors, depending on context.\",\"type\":\"integer\",\"default\":-1,\"minimum\":-1},\"guid\":{\"description\":\"A guid that uniquely identifies the descriptor.\",\"type\":\"string\",\"pattern\":\"^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$\"},\"toolComponent\":{\"description\":\"A reference used to locate the toolComponent associated with the descriptor.\",\"$ref\":\"#/definitions/toolComponentReference\"},\"properties\":{\"description\":\"Key/value pairs that provide additional information about the reporting descriptor reference.\",\"$ref\":\"#/definitions/propertyBag\"}},\"anyOf\":[{\"required\":[\"index\"]},{\"required\":[\"guid\"]},{\"required\":[\"id\"]}]},\"reportingDescriptorRelationship\":{\"description\":\"Information about the relation of one reporting descriptor to another.\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"target\":{\"description\":\"A reference to the related reporting descriptor.\",\"$ref\":\"#/definitions/reportingDescriptorReference\"},\"kinds\":{\"description\":\"A set of distinct strings that categorize the relationship. Well-known kinds include 'canPrecede', 'canFollow', 'willPrecede', 'willFollow', 'superset', 'subset', 'equal', 'disjoint', 'relevant', and 'incomparable'.\",\"type\":\"array\",\"default\":[\"relevant\"],\"uniqueItems\":true,\"items\":{\"type\":\"string\"}},\"description\":{\"description\":\"A description of the reporting descriptor relationship.\",\"$ref\":\"#/definitions/message\"},\"properties\":{\"description\":\"Key/value pairs that provide additional information about the reporting descriptor reference.\",\"$ref\":\"#/definitions/propertyBag\"}},\"required\":[\"target\"]},\"result\":{\"description\":\"A result produced by an analysis tool.\",\"additionalProperties\":false,\"type\":\"object\",\"properties\":{\"ruleId\":{\"description\":\"The stable, unique identifier of the rule, if any, to which this notification is relevant. This member can be used to retrieve rule metadata from the rules dictionary, if it exists.\",\"type\":\"string\"},\"ruleIndex\":{\"description\":\"The index within the tool component rules array of the rule object associated with this result.\",\"type\":\"integer\",\"default\":-1,\"minimum\":-1},\"rule\":{\"description\":\"A reference used to locate the rule descriptor relevant to this result.\",\"$ref\":\"#/definitions/reportingDescriptorReference\"},\"kind\":{\"description\":\"A value that categorizes results by evaluation state.\",\"default\":\"fail\",\"enum\":[\"notApplicable\",\"pass\",\"fail\",\"review\",\"open\",\"informational\"]},\"level\":{\"description\":\"A value specifying the severity level of the result.\",\"default\":\"warning\",\"enum\":[\"none\",\"note\",\"warning\",\"error\"]},\"message\":{\"description\":\"A message that describes the result. The first sentence of the message only will be displayed when visible space is limited.\",\"$ref\":\"#/definitions/message\"},\"analysisTarget\":{\"description\":\"Identifies the artifact that the analysis tool was instructed to scan. This need not be the same as the artifact where the result actually occurred.\",\"$ref\":\"#/definitions/artifactLocation\"},\"locations\":{\"description\":\"The set of locations where the result was detected. Specify only one location unless the problem indicated by the result can only be corrected by making a change at every specified location.\",\"type\":\"array\",\"minItems\":0,\"default\":[],\"items\":{\"$ref\":\"#/definitions/location\"}},\"guid\":{\"description\":\"A stable, unique identifer for the result in the form of a GUID.\",\"type\":\"string\",\"pattern\":\"^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$\"},\"correlationGuid\":{\"description\":\"A stable, unique identifier for the equivalence class of logically identical results to which this result belongs, in the form of a GUID.\",\"type\":\"string\",\"pattern\":\"^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$\"},\"occurrenceCount\":{\"description\":\"A positive integer specifying the number of times this logically unique result was observed in this run.\",\"type\":\"integer\",\"minimum\":1},\"partialFingerprints\":{\"description\":\"A set of strings that contribute to the stable, unique identity of the result.\",\"type\":\"object\",\"additionalProperties\":{\"type\":\"string\"}},\"fingerprints\":{\"description\":\"A set of strings each of which individually defines a stable, unique identity for the result.\",\"type\":\"object\",\"additionalProperties\":{\"type\":\"string\"}},\"stacks\":{\"description\":\"An array of 'stack' objects relevant to the result.\",\"type\":\"array\",\"minItems\":0,\"uniqueItems\":true,\"default\":[],\"items\":{\"$ref\":\"#/definitions/stack\"}},\"codeFlows\":{\"description\":\"An array of 'codeFlow' objects relevant to the result.\",\"type\":\"array\",\"minItems\":0,\"default\":[],\"items\":{\"$ref\":\"#/definitions/codeFlow\"}},\"graphs\":{\"description\":\"An array of zero or more unique graph objects associated with the result.\",\"type\":\"array\",\"minItems\":0,\"uniqueItems\":true,\"default\":[],\"items\":{\"$ref\":\"#/definitions/graph\"}},\"graphTraversals\":{\"description\":\"An array of one or more unique 'graphTraversal' objects.\",\"type\":\"array\",\"minItems\":0,\"uniqueItems\":true,\"default\":[],\"items\":{\"$ref\":\"#/definitions/graphTraversal\"}},\"relatedLocations\":{\"description\":\"A set of locations relevant to this result.\",\"type\":\"array\",\"minItems\":0,\"uniqueItems\":true,\"default\":[],\"items\":{\"$ref\":\"#/definitions/location\"}},\"suppressions\":{\"description\":\"A set of suppressions relevant to this result.\",\"type\":\"array\",\"minItems\":0,\"uniqueItems\":true,\"items\":{\"$ref\":\"#/definitions/suppression\"}},\"baselineState\":{\"description\":\"The state of a result relative to a baseline of a previous run.\",\"enum\":[\"new\",\"unchanged\",\"updated\",\"absent\"]},\"rank\":{\"description\":\"A number representing the priority or importance of the result.\",\"type\":\"number\",\"default\":-1,\"minimum\":-1,\"maximum\":100},\"attachments\":{\"description\":\"A set of artifacts relevant to the result.\",\"type\":\"array\",\"minItems\":0,\"uniqueItems\":true,\"default\":[],\"items\":{\"$ref\":\"#/definitions/attachment\"}},\"hostedViewerUri\":{\"description\":\"An absolute URI at which the result can be viewed.\",\"type\":\"string\",\"format\":\"uri\"},\"workItemUris\":{\"description\":\"The URIs of the work items associated with this result.\",\"type\":\"array\",\"minItems\":0,\"uniqueItems\":true,\"items\":{\"type\":\"string\",\"format\":\"uri\"}},\"provenance\":{\"description\":\"Information about how and when the result was detected.\",\"$ref\":\"#/definitions/resultProvenance\"},\"fixes\":{\"description\":\"An array of 'fix' objects, each of which represents a proposed fix to the problem indicated by the result.\",\"type\":\"array\",\"minItems\":0,\"uniqueItems\":true,\"default\":[],\"items\":{\"$ref\":\"#/definitions/fix\"}},\"taxa\":{\"description\":\"An array of references to taxonomy reporting descriptors that are applicable to the result.\",\"type\":\"array\",\"default\":[],\"minItems\":0,\"uniqueItems\":true,\"items\":{\"$ref\":\"#/definitions/reportingDescriptorReference\"}},\"webRequest\":{\"description\":\"A web request associated with this result.\",\"$ref\":\"#/definitions/webRequest\"},\"webResponse\":{\"description\":\"A web response associated with this result.\",\"$ref\":\"#/definitions/webResponse\"},\"properties\":{\"description\":\"Key/value pairs that provide additional information about the result.\",\"$ref\":\"#/definitions/propertyBag\"}},\"required\":[\"message\"]},\"resultProvenance\":{\"description\":\"Contains information about how and when a result was detected.\",\"additionalProperties\":false,\"type\":\"object\",\"properties\":{\"firstDetectionTimeUtc\":{\"description\":\"The Coordinated Universal Time (UTC) date and time at which the result was first detected. See \\\"Date/time properties\\\" in the SARIF spec for the required format.\",\"type\":\"string\",\"format\":\"date-time\"},\"lastDetectionTimeUtc\":{\"description\":\"The Coordinated Universal Time (UTC) date and time at which the result was most recently detected. See \\\"Date/time properties\\\" in the SARIF spec for the required format.\",\"type\":\"string\",\"format\":\"date-time\"},\"firstDetectionRunGuid\":{\"description\":\"A GUID-valued string equal to the automationDetails.guid property of the run in which the result was first detected.\",\"type\":\"string\",\"pattern\":\"^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$\"},\"lastDetectionRunGuid\":{\"description\":\"A GUID-valued string equal to the automationDetails.guid property of the run in which the result was most recently detected.\",\"type\":\"string\",\"pattern\":\"^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$\"},\"invocationIndex\":{\"description\":\"The index within the run.invocations array of the invocation object which describes the tool invocation that detected the result.\",\"type\":\"integer\",\"default\":-1,\"minimum\":-1},\"conversionSources\":{\"description\":\"An array of physicalLocation objects which specify the portions of an analysis tool's output that a converter transformed into the result.\",\"type\":\"array\",\"minItems\":0,\"uniqueItems\":true,\"default\":[],\"items\":{\"$ref\":\"#/definitions/physicalLocation\"}},\"properties\":{\"description\":\"Key/value pairs that provide additional information about the result.\",\"$ref\":\"#/definitions/propertyBag\"}}},\"run\":{\"description\":\"Describes a single run of an analysis tool, and contains the reported output of that run.\",\"additionalProperties\":false,\"type\":\"object\",\"properties\":{\"tool\":{\"description\":\"Information about the tool or tool pipeline that generated the results in this run. A run can only contain results produced by a single tool or tool pipeline. A run can aggregate results from multiple log files, as long as context around the tool run (tool command-line arguments and the like) is identical for all aggregated files.\",\"$ref\":\"#/definitions/tool\"},\"invocations\":{\"description\":\"Describes the invocation of the analysis tool.\",\"type\":\"array\",\"minItems\":0,\"default\":[],\"items\":{\"$ref\":\"#/definitions/invocation\"}},\"conversion\":{\"description\":\"A conversion object that describes how a converter transformed an analysis tool's native reporting format into the SARIF format.\",\"$ref\":\"#/definitions/conversion\"},\"language\":{\"description\":\"The language of the messages emitted into the log file during this run (expressed as an ISO 639-1 two-letter lowercase culture code) and an optional region (expressed as an ISO 3166-1 two-letter uppercase subculture code associated with a country or region). The casing is recommended but not required (in order for this data to conform to RFC5646).\",\"type\":\"string\",\"default\":\"en-US\",\"pattern\":\"^[a-zA-Z]{2}|^[a-zA-Z]{2}-[a-zA-Z]{2}]?$\"},\"versionControlProvenance\":{\"description\":\"Specifies the revision in version control of the artifacts that were scanned.\",\"type\":\"array\",\"minItems\":0,\"uniqueItems\":true,\"default\":[],\"items\":{\"$ref\":\"#/definitions/versionControlDetails\"}},\"originalUriBaseIds\":{\"description\":\"The artifact location specified by each uriBaseId symbol on the machine where the tool originally ran.\",\"type\":\"object\",\"additionalProperties\":{\"$ref\":\"#/definitions/artifactLocation\"}},\"artifacts\":{\"description\":\"An array of artifact objects relevant to the run.\",\"type\":\"array\",\"minItems\":0,\"uniqueItems\":true,\"items\":{\"$ref\":\"#/definitions/artifact\"}},\"logicalLocations\":{\"description\":\"An array of logical locations such as namespaces, types or functions.\",\"type\":\"array\",\"minItems\":0,\"uniqueItems\":true,\"default\":[],\"items\":{\"$ref\":\"#/definitions/logicalLocation\"}},\"graphs\":{\"description\":\"An array of zero or more unique graph objects associated with the run.\",\"type\":\"array\",\"minItems\":0,\"uniqueItems\":true,\"default\":[],\"items\":{\"$ref\":\"#/definitions/graph\"}},\"results\":{\"description\":\"The set of results contained in an SARIF log. The results array can be omitted when a run is solely exporting rules metadata. It must be present (but may be empty) if a log file represents an actual scan.\",\"type\":\"array\",\"minItems\":0,\"items\":{\"$ref\":\"#/definitions/result\"}},\"automationDetails\":{\"description\":\"Automation details that describe this run.\",\"$ref\":\"#/definitions/runAutomationDetails\"},\"runAggregates\":{\"description\":\"Automation details that describe the aggregate of runs to which this run belongs.\",\"type\":\"array\",\"minItems\":0,\"uniqueItems\":true,\"default\":[],\"items\":{\"$ref\":\"#/definitions/runAutomationDetails\"}},\"baselineGuid\":{\"description\":\"The 'guid' property of a previous SARIF 'run' that comprises the baseline that was used to compute result 'baselineState' properties for the run.\",\"type\":\"string\",\"pattern\":\"^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$\"},\"redactionTokens\":{\"description\":\"An array of strings used to replace sensitive information in a redaction-aware property.\",\"type\":\"array\",\"minItems\":0,\"uniqueItems\":true,\"default\":[],\"items\":{\"type\":\"string\"}},\"defaultEncoding\":{\"description\":\"Specifies the default encoding for any artifact object that refers to a text file.\",\"type\":\"string\"},\"defaultSourceLanguage\":{\"description\":\"Specifies the default source language for any artifact object that refers to a text file that contains source code.\",\"type\":\"string\"},\"newlineSequences\":{\"description\":\"An ordered list of character sequences that were treated as line breaks when computing region information for the run.\",\"type\":\"array\",\"minItems\":1,\"uniqueItems\":true,\"default\":[\"\\r\\n\",\"\\n\"],\"items\":{\"type\":\"string\"}},\"columnKind\":{\"description\":\"Specifies the unit in which the tool measures columns.\",\"enum\":[\"utf16CodeUnits\",\"unicodeCodePoints\"]},\"externalPropertyFileReferences\":{\"description\":\"References to external property files that should be inlined with the content of a root log file.\",\"$ref\":\"#/definitions/externalPropertyFileReferences\"},\"threadFlowLocations\":{\"description\":\"An array of threadFlowLocation objects cached at run level.\",\"type\":\"array\",\"minItems\":0,\"uniqueItems\":true,\"default\":[],\"items\":{\"$ref\":\"#/definitions/threadFlowLocation\"}},\"taxonomies\":{\"description\":\"An array of toolComponent objects relevant to a taxonomy in which results are categorized.\",\"type\":\"array\",\"minItems\":0,\"uniqueItems\":true,\"default\":[],\"items\":{\"$ref\":\"#/definitions/toolComponent\"}},\"addresses\":{\"description\":\"Addresses associated with this run instance, if any.\",\"type\":\"array\",\"minItems\":0,\"default\":[],\"items\":{\"$ref\":\"#/definitions/address\"}},\"translations\":{\"description\":\"The set of available translations of the localized data provided by the tool.\",\"type\":\"array\",\"minItems\":0,\"uniqueItems\":true,\"default\":[],\"items\":{\"$ref\":\"#/definitions/toolComponent\"}},\"policies\":{\"description\":\"Contains configurations that may potentially override both reportingDescriptor.defaultConfiguration (the tool's default severities) and invocation.configurationOverrides (severities established at run-time from the command line).\",\"type\":\"array\",\"minItems\":0,\"uniqueItems\":true,\"default\":[],\"items\":{\"$ref\":\"#/definitions/toolComponent\"}},\"webRequests\":{\"description\":\"An array of request objects cached at run level.\",\"type\":\"array\",\"minItems\":0,\"uniqueItems\":true,\"default\":[],\"items\":{\"$ref\":\"#/definitions/webRequest\"}},\"webResponses\":{\"description\":\"An array of response objects cached at run level.\",\"type\":\"array\",\"minItems\":0,\"uniqueItems\":true,\"default\":[],\"items\":{\"$ref\":\"#/definitions/webResponse\"}},\"specialLocations\":{\"description\":\"A specialLocations object that defines locations of special significance to SARIF consumers.\",\"$ref\":\"#/definitions/specialLocations\"},\"properties\":{\"description\":\"Key/value pairs that provide additional information about the run.\",\"$ref\":\"#/definitions/propertyBag\"}},\"required\":[\"tool\"]},\"runAutomationDetails\":{\"description\":\"Information that describes a run's identity and role within an engineering system process.\",\"additionalProperties\":false,\"type\":\"object\",\"properties\":{\"description\":{\"description\":\"A description of the identity and role played within the engineering system by this object's containing run object.\",\"$ref\":\"#/definitions/message\"},\"id\":{\"description\":\"A hierarchical string that uniquely identifies this object's containing run object.\",\"type\":\"string\"},\"guid\":{\"description\":\"A stable, unique identifer for this object's containing run object in the form of a GUID.\",\"type\":\"string\",\"pattern\":\"^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$\"},\"correlationGuid\":{\"description\":\"A stable, unique identifier for the equivalence class of runs to which this object's containing run object belongs in the form of a GUID.\",\"type\":\"string\",\"pattern\":\"^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$\"},\"properties\":{\"description\":\"Key/value pairs that provide additional information about the run automation details.\",\"$ref\":\"#/definitions/propertyBag\"}}},\"specialLocations\":{\"description\":\"Defines locations of special significance to SARIF consumers.\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"displayBase\":{\"description\":\"Provides a suggestion to SARIF consumers to display file paths relative to the specified location.\",\"$ref\":\"#/definitions/artifactLocation\"},\"properties\":{\"description\":\"Key/value pairs that provide additional information about the special locations.\",\"$ref\":\"#/definitions/propertyBag\"}}},\"stack\":{\"description\":\"A call stack that is relevant to a result.\",\"additionalProperties\":false,\"type\":\"object\",\"properties\":{\"message\":{\"description\":\"A message relevant to this call stack.\",\"$ref\":\"#/definitions/message\"},\"frames\":{\"description\":\"An array of stack frames that represents a sequence of calls, rendered in reverse chronological order, that comprise the call stack.\",\"type\":\"array\",\"minItems\":0,\"items\":{\"$ref\":\"#/definitions/stackFrame\"}},\"properties\":{\"description\":\"Key/value pairs that provide additional information about the stack.\",\"$ref\":\"#/definitions/propertyBag\"}},\"required\":[\"frames\"]},\"stackFrame\":{\"description\":\"A function call within a stack trace.\",\"additionalProperties\":false,\"type\":\"object\",\"properties\":{\"location\":{\"description\":\"The location to which this stack frame refers.\",\"$ref\":\"#/definitions/location\"},\"module\":{\"description\":\"The name of the module that contains the code of this stack frame.\",\"type\":\"string\"},\"threadId\":{\"description\":\"The thread identifier of the stack frame.\",\"type\":\"integer\"},\"parameters\":{\"description\":\"The parameters of the call that is executing.\",\"type\":\"array\",\"minItems\":0,\"default\":[],\"items\":{\"type\":\"string\",\"default\":[]}},\"properties\":{\"description\":\"Key/value pairs that provide additional information about the stack frame.\",\"$ref\":\"#/definitions/propertyBag\"}}},\"suppression\":{\"description\":\"A suppression that is relevant to a result.\",\"additionalProperties\":false,\"type\":\"object\",\"properties\":{\"guid\":{\"description\":\"A stable, unique identifer for the suprression in the form of a GUID.\",\"type\":\"string\",\"pattern\":\"^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$\"},\"kind\":{\"description\":\"A string that indicates where the suppression is persisted.\",\"enum\":[\"inSource\",\"external\"]},\"state\":{\"description\":\"A string that indicates the state of the suppression.\",\"enum\":[\"accepted\",\"underReview\",\"rejected\"]},\"justification\":{\"description\":\"A string representing the justification for the suppression.\",\"type\":\"string\"},\"location\":{\"description\":\"Identifies the location associated with the suppression.\",\"$ref\":\"#/definitions/location\"},\"properties\":{\"description\":\"Key/value pairs that provide additional information about the suppression.\",\"$ref\":\"#/definitions/propertyBag\"}},\"required\":[\"kind\"]},\"threadFlow\":{\"description\":\"Describes a sequence of code locations that specify a path through a single thread of execution such as an operating system or fiber.\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"id\":{\"description\":\"An string that uniquely identifies the threadFlow within the codeFlow in which it occurs.\",\"type\":\"string\"},\"message\":{\"description\":\"A message relevant to the thread flow.\",\"$ref\":\"#/definitions/message\"},\"initialState\":{\"description\":\"Values of relevant expressions at the start of the thread flow that may change during thread flow execution.\",\"type\":\"object\",\"additionalProperties\":{\"$ref\":\"#/definitions/multiformatMessageString\"}},\"immutableState\":{\"description\":\"Values of relevant expressions at the start of the thread flow that remain constant.\",\"type\":\"object\",\"additionalProperties\":{\"$ref\":\"#/definitions/multiformatMessageString\"}},\"locations\":{\"description\":\"A temporally ordered array of 'threadFlowLocation' objects, each of which describes a location visited by the tool while producing the result.\",\"type\":\"array\",\"minItems\":1,\"items\":{\"$ref\":\"#/definitions/threadFlowLocation\"}},\"properties\":{\"description\":\"Key/value pairs that provide additional information about the thread flow.\",\"$ref\":\"#/definitions/propertyBag\"}},\"required\":[\"locations\"]},\"threadFlowLocation\":{\"description\":\"A location visited by an analysis tool while simulating or monitoring the execution of a program.\",\"additionalProperties\":false,\"type\":\"object\",\"properties\":{\"index\":{\"description\":\"The index within the run threadFlowLocations array.\",\"type\":\"integer\",\"default\":-1,\"minimum\":-1},\"location\":{\"description\":\"The code location.\",\"$ref\":\"#/definitions/location\"},\"stack\":{\"description\":\"The call stack leading to this location.\",\"$ref\":\"#/definitions/stack\"},\"kinds\":{\"description\":\"A set of distinct strings that categorize the thread flow location. Well-known kinds include 'acquire', 'release', 'enter', 'exit', 'call', 'return', 'branch', 'implicit', 'false', 'true', 'caution', 'danger', 'unknown', 'unreachable', 'taint', 'function', 'handler', 'lock', 'memory', 'resource', 'scope' and 'value'.\",\"type\":\"array\",\"minItems\":0,\"uniqueItems\":true,\"default\":[],\"items\":{\"type\":\"string\"}},\"taxa\":{\"description\":\"An array of references to rule or taxonomy reporting descriptors that are applicable to the thread flow location.\",\"type\":\"array\",\"default\":[],\"minItems\":0,\"uniqueItems\":true,\"items\":{\"$ref\":\"#/definitions/reportingDescriptorReference\"}},\"module\":{\"description\":\"The name of the module that contains the code that is executing.\",\"type\":\"string\"},\"state\":{\"description\":\"A dictionary, each of whose keys specifies a variable or expression, the associated value of which represents the variable or expression value. For an annotation of kind 'continuation', for example, this dictionary might hold the current assumed values of a set of global variables.\",\"type\":\"object\",\"additionalProperties\":{\"$ref\":\"#/definitions/multiformatMessageString\"}},\"nestingLevel\":{\"description\":\"An integer representing a containment hierarchy within the thread flow.\",\"type\":\"integer\",\"minimum\":0},\"executionOrder\":{\"description\":\"An integer representing the temporal order in which execution reached this location.\",\"type\":\"integer\",\"default\":-1,\"minimum\":-1},\"executionTimeUtc\":{\"description\":\"The Coordinated Universal Time (UTC) date and time at which this location was executed.\",\"type\":\"string\",\"format\":\"date-time\"},\"importance\":{\"description\":\"Specifies the importance of this location in understanding the code flow in which it occurs. The order from most to least important is \\\"essential\\\", \\\"important\\\", \\\"unimportant\\\". Default: \\\"important\\\".\",\"enum\":[\"important\",\"essential\",\"unimportant\"],\"default\":\"important\"},\"webRequest\":{\"description\":\"A web request associated with this thread flow location.\",\"$ref\":\"#/definitions/webRequest\"},\"webResponse\":{\"description\":\"A web response associated with this thread flow location.\",\"$ref\":\"#/definitions/webResponse\"},\"properties\":{\"description\":\"Key/value pairs that provide additional information about the threadflow location.\",\"$ref\":\"#/definitions/propertyBag\"}}},\"tool\":{\"description\":\"The analysis tool that was run.\",\"additionalProperties\":false,\"type\":\"object\",\"properties\":{\"driver\":{\"description\":\"The analysis tool that was run.\",\"$ref\":\"#/definitions/toolComponent\"},\"extensions\":{\"description\":\"Tool extensions that contributed to or reconfigured the analysis tool that was run.\",\"type\":\"array\",\"minItems\":0,\"uniqueItems\":true,\"default\":[],\"items\":{\"$ref\":\"#/definitions/toolComponent\"}},\"properties\":{\"description\":\"Key/value pairs that provide additional information about the tool.\",\"$ref\":\"#/definitions/propertyBag\"}},\"required\":[\"driver\"]},\"toolComponent\":{\"description\":\"A component, such as a plug-in or the driver, of the analysis tool that was run.\",\"additionalProperties\":false,\"type\":\"object\",\"properties\":{\"guid\":{\"description\":\"A unique identifer for the tool component in the form of a GUID.\",\"type\":\"string\",\"pattern\":\"^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$\"},\"name\":{\"description\":\"The name of the tool component.\",\"type\":\"string\"},\"organization\":{\"description\":\"The organization or company that produced the tool component.\",\"type\":\"string\"},\"product\":{\"description\":\"A product suite to which the tool component belongs.\",\"type\":\"string\"},\"productSuite\":{\"description\":\"A localizable string containing the name of the suite of products to which the tool component belongs.\",\"type\":\"string\"},\"shortDescription\":{\"description\":\"A brief description of the tool component.\",\"$ref\":\"#/definitions/multiformatMessageString\"},\"fullDescription\":{\"description\":\"A comprehensive description of the tool component.\",\"$ref\":\"#/definitions/multiformatMessageString\"},\"fullName\":{\"description\":\"The name of the tool component along with its version and any other useful identifying information, such as its locale.\",\"type\":\"string\"},\"version\":{\"description\":\"The tool component version, in whatever format the component natively provides.\",\"type\":\"string\"},\"semanticVersion\":{\"description\":\"The tool component version in the format specified by Semantic Versioning 2.0.\",\"type\":\"string\"},\"dottedQuadFileVersion\":{\"description\":\"The binary version of the tool component's primary executable file expressed as four non-negative integers separated by a period (for operating systems that express file versions in this way).\",\"type\":\"string\",\"pattern\":\"[0-9]+(\\\\.[0-9]+){3}\"},\"releaseDateUtc\":{\"description\":\"A string specifying the UTC date (and optionally, the time) of the component's release.\",\"type\":\"string\"},\"downloadUri\":{\"description\":\"The absolute URI from which the tool component can be downloaded.\",\"type\":\"string\",\"format\":\"uri\"},\"informationUri\":{\"description\":\"The absolute URI at which information about this version of the tool component can be found.\",\"type\":\"string\",\"format\":\"uri\"},\"globalMessageStrings\":{\"description\":\"A dictionary, each of whose keys is a resource identifier and each of whose values is a multiformatMessageString object, which holds message strings in plain text and (optionally) Markdown format. The strings can include placeholders, which can be used to construct a message in combination with an arbitrary number of additional string arguments.\",\"type\":\"object\",\"additionalProperties\":{\"$ref\":\"#/definitions/multiformatMessageString\"}},\"notifications\":{\"description\":\"An array of reportingDescriptor objects relevant to the notifications related to the configuration and runtime execution of the tool component.\",\"type\":\"array\",\"minItems\":0,\"uniqueItems\":true,\"default\":[],\"items\":{\"$ref\":\"#/definitions/reportingDescriptor\"}},\"rules\":{\"description\":\"An array of reportingDescriptor objects relevant to the analysis performed by the tool component.\",\"type\":\"array\",\"minItems\":0,\"uniqueItems\":true,\"default\":[],\"items\":{\"$ref\":\"#/definitions/reportingDescriptor\"}},\"taxa\":{\"description\":\"An array of reportingDescriptor objects relevant to the definitions of both standalone and tool-defined taxonomies.\",\"type\":\"array\",\"minItems\":0,\"uniqueItems\":true,\"default\":[],\"items\":{\"$ref\":\"#/definitions/reportingDescriptor\"}},\"locations\":{\"description\":\"An array of the artifactLocation objects associated with the tool component.\",\"type\":\"array\",\"minItems\":0,\"default\":[],\"items\":{\"$ref\":\"#/definitions/artifactLocation\"}},\"language\":{\"description\":\"The language of the messages emitted into the log file during this run (expressed as an ISO 639-1 two-letter lowercase language code) and an optional region (expressed as an ISO 3166-1 two-letter uppercase subculture code associated with a country or region). The casing is recommended but not required (in order for this data to conform to RFC5646).\",\"type\":\"string\",\"default\":\"en-US\",\"pattern\":\"^[a-zA-Z]{2}|^[a-zA-Z]{2}-[a-zA-Z]{2}]?$\"},\"contents\":{\"description\":\"The kinds of data contained in this object.\",\"type\":\"array\",\"uniqueItems\":true,\"default\":[\"localizedData\",\"nonLocalizedData\"],\"items\":{\"enum\":[\"localizedData\",\"nonLocalizedData\"]}},\"isComprehensive\":{\"description\":\"Specifies whether this object contains a complete definition of the localizable and/or non-localizable data for this component, as opposed to including only data that is relevant to the results persisted to this log file.\",\"type\":\"boolean\",\"default\":false},\"localizedDataSemanticVersion\":{\"description\":\"The semantic version of the localized strings defined in this component; maintained by components that provide translations.\",\"type\":\"string\"},\"minimumRequiredLocalizedDataSemanticVersion\":{\"description\":\"The minimum value of localizedDataSemanticVersion required in translations consumed by this component; used by components that consume translations.\",\"type\":\"string\"},\"associatedComponent\":{\"description\":\"The component which is strongly associated with this component. For a translation, this refers to the component which has been translated. For an extension, this is the driver that provides the extension's plugin model.\",\"$ref\":\"#/definitions/toolComponentReference\"},\"translationMetadata\":{\"description\":\"Translation metadata, required for a translation, not populated by other component types.\",\"$ref\":\"#/definitions/translationMetadata\"},\"supportedTaxonomies\":{\"description\":\"An array of toolComponentReference objects to declare the taxonomies supported by the tool component.\",\"type\":\"array\",\"minItems\":0,\"uniqueItems\":true,\"default\":[],\"items\":{\"$ref\":\"#/definitions/toolComponentReference\"}},\"properties\":{\"description\":\"Key/value pairs that provide additional information about the tool component.\",\"$ref\":\"#/definitions/propertyBag\"}},\"required\":[\"name\"]},\"toolComponentReference\":{\"description\":\"Identifies a particular toolComponent object, either the driver or an extension.\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"name\":{\"description\":\"The 'name' property of the referenced toolComponent.\",\"type\":\"string\"},\"index\":{\"description\":\"An index into the referenced toolComponent in tool.extensions.\",\"type\":\"integer\",\"default\":-1,\"minimum\":-1},\"guid\":{\"description\":\"The 'guid' property of the referenced toolComponent.\",\"type\":\"string\",\"pattern\":\"^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$\"},\"properties\":{\"description\":\"Key/value pairs that provide additional information about the toolComponentReference.\",\"$ref\":\"#/definitions/propertyBag\"}}},\"translationMetadata\":{\"description\":\"Provides additional metadata related to translation.\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"name\":{\"description\":\"The name associated with the translation metadata.\",\"type\":\"string\"},\"fullName\":{\"description\":\"The full name associated with the translation metadata.\",\"type\":\"string\"},\"shortDescription\":{\"description\":\"A brief description of the translation metadata.\",\"$ref\":\"#/definitions/multiformatMessageString\"},\"fullDescription\":{\"description\":\"A comprehensive description of the translation metadata.\",\"$ref\":\"#/definitions/multiformatMessageString\"},\"downloadUri\":{\"description\":\"The absolute URI from which the translation metadata can be downloaded.\",\"type\":\"string\",\"format\":\"uri\"},\"informationUri\":{\"description\":\"The absolute URI from which information related to the translation metadata can be downloaded.\",\"type\":\"string\",\"format\":\"uri\"},\"properties\":{\"description\":\"Key/value pairs that provide additional information about the translation metadata.\",\"$ref\":\"#/definitions/propertyBag\"}},\"required\":[\"name\"]},\"versionControlDetails\":{\"description\":\"Specifies the information necessary to retrieve a desired revision from a version control system.\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"repositoryUri\":{\"description\":\"The absolute URI of the repository.\",\"type\":\"string\",\"format\":\"uri\"},\"revisionId\":{\"description\":\"A string that uniquely and permanently identifies the revision within the repository.\",\"type\":\"string\"},\"branch\":{\"description\":\"The name of a branch containing the revision.\",\"type\":\"string\"},\"revisionTag\":{\"description\":\"A tag that has been applied to the revision.\",\"type\":\"string\"},\"asOfTimeUtc\":{\"description\":\"A Coordinated Universal Time (UTC) date and time that can be used to synchronize an enlistment to the state of the repository at that time.\",\"type\":\"string\",\"format\":\"date-time\"},\"mappedTo\":{\"description\":\"The location in the local file system to which the root of the repository was mapped at the time of the analysis.\",\"$ref\":\"#/definitions/artifactLocation\"},\"properties\":{\"description\":\"Key/value pairs that provide additional information about the version control details.\",\"$ref\":\"#/definitions/propertyBag\"}},\"required\":[\"repositoryUri\"]},\"webRequest\":{\"description\":\"Describes an HTTP request.\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"index\":{\"description\":\"The index within the run.webRequests array of the request object associated with this result.\",\"type\":\"integer\",\"default\":-1,\"minimum\":-1},\"protocol\":{\"description\":\"The request protocol. Example: 'http'.\",\"type\":\"string\"},\"version\":{\"description\":\"The request version. Example: '1.1'.\",\"type\":\"string\"},\"target\":{\"description\":\"The target of the request.\",\"type\":\"string\"},\"method\":{\"description\":\"The HTTP method. Well-known values are 'GET', 'PUT', 'POST', 'DELETE', 'PATCH', 'HEAD', 'OPTIONS', 'TRACE', 'CONNECT'.\",\"type\":\"string\"},\"headers\":{\"description\":\"The request headers.\",\"type\":\"object\",\"additionalProperties\":{\"type\":\"string\"}},\"parameters\":{\"description\":\"The request parameters.\",\"type\":\"object\",\"additionalProperties\":{\"type\":\"string\"}},\"body\":{\"description\":\"The body of the request.\",\"$ref\":\"#/definitions/artifactContent\"},\"properties\":{\"description\":\"Key/value pairs that provide additional information about the request.\",\"$ref\":\"#/definitions/propertyBag\"}}},\"webResponse\":{\"description\":\"Describes the response to an HTTP request.\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"index\":{\"description\":\"The index within the run.webResponses array of the response object associated with this result.\",\"type\":\"integer\",\"default\":-1,\"minimum\":-1},\"protocol\":{\"description\":\"The response protocol. Example: 'http'.\",\"type\":\"string\"},\"version\":{\"description\":\"The response version. Example: '1.1'.\",\"type\":\"string\"},\"statusCode\":{\"description\":\"The response status code. Example: 451.\",\"type\":\"integer\"},\"reasonPhrase\":{\"description\":\"The response reason. Example: 'Not found'.\",\"type\":\"string\"},\"headers\":{\"description\":\"The response headers.\",\"type\":\"object\",\"additionalProperties\":{\"type\":\"string\"}},\"body\":{\"description\":\"The body of the response.\",\"$ref\":\"#/definitions/artifactContent\"},\"noResponseReceived\":{\"description\":\"Specifies whether a response was received from the server.\",\"type\":\"boolean\",\"default\":false},\"properties\":{\"description\":\"Key/value pairs that provide additional information about the response.\",\"$ref\":\"#/definitions/propertyBag\"}}}}}"); /***/ }), /***/ 2357: /***/ ((module) => { "use strict"; module.exports = require("assert"); /***/ }), /***/ 3129: /***/ ((module) => { "use strict"; module.exports = require("child_process"); /***/ }), /***/ 6417: /***/ ((module) => { "use strict"; module.exports = require("crypto"); /***/ }), /***/ 8614: /***/ ((module) => { "use strict"; module.exports = require("events"); /***/ }), /***/ 5747: /***/ ((module) => { "use strict"; module.exports = require("fs"); /***/ }), /***/ 8605: /***/ ((module) => { "use strict"; module.exports = require("http"); /***/ }), /***/ 7211: /***/ ((module) => { "use strict"; module.exports = require("https"); /***/ }), /***/ 1631: /***/ ((module) => { "use strict"; module.exports = require("net"); /***/ }), /***/ 2087: /***/ ((module) => { "use strict"; module.exports = require("os"); /***/ }), /***/ 5622: /***/ ((module) => { "use strict"; module.exports = require("path"); /***/ }), /***/ 2413: /***/ ((module) => { "use strict"; module.exports = require("stream"); /***/ }), /***/ 4016: /***/ ((module) => { "use strict"; module.exports = require("tls"); /***/ }), /***/ 8835: /***/ ((module) => { "use strict"; module.exports = require("url"); /***/ }), /***/ 1669: /***/ ((module) => { "use strict"; module.exports = require("util"); /***/ }), /***/ 8761: /***/ ((module) => { "use strict"; module.exports = require("zlib"); /***/ }) /******/ }); /************************************************************************/ /******/ // The module cache /******/ var __webpack_module_cache__ = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ // Check if module is in cache /******/ if(__webpack_module_cache__[moduleId]) { /******/ return __webpack_module_cache__[moduleId].exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = __webpack_module_cache__[moduleId] = { /******/ // no module.id needed /******/ // no module.loaded needed /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ var threw = true; /******/ try { /******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ threw = false; /******/ } finally { /******/ if(threw) delete __webpack_module_cache__[moduleId]; /******/ } /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /************************************************************************/ /******/ /* webpack/runtime/compat get default export */ /******/ (() => { /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = (module) => { /******/ var getter = module && module.__esModule ? /******/ () => module['default'] : /******/ () => module; /******/ __webpack_require__.d(getter, { a: getter }); /******/ return getter; /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/define property getters */ /******/ (() => { /******/ // define getter functions for harmony exports /******/ __webpack_require__.d = (exports, definition) => { /******/ for(var key in definition) { /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); /******/ } /******/ } /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/hasOwnProperty shorthand */ /******/ (() => { /******/ __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 }); /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/compat */ /******/ /******/ __webpack_require__.ab = __dirname + "/";/************************************************************************/ /******/ // module exports must be returned from runtime so entry inlining is disabled /******/ // startup /******/ // Load entry module and return exports /******/ return __webpack_require__(7465); /******/ })() ;