diff --git a/lib/analyze-action.js b/lib/analyze-action.js index 39ba407e7..9294a0560 100644 --- a/lib/analyze-action.js +++ b/lib/analyze-action.js @@ -108,11 +108,11 @@ var require_command = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.issueCommand = issueCommand; exports2.issue = issue; - var os5 = __importStar2(require("os")); + var os4 = __importStar2(require("os")); var utils_1 = require_utils(); function issueCommand(command, properties, message) { const cmd = new Command(command, properties, message); - process.stdout.write(cmd.toString() + os5.EOL); + process.stdout.write(cmd.toString() + os4.EOL); } function issue(name, message = "") { issueCommand(name, {}, message); @@ -204,18 +204,18 @@ var require_file_command = __commonJS({ exports2.issueFileCommand = issueFileCommand; exports2.prepareKeyValueMessage = prepareKeyValueMessage; var crypto3 = __importStar2(require("crypto")); - var fs17 = __importStar2(require("fs")); - var os5 = __importStar2(require("os")); + var fs14 = __importStar2(require("fs")); + var os4 = __importStar2(require("os")); var utils_1 = require_utils(); function issueFileCommand(command, message) { const filePath = process.env[`GITHUB_${command}`]; if (!filePath) { throw new Error(`Unable to find environment variable for file command ${command}`); } - if (!fs17.existsSync(filePath)) { + if (!fs14.existsSync(filePath)) { throw new Error(`Missing file at path: ${filePath}`); } - fs17.appendFileSync(filePath, `${(0, utils_1.toCommandValue)(message)}${os5.EOL}`, { + fs14.appendFileSync(filePath, `${(0, utils_1.toCommandValue)(message)}${os4.EOL}`, { encoding: "utf8" }); } @@ -228,7 +228,7 @@ var require_file_command = __commonJS({ if (convertedValue.includes(delimiter)) { throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`); } - return `${key}<<${delimiter}${os5.EOL}${convertedValue}${os5.EOL}${delimiter}`; + return `${key}<<${delimiter}${os4.EOL}${convertedValue}${os4.EOL}${delimiter}`; } } }); @@ -1228,7 +1228,7 @@ var require_util = __commonJS({ var assert = require("node:assert"); var { kDestroyed, kBodyUsed, kListeners, kBody } = require_symbols(); var { IncomingMessage } = require("node:http"); - var stream2 = require("node:stream"); + var stream = require("node:stream"); var net = require("node:net"); var { Blob: Blob2 } = require("node:buffer"); var nodeUtil = require("node:util"); @@ -1337,14 +1337,14 @@ var require_util = __commonJS({ } const port = url2.port != null ? url2.port : url2.protocol === "https:" ? 443 : 80; let origin = url2.origin != null ? url2.origin : `${url2.protocol || ""}//${url2.hostname || ""}:${port}`; - let path16 = url2.path != null ? url2.path : `${url2.pathname || ""}${url2.search || ""}`; + let path13 = url2.path != null ? url2.path : `${url2.pathname || ""}${url2.search || ""}`; if (origin[origin.length - 1] === "/") { origin = origin.slice(0, origin.length - 1); } - if (path16 && path16[0] !== "/") { - path16 = `/${path16}`; + if (path13 && path13[0] !== "/") { + path13 = `/${path13}`; } - return new URL(`${origin}${path16}`); + return new URL(`${origin}${path13}`); } if (!isHttpOrHttpsPrefixed(url2.origin || url2.protocol)) { throw new InvalidArgumentError("Invalid URL protocol: the URL must start with `http:` or `https:`."); @@ -1402,24 +1402,24 @@ var require_util = __commonJS({ return null; } function isDestroyed(body) { - return body && !!(body.destroyed || body[kDestroyed] || stream2.isDestroyed?.(body)); + return body && !!(body.destroyed || body[kDestroyed] || stream.isDestroyed?.(body)); } - function destroy(stream3, err) { - if (stream3 == null || !isStream(stream3) || isDestroyed(stream3)) { + function destroy(stream2, err) { + if (stream2 == null || !isStream(stream2) || isDestroyed(stream2)) { return; } - if (typeof stream3.destroy === "function") { - if (Object.getPrototypeOf(stream3).constructor === IncomingMessage) { - stream3.socket = null; + if (typeof stream2.destroy === "function") { + if (Object.getPrototypeOf(stream2).constructor === IncomingMessage) { + stream2.socket = null; } - stream3.destroy(err); + stream2.destroy(err); } else if (err) { queueMicrotask(() => { - stream3.emit("error", err); + stream2.emit("error", err); }); } - if (stream3.destroyed !== true) { - stream3[kDestroyed] = true; + if (stream2.destroyed !== true) { + stream2[kDestroyed] = true; } } var KEEPALIVE_TIMEOUT_EXPR = /timeout=(\d+)/; @@ -1518,13 +1518,13 @@ var require_util = __commonJS({ } } function isDisturbed(body) { - return !!(body && (stream2.isDisturbed(body) || body[kBodyUsed])); + return !!(body && (stream.isDisturbed(body) || body[kBodyUsed])); } function isErrored(body) { - return !!(body && stream2.isErrored(body)); + return !!(body && stream.isErrored(body)); } function isReadable(body) { - return !!(body && stream2.isReadable(body)); + return !!(body && stream.isReadable(body)); } function getSocketInfo(socket) { return { @@ -1795,39 +1795,39 @@ var require_diagnostics = __commonJS({ }); diagnosticsChannel.channel("undici:client:sendHeaders").subscribe((evt) => { const { - request: { method, path: path16, origin } + request: { method, path: path13, origin } } = evt; - debuglog("sending request to %s %s/%s", method, origin, path16); + debuglog("sending request to %s %s/%s", method, origin, path13); }); diagnosticsChannel.channel("undici:request:headers").subscribe((evt) => { const { - request: { method, path: path16, origin }, + request: { method, path: path13, origin }, response: { statusCode } } = evt; debuglog( "received response to %s %s/%s - HTTP %d", method, origin, - path16, + path13, statusCode ); }); diagnosticsChannel.channel("undici:request:trailers").subscribe((evt) => { const { - request: { method, path: path16, origin } + request: { method, path: path13, origin } } = evt; - debuglog("trailers received from %s %s/%s", method, origin, path16); + debuglog("trailers received from %s %s/%s", method, origin, path13); }); diagnosticsChannel.channel("undici:request:error").subscribe((evt) => { const { - request: { method, path: path16, origin }, + request: { method, path: path13, origin }, error: error3 } = evt; debuglog( "request to %s %s/%s errored - %s", method, origin, - path16, + path13, error3.message ); }); @@ -1876,9 +1876,9 @@ var require_diagnostics = __commonJS({ }); diagnosticsChannel.channel("undici:client:sendHeaders").subscribe((evt) => { const { - request: { method, path: path16, origin } + request: { method, path: path13, origin } } = evt; - debuglog("sending request to %s %s/%s", method, origin, path16); + debuglog("sending request to %s %s/%s", method, origin, path13); }); } diagnosticsChannel.channel("undici:websocket:open").subscribe((evt) => { @@ -1941,7 +1941,7 @@ var require_request = __commonJS({ var kHandler = /* @__PURE__ */ Symbol("handler"); var Request = class { constructor(origin, { - path: path16, + path: path13, method, body, headers, @@ -1956,11 +1956,11 @@ var require_request = __commonJS({ expectContinue, servername }, handler2) { - if (typeof path16 !== "string") { + if (typeof path13 !== "string") { throw new InvalidArgumentError("path must be a string"); - } else if (path16[0] !== "/" && !(path16.startsWith("http://") || path16.startsWith("https://")) && method !== "CONNECT") { + } else if (path13[0] !== "/" && !(path13.startsWith("http://") || path13.startsWith("https://")) && method !== "CONNECT") { throw new InvalidArgumentError("path must be an absolute URL or start with a slash"); - } else if (invalidPathRegex.test(path16)) { + } else if (invalidPathRegex.test(path13)) { throw new InvalidArgumentError("invalid request path"); } if (typeof method !== "string") { @@ -2023,7 +2023,7 @@ var require_request = __commonJS({ this.completed = false; this.aborted = false; this.upgrade = upgrade || null; - this.path = query ? buildURL(path16, query) : path16; + this.path = query ? buildURL(path13, query) : path13; this.origin = origin; this.idempotent = idempotent == null ? method === "HEAD" || method === "GET" : idempotent; this.blocking = blocking == null ? false : blocking; @@ -2335,9 +2335,9 @@ var require_dispatcher_base = __commonJS({ } close(callback) { if (callback === void 0) { - return new Promise((resolve8, reject) => { + return new Promise((resolve7, reject) => { this.close((err, data) => { - return err ? reject(err) : resolve8(data); + return err ? reject(err) : resolve7(data); }); }); } @@ -2375,12 +2375,12 @@ var require_dispatcher_base = __commonJS({ err = null; } if (callback === void 0) { - return new Promise((resolve8, reject) => { + return new Promise((resolve7, reject) => { this.destroy(err, (err2, data) => { return err2 ? ( /* istanbul ignore next: should never error */ reject(err2) - ) : resolve8(data); + ) : resolve7(data); }); }); } @@ -4256,7 +4256,7 @@ var require_util2 = __commonJS({ var { redirectStatusSet, referrerPolicySet: referrerPolicyTokens, badPortsSet } = require_constants3(); var { getGlobalOrigin } = require_global(); var { collectASequenceOfCodePoints, collectAnHTTPQuotedString, removeChars, parseMIMEType } = require_data_url(); - var { performance: performance5 } = require("node:perf_hooks"); + var { performance: performance4 } = require("node:perf_hooks"); var { isBlobLike, ReadableStreamFrom, isValidHTTPToken, normalizedMethodRecordsBase } = require_util(); var assert = require("node:assert"); var { isUint8Array } = require("node:util/types"); @@ -4415,7 +4415,7 @@ var require_util2 = __commonJS({ }; } function coarsenedSharedCurrentTime(crossOriginIsolatedCapability) { - return coarsenTime(performance5.now(), crossOriginIsolatedCapability); + return coarsenTime(performance4.now(), crossOriginIsolatedCapability); } function createOpaqueTimingInfo(timingInfo) { return { @@ -4647,8 +4647,8 @@ var require_util2 = __commonJS({ function createDeferredPromise() { let res; let rej; - const promise = new Promise((resolve8, reject) => { - res = resolve8; + const promise = new Promise((resolve7, reject) => { + res = resolve7; rej = reject; }); return { promise, resolve: res, reject: rej }; @@ -4813,8 +4813,8 @@ var require_util2 = __commonJS({ errorSteps(e); } } - function isReadableStreamLike(stream2) { - return stream2 instanceof ReadableStream || stream2[Symbol.toStringTag] === "ReadableStream" && typeof stream2.tee === "function"; + function isReadableStreamLike(stream) { + return stream instanceof ReadableStream || stream[Symbol.toStringTag] === "ReadableStream" && typeof stream.tee === "function"; } function readableStreamClose(controller) { try { @@ -5630,20 +5630,20 @@ var require_body = __commonJS({ var streamRegistry; if (hasFinalizationRegistry) { streamRegistry = new FinalizationRegistry((weakRef) => { - const stream2 = weakRef.deref(); - if (stream2 && !stream2.locked && !isDisturbed(stream2) && !isErrored(stream2)) { - stream2.cancel("Response object has been garbage collected").catch(noop3); + const stream = weakRef.deref(); + if (stream && !stream.locked && !isDisturbed(stream) && !isErrored(stream)) { + stream.cancel("Response object has been garbage collected").catch(noop3); } }); } function extractBody(object, keepalive = false) { - let stream2 = null; + let stream = null; if (object instanceof ReadableStream) { - stream2 = object; + stream = object; } else if (isBlobLike(object)) { - stream2 = object.stream(); + stream = object.stream(); } else { - stream2 = new ReadableStream({ + stream = new ReadableStream({ async pull(controller) { const buffer = typeof source === "string" ? textEncoder.encode(source) : source; if (buffer.byteLength) { @@ -5656,7 +5656,7 @@ var require_body = __commonJS({ type: "bytes" }); } - assert(isReadableStreamLike(stream2)); + assert(isReadableStreamLike(stream)); let action = null; let source = null; let length = null; @@ -5735,14 +5735,14 @@ Content-Type: ${value.type || "application/octet-stream"}\r "Response body object should not be disturbed or locked" ); } - stream2 = object instanceof ReadableStream ? object : ReadableStreamFrom(object); + stream = object instanceof ReadableStream ? object : ReadableStreamFrom(object); } if (typeof source === "string" || util.isBuffer(source)) { length = Buffer.byteLength(source); } if (action != null) { let iterator2; - stream2 = new ReadableStream({ + stream = new ReadableStream({ async start() { iterator2 = action(object)[Symbol.asyncIterator](); }, @@ -5754,7 +5754,7 @@ Content-Type: ${value.type || "application/octet-stream"}\r controller.byobRequest?.respond(0); }); } else { - if (!isErrored(stream2)) { + if (!isErrored(stream)) { const buffer = new Uint8Array(value); if (buffer.byteLength) { controller.enqueue(buffer); @@ -5769,7 +5769,7 @@ Content-Type: ${value.type || "application/octet-stream"}\r type: "bytes" }); } - const body = { stream: stream2, source, length }; + const body = { stream, source, length }; return [body, type2]; } function safelyExtractBody(object, keepalive = false) { @@ -6536,7 +6536,7 @@ var require_client_h1 = __commonJS({ return method !== "GET" && method !== "HEAD" && method !== "OPTIONS" && method !== "TRACE" && method !== "CONNECT"; } function writeH1(client, request2) { - const { method, path: path16, host, upgrade, blocking, reset } = request2; + const { method, path: path13, host, upgrade, blocking, reset } = request2; let { body, headers, contentLength } = request2; const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH" || method === "QUERY" || method === "PROPFIND" || method === "PROPPATCH"; if (util.isFormDataLike(body)) { @@ -6602,7 +6602,7 @@ var require_client_h1 = __commonJS({ if (blocking) { socket[kBlocking] = true; } - let header = `${method} ${path16} HTTP/1.1\r + let header = `${method} ${path13} HTTP/1.1\r `; if (typeof host === "string") { header += `host: ${host}\r @@ -6789,12 +6789,12 @@ upgrade: ${upgrade}\r cb(); } } - const waitForDrain = () => new Promise((resolve8, reject) => { + const waitForDrain = () => new Promise((resolve7, reject) => { assert(callback === null); if (socket[kError]) { reject(socket[kError]); } else { - callback = resolve8; + callback = resolve7; } }); socket.on("close", onDrain).on("drain", onDrain); @@ -7128,7 +7128,7 @@ var require_client_h2 = __commonJS({ } function writeH2(client, request2) { const session = client[kHTTP2Session]; - const { method, path: path16, host, upgrade, expectContinue, signal, headers: reqHeaders } = request2; + const { method, path: path13, host, upgrade, expectContinue, signal, headers: reqHeaders } = request2; let { body } = request2; if (upgrade) { util.errorRequest(client, request2, new Error("Upgrade not supported for H2")); @@ -7150,7 +7150,7 @@ var require_client_h2 = __commonJS({ headers[key] = val; } } - let stream2; + let stream; const { hostname, port } = client[kUrl]; headers[HTTP2_HEADER_AUTHORITY] = host || `${hostname}${port ? `:${port}` : ""}`; headers[HTTP2_HEADER_METHOD] = method; @@ -7160,8 +7160,8 @@ var require_client_h2 = __commonJS({ } err = err || new RequestAbortedError(); util.errorRequest(client, request2, err); - if (stream2 != null) { - util.destroy(stream2, err); + if (stream != null) { + util.destroy(stream, err); } util.destroy(body, err); client[kQueue][client[kRunningIdx]++] = null; @@ -7177,25 +7177,25 @@ var require_client_h2 = __commonJS({ } if (method === "CONNECT") { session.ref(); - stream2 = session.request(headers, { endStream: false, signal }); - if (stream2.id && !stream2.pending) { - request2.onUpgrade(null, null, stream2); + stream = session.request(headers, { endStream: false, signal }); + if (stream.id && !stream.pending) { + request2.onUpgrade(null, null, stream); ++session[kOpenStreams]; client[kQueue][client[kRunningIdx]++] = null; } else { - stream2.once("ready", () => { - request2.onUpgrade(null, null, stream2); + stream.once("ready", () => { + request2.onUpgrade(null, null, stream); ++session[kOpenStreams]; client[kQueue][client[kRunningIdx]++] = null; }); } - stream2.once("close", () => { + stream.once("close", () => { session[kOpenStreams] -= 1; if (session[kOpenStreams] === 0) session.unref(); }); return true; } - headers[HTTP2_HEADER_PATH] = path16; + headers[HTTP2_HEADER_PATH] = path13; headers[HTTP2_HEADER_SCHEME] = "https"; const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH"; if (body && typeof body.read === "function") { @@ -7230,36 +7230,36 @@ var require_client_h2 = __commonJS({ const shouldEndStream = method === "GET" || method === "HEAD" || body === null; if (expectContinue) { headers[HTTP2_HEADER_EXPECT] = "100-continue"; - stream2 = session.request(headers, { endStream: shouldEndStream, signal }); - stream2.once("continue", writeBodyH2); + stream = session.request(headers, { endStream: shouldEndStream, signal }); + stream.once("continue", writeBodyH2); } else { - stream2 = session.request(headers, { + stream = session.request(headers, { endStream: shouldEndStream, signal }); writeBodyH2(); } ++session[kOpenStreams]; - stream2.once("response", (headers2) => { + stream.once("response", (headers2) => { const { [HTTP2_HEADER_STATUS]: statusCode, ...realHeaders } = headers2; request2.onResponseStarted(); if (request2.aborted) { const err = new RequestAbortedError(); util.errorRequest(client, request2, err); - util.destroy(stream2, err); + util.destroy(stream, err); return; } - if (request2.onHeaders(Number(statusCode), parseH2Headers(realHeaders), stream2.resume.bind(stream2), "") === false) { - stream2.pause(); + if (request2.onHeaders(Number(statusCode), parseH2Headers(realHeaders), stream.resume.bind(stream), "") === false) { + stream.pause(); } - stream2.on("data", (chunk) => { + stream.on("data", (chunk) => { if (request2.onData(chunk) === false) { - stream2.pause(); + stream.pause(); } }); }); - stream2.once("end", () => { - if (stream2.state?.state == null || stream2.state.state < 6) { + stream.once("end", () => { + if (stream.state?.state == null || stream.state.state < 6) { request2.onComplete([]); } if (session[kOpenStreams] === 0) { @@ -7270,16 +7270,16 @@ var require_client_h2 = __commonJS({ client[kPendingIdx] = client[kRunningIdx]; client[kResume](); }); - stream2.once("close", () => { + stream.once("close", () => { session[kOpenStreams] -= 1; if (session[kOpenStreams] === 0) { session.unref(); } }); - stream2.once("error", function(err) { + stream.once("error", function(err) { abort(err); }); - stream2.once("frameError", (type2, code) => { + stream.once("frameError", (type2, code) => { abort(new InformationalError(`HTTP/2: "frameError" received - type ${type2}, code ${code}`)); }); return true; @@ -7287,7 +7287,7 @@ var require_client_h2 = __commonJS({ if (!body || contentLength === 0) { writeBuffer( abort, - stream2, + stream, null, client, request2, @@ -7298,7 +7298,7 @@ var require_client_h2 = __commonJS({ } else if (util.isBuffer(body)) { writeBuffer( abort, - stream2, + stream, body, client, request2, @@ -7310,7 +7310,7 @@ var require_client_h2 = __commonJS({ if (typeof body.stream === "function") { writeIterable( abort, - stream2, + stream, body.stream(), client, request2, @@ -7321,7 +7321,7 @@ var require_client_h2 = __commonJS({ } else { writeBlob( abort, - stream2, + stream, body, client, request2, @@ -7335,7 +7335,7 @@ var require_client_h2 = __commonJS({ abort, client[kSocket], expectsPayload, - stream2, + stream, body, client, request2, @@ -7344,7 +7344,7 @@ var require_client_h2 = __commonJS({ } else if (util.isIterable(body)) { writeIterable( abort, - stream2, + stream, body, client, request2, @@ -7431,12 +7431,12 @@ var require_client_h2 = __commonJS({ cb(); } } - const waitForDrain = () => new Promise((resolve8, reject) => { + const waitForDrain = () => new Promise((resolve7, reject) => { assert(callback === null); if (socket[kError]) { reject(socket[kError]); } else { - callback = resolve8; + callback = resolve7; } }); h2stream.on("close", onDrain).on("drain", onDrain); @@ -7548,9 +7548,9 @@ var require_redirect_handler = __commonJS({ return this.handler.onHeaders(statusCode, headers, resume, statusText); } const { origin, pathname, search } = util.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin))); - const path16 = search ? `${pathname}${search}` : pathname; + const path13 = search ? `${pathname}${search}` : pathname; this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin); - this.opts.path = path16; + this.opts.path = path13; this.opts.origin = origin; this.opts.maxRedirections = 0; this.opts.query = null; @@ -7913,16 +7913,16 @@ var require_client = __commonJS({ return this[kNeedDrain] < 2; } async [kClose]() { - return new Promise((resolve8) => { + return new Promise((resolve7) => { if (this[kSize]) { - this[kClosedResolve] = resolve8; + this[kClosedResolve] = resolve7; } else { - resolve8(null); + resolve7(null); } }); } async [kDestroy](err) { - return new Promise((resolve8) => { + return new Promise((resolve7) => { const requests = this[kQueue].splice(this[kPendingIdx]); for (let i = 0; i < requests.length; i++) { const request2 = requests[i]; @@ -7933,7 +7933,7 @@ var require_client = __commonJS({ this[kClosedResolve](); this[kClosedResolve] = null; } - resolve8(null); + resolve7(null); }; if (this[kHTTPContext]) { this[kHTTPContext].destroy(err, callback); @@ -7984,7 +7984,7 @@ var require_client = __commonJS({ }); } try { - const socket = await new Promise((resolve8, reject) => { + const socket = await new Promise((resolve7, reject) => { client[kConnector]({ host, hostname, @@ -7996,7 +7996,7 @@ var require_client = __commonJS({ if (err) { reject(err); } else { - resolve8(socket2); + resolve7(socket2); } }); }); @@ -8332,8 +8332,8 @@ var require_pool_base = __commonJS({ if (this[kQueue].isEmpty()) { await Promise.all(this[kClients].map((c) => c.close())); } else { - await new Promise((resolve8) => { - this[kClosedResolve] = resolve8; + await new Promise((resolve7) => { + this[kClosedResolve] = resolve7; }); } } @@ -8784,10 +8784,10 @@ var require_proxy_agent = __commonJS({ }; const { origin, - path: path16 = "/", + path: path13 = "/", headers = {} } = opts; - opts.path = origin + path16; + opts.path = origin + path13; if (!("host" in headers) && !("Host" in headers)) { const { host } = new URL2(origin); headers.host = host; @@ -9421,7 +9421,7 @@ var require_readable = __commonJS({ "node_modules/@actions/http-client/node_modules/undici/lib/api/readable.js"(exports2, module2) { "use strict"; var assert = require("node:assert"); - var { Readable: Readable2 } = require("node:stream"); + var { Readable } = require("node:stream"); var { RequestAbortedError, NotSupportedError, InvalidArgumentError, AbortError } = require_errors(); var util = require_util(); var { ReadableStreamFrom } = require_util(); @@ -9433,7 +9433,7 @@ var require_readable = __commonJS({ var kContentLength = /* @__PURE__ */ Symbol("kContentLength"); var noop3 = () => { }; - var BodyReadable = class extends Readable2 { + var BodyReadable = class extends Readable { constructor({ resume, abort, @@ -9548,7 +9548,7 @@ var require_readable = __commonJS({ if (this._readableState.closeEmitted) { return null; } - return await new Promise((resolve8, reject) => { + return await new Promise((resolve7, reject) => { if (this[kContentLength] > limit) { this.destroy(new AbortError()); } @@ -9561,7 +9561,7 @@ var require_readable = __commonJS({ if (signal?.aborted) { reject(signal.reason ?? new AbortError()); } else { - resolve8(null); + resolve7(null); } }).on("error", noop3).on("data", function(chunk) { limit -= chunk.length; @@ -9578,13 +9578,13 @@ var require_readable = __commonJS({ function isUnusable(self2) { return util.isDisturbed(self2) || isLocked(self2); } - async function consume(stream2, type2) { - assert(!stream2[kConsume]); - return new Promise((resolve8, reject) => { - if (isUnusable(stream2)) { - const rState = stream2._readableState; + async function consume(stream, type2) { + assert(!stream[kConsume]); + return new Promise((resolve7, reject) => { + if (isUnusable(stream)) { + const rState = stream._readableState; if (rState.destroyed && rState.closeEmitted === false) { - stream2.on("error", (err) => { + stream.on("error", (err) => { reject(err); }).on("close", () => { reject(new TypeError("unusable")); @@ -9594,22 +9594,22 @@ var require_readable = __commonJS({ } } else { queueMicrotask(() => { - stream2[kConsume] = { + stream[kConsume] = { type: type2, - stream: stream2, - resolve: resolve8, + stream, + resolve: resolve7, reject, length: 0, body: [] }; - stream2.on("error", function(err) { + stream.on("error", function(err) { consumeFinish(this[kConsume], err); }).on("close", function() { if (this[kConsume].body !== null) { consumeFinish(this[kConsume], new RequestAbortedError()); } }); - consumeStart(stream2[kConsume]); + consumeStart(stream[kConsume]); }); } }); @@ -9667,22 +9667,22 @@ var require_readable = __commonJS({ return buffer; } function consumeEnd(consume2) { - const { type: type2, body, resolve: resolve8, stream: stream2, length } = consume2; + const { type: type2, body, resolve: resolve7, stream, length } = consume2; try { if (type2 === "text") { - resolve8(chunksDecode(body, length)); + resolve7(chunksDecode(body, length)); } else if (type2 === "json") { - resolve8(JSON.parse(chunksDecode(body, length))); + resolve7(JSON.parse(chunksDecode(body, length))); } else if (type2 === "arrayBuffer") { - resolve8(chunksConcat(body, length).buffer); + resolve7(chunksConcat(body, length).buffer); } else if (type2 === "blob") { - resolve8(new Blob(body, { type: stream2[kContentType] })); + resolve7(new Blob(body, { type: stream[kContentType] })); } else if (type2 === "bytes") { - resolve8(chunksConcat(body, length)); + resolve7(chunksConcat(body, length)); } consumeFinish(consume2); } catch (err) { - stream2.destroy(err); + stream.destroy(err); } } function consumePush(consume2, chunk) { @@ -9775,7 +9775,7 @@ var require_api_request = __commonJS({ "node_modules/@actions/http-client/node_modules/undici/lib/api/api-request.js"(exports2, module2) { "use strict"; var assert = require("node:assert"); - var { Readable: Readable2 } = require_readable(); + var { Readable } = require_readable(); var { InvalidArgumentError, RequestAbortedError } = require_errors(); var util = require_util(); var { getResolveErrorBodyCallback } = require_util3(); @@ -9870,7 +9870,7 @@ var require_api_request = __commonJS({ const parsedHeaders = responseHeaders === "raw" ? util.parseHeaders(rawHeaders) : headers; const contentType = parsedHeaders["content-type"]; const contentLength = parsedHeaders["content-length"]; - const res = new Readable2({ + const res = new Readable({ resume, abort, contentType, @@ -9935,9 +9935,9 @@ var require_api_request = __commonJS({ }; function request2(opts, callback) { if (callback === void 0) { - return new Promise((resolve8, reject) => { + return new Promise((resolve7, reject) => { request2.call(this, opts, (err, data) => { - return err ? reject(err) : resolve8(data); + return err ? reject(err) : resolve7(data); }); }); } @@ -10158,11 +10158,11 @@ var require_api_stream = __commonJS({ } } }; - function stream2(opts, factory, callback) { + function stream(opts, factory, callback) { if (callback === void 0) { - return new Promise((resolve8, reject) => { - stream2.call(this, opts, factory, (err, data) => { - return err ? reject(err) : resolve8(data); + return new Promise((resolve7, reject) => { + stream.call(this, opts, factory, (err, data) => { + return err ? reject(err) : resolve7(data); }); }); } @@ -10176,7 +10176,7 @@ var require_api_stream = __commonJS({ queueMicrotask(() => callback(err, { opaque })); } } - module2.exports = stream2; + module2.exports = stream; } }); @@ -10185,7 +10185,7 @@ var require_api_pipeline = __commonJS({ "node_modules/@actions/http-client/node_modules/undici/lib/api/api-pipeline.js"(exports2, module2) { "use strict"; var { - Readable: Readable2, + Readable, Duplex, PassThrough } = require("node:stream"); @@ -10199,7 +10199,7 @@ var require_api_pipeline = __commonJS({ var { addSignal, removeSignal } = require_abort_signal(); var assert = require("node:assert"); var kResume = /* @__PURE__ */ Symbol("resume"); - var PipelineRequest = class extends Readable2 { + var PipelineRequest = class extends Readable { constructor() { super({ autoDestroy: true }); this[kResume] = null; @@ -10216,7 +10216,7 @@ var require_api_pipeline = __commonJS({ callback(err); } }; - var PipelineResponse = class extends Readable2 { + var PipelineResponse = class extends Readable { constructor(resume) { super({ autoDestroy: true }); this[kResume] = resume; @@ -10447,9 +10447,9 @@ var require_api_upgrade = __commonJS({ }; function upgrade(opts, callback) { if (callback === void 0) { - return new Promise((resolve8, reject) => { + return new Promise((resolve7, reject) => { upgrade.call(this, opts, (err, data) => { - return err ? reject(err) : resolve8(data); + return err ? reject(err) : resolve7(data); }); }); } @@ -10541,9 +10541,9 @@ var require_api_connect = __commonJS({ }; function connect(opts, callback) { if (callback === void 0) { - return new Promise((resolve8, reject) => { + return new Promise((resolve7, reject) => { connect.call(this, opts, (err, data) => { - return err ? reject(err) : resolve8(data); + return err ? reject(err) : resolve7(data); }); }); } @@ -10708,20 +10708,20 @@ var require_mock_utils = __commonJS({ } return true; } - function safeUrl(path16) { - if (typeof path16 !== "string") { - return path16; + function safeUrl(path13) { + if (typeof path13 !== "string") { + return path13; } - const pathSegments = path16.split("?"); + const pathSegments = path13.split("?"); if (pathSegments.length !== 2) { - return path16; + return path13; } const qp = new URLSearchParams(pathSegments.pop()); qp.sort(); return [...pathSegments, qp.toString()].join("?"); } - function matchKey(mockDispatch2, { path: path16, method, body, headers }) { - const pathMatch = matchValue(mockDispatch2.path, path16); + function matchKey(mockDispatch2, { path: path13, method, body, headers }) { + const pathMatch = matchValue(mockDispatch2.path, path13); const methodMatch = matchValue(mockDispatch2.method, method); const bodyMatch = typeof mockDispatch2.body !== "undefined" ? matchValue(mockDispatch2.body, body) : true; const headersMatch = matchHeaders(mockDispatch2, headers); @@ -10743,7 +10743,7 @@ var require_mock_utils = __commonJS({ function getMockDispatch(mockDispatches, key) { const basePath = key.query ? buildURL(key.path, key.query) : key.path; const resolvedPath = typeof basePath === "string" ? safeUrl(basePath) : basePath; - let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path: path16 }) => matchValue(safeUrl(path16), resolvedPath)); + let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path: path13 }) => matchValue(safeUrl(path13), resolvedPath)); if (matchedMockDispatches.length === 0) { throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`); } @@ -10781,9 +10781,9 @@ var require_mock_utils = __commonJS({ } } function buildKey(opts) { - const { path: path16, method, body, headers, query } = opts; + const { path: path13, method, body, headers, query } = opts; return { - path: path16, + path: path13, method, body, headers, @@ -11246,10 +11246,10 @@ var require_pending_interceptors_formatter = __commonJS({ } format(pendingInterceptors) { const withPrettyHeaders = pendingInterceptors.map( - ({ method, path: path16, data: { statusCode }, persist, times, timesInvoked, origin }) => ({ + ({ method, path: path13, data: { statusCode }, persist, times, timesInvoked, origin }) => ({ Method: method, Origin: origin, - Path: path16, + Path: path13, "Status code": statusCode, Persistent: persist ? PERSISTENT : NOT_PERSISTENT, Invocations: timesInvoked, @@ -13541,7 +13541,7 @@ var require_fetch = __commonJS({ subresourceSet } = require_constants3(); var EE = require("node:events"); - var { Readable: Readable2, pipeline, finished } = require("node:stream"); + var { Readable, pipeline, finished } = require("node:stream"); var { addAbortListener, isErrored, isReadable, bufferToLowerCasedHeaderName } = require_util(); var { dataURLProcessor, serializeAMimeType, minimizeSupportedMimeType } = require_data_url(); var { getGlobalDispatcher } = require_global2(); @@ -14326,7 +14326,7 @@ var require_fetch = __commonJS({ fetchParams.controller.abort(reason); } }; - const stream2 = new ReadableStream( + const stream = new ReadableStream( { async start(controller) { fetchParams.controller.controller = controller; @@ -14340,7 +14340,7 @@ var require_fetch = __commonJS({ type: "bytes" } ); - response.body = { stream: stream2, source: null, length: null }; + response.body = { stream, source: null, length: null }; fetchParams.controller.onAborted = onAborted; fetchParams.controller.on("terminated", onAborted); fetchParams.controller.resume = async () => { @@ -14375,7 +14375,7 @@ var require_fetch = __commonJS({ if (buffer.byteLength) { fetchParams.controller.controller.enqueue(buffer); } - if (isErrored(stream2)) { + if (isErrored(stream)) { fetchParams.controller.terminate(); return; } @@ -14387,13 +14387,13 @@ var require_fetch = __commonJS({ function onAborted(reason) { if (isAborted(fetchParams)) { response.aborted = true; - if (isReadable(stream2)) { + if (isReadable(stream)) { fetchParams.controller.controller.error( fetchParams.controller.serializedAbortReason ); } } else { - if (isReadable(stream2)) { + if (isReadable(stream)) { fetchParams.controller.controller.error(new TypeError("terminated", { cause: isErrorLike(reason) ? reason : void 0 })); @@ -14405,7 +14405,7 @@ var require_fetch = __commonJS({ function dispatch({ body }) { const url2 = requestCurrentURL(request2); const agent = fetchParams.controller.dispatcher; - return new Promise((resolve8, reject) => agent.dispatch( + return new Promise((resolve7, reject) => agent.dispatch( { path: url2.pathname + url2.search, origin: url2.origin, @@ -14442,7 +14442,7 @@ var require_fetch = __commonJS({ headersList.append(bufferToLowerCasedHeaderName(rawHeaders[i]), rawHeaders[i + 1].toString("latin1"), true); } location = headersList.get("location", true); - this.body = new Readable2({ read: resume }); + this.body = new Readable({ read: resume }); const decoders = []; const willFollow = location && request2.redirect === "follow" && redirectStatusSet.has(status); if (request2.method !== "HEAD" && request2.method !== "CONNECT" && !nullBodyStatus.includes(status) && !willFollow) { @@ -14481,7 +14481,7 @@ var require_fetch = __commonJS({ } } const onError = this.onError.bind(this); - resolve8({ + resolve7({ status, statusText, headersList, @@ -14527,7 +14527,7 @@ var require_fetch = __commonJS({ for (let i = 0; i < rawHeaders.length; i += 2) { headersList.append(bufferToLowerCasedHeaderName(rawHeaders[i]), rawHeaders[i + 1].toString("latin1"), true); } - resolve8({ + resolve7({ status, statusText: STATUS_CODES[status], headersList, @@ -14946,8 +14946,8 @@ var require_util4 = __commonJS({ fr[kState] = "loading"; fr[kResult] = null; fr[kError] = null; - const stream2 = blob.stream(); - const reader = stream2.getReader(); + const stream = blob.stream(); + const reader = stream.getReader(); const bytes = []; let chunkPromise = reader.read(); let isFirstChunk = true; @@ -15606,8 +15606,8 @@ var require_cache = __commonJS({ const clonedResponse = cloneResponse(innerResponse); const bodyReadPromise = createDeferredPromise(); if (innerResponse.body != null) { - const stream2 = innerResponse.body.stream; - const reader = stream2.getReader(); + const stream = innerResponse.body.stream; + const reader = stream.getReader(); readAllBytes(reader).then(bodyReadPromise.resolve, bodyReadPromise.reject); } else { bodyReadPromise.resolve(void 0); @@ -16130,9 +16130,9 @@ var require_util6 = __commonJS({ } } } - function validateCookiePath(path16) { - for (let i = 0; i < path16.length; ++i) { - const code = path16.charCodeAt(i); + function validateCookiePath(path13) { + for (let i = 0; i < path13.length; ++i) { + const code = path13.charCodeAt(i); if (code < 32 || // exclude CTLs (0-31) code === 127 || // DEL code === 59) { @@ -17031,7 +17031,7 @@ var require_frame = __commonJS({ } catch { crypto3 = { // not full compatibility, but minimum. - randomFillSync: function randomFillSync2(buffer2, _offset, _size) { + randomFillSync: function randomFillSync(buffer2, _offset, _size) { for (let i = 0; i < buffer2.length; ++i) { buffer2[i] = Math.random() * 255 | 0; } @@ -18120,8 +18120,8 @@ var require_util8 = __commonJS({ return true; } function delay2(ms) { - return new Promise((resolve8) => { - setTimeout(resolve8, ms).unref(); + return new Promise((resolve7) => { + setTimeout(resolve7, ms).unref(); }); } module2.exports = { @@ -18726,11 +18726,11 @@ var require_undici = __commonJS({ if (typeof opts.path !== "string") { throw new InvalidArgumentError("invalid opts.path"); } - let path16 = opts.path; + let path13 = opts.path; if (!opts.path.startsWith("/")) { - path16 = `/${path16}`; + path13 = `/${path13}`; } - url2 = new URL(util.parseOrigin(url2).origin + path16); + url2 = new URL(util.parseOrigin(url2).origin + path13); } else { if (!opts) { opts = typeof url2 === "object" ? url2 : {}; @@ -18844,11 +18844,11 @@ var require_lib = __commonJS({ })(); var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { - return value instanceof P ? value : new P(function(resolve8) { - resolve8(value); + return value instanceof P ? value : new P(function(resolve7) { + resolve7(value); }); } - return new (P || (P = Promise))(function(resolve8, reject) { + return new (P || (P = Promise))(function(resolve7, reject) { function fulfilled(value) { try { step(generator.next(value)); @@ -18864,7 +18864,7 @@ var require_lib = __commonJS({ } } function step(result) { - result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); + result.done ? resolve7(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); @@ -18951,26 +18951,26 @@ var require_lib = __commonJS({ } readBody() { return __awaiter2(this, void 0, void 0, function* () { - return new Promise((resolve8) => __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve7) => __awaiter2(this, void 0, void 0, function* () { let output = Buffer.alloc(0); this.message.on("data", (chunk) => { output = Buffer.concat([output, chunk]); }); this.message.on("end", () => { - resolve8(output.toString()); + resolve7(output.toString()); }); })); }); } readBodyBuffer() { return __awaiter2(this, void 0, void 0, function* () { - return new Promise((resolve8) => __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve7) => __awaiter2(this, void 0, void 0, function* () { const chunks = []; this.message.on("data", (chunk) => { chunks.push(chunk); }); this.message.on("end", () => { - resolve8(Buffer.concat(chunks)); + resolve7(Buffer.concat(chunks)); }); })); }); @@ -19054,9 +19054,9 @@ var require_lib = __commonJS({ return this.request("HEAD", requestUrl, null, additionalHeaders || {}); }); } - sendStream(verb, requestUrl, stream2, additionalHeaders) { + sendStream(verb, requestUrl, stream, additionalHeaders) { return __awaiter2(this, void 0, void 0, function* () { - return this.request(verb, requestUrl, stream2, additionalHeaders); + return this.request(verb, requestUrl, stream, additionalHeaders); }); } /** @@ -19178,14 +19178,14 @@ var require_lib = __commonJS({ */ requestRaw(info6, data) { return __awaiter2(this, void 0, void 0, function* () { - return new Promise((resolve8, reject) => { + return new Promise((resolve7, reject) => { function callbackForResult(err, res) { if (err) { reject(err); } else if (!res) { reject(new Error("Unknown error")); } else { - resolve8(res); + resolve7(res); } } this.requestRawWithCallback(info6, data, callbackForResult); @@ -19429,12 +19429,12 @@ var require_lib = __commonJS({ return __awaiter2(this, void 0, void 0, function* () { retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); - return new Promise((resolve8) => setTimeout(() => resolve8(), ms)); + return new Promise((resolve7) => setTimeout(() => resolve7(), ms)); }); } _processResponse(res, options) { return __awaiter2(this, void 0, void 0, function* () { - return new Promise((resolve8, reject) => __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve7, reject) => __awaiter2(this, void 0, void 0, function* () { const statusCode = res.message.statusCode || 0; const response = { statusCode, @@ -19442,7 +19442,7 @@ var require_lib = __commonJS({ headers: {} }; if (statusCode === HttpCodes.NotFound) { - resolve8(response); + resolve7(response); } function dateTimeDeserializer(key, value) { if (typeof value === "string") { @@ -19481,7 +19481,7 @@ var require_lib = __commonJS({ err.result = response.result; reject(err); } else { - resolve8(response); + resolve7(response); } })); }); @@ -19498,11 +19498,11 @@ var require_auth = __commonJS({ "use strict"; var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { - return value instanceof P ? value : new P(function(resolve8) { - resolve8(value); + return value instanceof P ? value : new P(function(resolve7) { + resolve7(value); }); } - return new (P || (P = Promise))(function(resolve8, reject) { + return new (P || (P = Promise))(function(resolve7, reject) { function fulfilled(value) { try { step(generator.next(value)); @@ -19518,7 +19518,7 @@ var require_auth = __commonJS({ } } function step(result) { - result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); + result.done ? resolve7(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); @@ -19602,11 +19602,11 @@ var require_oidc_utils = __commonJS({ "use strict"; var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { - return value instanceof P ? value : new P(function(resolve8) { - resolve8(value); + return value instanceof P ? value : new P(function(resolve7) { + resolve7(value); }); } - return new (P || (P = Promise))(function(resolve8, reject) { + return new (P || (P = Promise))(function(resolve7, reject) { function fulfilled(value) { try { step(generator.next(value)); @@ -19622,7 +19622,7 @@ var require_oidc_utils = __commonJS({ } } function step(result) { - result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); + result.done ? resolve7(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); @@ -19700,11 +19700,11 @@ var require_summary = __commonJS({ "use strict"; var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { - return value instanceof P ? value : new P(function(resolve8) { - resolve8(value); + return value instanceof P ? value : new P(function(resolve7) { + resolve7(value); }); } - return new (P || (P = Promise))(function(resolve8, reject) { + return new (P || (P = Promise))(function(resolve7, reject) { function fulfilled(value) { try { step(generator.next(value)); @@ -19720,7 +19720,7 @@ var require_summary = __commonJS({ } } function step(result) { - result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); + result.done ? resolve7(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); @@ -20033,7 +20033,7 @@ var require_path_utils = __commonJS({ exports2.toPosixPath = toPosixPath; exports2.toWin32Path = toWin32Path; exports2.toPlatformPath = toPlatformPath; - var path16 = __importStar2(require("path")); + var path13 = __importStar2(require("path")); function toPosixPath(pth) { return pth.replace(/[\\]/g, "/"); } @@ -20041,7 +20041,7 @@ var require_path_utils = __commonJS({ return pth.replace(/[/]/g, "\\"); } function toPlatformPath(pth) { - return pth.replace(/[/\\]/g, path16.sep); + return pth.replace(/[/\\]/g, path13.sep); } } }); @@ -20089,11 +20089,11 @@ var require_io_util = __commonJS({ })(); var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { - return value instanceof P ? value : new P(function(resolve8) { - resolve8(value); + return value instanceof P ? value : new P(function(resolve7) { + resolve7(value); }); } - return new (P || (P = Promise))(function(resolve8, reject) { + return new (P || (P = Promise))(function(resolve7, reject) { function fulfilled(value) { try { step(generator.next(value)); @@ -20109,7 +20109,7 @@ var require_io_util = __commonJS({ } } function step(result) { - result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); + result.done ? resolve7(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); @@ -20123,13 +20123,13 @@ var require_io_util = __commonJS({ exports2.isRooted = isRooted; exports2.tryGetExecutablePath = tryGetExecutablePath; exports2.getCmdPath = getCmdPath; - var fs17 = __importStar2(require("fs")); - var path16 = __importStar2(require("path")); - _a = fs17.promises, exports2.chmod = _a.chmod, exports2.copyFile = _a.copyFile, exports2.lstat = _a.lstat, exports2.mkdir = _a.mkdir, exports2.open = _a.open, exports2.readdir = _a.readdir, exports2.rename = _a.rename, exports2.rm = _a.rm, exports2.rmdir = _a.rmdir, exports2.stat = _a.stat, exports2.symlink = _a.symlink, exports2.unlink = _a.unlink; + var fs14 = __importStar2(require("fs")); + var path13 = __importStar2(require("path")); + _a = fs14.promises, exports2.chmod = _a.chmod, exports2.copyFile = _a.copyFile, exports2.lstat = _a.lstat, exports2.mkdir = _a.mkdir, exports2.open = _a.open, exports2.readdir = _a.readdir, exports2.rename = _a.rename, exports2.rm = _a.rm, exports2.rmdir = _a.rmdir, exports2.stat = _a.stat, exports2.symlink = _a.symlink, exports2.unlink = _a.unlink; exports2.IS_WINDOWS = process.platform === "win32"; function readlink(fsPath) { return __awaiter2(this, void 0, void 0, function* () { - const result = yield fs17.promises.readlink(fsPath); + const result = yield fs14.promises.readlink(fsPath); if (exports2.IS_WINDOWS && !result.endsWith("\\")) { return `${result}\\`; } @@ -20137,7 +20137,7 @@ var require_io_util = __commonJS({ }); } exports2.UV_FS_O_EXLOCK = 268435456; - exports2.READONLY = fs17.constants.O_RDONLY; + exports2.READONLY = fs14.constants.O_RDONLY; function exists(fsPath) { return __awaiter2(this, void 0, void 0, function* () { try { @@ -20179,7 +20179,7 @@ var require_io_util = __commonJS({ } if (stats && stats.isFile()) { if (exports2.IS_WINDOWS) { - const upperExt = path16.extname(filePath).toUpperCase(); + const upperExt = path13.extname(filePath).toUpperCase(); if (extensions.some((validExt) => validExt.toUpperCase() === upperExt)) { return filePath; } @@ -20203,11 +20203,11 @@ var require_io_util = __commonJS({ if (stats && stats.isFile()) { if (exports2.IS_WINDOWS) { try { - const directory = path16.dirname(filePath); - const upperName = path16.basename(filePath).toUpperCase(); + const directory = path13.dirname(filePath); + const upperName = path13.basename(filePath).toUpperCase(); for (const actualName of yield (0, exports2.readdir)(directory)) { if (upperName === actualName.toUpperCase()) { - filePath = path16.join(directory, actualName); + filePath = path13.join(directory, actualName); break; } } @@ -20286,11 +20286,11 @@ var require_io = __commonJS({ })(); var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { - return value instanceof P ? value : new P(function(resolve8) { - resolve8(value); + return value instanceof P ? value : new P(function(resolve7) { + resolve7(value); }); } - return new (P || (P = Promise))(function(resolve8, reject) { + return new (P || (P = Promise))(function(resolve7, reject) { function fulfilled(value) { try { step(generator.next(value)); @@ -20306,7 +20306,7 @@ var require_io = __commonJS({ } } function step(result) { - result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); + result.done ? resolve7(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); @@ -20319,7 +20319,7 @@ var require_io = __commonJS({ exports2.which = which7; exports2.findInPath = findInPath; var assert_1 = require("assert"); - var path16 = __importStar2(require("path")); + var path13 = __importStar2(require("path")); var ioUtil = __importStar2(require_io_util()); function cp(source_1, dest_1) { return __awaiter2(this, arguments, void 0, function* (source, dest, options = {}) { @@ -20328,7 +20328,7 @@ var require_io = __commonJS({ if (destStat && destStat.isFile() && !force) { return; } - const newDest = destStat && destStat.isDirectory() && copySourceDirectory ? path16.join(dest, path16.basename(source)) : dest; + const newDest = destStat && destStat.isDirectory() && copySourceDirectory ? path13.join(dest, path13.basename(source)) : dest; if (!(yield ioUtil.exists(source))) { throw new Error(`no such file or directory: ${source}`); } @@ -20340,7 +20340,7 @@ var require_io = __commonJS({ yield cpDirRecursive(source, newDest, 0, force); } } else { - if (path16.relative(source, newDest) === "") { + if (path13.relative(source, newDest) === "") { throw new Error(`'${newDest}' and '${source}' are the same file`); } yield copyFile2(source, newDest, force); @@ -20352,7 +20352,7 @@ var require_io = __commonJS({ if (yield ioUtil.exists(dest)) { let destExists = true; if (yield ioUtil.isDirectory(dest)) { - dest = path16.join(dest, path16.basename(source)); + dest = path13.join(dest, path13.basename(source)); destExists = yield ioUtil.exists(dest); } if (destExists) { @@ -20363,7 +20363,7 @@ var require_io = __commonJS({ } } } - yield mkdirP(path16.dirname(dest)); + yield mkdirP(path13.dirname(dest)); yield ioUtil.rename(source, dest); }); } @@ -20422,7 +20422,7 @@ var require_io = __commonJS({ } const extensions = []; if (ioUtil.IS_WINDOWS && process.env["PATHEXT"]) { - for (const extension of process.env["PATHEXT"].split(path16.delimiter)) { + for (const extension of process.env["PATHEXT"].split(path13.delimiter)) { if (extension) { extensions.push(extension); } @@ -20435,12 +20435,12 @@ var require_io = __commonJS({ } return []; } - if (tool.includes(path16.sep)) { + if (tool.includes(path13.sep)) { return []; } const directories = []; if (process.env.PATH) { - for (const p of process.env.PATH.split(path16.delimiter)) { + for (const p of process.env.PATH.split(path13.delimiter)) { if (p) { directories.push(p); } @@ -20448,7 +20448,7 @@ var require_io = __commonJS({ } const matches = []; for (const directory of directories) { - const filePath = yield ioUtil.tryGetExecutablePath(path16.join(directory, tool), extensions); + const filePath = yield ioUtil.tryGetExecutablePath(path13.join(directory, tool), extensions); if (filePath) { matches.push(filePath); } @@ -20547,11 +20547,11 @@ var require_toolrunner = __commonJS({ })(); var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { - return value instanceof P ? value : new P(function(resolve8) { - resolve8(value); + return value instanceof P ? value : new P(function(resolve7) { + resolve7(value); }); } - return new (P || (P = Promise))(function(resolve8, reject) { + return new (P || (P = Promise))(function(resolve7, reject) { function fulfilled(value) { try { step(generator.next(value)); @@ -20567,7 +20567,7 @@ var require_toolrunner = __commonJS({ } } function step(result) { - result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); + result.done ? resolve7(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); @@ -20575,10 +20575,10 @@ var require_toolrunner = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.ToolRunner = void 0; exports2.argStringToArray = argStringToArray; - var os5 = __importStar2(require("os")); + var os4 = __importStar2(require("os")); var events = __importStar2(require("events")); var child = __importStar2(require("child_process")); - var path16 = __importStar2(require("path")); + var path13 = __importStar2(require("path")); var io7 = __importStar2(require_io()); var ioUtil = __importStar2(require_io_util()); var timers_1 = require("timers"); @@ -20630,12 +20630,12 @@ var require_toolrunner = __commonJS({ _processLineBuffer(data, strBuffer, onLine) { try { let s = strBuffer + data.toString(); - let n = s.indexOf(os5.EOL); + let n = s.indexOf(os4.EOL); while (n > -1) { const line = s.substring(0, n); onLine(line); - s = s.substring(n + os5.EOL.length); - n = s.indexOf(os5.EOL); + s = s.substring(n + os4.EOL.length); + n = s.indexOf(os4.EOL); } return s; } catch (err) { @@ -20793,10 +20793,10 @@ var require_toolrunner = __commonJS({ exec() { return __awaiter2(this, void 0, void 0, function* () { if (!ioUtil.isRooted(this.toolPath) && (this.toolPath.includes("/") || IS_WINDOWS && this.toolPath.includes("\\"))) { - this.toolPath = path16.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath); + this.toolPath = path13.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath); } this.toolPath = yield io7.which(this.toolPath, true); - return new Promise((resolve8, reject) => __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve7, reject) => __awaiter2(this, void 0, void 0, function* () { this._debug(`exec tool: ${this.toolPath}`); this._debug("arguments:"); for (const arg of this.args) { @@ -20804,7 +20804,7 @@ var require_toolrunner = __commonJS({ } const optionsNonNull = this._cloneExecOptions(this.options); if (!optionsNonNull.silent && optionsNonNull.outStream) { - optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os5.EOL); + optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os4.EOL); } const state = new ExecState(optionsNonNull, this.toolPath); state.on("debug", (message) => { @@ -20879,7 +20879,7 @@ var require_toolrunner = __commonJS({ if (error3) { reject(error3); } else { - resolve8(exitCode); + resolve7(exitCode); } }); if (this.options.input) { @@ -21045,11 +21045,11 @@ var require_exec = __commonJS({ })(); var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { - return value instanceof P ? value : new P(function(resolve8) { - resolve8(value); + return value instanceof P ? value : new P(function(resolve7) { + resolve7(value); }); } - return new (P || (P = Promise))(function(resolve8, reject) { + return new (P || (P = Promise))(function(resolve7, reject) { function fulfilled(value) { try { step(generator.next(value)); @@ -21065,7 +21065,7 @@ var require_exec = __commonJS({ } } function step(result) { - result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); + result.done ? resolve7(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); @@ -21165,11 +21165,11 @@ var require_platform = __commonJS({ })(); var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { - return value instanceof P ? value : new P(function(resolve8) { - resolve8(value); + return value instanceof P ? value : new P(function(resolve7) { + resolve7(value); }); } - return new (P || (P = Promise))(function(resolve8, reject) { + return new (P || (P = Promise))(function(resolve7, reject) { function fulfilled(value) { try { step(generator.next(value)); @@ -21185,7 +21185,7 @@ var require_platform = __commonJS({ } } function step(result) { - result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); + result.done ? resolve7(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); @@ -21294,11 +21294,11 @@ var require_core = __commonJS({ })(); var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { - return value instanceof P ? value : new P(function(resolve8) { - resolve8(value); + return value instanceof P ? value : new P(function(resolve7) { + resolve7(value); }); } - return new (P || (P = Promise))(function(resolve8, reject) { + return new (P || (P = Promise))(function(resolve7, reject) { function fulfilled(value) { try { step(generator.next(value)); @@ -21314,7 +21314,7 @@ var require_core = __commonJS({ } } function step(result) { - result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); + result.done ? resolve7(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); @@ -21345,8 +21345,8 @@ var require_core = __commonJS({ var command_1 = require_command(); var file_command_1 = require_file_command(); var utils_1 = require_utils(); - var os5 = __importStar2(require("os")); - var path16 = __importStar2(require("path")); + var os4 = __importStar2(require("os")); + var path13 = __importStar2(require("path")); var oidc_utils_1 = require_oidc_utils(); var ExitCode; (function(ExitCode2) { @@ -21372,7 +21372,7 @@ var require_core = __commonJS({ } else { (0, command_1.issueCommand)("add-path", {}, inputPath); } - process.env["PATH"] = `${inputPath}${path16.delimiter}${process.env["PATH"]}`; + process.env["PATH"] = `${inputPath}${path13.delimiter}${process.env["PATH"]}`; } function getInput2(name, options) { const val = process.env[`INPUT_${name.replace(/ /g, "_").toUpperCase()}`] || ""; @@ -21407,7 +21407,7 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``); if (filePath) { return (0, file_command_1.issueFileCommand)("OUTPUT", (0, file_command_1.prepareKeyValueMessage)(name, value)); } - process.stdout.write(os5.EOL); + process.stdout.write(os4.EOL); (0, command_1.issueCommand)("set-output", { name }, (0, utils_1.toCommandValue)(value)); } function setCommandEcho(enabled) { @@ -21433,7 +21433,7 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``); (0, command_1.issueCommand)("notice", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); } function info6(message) { - process.stdout.write(message + os5.EOL); + process.stdout.write(message + os4.EOL); } function startGroup3(name) { (0, command_1.issue)("group", name); @@ -21509,8 +21509,8 @@ var require_context = __commonJS({ if ((0, fs_1.existsSync)(process.env.GITHUB_EVENT_PATH)) { this.payload = JSON.parse((0, fs_1.readFileSync)(process.env.GITHUB_EVENT_PATH, { encoding: "utf8" })); } else { - const path16 = process.env.GITHUB_EVENT_PATH; - process.stdout.write(`GITHUB_EVENT_PATH ${path16} does not exist${os_1.EOL}`); + const path13 = process.env.GITHUB_EVENT_PATH; + process.stdout.write(`GITHUB_EVENT_PATH ${path13} does not exist${os_1.EOL}`); } } this.eventName = process.env.GITHUB_EVENT_NAME; @@ -22226,7 +22226,7 @@ var require_util9 = __commonJS({ var assert = require("node:assert"); var { kDestroyed, kBodyUsed, kListeners, kBody } = require_symbols6(); var { IncomingMessage } = require("node:http"); - var stream2 = require("node:stream"); + var stream = require("node:stream"); var net = require("node:net"); var { Blob: Blob2 } = require("node:buffer"); var nodeUtil = require("node:util"); @@ -22335,14 +22335,14 @@ var require_util9 = __commonJS({ } const port = url2.port != null ? url2.port : url2.protocol === "https:" ? 443 : 80; let origin = url2.origin != null ? url2.origin : `${url2.protocol || ""}//${url2.hostname || ""}:${port}`; - let path16 = url2.path != null ? url2.path : `${url2.pathname || ""}${url2.search || ""}`; + let path13 = url2.path != null ? url2.path : `${url2.pathname || ""}${url2.search || ""}`; if (origin[origin.length - 1] === "/") { origin = origin.slice(0, origin.length - 1); } - if (path16 && path16[0] !== "/") { - path16 = `/${path16}`; + if (path13 && path13[0] !== "/") { + path13 = `/${path13}`; } - return new URL(`${origin}${path16}`); + return new URL(`${origin}${path13}`); } if (!isHttpOrHttpsPrefixed(url2.origin || url2.protocol)) { throw new InvalidArgumentError("Invalid URL protocol: the URL must start with `http:` or `https:`."); @@ -22400,24 +22400,24 @@ var require_util9 = __commonJS({ return null; } function isDestroyed(body) { - return body && !!(body.destroyed || body[kDestroyed] || stream2.isDestroyed?.(body)); + return body && !!(body.destroyed || body[kDestroyed] || stream.isDestroyed?.(body)); } - function destroy(stream3, err) { - if (stream3 == null || !isStream(stream3) || isDestroyed(stream3)) { + function destroy(stream2, err) { + if (stream2 == null || !isStream(stream2) || isDestroyed(stream2)) { return; } - if (typeof stream3.destroy === "function") { - if (Object.getPrototypeOf(stream3).constructor === IncomingMessage) { - stream3.socket = null; + if (typeof stream2.destroy === "function") { + if (Object.getPrototypeOf(stream2).constructor === IncomingMessage) { + stream2.socket = null; } - stream3.destroy(err); + stream2.destroy(err); } else if (err) { queueMicrotask(() => { - stream3.emit("error", err); + stream2.emit("error", err); }); } - if (stream3.destroyed !== true) { - stream3[kDestroyed] = true; + if (stream2.destroyed !== true) { + stream2[kDestroyed] = true; } } var KEEPALIVE_TIMEOUT_EXPR = /timeout=(\d+)/; @@ -22516,13 +22516,13 @@ var require_util9 = __commonJS({ } } function isDisturbed(body) { - return !!(body && (stream2.isDisturbed(body) || body[kBodyUsed])); + return !!(body && (stream.isDisturbed(body) || body[kBodyUsed])); } function isErrored(body) { - return !!(body && stream2.isErrored(body)); + return !!(body && stream.isErrored(body)); } function isReadable(body) { - return !!(body && stream2.isReadable(body)); + return !!(body && stream.isReadable(body)); } function getSocketInfo(socket) { return { @@ -22793,39 +22793,39 @@ var require_diagnostics2 = __commonJS({ }); diagnosticsChannel.channel("undici:client:sendHeaders").subscribe((evt) => { const { - request: { method, path: path16, origin } + request: { method, path: path13, origin } } = evt; - debuglog("sending request to %s %s/%s", method, origin, path16); + debuglog("sending request to %s %s/%s", method, origin, path13); }); diagnosticsChannel.channel("undici:request:headers").subscribe((evt) => { const { - request: { method, path: path16, origin }, + request: { method, path: path13, origin }, response: { statusCode } } = evt; debuglog( "received response to %s %s/%s - HTTP %d", method, origin, - path16, + path13, statusCode ); }); diagnosticsChannel.channel("undici:request:trailers").subscribe((evt) => { const { - request: { method, path: path16, origin } + request: { method, path: path13, origin } } = evt; - debuglog("trailers received from %s %s/%s", method, origin, path16); + debuglog("trailers received from %s %s/%s", method, origin, path13); }); diagnosticsChannel.channel("undici:request:error").subscribe((evt) => { const { - request: { method, path: path16, origin }, + request: { method, path: path13, origin }, error: error3 } = evt; debuglog( "request to %s %s/%s errored - %s", method, origin, - path16, + path13, error3.message ); }); @@ -22874,9 +22874,9 @@ var require_diagnostics2 = __commonJS({ }); diagnosticsChannel.channel("undici:client:sendHeaders").subscribe((evt) => { const { - request: { method, path: path16, origin } + request: { method, path: path13, origin } } = evt; - debuglog("sending request to %s %s/%s", method, origin, path16); + debuglog("sending request to %s %s/%s", method, origin, path13); }); } diagnosticsChannel.channel("undici:websocket:open").subscribe((evt) => { @@ -22939,7 +22939,7 @@ var require_request3 = __commonJS({ var kHandler = /* @__PURE__ */ Symbol("handler"); var Request = class { constructor(origin, { - path: path16, + path: path13, method, body, headers, @@ -22954,11 +22954,11 @@ var require_request3 = __commonJS({ expectContinue, servername }, handler2) { - if (typeof path16 !== "string") { + if (typeof path13 !== "string") { throw new InvalidArgumentError("path must be a string"); - } else if (path16[0] !== "/" && !(path16.startsWith("http://") || path16.startsWith("https://")) && method !== "CONNECT") { + } else if (path13[0] !== "/" && !(path13.startsWith("http://") || path13.startsWith("https://")) && method !== "CONNECT") { throw new InvalidArgumentError("path must be an absolute URL or start with a slash"); - } else if (invalidPathRegex.test(path16)) { + } else if (invalidPathRegex.test(path13)) { throw new InvalidArgumentError("invalid request path"); } if (typeof method !== "string") { @@ -23021,7 +23021,7 @@ var require_request3 = __commonJS({ this.completed = false; this.aborted = false; this.upgrade = upgrade || null; - this.path = query ? buildURL(path16, query) : path16; + this.path = query ? buildURL(path13, query) : path13; this.origin = origin; this.idempotent = idempotent == null ? method === "HEAD" || method === "GET" : idempotent; this.blocking = blocking == null ? false : blocking; @@ -23333,9 +23333,9 @@ var require_dispatcher_base2 = __commonJS({ } close(callback) { if (callback === void 0) { - return new Promise((resolve8, reject) => { + return new Promise((resolve7, reject) => { this.close((err, data) => { - return err ? reject(err) : resolve8(data); + return err ? reject(err) : resolve7(data); }); }); } @@ -23373,12 +23373,12 @@ var require_dispatcher_base2 = __commonJS({ err = null; } if (callback === void 0) { - return new Promise((resolve8, reject) => { + return new Promise((resolve7, reject) => { this.destroy(err, (err2, data) => { return err2 ? ( /* istanbul ignore next: should never error */ reject(err2) - ) : resolve8(data); + ) : resolve7(data); }); }); } @@ -25254,7 +25254,7 @@ var require_util10 = __commonJS({ var { redirectStatusSet, referrerPolicySet: referrerPolicyTokens, badPortsSet } = require_constants8(); var { getGlobalOrigin } = require_global3(); var { collectASequenceOfCodePoints, collectAnHTTPQuotedString, removeChars, parseMIMEType } = require_data_url2(); - var { performance: performance5 } = require("node:perf_hooks"); + var { performance: performance4 } = require("node:perf_hooks"); var { isBlobLike, ReadableStreamFrom, isValidHTTPToken, normalizedMethodRecordsBase } = require_util9(); var assert = require("node:assert"); var { isUint8Array } = require("node:util/types"); @@ -25413,7 +25413,7 @@ var require_util10 = __commonJS({ }; } function coarsenedSharedCurrentTime(crossOriginIsolatedCapability) { - return coarsenTime(performance5.now(), crossOriginIsolatedCapability); + return coarsenTime(performance4.now(), crossOriginIsolatedCapability); } function createOpaqueTimingInfo(timingInfo) { return { @@ -25645,8 +25645,8 @@ var require_util10 = __commonJS({ function createDeferredPromise() { let res; let rej; - const promise = new Promise((resolve8, reject) => { - res = resolve8; + const promise = new Promise((resolve7, reject) => { + res = resolve7; rej = reject; }); return { promise, resolve: res, reject: rej }; @@ -25811,8 +25811,8 @@ var require_util10 = __commonJS({ errorSteps(e); } } - function isReadableStreamLike(stream2) { - return stream2 instanceof ReadableStream || stream2[Symbol.toStringTag] === "ReadableStream" && typeof stream2.tee === "function"; + function isReadableStreamLike(stream) { + return stream instanceof ReadableStream || stream[Symbol.toStringTag] === "ReadableStream" && typeof stream.tee === "function"; } function readableStreamClose(controller) { try { @@ -26628,20 +26628,20 @@ var require_body2 = __commonJS({ var streamRegistry; if (hasFinalizationRegistry) { streamRegistry = new FinalizationRegistry((weakRef) => { - const stream2 = weakRef.deref(); - if (stream2 && !stream2.locked && !isDisturbed(stream2) && !isErrored(stream2)) { - stream2.cancel("Response object has been garbage collected").catch(noop3); + const stream = weakRef.deref(); + if (stream && !stream.locked && !isDisturbed(stream) && !isErrored(stream)) { + stream.cancel("Response object has been garbage collected").catch(noop3); } }); } function extractBody(object, keepalive = false) { - let stream2 = null; + let stream = null; if (object instanceof ReadableStream) { - stream2 = object; + stream = object; } else if (isBlobLike(object)) { - stream2 = object.stream(); + stream = object.stream(); } else { - stream2 = new ReadableStream({ + stream = new ReadableStream({ async pull(controller) { const buffer = typeof source === "string" ? textEncoder.encode(source) : source; if (buffer.byteLength) { @@ -26654,7 +26654,7 @@ var require_body2 = __commonJS({ type: "bytes" }); } - assert(isReadableStreamLike(stream2)); + assert(isReadableStreamLike(stream)); let action = null; let source = null; let length = null; @@ -26733,14 +26733,14 @@ Content-Type: ${value.type || "application/octet-stream"}\r "Response body object should not be disturbed or locked" ); } - stream2 = object instanceof ReadableStream ? object : ReadableStreamFrom(object); + stream = object instanceof ReadableStream ? object : ReadableStreamFrom(object); } if (typeof source === "string" || util.isBuffer(source)) { length = Buffer.byteLength(source); } if (action != null) { let iterator2; - stream2 = new ReadableStream({ + stream = new ReadableStream({ async start() { iterator2 = action(object)[Symbol.asyncIterator](); }, @@ -26752,7 +26752,7 @@ Content-Type: ${value.type || "application/octet-stream"}\r controller.byobRequest?.respond(0); }); } else { - if (!isErrored(stream2)) { + if (!isErrored(stream)) { const buffer = new Uint8Array(value); if (buffer.byteLength) { controller.enqueue(buffer); @@ -26767,7 +26767,7 @@ Content-Type: ${value.type || "application/octet-stream"}\r type: "bytes" }); } - const body = { stream: stream2, source, length }; + const body = { stream, source, length }; return [body, type2]; } function safelyExtractBody(object, keepalive = false) { @@ -27534,7 +27534,7 @@ var require_client_h12 = __commonJS({ return method !== "GET" && method !== "HEAD" && method !== "OPTIONS" && method !== "TRACE" && method !== "CONNECT"; } function writeH1(client, request2) { - const { method, path: path16, host, upgrade, blocking, reset } = request2; + const { method, path: path13, host, upgrade, blocking, reset } = request2; let { body, headers, contentLength } = request2; const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH" || method === "QUERY" || method === "PROPFIND" || method === "PROPPATCH"; if (util.isFormDataLike(body)) { @@ -27600,7 +27600,7 @@ var require_client_h12 = __commonJS({ if (blocking) { socket[kBlocking] = true; } - let header = `${method} ${path16} HTTP/1.1\r + let header = `${method} ${path13} HTTP/1.1\r `; if (typeof host === "string") { header += `host: ${host}\r @@ -27787,12 +27787,12 @@ upgrade: ${upgrade}\r cb(); } } - const waitForDrain = () => new Promise((resolve8, reject) => { + const waitForDrain = () => new Promise((resolve7, reject) => { assert(callback === null); if (socket[kError]) { reject(socket[kError]); } else { - callback = resolve8; + callback = resolve7; } }); socket.on("close", onDrain).on("drain", onDrain); @@ -28126,7 +28126,7 @@ var require_client_h22 = __commonJS({ } function writeH2(client, request2) { const session = client[kHTTP2Session]; - const { method, path: path16, host, upgrade, expectContinue, signal, headers: reqHeaders } = request2; + const { method, path: path13, host, upgrade, expectContinue, signal, headers: reqHeaders } = request2; let { body } = request2; if (upgrade) { util.errorRequest(client, request2, new Error("Upgrade not supported for H2")); @@ -28148,7 +28148,7 @@ var require_client_h22 = __commonJS({ headers[key] = val; } } - let stream2; + let stream; const { hostname, port } = client[kUrl]; headers[HTTP2_HEADER_AUTHORITY] = host || `${hostname}${port ? `:${port}` : ""}`; headers[HTTP2_HEADER_METHOD] = method; @@ -28158,8 +28158,8 @@ var require_client_h22 = __commonJS({ } err = err || new RequestAbortedError(); util.errorRequest(client, request2, err); - if (stream2 != null) { - util.destroy(stream2, err); + if (stream != null) { + util.destroy(stream, err); } util.destroy(body, err); client[kQueue][client[kRunningIdx]++] = null; @@ -28175,25 +28175,25 @@ var require_client_h22 = __commonJS({ } if (method === "CONNECT") { session.ref(); - stream2 = session.request(headers, { endStream: false, signal }); - if (stream2.id && !stream2.pending) { - request2.onUpgrade(null, null, stream2); + stream = session.request(headers, { endStream: false, signal }); + if (stream.id && !stream.pending) { + request2.onUpgrade(null, null, stream); ++session[kOpenStreams]; client[kQueue][client[kRunningIdx]++] = null; } else { - stream2.once("ready", () => { - request2.onUpgrade(null, null, stream2); + stream.once("ready", () => { + request2.onUpgrade(null, null, stream); ++session[kOpenStreams]; client[kQueue][client[kRunningIdx]++] = null; }); } - stream2.once("close", () => { + stream.once("close", () => { session[kOpenStreams] -= 1; if (session[kOpenStreams] === 0) session.unref(); }); return true; } - headers[HTTP2_HEADER_PATH] = path16; + headers[HTTP2_HEADER_PATH] = path13; headers[HTTP2_HEADER_SCHEME] = "https"; const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH"; if (body && typeof body.read === "function") { @@ -28228,36 +28228,36 @@ var require_client_h22 = __commonJS({ const shouldEndStream = method === "GET" || method === "HEAD" || body === null; if (expectContinue) { headers[HTTP2_HEADER_EXPECT] = "100-continue"; - stream2 = session.request(headers, { endStream: shouldEndStream, signal }); - stream2.once("continue", writeBodyH2); + stream = session.request(headers, { endStream: shouldEndStream, signal }); + stream.once("continue", writeBodyH2); } else { - stream2 = session.request(headers, { + stream = session.request(headers, { endStream: shouldEndStream, signal }); writeBodyH2(); } ++session[kOpenStreams]; - stream2.once("response", (headers2) => { + stream.once("response", (headers2) => { const { [HTTP2_HEADER_STATUS]: statusCode, ...realHeaders } = headers2; request2.onResponseStarted(); if (request2.aborted) { const err = new RequestAbortedError(); util.errorRequest(client, request2, err); - util.destroy(stream2, err); + util.destroy(stream, err); return; } - if (request2.onHeaders(Number(statusCode), parseH2Headers(realHeaders), stream2.resume.bind(stream2), "") === false) { - stream2.pause(); + if (request2.onHeaders(Number(statusCode), parseH2Headers(realHeaders), stream.resume.bind(stream), "") === false) { + stream.pause(); } - stream2.on("data", (chunk) => { + stream.on("data", (chunk) => { if (request2.onData(chunk) === false) { - stream2.pause(); + stream.pause(); } }); }); - stream2.once("end", () => { - if (stream2.state?.state == null || stream2.state.state < 6) { + stream.once("end", () => { + if (stream.state?.state == null || stream.state.state < 6) { request2.onComplete([]); } if (session[kOpenStreams] === 0) { @@ -28268,16 +28268,16 @@ var require_client_h22 = __commonJS({ client[kPendingIdx] = client[kRunningIdx]; client[kResume](); }); - stream2.once("close", () => { + stream.once("close", () => { session[kOpenStreams] -= 1; if (session[kOpenStreams] === 0) { session.unref(); } }); - stream2.once("error", function(err) { + stream.once("error", function(err) { abort(err); }); - stream2.once("frameError", (type2, code) => { + stream.once("frameError", (type2, code) => { abort(new InformationalError(`HTTP/2: "frameError" received - type ${type2}, code ${code}`)); }); return true; @@ -28285,7 +28285,7 @@ var require_client_h22 = __commonJS({ if (!body || contentLength === 0) { writeBuffer( abort, - stream2, + stream, null, client, request2, @@ -28296,7 +28296,7 @@ var require_client_h22 = __commonJS({ } else if (util.isBuffer(body)) { writeBuffer( abort, - stream2, + stream, body, client, request2, @@ -28308,7 +28308,7 @@ var require_client_h22 = __commonJS({ if (typeof body.stream === "function") { writeIterable( abort, - stream2, + stream, body.stream(), client, request2, @@ -28319,7 +28319,7 @@ var require_client_h22 = __commonJS({ } else { writeBlob( abort, - stream2, + stream, body, client, request2, @@ -28333,7 +28333,7 @@ var require_client_h22 = __commonJS({ abort, client[kSocket], expectsPayload, - stream2, + stream, body, client, request2, @@ -28342,7 +28342,7 @@ var require_client_h22 = __commonJS({ } else if (util.isIterable(body)) { writeIterable( abort, - stream2, + stream, body, client, request2, @@ -28429,12 +28429,12 @@ var require_client_h22 = __commonJS({ cb(); } } - const waitForDrain = () => new Promise((resolve8, reject) => { + const waitForDrain = () => new Promise((resolve7, reject) => { assert(callback === null); if (socket[kError]) { reject(socket[kError]); } else { - callback = resolve8; + callback = resolve7; } }); h2stream.on("close", onDrain).on("drain", onDrain); @@ -28546,9 +28546,9 @@ var require_redirect_handler2 = __commonJS({ return this.handler.onHeaders(statusCode, headers, resume, statusText); } const { origin, pathname, search } = util.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin))); - const path16 = search ? `${pathname}${search}` : pathname; + const path13 = search ? `${pathname}${search}` : pathname; this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin); - this.opts.path = path16; + this.opts.path = path13; this.opts.origin = origin; this.opts.maxRedirections = 0; this.opts.query = null; @@ -28911,16 +28911,16 @@ var require_client2 = __commonJS({ return this[kNeedDrain] < 2; } async [kClose]() { - return new Promise((resolve8) => { + return new Promise((resolve7) => { if (this[kSize]) { - this[kClosedResolve] = resolve8; + this[kClosedResolve] = resolve7; } else { - resolve8(null); + resolve7(null); } }); } async [kDestroy](err) { - return new Promise((resolve8) => { + return new Promise((resolve7) => { const requests = this[kQueue].splice(this[kPendingIdx]); for (let i = 0; i < requests.length; i++) { const request2 = requests[i]; @@ -28931,7 +28931,7 @@ var require_client2 = __commonJS({ this[kClosedResolve](); this[kClosedResolve] = null; } - resolve8(null); + resolve7(null); }; if (this[kHTTPContext]) { this[kHTTPContext].destroy(err, callback); @@ -28982,7 +28982,7 @@ var require_client2 = __commonJS({ }); } try { - const socket = await new Promise((resolve8, reject) => { + const socket = await new Promise((resolve7, reject) => { client[kConnector]({ host, hostname, @@ -28994,7 +28994,7 @@ var require_client2 = __commonJS({ if (err) { reject(err); } else { - resolve8(socket2); + resolve7(socket2); } }); }); @@ -29330,8 +29330,8 @@ var require_pool_base2 = __commonJS({ if (this[kQueue].isEmpty()) { await Promise.all(this[kClients].map((c) => c.close())); } else { - await new Promise((resolve8) => { - this[kClosedResolve] = resolve8; + await new Promise((resolve7) => { + this[kClosedResolve] = resolve7; }); } } @@ -29782,10 +29782,10 @@ var require_proxy_agent2 = __commonJS({ }; const { origin, - path: path16 = "/", + path: path13 = "/", headers = {} } = opts; - opts.path = origin + path16; + opts.path = origin + path13; if (!("host" in headers) && !("Host" in headers)) { const { host } = new URL2(origin); headers.host = host; @@ -30419,7 +30419,7 @@ var require_readable2 = __commonJS({ "node_modules/@actions/github/node_modules/undici/lib/api/readable.js"(exports2, module2) { "use strict"; var assert = require("node:assert"); - var { Readable: Readable2 } = require("node:stream"); + var { Readable } = require("node:stream"); var { RequestAbortedError, NotSupportedError, InvalidArgumentError, AbortError } = require_errors2(); var util = require_util9(); var { ReadableStreamFrom } = require_util9(); @@ -30431,7 +30431,7 @@ var require_readable2 = __commonJS({ var kContentLength = /* @__PURE__ */ Symbol("kContentLength"); var noop3 = () => { }; - var BodyReadable = class extends Readable2 { + var BodyReadable = class extends Readable { constructor({ resume, abort, @@ -30546,7 +30546,7 @@ var require_readable2 = __commonJS({ if (this._readableState.closeEmitted) { return null; } - return await new Promise((resolve8, reject) => { + return await new Promise((resolve7, reject) => { if (this[kContentLength] > limit) { this.destroy(new AbortError()); } @@ -30559,7 +30559,7 @@ var require_readable2 = __commonJS({ if (signal?.aborted) { reject(signal.reason ?? new AbortError()); } else { - resolve8(null); + resolve7(null); } }).on("error", noop3).on("data", function(chunk) { limit -= chunk.length; @@ -30576,13 +30576,13 @@ var require_readable2 = __commonJS({ function isUnusable(self2) { return util.isDisturbed(self2) || isLocked(self2); } - async function consume(stream2, type2) { - assert(!stream2[kConsume]); - return new Promise((resolve8, reject) => { - if (isUnusable(stream2)) { - const rState = stream2._readableState; + async function consume(stream, type2) { + assert(!stream[kConsume]); + return new Promise((resolve7, reject) => { + if (isUnusable(stream)) { + const rState = stream._readableState; if (rState.destroyed && rState.closeEmitted === false) { - stream2.on("error", (err) => { + stream.on("error", (err) => { reject(err); }).on("close", () => { reject(new TypeError("unusable")); @@ -30592,22 +30592,22 @@ var require_readable2 = __commonJS({ } } else { queueMicrotask(() => { - stream2[kConsume] = { + stream[kConsume] = { type: type2, - stream: stream2, - resolve: resolve8, + stream, + resolve: resolve7, reject, length: 0, body: [] }; - stream2.on("error", function(err) { + stream.on("error", function(err) { consumeFinish(this[kConsume], err); }).on("close", function() { if (this[kConsume].body !== null) { consumeFinish(this[kConsume], new RequestAbortedError()); } }); - consumeStart(stream2[kConsume]); + consumeStart(stream[kConsume]); }); } }); @@ -30665,22 +30665,22 @@ var require_readable2 = __commonJS({ return buffer; } function consumeEnd(consume2) { - const { type: type2, body, resolve: resolve8, stream: stream2, length } = consume2; + const { type: type2, body, resolve: resolve7, stream, length } = consume2; try { if (type2 === "text") { - resolve8(chunksDecode(body, length)); + resolve7(chunksDecode(body, length)); } else if (type2 === "json") { - resolve8(JSON.parse(chunksDecode(body, length))); + resolve7(JSON.parse(chunksDecode(body, length))); } else if (type2 === "arrayBuffer") { - resolve8(chunksConcat(body, length).buffer); + resolve7(chunksConcat(body, length).buffer); } else if (type2 === "blob") { - resolve8(new Blob(body, { type: stream2[kContentType] })); + resolve7(new Blob(body, { type: stream[kContentType] })); } else if (type2 === "bytes") { - resolve8(chunksConcat(body, length)); + resolve7(chunksConcat(body, length)); } consumeFinish(consume2); } catch (err) { - stream2.destroy(err); + stream.destroy(err); } } function consumePush(consume2, chunk) { @@ -30773,7 +30773,7 @@ var require_api_request2 = __commonJS({ "node_modules/@actions/github/node_modules/undici/lib/api/api-request.js"(exports2, module2) { "use strict"; var assert = require("node:assert"); - var { Readable: Readable2 } = require_readable2(); + var { Readable } = require_readable2(); var { InvalidArgumentError, RequestAbortedError } = require_errors2(); var util = require_util9(); var { getResolveErrorBodyCallback } = require_util11(); @@ -30868,7 +30868,7 @@ var require_api_request2 = __commonJS({ const parsedHeaders = responseHeaders === "raw" ? util.parseHeaders(rawHeaders) : headers; const contentType = parsedHeaders["content-type"]; const contentLength = parsedHeaders["content-length"]; - const res = new Readable2({ + const res = new Readable({ resume, abort, contentType, @@ -30933,9 +30933,9 @@ var require_api_request2 = __commonJS({ }; function request2(opts, callback) { if (callback === void 0) { - return new Promise((resolve8, reject) => { + return new Promise((resolve7, reject) => { request2.call(this, opts, (err, data) => { - return err ? reject(err) : resolve8(data); + return err ? reject(err) : resolve7(data); }); }); } @@ -31156,11 +31156,11 @@ var require_api_stream2 = __commonJS({ } } }; - function stream2(opts, factory, callback) { + function stream(opts, factory, callback) { if (callback === void 0) { - return new Promise((resolve8, reject) => { - stream2.call(this, opts, factory, (err, data) => { - return err ? reject(err) : resolve8(data); + return new Promise((resolve7, reject) => { + stream.call(this, opts, factory, (err, data) => { + return err ? reject(err) : resolve7(data); }); }); } @@ -31174,7 +31174,7 @@ var require_api_stream2 = __commonJS({ queueMicrotask(() => callback(err, { opaque })); } } - module2.exports = stream2; + module2.exports = stream; } }); @@ -31183,7 +31183,7 @@ var require_api_pipeline2 = __commonJS({ "node_modules/@actions/github/node_modules/undici/lib/api/api-pipeline.js"(exports2, module2) { "use strict"; var { - Readable: Readable2, + Readable, Duplex, PassThrough } = require("node:stream"); @@ -31197,7 +31197,7 @@ var require_api_pipeline2 = __commonJS({ var { addSignal, removeSignal } = require_abort_signal2(); var assert = require("node:assert"); var kResume = /* @__PURE__ */ Symbol("resume"); - var PipelineRequest = class extends Readable2 { + var PipelineRequest = class extends Readable { constructor() { super({ autoDestroy: true }); this[kResume] = null; @@ -31214,7 +31214,7 @@ var require_api_pipeline2 = __commonJS({ callback(err); } }; - var PipelineResponse = class extends Readable2 { + var PipelineResponse = class extends Readable { constructor(resume) { super({ autoDestroy: true }); this[kResume] = resume; @@ -31445,9 +31445,9 @@ var require_api_upgrade2 = __commonJS({ }; function upgrade(opts, callback) { if (callback === void 0) { - return new Promise((resolve8, reject) => { + return new Promise((resolve7, reject) => { upgrade.call(this, opts, (err, data) => { - return err ? reject(err) : resolve8(data); + return err ? reject(err) : resolve7(data); }); }); } @@ -31539,9 +31539,9 @@ var require_api_connect2 = __commonJS({ }; function connect(opts, callback) { if (callback === void 0) { - return new Promise((resolve8, reject) => { + return new Promise((resolve7, reject) => { connect.call(this, opts, (err, data) => { - return err ? reject(err) : resolve8(data); + return err ? reject(err) : resolve7(data); }); }); } @@ -31706,20 +31706,20 @@ var require_mock_utils2 = __commonJS({ } return true; } - function safeUrl(path16) { - if (typeof path16 !== "string") { - return path16; + function safeUrl(path13) { + if (typeof path13 !== "string") { + return path13; } - const pathSegments = path16.split("?"); + const pathSegments = path13.split("?"); if (pathSegments.length !== 2) { - return path16; + return path13; } const qp = new URLSearchParams(pathSegments.pop()); qp.sort(); return [...pathSegments, qp.toString()].join("?"); } - function matchKey(mockDispatch2, { path: path16, method, body, headers }) { - const pathMatch = matchValue(mockDispatch2.path, path16); + function matchKey(mockDispatch2, { path: path13, method, body, headers }) { + const pathMatch = matchValue(mockDispatch2.path, path13); const methodMatch = matchValue(mockDispatch2.method, method); const bodyMatch = typeof mockDispatch2.body !== "undefined" ? matchValue(mockDispatch2.body, body) : true; const headersMatch = matchHeaders(mockDispatch2, headers); @@ -31741,7 +31741,7 @@ var require_mock_utils2 = __commonJS({ function getMockDispatch(mockDispatches, key) { const basePath = key.query ? buildURL(key.path, key.query) : key.path; const resolvedPath = typeof basePath === "string" ? safeUrl(basePath) : basePath; - let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path: path16 }) => matchValue(safeUrl(path16), resolvedPath)); + let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path: path13 }) => matchValue(safeUrl(path13), resolvedPath)); if (matchedMockDispatches.length === 0) { throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`); } @@ -31779,9 +31779,9 @@ var require_mock_utils2 = __commonJS({ } } function buildKey(opts) { - const { path: path16, method, body, headers, query } = opts; + const { path: path13, method, body, headers, query } = opts; return { - path: path16, + path: path13, method, body, headers, @@ -32244,10 +32244,10 @@ var require_pending_interceptors_formatter2 = __commonJS({ } format(pendingInterceptors) { const withPrettyHeaders = pendingInterceptors.map( - ({ method, path: path16, data: { statusCode }, persist, times, timesInvoked, origin }) => ({ + ({ method, path: path13, data: { statusCode }, persist, times, timesInvoked, origin }) => ({ Method: method, Origin: origin, - Path: path16, + Path: path13, "Status code": statusCode, Persistent: persist ? PERSISTENT : NOT_PERSISTENT, Invocations: timesInvoked, @@ -34539,7 +34539,7 @@ var require_fetch2 = __commonJS({ subresourceSet } = require_constants8(); var EE = require("node:events"); - var { Readable: Readable2, pipeline, finished } = require("node:stream"); + var { Readable, pipeline, finished } = require("node:stream"); var { addAbortListener, isErrored, isReadable, bufferToLowerCasedHeaderName } = require_util9(); var { dataURLProcessor, serializeAMimeType, minimizeSupportedMimeType } = require_data_url2(); var { getGlobalDispatcher } = require_global4(); @@ -35324,7 +35324,7 @@ var require_fetch2 = __commonJS({ fetchParams.controller.abort(reason); } }; - const stream2 = new ReadableStream( + const stream = new ReadableStream( { async start(controller) { fetchParams.controller.controller = controller; @@ -35338,7 +35338,7 @@ var require_fetch2 = __commonJS({ type: "bytes" } ); - response.body = { stream: stream2, source: null, length: null }; + response.body = { stream, source: null, length: null }; fetchParams.controller.onAborted = onAborted; fetchParams.controller.on("terminated", onAborted); fetchParams.controller.resume = async () => { @@ -35373,7 +35373,7 @@ var require_fetch2 = __commonJS({ if (buffer.byteLength) { fetchParams.controller.controller.enqueue(buffer); } - if (isErrored(stream2)) { + if (isErrored(stream)) { fetchParams.controller.terminate(); return; } @@ -35385,13 +35385,13 @@ var require_fetch2 = __commonJS({ function onAborted(reason) { if (isAborted(fetchParams)) { response.aborted = true; - if (isReadable(stream2)) { + if (isReadable(stream)) { fetchParams.controller.controller.error( fetchParams.controller.serializedAbortReason ); } } else { - if (isReadable(stream2)) { + if (isReadable(stream)) { fetchParams.controller.controller.error(new TypeError("terminated", { cause: isErrorLike(reason) ? reason : void 0 })); @@ -35403,7 +35403,7 @@ var require_fetch2 = __commonJS({ function dispatch({ body }) { const url2 = requestCurrentURL(request2); const agent = fetchParams.controller.dispatcher; - return new Promise((resolve8, reject) => agent.dispatch( + return new Promise((resolve7, reject) => agent.dispatch( { path: url2.pathname + url2.search, origin: url2.origin, @@ -35440,7 +35440,7 @@ var require_fetch2 = __commonJS({ headersList.append(bufferToLowerCasedHeaderName(rawHeaders[i]), rawHeaders[i + 1].toString("latin1"), true); } location = headersList.get("location", true); - this.body = new Readable2({ read: resume }); + this.body = new Readable({ read: resume }); const decoders = []; const willFollow = location && request2.redirect === "follow" && redirectStatusSet.has(status); if (request2.method !== "HEAD" && request2.method !== "CONNECT" && !nullBodyStatus.includes(status) && !willFollow) { @@ -35479,7 +35479,7 @@ var require_fetch2 = __commonJS({ } } const onError = this.onError.bind(this); - resolve8({ + resolve7({ status, statusText, headersList, @@ -35525,7 +35525,7 @@ var require_fetch2 = __commonJS({ for (let i = 0; i < rawHeaders.length; i += 2) { headersList.append(bufferToLowerCasedHeaderName(rawHeaders[i]), rawHeaders[i + 1].toString("latin1"), true); } - resolve8({ + resolve7({ status, statusText: STATUS_CODES[status], headersList, @@ -35944,8 +35944,8 @@ var require_util12 = __commonJS({ fr[kState] = "loading"; fr[kResult] = null; fr[kError] = null; - const stream2 = blob.stream(); - const reader = stream2.getReader(); + const stream = blob.stream(); + const reader = stream.getReader(); const bytes = []; let chunkPromise = reader.read(); let isFirstChunk = true; @@ -36604,8 +36604,8 @@ var require_cache2 = __commonJS({ const clonedResponse = cloneResponse(innerResponse); const bodyReadPromise = createDeferredPromise(); if (innerResponse.body != null) { - const stream2 = innerResponse.body.stream; - const reader = stream2.getReader(); + const stream = innerResponse.body.stream; + const reader = stream.getReader(); readAllBytes(reader).then(bodyReadPromise.resolve, bodyReadPromise.reject); } else { bodyReadPromise.resolve(void 0); @@ -37128,9 +37128,9 @@ var require_util14 = __commonJS({ } } } - function validateCookiePath(path16) { - for (let i = 0; i < path16.length; ++i) { - const code = path16.charCodeAt(i); + function validateCookiePath(path13) { + for (let i = 0; i < path13.length; ++i) { + const code = path13.charCodeAt(i); if (code < 32 || // exclude CTLs (0-31) code === 127 || // DEL code === 59) { @@ -38029,7 +38029,7 @@ var require_frame2 = __commonJS({ } catch { crypto3 = { // not full compatibility, but minimum. - randomFillSync: function randomFillSync2(buffer2, _offset, _size) { + randomFillSync: function randomFillSync(buffer2, _offset, _size) { for (let i = 0; i < buffer2.length; ++i) { buffer2[i] = Math.random() * 255 | 0; } @@ -39118,8 +39118,8 @@ var require_util16 = __commonJS({ return true; } function delay2(ms) { - return new Promise((resolve8) => { - setTimeout(resolve8, ms).unref(); + return new Promise((resolve7) => { + setTimeout(resolve7, ms).unref(); }); } module2.exports = { @@ -39724,11 +39724,11 @@ var require_undici2 = __commonJS({ if (typeof opts.path !== "string") { throw new InvalidArgumentError("invalid opts.path"); } - let path16 = opts.path; + let path13 = opts.path; if (!opts.path.startsWith("/")) { - path16 = `/${path16}`; + path13 = `/${path13}`; } - url2 = new URL(util.parseOrigin(url2).origin + path16); + url2 = new URL(util.parseOrigin(url2).origin + path13); } else { if (!opts) { opts = typeof url2 === "object" ? url2 : {}; @@ -39842,11 +39842,11 @@ var require_utils4 = __commonJS({ })(); var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { - return value instanceof P ? value : new P(function(resolve8) { - resolve8(value); + return value instanceof P ? value : new P(function(resolve7) { + resolve7(value); }); } - return new (P || (P = Promise))(function(resolve8, reject) { + return new (P || (P = Promise))(function(resolve7, reject) { function fulfilled(value) { try { step(generator.next(value)); @@ -39862,7 +39862,7 @@ var require_utils4 = __commonJS({ } } function step(result) { - result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); + result.done ? resolve7(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); @@ -46543,8 +46543,8 @@ var require_light = __commonJS({ return this.Promise.resolve(); } yieldLoop(t = 0) { - return new this.Promise(function(resolve8, reject) { - return setTimeout(resolve8, t); + return new this.Promise(function(resolve7, reject) { + return setTimeout(resolve7, t); }); } computePenalty() { @@ -46755,15 +46755,15 @@ var require_light = __commonJS({ return this._queue.length === 0; } async _tryToRun() { - var args, cb, error3, reject, resolve8, returned, task; + var args, cb, error3, reject, resolve7, returned, task; if (this._running < 1 && this._queue.length > 0) { this._running++; - ({ task, args, resolve: resolve8, reject } = this._queue.shift()); + ({ task, args, resolve: resolve7, reject } = this._queue.shift()); cb = await (async function() { try { returned = await task(...args); return function() { - return resolve8(returned); + return resolve7(returned); }; } catch (error1) { error3 = error1; @@ -46778,13 +46778,13 @@ var require_light = __commonJS({ } } schedule(task, ...args) { - var promise, reject, resolve8; - resolve8 = reject = null; + var promise, reject, resolve7; + resolve7 = reject = null; promise = new this.Promise(function(_resolve, _reject) { - resolve8 = _resolve; + resolve7 = _resolve; return reject = _reject; }); - this._queue.push({ task, args, resolve: resolve8, reject }); + this._queue.push({ task, args, resolve: resolve7, reject }); this._tryToRun(); return promise; } @@ -47185,14 +47185,14 @@ var require_light = __commonJS({ counts = this._states.counts; return counts[0] + counts[1] + counts[2] + counts[3] === at; }; - return new this.Promise((resolve8, reject) => { + return new this.Promise((resolve7, reject) => { if (finished()) { - return resolve8(); + return resolve7(); } else { return this.on("done", () => { if (finished()) { this.removeAllListeners("done"); - return resolve8(); + return resolve7(); } }); } @@ -47285,9 +47285,9 @@ var require_light = __commonJS({ options = parser$5.load(options, this.jobDefaults); } task = (...args2) => { - return new this.Promise(function(resolve8, reject) { + return new this.Promise(function(resolve7, reject) { return fn(...args2, function(...args3) { - return (args3[0] != null ? reject : resolve8)(args3); + return (args3[0] != null ? reject : resolve7)(args3); }); }); }; @@ -47414,14 +47414,14 @@ var require_helpers = __commonJS({ "node_modules/jsonschema/lib/helpers.js"(exports2, module2) { "use strict"; var uri = require("url"); - var ValidationError = exports2.ValidationError = function ValidationError2(message, instance, schema2, path16, name, argument) { - if (Array.isArray(path16)) { - this.path = path16; - this.property = path16.reduce(function(sum, item) { + var ValidationError = exports2.ValidationError = function ValidationError2(message, instance, schema2, path13, name, argument) { + if (Array.isArray(path13)) { + this.path = path13; + this.property = path13.reduce(function(sum, item) { return sum + makeSuffix(item); }, "instance"); - } else if (path16 !== void 0) { - this.property = path16; + } else if (path13 !== void 0) { + this.property = path13; } if (message) { this.message = message; @@ -47512,28 +47512,28 @@ var require_helpers = __commonJS({ name: { value: "SchemaError", enumerable: false } } ); - var SchemaContext = exports2.SchemaContext = function SchemaContext2(schema2, options, path16, base, schemas) { + var SchemaContext = exports2.SchemaContext = function SchemaContext2(schema2, options, path13, base, schemas) { this.schema = schema2; this.options = options; - if (Array.isArray(path16)) { - this.path = path16; - this.propertyPath = path16.reduce(function(sum, item) { + if (Array.isArray(path13)) { + this.path = path13; + this.propertyPath = path13.reduce(function(sum, item) { return sum + makeSuffix(item); }, "instance"); } else { - this.propertyPath = path16; + this.propertyPath = path13; } this.base = base; this.schemas = schemas; }; - SchemaContext.prototype.resolve = function resolve8(target) { + SchemaContext.prototype.resolve = function resolve7(target) { return uri.resolve(this.base, target); }; SchemaContext.prototype.makeChild = function makeChild(schema2, propertyName) { - var path16 = propertyName === void 0 ? this.path : this.path.concat([propertyName]); + var path13 = propertyName === void 0 ? this.path : this.path.concat([propertyName]); var id = schema2.$id || schema2.id; var base = uri.resolve(this.base, id || ""); - var ctx = new SchemaContext(schema2, this.options, path16, base, Object.create(this.schemas)); + var ctx = new SchemaContext(schema2, this.options, path13, base, Object.create(this.schemas)); if (id && !ctx.schemas[base]) { ctx.schemas[base] = schema2; } @@ -48624,7 +48624,7 @@ var require_validator = __commonJS({ } return schema2; }; - Validator3.prototype.resolve = function resolve8(schema2, switchSchema, ctx) { + Validator3.prototype.resolve = function resolve7(schema2, switchSchema, ctx) { switchSchema = ctx.resolve(switchSchema); if (ctx.schemas[switchSchema]) { return { subschema: ctx.schemas[switchSchema], switchSchema }; @@ -48830,21 +48830,21 @@ var require_internal_path_helper = __commonJS({ return mod && mod.__esModule ? mod : { "default": mod }; }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.dirname = dirname3; + exports2.dirname = dirname2; exports2.ensureAbsoluteRoot = ensureAbsoluteRoot; exports2.hasAbsoluteRoot = hasAbsoluteRoot; exports2.hasRoot = hasRoot; exports2.normalizeSeparators = normalizeSeparators; exports2.safeTrimTrailingSeparator = safeTrimTrailingSeparator; - var path16 = __importStar2(require("path")); + var path13 = __importStar2(require("path")); var assert_1 = __importDefault2(require("assert")); var IS_WINDOWS = process.platform === "win32"; - function dirname3(p) { + function dirname2(p) { p = safeTrimTrailingSeparator(p); if (IS_WINDOWS && /^\\\\[^\\]+(\\[^\\]+)?$/.test(p)) { return p; } - let result = path16.dirname(p); + let result = path13.dirname(p); if (IS_WINDOWS && /^\\\\[^\\]+\\[^\\]+\\$/.test(result)) { result = safeTrimTrailingSeparator(result); } @@ -48881,7 +48881,7 @@ var require_internal_path_helper = __commonJS({ (0, assert_1.default)(hasAbsoluteRoot(root), `ensureAbsoluteRoot parameter 'root' must have an absolute root`); if (root.endsWith("/") || IS_WINDOWS && root.endsWith("\\")) { } else { - root += path16.sep; + root += path13.sep; } return root + itemPath; } @@ -48915,10 +48915,10 @@ var require_internal_path_helper = __commonJS({ return ""; } p = normalizeSeparators(p); - if (!p.endsWith(path16.sep)) { + if (!p.endsWith(path13.sep)) { return p; } - if (p === path16.sep) { + if (p === path13.sep) { return p; } if (IS_WINDOWS && /^[A-Z]:\\$/i.test(p)) { @@ -49263,7 +49263,7 @@ var require_minimatch = __commonJS({ "node_modules/minimatch/minimatch.js"(exports2, module2) { module2.exports = minimatch; minimatch.Minimatch = Minimatch; - var path16 = (function() { + var path13 = (function() { try { return require("path"); } catch (e) { @@ -49271,7 +49271,7 @@ var require_minimatch = __commonJS({ })() || { sep: "/" }; - minimatch.sep = path16.sep; + minimatch.sep = path13.sep; var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {}; var expand2 = require_brace_expansion(); var plTypes = { @@ -49360,8 +49360,8 @@ var require_minimatch = __commonJS({ assertValidPattern(pattern); if (!options) options = {}; pattern = pattern.trim(); - if (!options.allowWindowsEscape && path16.sep !== "/") { - pattern = pattern.split(path16.sep).join("/"); + if (!options.allowWindowsEscape && path13.sep !== "/") { + pattern = pattern.split(path13.sep).join("/"); } this.options = options; this.set = []; @@ -49730,8 +49730,8 @@ var require_minimatch = __commonJS({ if (this.empty) return f === ""; if (f === "/" && partial) return true; var options = this.options; - if (path16.sep !== "/") { - f = f.split(path16.sep).join("/"); + if (path13.sep !== "/") { + f = f.split(path13.sep).join("/"); } f = f.split(slashSplit); this.debug(this.pattern, "split", f); @@ -49877,7 +49877,7 @@ var require_internal_path = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.Path = void 0; - var path16 = __importStar2(require("path")); + var path13 = __importStar2(require("path")); var pathHelper = __importStar2(require_internal_path_helper()); var assert_1 = __importDefault2(require("assert")); var IS_WINDOWS = process.platform === "win32"; @@ -49892,12 +49892,12 @@ var require_internal_path = __commonJS({ (0, assert_1.default)(itemPath, `Parameter 'itemPath' must not be empty`); itemPath = pathHelper.safeTrimTrailingSeparator(itemPath); if (!pathHelper.hasRoot(itemPath)) { - this.segments = itemPath.split(path16.sep); + this.segments = itemPath.split(path13.sep); } else { let remaining = itemPath; let dir = pathHelper.dirname(remaining); while (dir !== remaining) { - const basename = path16.basename(remaining); + const basename = path13.basename(remaining); this.segments.unshift(basename); remaining = dir; dir = pathHelper.dirname(remaining); @@ -49915,7 +49915,7 @@ var require_internal_path = __commonJS({ (0, assert_1.default)(segment === pathHelper.dirname(segment), `Parameter 'itemPath' root segment contains information for multiple segments`); this.segments.push(segment); } else { - (0, assert_1.default)(!segment.includes(path16.sep), `Parameter 'itemPath' contains unexpected path separators`); + (0, assert_1.default)(!segment.includes(path13.sep), `Parameter 'itemPath' contains unexpected path separators`); this.segments.push(segment); } } @@ -49926,12 +49926,12 @@ var require_internal_path = __commonJS({ */ toString() { let result = this.segments[0]; - let skipSlash = result.endsWith(path16.sep) || IS_WINDOWS && /^[A-Z]:$/i.test(result); + let skipSlash = result.endsWith(path13.sep) || IS_WINDOWS && /^[A-Z]:$/i.test(result); for (let i = 1; i < this.segments.length; i++) { if (skipSlash) { skipSlash = false; } else { - result += path16.sep; + result += path13.sep; } result += this.segments[i]; } @@ -49988,8 +49988,8 @@ var require_internal_pattern = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.Pattern = void 0; - var os5 = __importStar2(require("os")); - var path16 = __importStar2(require("path")); + var os4 = __importStar2(require("os")); + var path13 = __importStar2(require("path")); var pathHelper = __importStar2(require_internal_path_helper()); var assert_1 = __importDefault2(require("assert")); var minimatch_1 = require_minimatch(); @@ -50018,7 +50018,7 @@ var require_internal_pattern = __commonJS({ } pattern = _Pattern.fixupPattern(pattern, homedir2); this.segments = new internal_path_1.Path(pattern).segments; - this.trailingSeparator = pathHelper.normalizeSeparators(pattern).endsWith(path16.sep); + this.trailingSeparator = pathHelper.normalizeSeparators(pattern).endsWith(path13.sep); pattern = pathHelper.safeTrimTrailingSeparator(pattern); let foundGlob = false; const searchSegments = this.segments.map((x) => _Pattern.getLiteral(x)).filter((x) => !foundGlob && !(foundGlob = x === "")); @@ -50042,8 +50042,8 @@ var require_internal_pattern = __commonJS({ match(itemPath) { if (this.segments[this.segments.length - 1] === "**") { itemPath = pathHelper.normalizeSeparators(itemPath); - if (!itemPath.endsWith(path16.sep) && this.isImplicitPattern === false) { - itemPath = `${itemPath}${path16.sep}`; + if (!itemPath.endsWith(path13.sep) && this.isImplicitPattern === false) { + itemPath = `${itemPath}${path13.sep}`; } } else { itemPath = pathHelper.safeTrimTrailingSeparator(itemPath); @@ -50078,10 +50078,10 @@ var require_internal_pattern = __commonJS({ (0, assert_1.default)(literalSegments.every((x, i) => (x !== "." || i === 0) && x !== ".."), `Invalid pattern '${pattern}'. Relative pathing '.' and '..' is not allowed.`); (0, assert_1.default)(!pathHelper.hasRoot(pattern) || literalSegments[0], `Invalid pattern '${pattern}'. Root segment must not contain globs.`); pattern = pathHelper.normalizeSeparators(pattern); - if (pattern === "." || pattern.startsWith(`.${path16.sep}`)) { + if (pattern === "." || pattern.startsWith(`.${path13.sep}`)) { pattern = _Pattern.globEscape(process.cwd()) + pattern.substr(1); - } else if (pattern === "~" || pattern.startsWith(`~${path16.sep}`)) { - homedir2 = homedir2 || os5.homedir(); + } else if (pattern === "~" || pattern.startsWith(`~${path13.sep}`)) { + homedir2 = homedir2 || os4.homedir(); (0, assert_1.default)(homedir2, "Unable to determine HOME directory"); (0, assert_1.default)(pathHelper.hasAbsoluteRoot(homedir2), `Expected HOME directory to be a rooted path. Actual '${homedir2}'`); pattern = _Pattern.globEscape(homedir2) + pattern.substr(1); @@ -50164,8 +50164,8 @@ var require_internal_search_state = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.SearchState = void 0; var SearchState = class { - constructor(path16, level) { - this.path = path16; + constructor(path13, level) { + this.path = path13; this.level = level; } }; @@ -50216,11 +50216,11 @@ var require_internal_globber = __commonJS({ })(); var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { - return value instanceof P ? value : new P(function(resolve8) { - resolve8(value); + return value instanceof P ? value : new P(function(resolve7) { + resolve7(value); }); } - return new (P || (P = Promise))(function(resolve8, reject) { + return new (P || (P = Promise))(function(resolve7, reject) { function fulfilled(value) { try { step(generator.next(value)); @@ -50236,7 +50236,7 @@ var require_internal_globber = __commonJS({ } } function step(result) { - result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); + result.done ? resolve7(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); @@ -50249,14 +50249,14 @@ var require_internal_globber = __commonJS({ }, i); function verb(n) { i[n] = o[n] && function(v) { - return new Promise(function(resolve8, reject) { - v = o[n](v), settle(resolve8, reject, v.done, v.value); + return new Promise(function(resolve7, reject) { + v = o[n](v), settle(resolve7, reject, v.done, v.value); }); }; } - function settle(resolve8, reject, d, v) { + function settle(resolve7, reject, d, v) { Promise.resolve(v).then(function(v2) { - resolve8({ value: v2, done: d }); + resolve7({ value: v2, done: d }); }, reject); } }; @@ -50307,9 +50307,9 @@ var require_internal_globber = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.DefaultGlobber = void 0; var core15 = __importStar2(require_core()); - var fs17 = __importStar2(require("fs")); + var fs14 = __importStar2(require("fs")); var globOptionsHelper = __importStar2(require_internal_glob_options_helper()); - var path16 = __importStar2(require("path")); + var path13 = __importStar2(require("path")); var patternHelper = __importStar2(require_internal_pattern_helper()); var internal_match_kind_1 = require_internal_match_kind(); var internal_pattern_1 = require_internal_pattern(); @@ -50361,7 +50361,7 @@ var require_internal_globber = __commonJS({ for (const searchPath of patternHelper.getSearchPaths(patterns)) { core15.debug(`Search path '${searchPath}'`); try { - yield __await2(fs17.promises.lstat(searchPath)); + yield __await2(fs14.promises.lstat(searchPath)); } catch (err) { if (err.code === "ENOENT") { continue; @@ -50385,7 +50385,7 @@ var require_internal_globber = __commonJS({ if (!stats) { continue; } - if (options.excludeHiddenFiles && path16.basename(item.path).match(/^\./)) { + if (options.excludeHiddenFiles && path13.basename(item.path).match(/^\./)) { continue; } if (stats.isDirectory()) { @@ -50395,7 +50395,7 @@ var require_internal_globber = __commonJS({ continue; } const childLevel = item.level + 1; - const childItems = (yield __await2(fs17.promises.readdir(item.path))).map((x) => new internal_search_state_1.SearchState(path16.join(item.path, x), childLevel)); + const childItems = (yield __await2(fs14.promises.readdir(item.path))).map((x) => new internal_search_state_1.SearchState(path13.join(item.path, x), childLevel)); stack.push(...childItems.reverse()); } else if (match & internal_match_kind_1.MatchKind.File) { yield yield __await2(item.path); @@ -50430,7 +50430,7 @@ var require_internal_globber = __commonJS({ let stats; if (options.followSymbolicLinks) { try { - stats = yield fs17.promises.stat(item.path); + stats = yield fs14.promises.stat(item.path); } catch (err) { if (err.code === "ENOENT") { if (options.omitBrokenSymbolicLinks) { @@ -50442,10 +50442,10 @@ var require_internal_globber = __commonJS({ throw err; } } else { - stats = yield fs17.promises.lstat(item.path); + stats = yield fs14.promises.lstat(item.path); } if (stats.isDirectory() && options.followSymbolicLinks) { - const realPath = yield fs17.promises.realpath(item.path); + const realPath = yield fs14.promises.realpath(item.path); while (traversalChain.length >= item.level) { traversalChain.pop(); } @@ -50506,11 +50506,11 @@ var require_internal_hash_files = __commonJS({ })(); var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { - return value instanceof P ? value : new P(function(resolve8) { - resolve8(value); + return value instanceof P ? value : new P(function(resolve7) { + resolve7(value); }); } - return new (P || (P = Promise))(function(resolve8, reject) { + return new (P || (P = Promise))(function(resolve7, reject) { function fulfilled(value) { try { step(generator.next(value)); @@ -50526,7 +50526,7 @@ var require_internal_hash_files = __commonJS({ } } function step(result) { - result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); + result.done ? resolve7(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); @@ -50539,14 +50539,14 @@ var require_internal_hash_files = __commonJS({ }, i); function verb(n) { i[n] = o[n] && function(v) { - return new Promise(function(resolve8, reject) { - v = o[n](v), settle(resolve8, reject, v.done, v.value); + return new Promise(function(resolve7, reject) { + v = o[n](v), settle(resolve7, reject, v.done, v.value); }); }; } - function settle(resolve8, reject, d, v) { + function settle(resolve7, reject, d, v) { Promise.resolve(v).then(function(v2) { - resolve8({ value: v2, done: d }); + resolve7({ value: v2, done: d }); }, reject); } }; @@ -50554,10 +50554,10 @@ var require_internal_hash_files = __commonJS({ exports2.hashFiles = hashFiles2; var crypto3 = __importStar2(require("crypto")); var core15 = __importStar2(require_core()); - var fs17 = __importStar2(require("fs")); - var stream2 = __importStar2(require("stream")); + var fs14 = __importStar2(require("fs")); + var stream = __importStar2(require("stream")); var util = __importStar2(require("util")); - var path16 = __importStar2(require("path")); + var path13 = __importStar2(require("path")); function hashFiles2(globber_1, currentWorkspace_1) { return __awaiter2(this, arguments, void 0, function* (globber, currentWorkspace, verbose = false) { var _a, e_1, _b, _c; @@ -50573,17 +50573,17 @@ var require_internal_hash_files = __commonJS({ _e = false; const file = _c; writeDelegate(file); - if (!file.startsWith(`${githubWorkspace}${path16.sep}`)) { + if (!file.startsWith(`${githubWorkspace}${path13.sep}`)) { writeDelegate(`Ignore '${file}' since it is not under GITHUB_WORKSPACE.`); continue; } - if (fs17.statSync(file).isDirectory()) { + if (fs14.statSync(file).isDirectory()) { writeDelegate(`Skip directory '${file}'.`); continue; } const hash2 = crypto3.createHash("sha256"); - const pipeline = util.promisify(stream2.pipeline); - yield pipeline(fs17.createReadStream(file), hash2); + const pipeline = util.promisify(stream.pipeline); + yield pipeline(fs14.createReadStream(file), hash2); result.write(hash2.digest()); count++; if (!hasMatch) { @@ -50618,11 +50618,11 @@ var require_glob = __commonJS({ "use strict"; var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { - return value instanceof P ? value : new P(function(resolve8) { - resolve8(value); + return value instanceof P ? value : new P(function(resolve7) { + resolve7(value); }); } - return new (P || (P = Promise))(function(resolve8, reject) { + return new (P || (P = Promise))(function(resolve7, reject) { function fulfilled(value) { try { step(generator.next(value)); @@ -50638,7 +50638,7 @@ var require_glob = __commonJS({ } } function step(result) { - result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); + result.done ? resolve7(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); @@ -51898,11 +51898,11 @@ var require_cacheUtils = __commonJS({ })(); var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { - return value instanceof P ? value : new P(function(resolve8) { - resolve8(value); + return value instanceof P ? value : new P(function(resolve7) { + resolve7(value); }); } - return new (P || (P = Promise))(function(resolve8, reject) { + return new (P || (P = Promise))(function(resolve7, reject) { function fulfilled(value) { try { step(generator.next(value)); @@ -51918,7 +51918,7 @@ var require_cacheUtils = __commonJS({ } } function step(result) { - result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); + result.done ? resolve7(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); @@ -51931,14 +51931,14 @@ var require_cacheUtils = __commonJS({ }, i); function verb(n) { i[n] = o[n] && function(v) { - return new Promise(function(resolve8, reject) { - v = o[n](v), settle(resolve8, reject, v.done, v.value); + return new Promise(function(resolve7, reject) { + v = o[n](v), settle(resolve7, reject, v.done, v.value); }); }; } - function settle(resolve8, reject, d, v) { + function settle(resolve7, reject, d, v) { Promise.resolve(v).then(function(v2) { - resolve8({ value: v2, done: d }); + resolve7({ value: v2, done: d }); }, reject); } }; @@ -51958,8 +51958,8 @@ var require_cacheUtils = __commonJS({ var glob2 = __importStar2(require_glob()); var io7 = __importStar2(require_io()); var crypto3 = __importStar2(require("crypto")); - var fs17 = __importStar2(require("fs")); - var path16 = __importStar2(require("path")); + var fs14 = __importStar2(require("fs")); + var path13 = __importStar2(require("path")); var semver9 = __importStar2(require_semver3()); var util = __importStar2(require("util")); var constants_1 = require_constants12(); @@ -51979,15 +51979,15 @@ var require_cacheUtils = __commonJS({ baseLocation = "/home"; } } - tempDirectory = path16.join(baseLocation, "actions", "temp"); + tempDirectory = path13.join(baseLocation, "actions", "temp"); } - const dest = path16.join(tempDirectory, crypto3.randomUUID()); + const dest = path13.join(tempDirectory, crypto3.randomUUID()); yield io7.mkdirP(dest); return dest; }); } function getArchiveFileSizeInBytes(filePath) { - return fs17.statSync(filePath).size; + return fs14.statSync(filePath).size; } function resolvePaths(patterns) { return __awaiter2(this, void 0, void 0, function* () { @@ -52003,7 +52003,7 @@ var require_cacheUtils = __commonJS({ _c = _g.value; _e = false; const file = _c; - const relativeFile = path16.relative(workspace, file).replace(new RegExp(`\\${path16.sep}`, "g"), "/"); + const relativeFile = path13.relative(workspace, file).replace(new RegExp(`\\${path13.sep}`, "g"), "/"); core15.debug(`Matched: ${relativeFile}`); if (relativeFile === "") { paths.push("."); @@ -52025,7 +52025,7 @@ var require_cacheUtils = __commonJS({ } function unlinkFile(filePath) { return __awaiter2(this, void 0, void 0, function* () { - return util.promisify(fs17.unlink)(filePath); + return util.promisify(fs14.unlink)(filePath); }); } function getVersion(app_1) { @@ -52067,7 +52067,7 @@ var require_cacheUtils = __commonJS({ } function getGnuTarPathOnWindows() { return __awaiter2(this, void 0, void 0, function* () { - if (fs17.existsSync(constants_1.GnuTarPathOnWindows)) { + if (fs14.existsSync(constants_1.GnuTarPathOnWindows)) { return constants_1.GnuTarPathOnWindows; } const versionOutput = yield getVersion("tar"); @@ -52220,11 +52220,11 @@ function __metadata(metadataKey, metadataValue) { } function __awaiter(thisArg, _arguments, P, generator) { function adopt(value) { - return value instanceof P ? value : new P(function(resolve8) { - resolve8(value); + return value instanceof P ? value : new P(function(resolve7) { + resolve7(value); }); } - return new (P || (P = Promise))(function(resolve8, reject) { + return new (P || (P = Promise))(function(resolve7, reject) { function fulfilled(value) { try { step(generator.next(value)); @@ -52240,7 +52240,7 @@ function __awaiter(thisArg, _arguments, P, generator) { } } function step(result) { - result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); + result.done ? resolve7(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); @@ -52431,14 +52431,14 @@ function __asyncValues(o) { }, i); function verb(n) { i[n] = o[n] && function(v) { - return new Promise(function(resolve8, reject) { - v = o[n](v), settle(resolve8, reject, v.done, v.value); + return new Promise(function(resolve7, reject) { + v = o[n](v), settle(resolve7, reject, v.done, v.value); }); }; } - function settle(resolve8, reject, d, v) { + function settle(resolve7, reject, d, v) { Promise.resolve(v).then(function(v2) { - resolve8({ value: v2, done: d }); + resolve7({ value: v2, done: d }); }, reject); } } @@ -52530,13 +52530,13 @@ function __disposeResources(env) { } return next(); } -function __rewriteRelativeImportExtension(path16, preserveJsx) { - if (typeof path16 === "string" && /^\.\.?\//.test(path16)) { - return path16.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function(m, tsx, d, ext, cm) { +function __rewriteRelativeImportExtension(path13, preserveJsx) { + if (typeof path13 === "string" && /^\.\.?\//.test(path13)) { + return path13.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function(m, tsx, d, ext, cm) { return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : d + ext + "." + cm.toLowerCase() + "js"; }); } - return path16; + return path13; } var extendStatics, __assign, __createBinding, __setModuleDefault, ownKeys, _SuppressedError, tslib_es6_default; var init_tslib_es6 = __esm({ @@ -53041,8 +53041,8 @@ var require_uuidUtils = __commonJS({ "node_modules/@typespec/ts-http-runtime/dist/commonjs/util/uuidUtils.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.randomUUID = randomUUID2; - function randomUUID2() { + exports2.randomUUID = randomUUID; + function randomUUID() { return crypto.randomUUID(); } } @@ -53606,20 +53606,20 @@ var require_nodeHttpClient = __commonJS({ function isReadableStream(body) { return body && typeof body.pipe === "function"; } - function isStreamComplete(stream2) { - if (stream2.readable === false) { + function isStreamComplete(stream) { + if (stream.readable === false) { return Promise.resolve(); } - return new Promise((resolve8) => { + return new Promise((resolve7) => { const handler2 = () => { - resolve8(); - stream2.removeListener("close", handler2); - stream2.removeListener("end", handler2); - stream2.removeListener("error", handler2); + resolve7(); + stream.removeListener("close", handler2); + stream.removeListener("end", handler2); + stream.removeListener("error", handler2); }; - stream2.on("close", handler2); - stream2.on("end", handler2); - stream2.on("error", handler2); + stream.on("close", handler2); + stream.on("end", handler2); + stream.on("error", handler2); }); } function isArrayBuffer(body) { @@ -53767,8 +53767,8 @@ var require_nodeHttpClient = __commonJS({ headers: request2.headers.toJSON({ preserveCase: true }), ...request2.requestOverrides }; - return new Promise((resolve8, reject) => { - const req = isInsecure ? node_http_1.default.request(options, resolve8) : node_https_1.default.request(options, resolve8); + return new Promise((resolve7, reject) => { + const req = isInsecure ? node_http_1.default.request(options, resolve7) : node_https_1.default.request(options, resolve7); req.once("error", (err) => { reject(new restError_js_1.RestError(err.message, { code: err.code ?? restError_js_1.RestError.REQUEST_SEND_ERROR, request: request2 })); }); @@ -53838,33 +53838,33 @@ var require_nodeHttpClient = __commonJS({ } return headers; } - function getDecodedResponseStream(stream2, headers) { + function getDecodedResponseStream(stream, headers) { const contentEncoding = headers.get("Content-Encoding"); if (contentEncoding === "gzip") { const unzip = node_zlib_1.default.createGunzip(); - stream2.pipe(unzip); + stream.pipe(unzip); return unzip; } else if (contentEncoding === "deflate") { const inflate = node_zlib_1.default.createInflate(); - stream2.pipe(inflate); + stream.pipe(inflate); return inflate; } - return stream2; + return stream; } - function streamToText(stream2) { - return new Promise((resolve8, reject) => { + function streamToText(stream) { + return new Promise((resolve7, reject) => { const buffer = []; - stream2.on("data", (chunk) => { + stream.on("data", (chunk) => { if (Buffer.isBuffer(chunk)) { buffer.push(chunk); } else { buffer.push(Buffer.from(chunk)); } }); - stream2.on("end", () => { - resolve8(Buffer.concat(buffer).toString("utf8")); + stream.on("end", () => { + resolve7(Buffer.concat(buffer).toString("utf8")); }); - stream2.on("error", (e) => { + stream.on("error", (e) => { if (e && e?.name === "AbortError") { reject(e); } else { @@ -54140,7 +54140,7 @@ var require_helpers2 = __commonJS({ var AbortError_js_1 = require_AbortError(); var StandardAbortMessage = "The operation was aborted."; function delay2(delayInMs, value, options) { - return new Promise((resolve8, reject) => { + return new Promise((resolve7, reject) => { let timer = void 0; let onAborted = void 0; const rejectOnAbort = () => { @@ -54163,7 +54163,7 @@ var require_helpers2 = __commonJS({ } timer = setTimeout(() => { removeListeners(); - resolve8(value); + resolve7(value); }, delayInMs); if (options?.abortSignal) { options.abortSignal.addEventListener("abort", onAborted); @@ -54983,7 +54983,7 @@ var require_has_flag = __commonJS({ var require_supports_color = __commonJS({ "node_modules/supports-color/index.js"(exports2, module2) { "use strict"; - var os5 = require("os"); + var os4 = require("os"); var tty = require("tty"); var hasFlag = require_has_flag(); var { env } = process; @@ -55031,7 +55031,7 @@ var require_supports_color = __commonJS({ return min; } if (process.platform === "win32") { - const osRelease = os5.release().split("."); + const osRelease = os4.release().split("."); if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) { return Number(osRelease[2]) >= 14931 ? 3 : 2; } @@ -55069,8 +55069,8 @@ var require_supports_color = __commonJS({ } return min; } - function getSupportLevel(stream2) { - const level = supportsColor(stream2, stream2 && stream2.isTTY); + function getSupportLevel(stream) { + const level = supportsColor(stream, stream && stream.isTTY); return translateLevel(level); } module2.exports = { @@ -55301,18 +55301,18 @@ var require_helpers3 = __commonJS({ exports2.req = exports2.json = exports2.toBuffer = void 0; var http = __importStar2(require("http")); var https2 = __importStar2(require("https")); - async function toBuffer(stream2) { + async function toBuffer(stream) { let length = 0; const chunks = []; - for await (const chunk of stream2) { + for await (const chunk of stream) { length += chunk.length; chunks.push(chunk); } return Buffer.concat(chunks, length); } exports2.toBuffer = toBuffer; - async function json2(stream2) { - const buf = await toBuffer(stream2); + async function json2(stream) { + const buf = await toBuffer(stream); const str2 = buf.toString("utf8"); try { return JSON.parse(str2); @@ -55326,8 +55326,8 @@ var require_helpers3 = __commonJS({ function req(url2, opts = {}) { const href = typeof url2 === "string" ? url2 : url2.href; const req2 = (href.startsWith("https:") ? https2 : http).request(url2, opts); - const promise = new Promise((resolve8, reject) => { - req2.once("response", resolve8).once("error", reject).end(); + const promise = new Promise((resolve7, reject) => { + req2.once("response", resolve7).once("error", reject).end(); }); req2.then = promise.then.bind(promise); return req2; @@ -55504,7 +55504,7 @@ var require_parse_proxy_response = __commonJS({ var debug_1 = __importDefault2(require_src()); var debug5 = (0, debug_1.default)("https-proxy-agent:parse-proxy-response"); function parseProxyResponse(socket) { - return new Promise((resolve8, reject) => { + return new Promise((resolve7, reject) => { let buffersLength = 0; const buffers = []; function read() { @@ -55570,7 +55570,7 @@ var require_parse_proxy_response = __commonJS({ } debug5("got proxy server response: %o %o", firstLine, headers); cleanup(); - resolve8({ + resolve7({ connect: { statusCode, statusText, @@ -56121,12 +56121,12 @@ var require_concat = __commonJS({ webStream.values = streamAsyncIterator.bind(webStream); } } - function ensureNodeStream(stream2) { - if (stream2 instanceof ReadableStream) { - makeAsyncIterable(stream2); - return stream_1.Readable.fromWeb(stream2); + function ensureNodeStream(stream) { + if (stream instanceof ReadableStream) { + makeAsyncIterable(stream); + return stream_1.Readable.fromWeb(stream); } else { - return stream2; + return stream; } } function toStream(source) { @@ -56142,8 +56142,8 @@ var require_concat = __commonJS({ return function() { const streams = sources.map((x) => typeof x === "function" ? x() : x).map(toStream); return stream_1.Readable.from((async function* () { - for (const stream2 of streams) { - for await (const chunk of stream2) { + for (const stream of streams) { + for await (const chunk of stream) { yield chunk; } } @@ -56678,9 +56678,9 @@ var require_sendRequest = __commonJS({ try { const response = await pipeline.sendRequest(httpClient, request2); const headers = response.headers.toJSON(); - const stream2 = response.readableStreamBody ?? response.browserStreamBody; - const parsedBody = options.responseAsStream || stream2 !== void 0 ? void 0 : getResponseBody(response); - const body = stream2 ?? parsedBody; + const stream = response.readableStreamBody ?? response.browserStreamBody; + const parsedBody = options.responseAsStream || stream !== void 0 ? void 0 : getResponseBody(response); + const body = stream ?? parsedBody; if (options?.onResponse) { options.onResponse({ ...response, request: request2, rawHeaders: headers, parsedBody }); } @@ -56950,8 +56950,8 @@ var require_getClient = __commonJS({ } const { allowInsecureConnection, httpClient } = clientOptions; const endpointUrl = clientOptions.endpoint ?? endpoint2; - const client = (path16, ...args) => { - const getUrl = (requestOptions) => (0, urlHelpers_js_1.buildRequestUrl)(endpointUrl, path16, args, { allowInsecureConnection, ...requestOptions }); + const client = (path13, ...args) => { + const getUrl = (requestOptions) => (0, urlHelpers_js_1.buildRequestUrl)(endpointUrl, path13, args, { allowInsecureConnection, ...requestOptions }); return { get: (requestOptions = {}) => { return buildOperation("GET", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); @@ -57656,7 +57656,7 @@ var require_createAbortablePromise = __commonJS({ var abort_controller_1 = require_commonjs3(); function createAbortablePromise(buildPromise, options) { const { cleanupBeforeAbort, abortSignal, abortErrorMsg } = options ?? {}; - return new Promise((resolve8, reject) => { + return new Promise((resolve7, reject) => { function rejectOnAbort() { reject(new abort_controller_1.AbortError(abortErrorMsg ?? "The operation was aborted.")); } @@ -57674,7 +57674,7 @@ var require_createAbortablePromise = __commonJS({ try { buildPromise((x) => { removeListeners(); - resolve8(x); + resolve7(x); }, (x) => { removeListeners(); reject(x); @@ -57701,8 +57701,8 @@ var require_delay2 = __commonJS({ function delay2(timeInMs, options) { let token; const { abortSignal, abortErrorMsg } = options ?? {}; - return (0, createAbortablePromise_js_1.createAbortablePromise)((resolve8) => { - token = setTimeout(resolve8, timeInMs); + return (0, createAbortablePromise_js_1.createAbortablePromise)((resolve7) => { + token = setTimeout(resolve7, timeInMs); }, { cleanupBeforeAbort: () => clearTimeout(token), abortSignal, @@ -57785,7 +57785,7 @@ var require_commonjs4 = __commonJS({ exports2.getRandomIntegerInclusive = getRandomIntegerInclusive; exports2.isError = isError; exports2.isObject = isObject2; - exports2.randomUUID = randomUUID2; + exports2.randomUUID = randomUUID; exports2.uint8ArrayToString = uint8ArrayToString; exports2.stringToUint8Array = stringToUint8Array; var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); @@ -57834,7 +57834,7 @@ var require_commonjs4 = __commonJS({ function isObject2(input) { return tspRuntime.isObject(input); } - function randomUUID2() { + function randomUUID() { return tspRuntime.randomUUID(); } exports2.isBrowser = tspRuntime.isBrowser; @@ -57892,7 +57892,7 @@ var require_file3 = __commonJS({ return blob; } } - function createFileFromStream(stream2, name, options = {}) { + function createFileFromStream(stream, name, options = {}) { return { ...unimplementedMethods, type: options.type ?? "", @@ -57901,13 +57901,13 @@ var require_file3 = __commonJS({ size: options.size ?? -1, name, stream: () => { - const s = stream2(); + const s = stream(); if (isNodeReadableStream(s)) { throw new Error("Not supported: a Node stream was provided as input to createFileFromStream."); } return s; }, - [rawContent]: stream2 + [rawContent]: stream }; } function createFile(content, name, options = {}) { @@ -60822,15 +60822,15 @@ var require_urlHelpers2 = __commonJS({ let isAbsolutePath = false; let requestUrl = replaceAll(baseUri, urlReplacements); if (operationSpec.path) { - let path16 = replaceAll(operationSpec.path, urlReplacements); - if (operationSpec.path === "/{nextLink}" && path16.startsWith("/")) { - path16 = path16.substring(1); + let path13 = replaceAll(operationSpec.path, urlReplacements); + if (operationSpec.path === "/{nextLink}" && path13.startsWith("/")) { + path13 = path13.substring(1); } - if (isAbsoluteUrl(path16)) { - requestUrl = path16; + if (isAbsoluteUrl(path13)) { + requestUrl = path13; isAbsolutePath = true; } else { - requestUrl = appendPath(requestUrl, path16); + requestUrl = appendPath(requestUrl, path13); } } const { queryParams, sequenceParams } = calculateQueryParameters(operationSpec, operationArguments, fallbackObject); @@ -60876,9 +60876,9 @@ var require_urlHelpers2 = __commonJS({ } const searchStart = pathToAppend.indexOf("?"); if (searchStart !== -1) { - const path16 = pathToAppend.substring(0, searchStart); + const path13 = pathToAppend.substring(0, searchStart); const search = pathToAppend.substring(searchStart + 1); - newPath = newPath + path16; + newPath = newPath + path13; if (search) { parsedUrl.search = parsedUrl.search ? `${parsedUrl.search}&${search}` : search; } @@ -63129,10 +63129,10 @@ var require_utils_common = __commonJS({ var constants_js_1 = require_constants15(); function escapeURLPath(url2) { const urlParsed = new URL(url2); - let path16 = urlParsed.pathname; - path16 = path16 || "/"; - path16 = escape(path16); - urlParsed.pathname = path16; + let path13 = urlParsed.pathname; + path13 = path13 || "/"; + path13 = escape(path13); + urlParsed.pathname = path13; return urlParsed.toString(); } function getProxyUriFromDevConnString(connectionString) { @@ -63217,9 +63217,9 @@ var require_utils_common = __commonJS({ } function appendToURLPath(url2, name) { const urlParsed = new URL(url2); - let path16 = urlParsed.pathname; - path16 = path16 ? path16.endsWith("/") ? `${path16}${name}` : `${path16}/${name}` : name; - urlParsed.pathname = path16; + let path13 = urlParsed.pathname; + path13 = path13 ? path13.endsWith("/") ? `${path13}${name}` : `${path13}/${name}` : name; + urlParsed.pathname = path13; return urlParsed.toString(); } function setURLParameter(url2, name, value) { @@ -63334,7 +63334,7 @@ var require_utils_common = __commonJS({ return base64encode(res); } async function delay2(timeInMs, aborter, abortError) { - return new Promise((resolve8, reject) => { + return new Promise((resolve7, reject) => { let timeout; const abortHandler = () => { if (timeout !== void 0) { @@ -63346,7 +63346,7 @@ var require_utils_common = __commonJS({ if (aborter !== void 0) { aborter.removeEventListener("abort", abortHandler); } - resolve8(); + resolve7(); }; timeout = setTimeout(resolveHandler, timeInMs); if (aborter !== void 0) { @@ -64446,9 +64446,9 @@ var require_StorageSharedKeyCredentialPolicy = __commonJS({ * @param request - */ getCanonicalizedResourceString(request2) { - const path16 = (0, utils_common_js_1.getURLPath)(request2.url) || "/"; + const path13 = (0, utils_common_js_1.getURLPath)(request2.url) || "/"; let canonicalizedResourceString = ""; - canonicalizedResourceString += `/${this.factory.accountName}${path16}`; + canonicalizedResourceString += `/${this.factory.accountName}${path13}`; const queries = (0, utils_common_js_1.getURLQueries)(request2.url); const lowercaseQueries = {}; if (queries) { @@ -64887,7 +64887,7 @@ var require_BufferScheduler = __commonJS({ * */ async do() { - return new Promise((resolve8, reject) => { + return new Promise((resolve7, reject) => { this.readable.on("data", (data) => { data = typeof data === "string" ? Buffer.from(data, this.encoding) : data; this.appendUnresolvedData(data); @@ -64915,11 +64915,11 @@ var require_BufferScheduler = __commonJS({ if (this.isStreamEnd && this.executingOutgoingHandlers === 0) { if (this.unresolvedLength > 0 && this.unresolvedLength < this.bufferSize) { const buffer = this.shiftBufferFromUnresolvedDataArray(); - this.outgoingHandler(() => buffer.getReadableStream(), buffer.size, this.offset).then(resolve8).catch(reject); + this.outgoingHandler(() => buffer.getReadableStream(), buffer.size, this.offset).then(resolve7).catch(reject); } else if (this.unresolvedLength >= this.bufferSize) { return; } else { - resolve8(); + resolve7(); } } }); @@ -65187,10 +65187,10 @@ var require_utils_common2 = __commonJS({ var constants_js_1 = require_constants16(); function escapeURLPath(url2) { const urlParsed = new URL(url2); - let path16 = urlParsed.pathname; - path16 = path16 || "/"; - path16 = escape(path16); - urlParsed.pathname = path16; + let path13 = urlParsed.pathname; + path13 = path13 || "/"; + path13 = escape(path13); + urlParsed.pathname = path13; return urlParsed.toString(); } function getProxyUriFromDevConnString(connectionString) { @@ -65275,9 +65275,9 @@ var require_utils_common2 = __commonJS({ } function appendToURLPath(url2, name) { const urlParsed = new URL(url2); - let path16 = urlParsed.pathname; - path16 = path16 ? path16.endsWith("/") ? `${path16}${name}` : `${path16}/${name}` : name; - urlParsed.pathname = path16; + let path13 = urlParsed.pathname; + path13 = path13 ? path13.endsWith("/") ? `${path13}${name}` : `${path13}/${name}` : name; + urlParsed.pathname = path13; return urlParsed.toString(); } function setURLParameter(url2, name, value) { @@ -65392,7 +65392,7 @@ var require_utils_common2 = __commonJS({ return base64encode(res); } async function delay2(timeInMs, aborter, abortError) { - return new Promise((resolve8, reject) => { + return new Promise((resolve7, reject) => { let timeout; const abortHandler = () => { if (timeout !== void 0) { @@ -65404,7 +65404,7 @@ var require_utils_common2 = __commonJS({ if (aborter !== void 0) { aborter.removeEventListener("abort", abortHandler); } - resolve8(); + resolve7(); }; timeout = setTimeout(resolveHandler, timeInMs); if (aborter !== void 0) { @@ -66198,9 +66198,9 @@ var require_StorageSharedKeyCredentialPolicy2 = __commonJS({ * @param request - */ getCanonicalizedResourceString(request2) { - const path16 = (0, utils_common_js_1.getURLPath)(request2.url) || "/"; + const path13 = (0, utils_common_js_1.getURLPath)(request2.url) || "/"; let canonicalizedResourceString = ""; - canonicalizedResourceString += `/${this.factory.accountName}${path16}`; + canonicalizedResourceString += `/${this.factory.accountName}${path13}`; const queries = (0, utils_common_js_1.getURLQueries)(request2.url); const lowercaseQueries = {}; if (queries) { @@ -66830,9 +66830,9 @@ var require_StorageSharedKeyCredentialPolicyV2 = __commonJS({ return canonicalizedHeadersStringToSign; } function getCanonicalizedResourceString(request2) { - const path16 = (0, utils_common_js_1.getURLPath)(request2.url) || "/"; + const path13 = (0, utils_common_js_1.getURLPath)(request2.url) || "/"; let canonicalizedResourceString = ""; - canonicalizedResourceString += `/${options.accountName}${path16}`; + canonicalizedResourceString += `/${options.accountName}${path13}`; const queries = (0, utils_common_js_1.getURLQueries)(request2.url); const lowercaseQueries = {}; if (queries) { @@ -67177,9 +67177,9 @@ var require_StorageSharedKeyCredentialPolicyV22 = __commonJS({ return canonicalizedHeadersStringToSign; } function getCanonicalizedResourceString(request2) { - const path16 = (0, utils_common_js_1.getURLPath)(request2.url) || "/"; + const path13 = (0, utils_common_js_1.getURLPath)(request2.url) || "/"; let canonicalizedResourceString = ""; - canonicalizedResourceString += `/${options.accountName}${path16}`; + canonicalizedResourceString += `/${options.accountName}${path13}`; const queries = (0, utils_common_js_1.getURLQueries)(request2.url); const lowercaseQueries = {}; if (queries) { @@ -83105,8 +83105,8 @@ var require_AvroParser = __commonJS({ * @param length - * @param options - */ - static async readFixedBytes(stream2, length, options = {}) { - const bytes = await stream2.read(length, { abortSignal: options.abortSignal }); + static async readFixedBytes(stream, length, options = {}) { + const bytes = await stream.read(length, { abortSignal: options.abortSignal }); if (bytes.length !== length) { throw new Error("Hit stream end."); } @@ -83118,19 +83118,19 @@ var require_AvroParser = __commonJS({ * @param stream - * @param options - */ - static async readByte(stream2, options = {}) { - const buf = await _AvroParser.readFixedBytes(stream2, 1, options); + static async readByte(stream, options = {}) { + const buf = await _AvroParser.readFixedBytes(stream, 1, options); return buf[0]; } // int and long are stored in variable-length zig-zag coding. // variable-length: https://lucene.apache.org/core/3_5_0/fileformats.html#VInt // zig-zag: https://developers.google.com/protocol-buffers/docs/encoding?csw=1#types - static async readZigZagLong(stream2, options = {}) { + static async readZigZagLong(stream, options = {}) { let zigZagEncoded = 0; let significanceInBit = 0; let byte, haveMoreByte, significanceInFloat; do { - byte = await _AvroParser.readByte(stream2, options); + byte = await _AvroParser.readByte(stream, options); haveMoreByte = byte & 128; zigZagEncoded |= (byte & 127) << significanceInBit; significanceInBit += 7; @@ -83139,7 +83139,7 @@ var require_AvroParser = __commonJS({ zigZagEncoded = zigZagEncoded; significanceInFloat = 268435456; do { - byte = await _AvroParser.readByte(stream2, options); + byte = await _AvroParser.readByte(stream, options); zigZagEncoded += (byte & 127) * significanceInFloat; significanceInFloat *= 128; } while (byte & 128); @@ -83151,17 +83151,17 @@ var require_AvroParser = __commonJS({ } return zigZagEncoded >> 1 ^ -(zigZagEncoded & 1); } - static async readLong(stream2, options = {}) { - return _AvroParser.readZigZagLong(stream2, options); + static async readLong(stream, options = {}) { + return _AvroParser.readZigZagLong(stream, options); } - static async readInt(stream2, options = {}) { - return _AvroParser.readZigZagLong(stream2, options); + static async readInt(stream, options = {}) { + return _AvroParser.readZigZagLong(stream, options); } static async readNull() { return null; } - static async readBoolean(stream2, options = {}) { - const b = await _AvroParser.readByte(stream2, options); + static async readBoolean(stream, options = {}) { + const b = await _AvroParser.readByte(stream, options); if (b === 1) { return true; } else if (b === 0) { @@ -83170,53 +83170,53 @@ var require_AvroParser = __commonJS({ throw new Error("Byte was not a boolean."); } } - static async readFloat(stream2, options = {}) { - const u8arr = await _AvroParser.readFixedBytes(stream2, 4, options); + static async readFloat(stream, options = {}) { + const u8arr = await _AvroParser.readFixedBytes(stream, 4, options); const view = new DataView(u8arr.buffer, u8arr.byteOffset, u8arr.byteLength); return view.getFloat32(0, true); } - static async readDouble(stream2, options = {}) { - const u8arr = await _AvroParser.readFixedBytes(stream2, 8, options); + static async readDouble(stream, options = {}) { + const u8arr = await _AvroParser.readFixedBytes(stream, 8, options); const view = new DataView(u8arr.buffer, u8arr.byteOffset, u8arr.byteLength); return view.getFloat64(0, true); } - static async readBytes(stream2, options = {}) { - const size = await _AvroParser.readLong(stream2, options); + static async readBytes(stream, options = {}) { + const size = await _AvroParser.readLong(stream, options); if (size < 0) { throw new Error("Bytes size was negative."); } - return stream2.read(size, { abortSignal: options.abortSignal }); + return stream.read(size, { abortSignal: options.abortSignal }); } - static async readString(stream2, options = {}) { - const u8arr = await _AvroParser.readBytes(stream2, options); + static async readString(stream, options = {}) { + const u8arr = await _AvroParser.readBytes(stream, options); const utf8decoder = new TextDecoder(); return utf8decoder.decode(u8arr); } - static async readMapPair(stream2, readItemMethod, options = {}) { - const key = await _AvroParser.readString(stream2, options); - const value = await readItemMethod(stream2, options); + static async readMapPair(stream, readItemMethod, options = {}) { + const key = await _AvroParser.readString(stream, options); + const value = await readItemMethod(stream, options); return { key, value }; } - static async readMap(stream2, readItemMethod, options = {}) { + static async readMap(stream, readItemMethod, options = {}) { const readPairMethod = (s, opts = {}) => { return _AvroParser.readMapPair(s, readItemMethod, opts); }; - const pairs2 = await _AvroParser.readArray(stream2, readPairMethod, options); + const pairs2 = await _AvroParser.readArray(stream, readPairMethod, options); const dict = {}; for (const pair of pairs2) { dict[pair.key] = pair.value; } return dict; } - static async readArray(stream2, readItemMethod, options = {}) { + static async readArray(stream, readItemMethod, options = {}) { const items = []; - for (let count = await _AvroParser.readLong(stream2, options); count !== 0; count = await _AvroParser.readLong(stream2, options)) { + for (let count = await _AvroParser.readLong(stream, options); count !== 0; count = await _AvroParser.readLong(stream, options)) { if (count < 0) { - await _AvroParser.readLong(stream2, options); + await _AvroParser.readLong(stream, options); count = -count; } while (count--) { - const item = await readItemMethod(stream2, options); + const item = await readItemMethod(stream, options); items.push(item); } } @@ -83328,24 +83328,24 @@ var require_AvroParser = __commonJS({ this._primitive = primitive; } // eslint-disable-next-line @typescript-eslint/no-wrapper-object-types - read(stream2, options = {}) { + read(stream, options = {}) { switch (this._primitive) { case AvroPrimitive.NULL: return AvroParser.readNull(); case AvroPrimitive.BOOLEAN: - return AvroParser.readBoolean(stream2, options); + return AvroParser.readBoolean(stream, options); case AvroPrimitive.INT: - return AvroParser.readInt(stream2, options); + return AvroParser.readInt(stream, options); case AvroPrimitive.LONG: - return AvroParser.readLong(stream2, options); + return AvroParser.readLong(stream, options); case AvroPrimitive.FLOAT: - return AvroParser.readFloat(stream2, options); + return AvroParser.readFloat(stream, options); case AvroPrimitive.DOUBLE: - return AvroParser.readDouble(stream2, options); + return AvroParser.readDouble(stream, options); case AvroPrimitive.BYTES: - return AvroParser.readBytes(stream2, options); + return AvroParser.readBytes(stream, options); case AvroPrimitive.STRING: - return AvroParser.readString(stream2, options); + return AvroParser.readString(stream, options); default: throw new Error("Unknown Avro Primitive"); } @@ -83358,8 +83358,8 @@ var require_AvroParser = __commonJS({ this._symbols = symbols; } // eslint-disable-next-line @typescript-eslint/no-wrapper-object-types - async read(stream2, options = {}) { - const value = await AvroParser.readInt(stream2, options); + async read(stream, options = {}) { + const value = await AvroParser.readInt(stream, options); return this._symbols[value]; } }; @@ -83369,9 +83369,9 @@ var require_AvroParser = __commonJS({ super(); this._types = types; } - async read(stream2, options = {}) { - const typeIndex = await AvroParser.readInt(stream2, options); - return this._types[typeIndex].read(stream2, options); + async read(stream, options = {}) { + const typeIndex = await AvroParser.readInt(stream, options); + return this._types[typeIndex].read(stream, options); } }; var AvroMapType = class extends AvroType { @@ -83381,11 +83381,11 @@ var require_AvroParser = __commonJS({ this._itemType = itemType; } // eslint-disable-next-line @typescript-eslint/no-wrapper-object-types - read(stream2, options = {}) { + read(stream, options = {}) { const readItemMethod = (s, opts) => { return this._itemType.read(s, opts); }; - return AvroParser.readMap(stream2, readItemMethod, options); + return AvroParser.readMap(stream, readItemMethod, options); } }; var AvroRecordType = class extends AvroType { @@ -83397,12 +83397,12 @@ var require_AvroParser = __commonJS({ this._name = name; } // eslint-disable-next-line @typescript-eslint/no-wrapper-object-types - async read(stream2, options = {}) { + async read(stream, options = {}) { const record = {}; record["$schema"] = this._name; for (const key in this._fields) { if (Object.prototype.hasOwnProperty.call(this._fields, key)) { - record[key] = await this._fields[key].read(stream2, options); + record[key] = await this._fields[key].read(stream, options); } } return record; @@ -83602,7 +83602,7 @@ var require_AvroReadableFromStream = __commonJS({ this._position += chunk.length; return this.toUint8Array(chunk); } else { - return new Promise((resolve8, reject) => { + return new Promise((resolve7, reject) => { const cleanUp = () => { this._readable.removeListener("readable", readableCallback); this._readable.removeListener("error", rejectCallback); @@ -83617,7 +83617,7 @@ var require_AvroReadableFromStream = __commonJS({ if (callbackChunk) { this._position += callbackChunk.length; cleanUp(); - resolve8(this.toUint8Array(callbackChunk)); + resolve7(this.toUint8Array(callbackChunk)); } }; const rejectCallback = () => { @@ -85097,8 +85097,8 @@ var require_poller3 = __commonJS({ this.stopped = true; this.pollProgressCallbacks = []; this.operation = operation; - this.promise = new Promise((resolve8, reject) => { - this.resolve = resolve8; + this.promise = new Promise((resolve7, reject) => { + this.resolve = resolve7; this.reject = reject; }); this.promise.catch(() => { @@ -85351,7 +85351,7 @@ var require_lroEngine = __commonJS({ * The method used by the poller to wait before attempting to update its operation. */ delay() { - return new Promise((resolve8) => setTimeout(() => resolve8(), this.config.intervalInMs)); + return new Promise((resolve7) => setTimeout(() => resolve7(), this.config.intervalInMs)); } }; exports2.LroEngine = LroEngine; @@ -85597,8 +85597,8 @@ var require_Batch = __commonJS({ return Promise.resolve(); } this.parallelExecute(); - return new Promise((resolve8, reject) => { - this.emitter.on("finish", resolve8); + return new Promise((resolve7, reject) => { + this.emitter.on("finish", resolve7); this.emitter.on("error", (error3) => { this.state = BatchStates.Error; reject(error3); @@ -85656,18 +85656,18 @@ var require_utils7 = __commonJS({ var node_fs_1 = tslib_1.__importDefault(require("node:fs")); var node_util_1 = tslib_1.__importDefault(require("node:util")); var constants_js_1 = require_constants15(); - async function streamToBuffer(stream2, buffer, offset, end, encoding) { + async function streamToBuffer(stream, buffer, offset, end, encoding) { let pos = 0; const count = end - offset; - return new Promise((resolve8, reject) => { + return new Promise((resolve7, reject) => { const timeout = setTimeout(() => reject(new Error(`The operation cannot be completed in timeout.`)), constants_js_1.REQUEST_TIMEOUT); - stream2.on("readable", () => { + stream.on("readable", () => { if (pos >= count) { clearTimeout(timeout); - resolve8(); + resolve7(); return; } - let chunk = stream2.read(); + let chunk = stream.read(); if (!chunk) { return; } @@ -85678,25 +85678,25 @@ var require_utils7 = __commonJS({ buffer.fill(chunk.slice(0, chunkLength), offset + pos, offset + pos + chunkLength); pos += chunkLength; }); - stream2.on("end", () => { + stream.on("end", () => { clearTimeout(timeout); if (pos < count) { reject(new Error(`Stream drains before getting enough data needed. Data read: ${pos}, data need: ${count}`)); } - resolve8(); + resolve7(); }); - stream2.on("error", (msg) => { + stream.on("error", (msg) => { clearTimeout(timeout); reject(msg); }); }); } - async function streamToBuffer2(stream2, buffer, encoding) { + async function streamToBuffer2(stream, buffer, encoding) { let pos = 0; const bufferSize = buffer.length; - return new Promise((resolve8, reject) => { - stream2.on("readable", () => { - let chunk = stream2.read(); + return new Promise((resolve7, reject) => { + stream.on("readable", () => { + let chunk = stream.read(); if (!chunk) { return; } @@ -85710,26 +85710,26 @@ var require_utils7 = __commonJS({ buffer.fill(chunk, pos, pos + chunk.length); pos += chunk.length; }); - stream2.on("end", () => { - resolve8(pos); + stream.on("end", () => { + resolve7(pos); }); - stream2.on("error", reject); + stream.on("error", reject); }); } async function streamToBuffer3(readableStream, encoding) { - return new Promise((resolve8, reject) => { + return new Promise((resolve7, reject) => { const chunks = []; readableStream.on("data", (data) => { chunks.push(typeof data === "string" ? Buffer.from(data, encoding) : data); }); readableStream.on("end", () => { - resolve8(Buffer.concat(chunks)); + resolve7(Buffer.concat(chunks)); }); readableStream.on("error", reject); }); } async function readStreamToLocalFile(rs, file) { - return new Promise((resolve8, reject) => { + return new Promise((resolve7, reject) => { const ws = node_fs_1.default.createWriteStream(file); rs.on("error", (err) => { reject(err); @@ -85737,7 +85737,7 @@ var require_utils7 = __commonJS({ ws.on("error", (err) => { reject(err); }); - ws.on("close", resolve8); + ws.on("close", resolve7); rs.pipe(ws); }); } @@ -86551,8 +86551,8 @@ var require_Clients = __commonJS({ customerProvidedKey: options.customerProvidedKey, tracingOptions: updatedOptions.tracingOptions }); - const stream2 = response.readableStreamBody; - await (0, utils_js_1.streamToBuffer)(stream2, buffer, off - offset, chunkEnd - offset); + const stream = response.readableStreamBody; + await (0, utils_js_1.streamToBuffer)(stream, buffer, off - offset, chunkEnd - offset); transferProgress += chunkEnd - off; if (options.onProgress) { options.onProgress({ loadedBytes: transferProgress }); @@ -86676,7 +86676,7 @@ var require_Clients = __commonJS({ * @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token. */ generateSasUrl(options) { - return new Promise((resolve8) => { + return new Promise((resolve7) => { if (!(this.credential instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential)) { throw new RangeError("Can only generate the SAS when the client is initialized with a shared key credential"); } @@ -86687,7 +86687,7 @@ var require_Clients = __commonJS({ versionId: this._versionId, ...options }, this.credential).toString(); - resolve8((0, utils_common_js_1.appendToURLQuery)(this.url, sas)); + resolve7((0, utils_common_js_1.appendToURLQuery)(this.url, sas)); }); } /** @@ -86726,7 +86726,7 @@ var require_Clients = __commonJS({ * @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token. */ generateUserDelegationSasUrl(options, userDelegationKey) { - return new Promise((resolve8) => { + return new Promise((resolve7) => { const sas = (0, BlobSASSignatureValues_js_1.generateBlobSASQueryParameters)({ containerName: this._containerName, blobName: this._name, @@ -86734,7 +86734,7 @@ var require_Clients = __commonJS({ versionId: this._versionId, ...options }, userDelegationKey, this.accountName).toString(); - resolve8((0, utils_common_js_1.appendToURLQuery)(this.url, sas)); + resolve7((0, utils_common_js_1.appendToURLQuery)(this.url, sas)); }); } /** @@ -87655,7 +87655,7 @@ var require_Clients = __commonJS({ * @param options - Options to Upload Stream to Block Blob operation. * @returns Response data for the Blob Upload operation. */ - async uploadStream(stream2, bufferSize = constants_js_1.DEFAULT_BLOCK_BUFFER_SIZE_BYTES, maxConcurrency = 5, options = {}) { + async uploadStream(stream, bufferSize = constants_js_1.DEFAULT_BLOCK_BUFFER_SIZE_BYTES, maxConcurrency = 5, options = {}) { if (!options.blobHTTPHeaders) { options.blobHTTPHeaders = {}; } @@ -87668,7 +87668,7 @@ var require_Clients = __commonJS({ let transferProgress = 0; const blockList = []; const scheduler = new storage_common_1.BufferScheduler( - stream2, + stream, bufferSize, maxConcurrency, async (body, length) => { @@ -88589,14 +88589,14 @@ var require_Mutex = __commonJS({ * @param key - lock key */ static async lock(key) { - return new Promise((resolve8) => { + return new Promise((resolve7) => { if (this.keys[key] === void 0 || this.keys[key] === MutexLockStatus.UNLOCKED) { this.keys[key] = MutexLockStatus.LOCKED; - resolve8(); + resolve7(); } else { this.onUnlockEvent(key, () => { this.keys[key] = MutexLockStatus.LOCKED; - resolve8(); + resolve7(); }); } }); @@ -88607,12 +88607,12 @@ var require_Mutex = __commonJS({ * @param key - */ static async unlock(key) { - return new Promise((resolve8) => { + return new Promise((resolve7) => { if (this.keys[key] === MutexLockStatus.LOCKED) { this.emitUnlockEvent(key); } delete this.keys[key]; - resolve8(); + resolve7(); }); } static keys = {}; @@ -88834,8 +88834,8 @@ var require_BlobBatch = __commonJS({ if (this.operationCount >= constants_js_1.BATCH_MAX_REQUEST) { throw new RangeError(`Cannot exceed ${constants_js_1.BATCH_MAX_REQUEST} sub requests in a single batch`); } - const path16 = (0, utils_common_js_1.getURLPath)(subRequest.url); - if (!path16 || path16 === "") { + const path13 = (0, utils_common_js_1.getURLPath)(subRequest.url); + if (!path13 || path13 === "") { throw new RangeError(`Invalid url for sub request: '${subRequest.url}'`); } } @@ -88913,8 +88913,8 @@ var require_BlobBatchClient = __commonJS({ pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipeline, options); } const storageClientContext = new StorageContextClient_js_1.StorageContextClient(url2, (0, Pipeline_js_1.getCoreClientOptions)(pipeline)); - const path16 = (0, utils_common_js_1.getURLPath)(url2); - if (path16 && path16 !== "/") { + const path13 = (0, utils_common_js_1.getURLPath)(url2); + if (path13 && path13 !== "/") { this.serviceOrContainerContext = storageClientContext.container; } else { this.serviceOrContainerContext = storageClientContext.service; @@ -90215,7 +90215,7 @@ var require_ContainerClient = __commonJS({ * @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token. */ generateSasUrl(options) { - return new Promise((resolve8) => { + return new Promise((resolve7) => { if (!(this.credential instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential)) { throw new RangeError("Can only generate the SAS when the client is initialized with a shared key credential"); } @@ -90223,7 +90223,7 @@ var require_ContainerClient = __commonJS({ containerName: this._containerName, ...options }, this.credential).toString(); - resolve8((0, utils_common_js_1.appendToURLQuery)(this.url, sas)); + resolve7((0, utils_common_js_1.appendToURLQuery)(this.url, sas)); }); } /** @@ -90258,12 +90258,12 @@ var require_ContainerClient = __commonJS({ * @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token. */ generateUserDelegationSasUrl(options, userDelegationKey) { - return new Promise((resolve8) => { + return new Promise((resolve7) => { const sas = (0, BlobSASSignatureValues_js_1.generateBlobSASQueryParameters)({ containerName: this._containerName, ...options }, userDelegationKey, this.accountName).toString(); - resolve8((0, utils_common_js_1.appendToURLQuery)(this.url, sas)); + resolve7((0, utils_common_js_1.appendToURLQuery)(this.url, sas)); }); } /** @@ -91659,11 +91659,11 @@ var require_uploadUtils = __commonJS({ })(); var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { - return value instanceof P ? value : new P(function(resolve8) { - resolve8(value); + return value instanceof P ? value : new P(function(resolve7) { + resolve7(value); }); } - return new (P || (P = Promise))(function(resolve8, reject) { + return new (P || (P = Promise))(function(resolve7, reject) { function fulfilled(value) { try { step(generator.next(value)); @@ -91679,7 +91679,7 @@ var require_uploadUtils = __commonJS({ } } function step(result) { - result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); + result.done ? resolve7(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); @@ -91846,11 +91846,11 @@ var require_requestUtils = __commonJS({ })(); var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { - return value instanceof P ? value : new P(function(resolve8) { - resolve8(value); + return value instanceof P ? value : new P(function(resolve7) { + resolve7(value); }); } - return new (P || (P = Promise))(function(resolve8, reject) { + return new (P || (P = Promise))(function(resolve7, reject) { function fulfilled(value) { try { step(generator.next(value)); @@ -91866,7 +91866,7 @@ var require_requestUtils = __commonJS({ } } function step(result) { - result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); + result.done ? resolve7(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); @@ -91906,7 +91906,7 @@ var require_requestUtils = __commonJS({ } function sleep(milliseconds) { return __awaiter2(this, void 0, void 0, function* () { - return new Promise((resolve8) => setTimeout(resolve8, milliseconds)); + return new Promise((resolve7) => setTimeout(resolve7, milliseconds)); }); } function retry2(name_1, method_1, getStatusCode_1) { @@ -92167,11 +92167,11 @@ var require_downloadUtils = __commonJS({ })(); var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { - return value instanceof P ? value : new P(function(resolve8) { - resolve8(value); + return value instanceof P ? value : new P(function(resolve7) { + resolve7(value); }); } - return new (P || (P = Promise))(function(resolve8, reject) { + return new (P || (P = Promise))(function(resolve7, reject) { function fulfilled(value) { try { step(generator.next(value)); @@ -92187,7 +92187,7 @@ var require_downloadUtils = __commonJS({ } } function step(result) { - result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); + result.done ? resolve7(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); @@ -92201,8 +92201,8 @@ var require_downloadUtils = __commonJS({ var http_client_1 = require_lib(); var storage_blob_1 = require_commonjs15(); var buffer = __importStar2(require("buffer")); - var fs17 = __importStar2(require("fs")); - var stream2 = __importStar2(require("stream")); + var fs14 = __importStar2(require("fs")); + var stream = __importStar2(require("stream")); var util = __importStar2(require("util")); var utils = __importStar2(require_cacheUtils()); var constants_1 = require_constants12(); @@ -92210,7 +92210,7 @@ var require_downloadUtils = __commonJS({ var abort_controller_1 = require_dist4(); function pipeResponseToStream(response, output) { return __awaiter2(this, void 0, void 0, function* () { - const pipeline = util.promisify(stream2.pipeline); + const pipeline = util.promisify(stream.pipeline); yield pipeline(response.message, output); }); } @@ -92312,7 +92312,7 @@ var require_downloadUtils = __commonJS({ exports2.DownloadProgress = DownloadProgress; function downloadCacheHttpClient(archiveLocation, archivePath) { return __awaiter2(this, void 0, void 0, function* () { - const writeStream = fs17.createWriteStream(archivePath); + const writeStream = fs14.createWriteStream(archivePath); const httpClient = new http_client_1.HttpClient("actions/cache"); const downloadResponse = yield (0, requestUtils_1.retryHttpClientResponse)("downloadCache", () => __awaiter2(this, void 0, void 0, function* () { return httpClient.get(archiveLocation); @@ -92337,7 +92337,7 @@ var require_downloadUtils = __commonJS({ function downloadCacheHttpClientConcurrent(archiveLocation, archivePath, options) { return __awaiter2(this, void 0, void 0, function* () { var _a; - const archiveDescriptor = yield fs17.promises.open(archivePath, "w"); + const archiveDescriptor = yield fs14.promises.open(archivePath, "w"); const httpClient = new http_client_1.HttpClient("actions/cache", void 0, { socketTimeout: options.timeoutInMs, keepAlive: true @@ -92453,7 +92453,7 @@ var require_downloadUtils = __commonJS({ } else { const maxSegmentSize = Math.min(134217728, buffer.constants.MAX_LENGTH); const downloadProgress = new DownloadProgress(contentLength); - const fd = fs17.openSync(archivePath, "w"); + const fd = fs14.openSync(archivePath, "w"); try { downloadProgress.startDisplayTimer(); const controller = new abort_controller_1.AbortController(); @@ -92471,20 +92471,20 @@ var require_downloadUtils = __commonJS({ controller.abort(); throw new Error("Aborting cache download as the download time exceeded the timeout."); } else if (Buffer.isBuffer(result)) { - fs17.writeFileSync(fd, result); + fs14.writeFileSync(fd, result); } } } finally { downloadProgress.stopDisplayTimer(); - fs17.closeSync(fd); + fs14.closeSync(fd); } } }); } var promiseWithTimeout = (timeoutMs, promise) => __awaiter2(void 0, void 0, void 0, function* () { let timeoutHandle; - const timeoutPromise = new Promise((resolve8) => { - timeoutHandle = setTimeout(() => resolve8("timeout"), timeoutMs); + const timeoutPromise = new Promise((resolve7) => { + timeoutHandle = setTimeout(() => resolve7("timeout"), timeoutMs); }); return Promise.race([promise, timeoutPromise]).then((result) => { clearTimeout(timeoutHandle); @@ -92765,11 +92765,11 @@ var require_cacheHttpClient = __commonJS({ })(); var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { - return value instanceof P ? value : new P(function(resolve8) { - resolve8(value); + return value instanceof P ? value : new P(function(resolve7) { + resolve7(value); }); } - return new (P || (P = Promise))(function(resolve8, reject) { + return new (P || (P = Promise))(function(resolve7, reject) { function fulfilled(value) { try { step(generator.next(value)); @@ -92785,7 +92785,7 @@ var require_cacheHttpClient = __commonJS({ } } function step(result) { - result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); + result.done ? resolve7(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); @@ -92798,7 +92798,7 @@ var require_cacheHttpClient = __commonJS({ var core15 = __importStar2(require_core()); var http_client_1 = require_lib(); var auth_1 = require_auth(); - var fs17 = __importStar2(require("fs")); + var fs14 = __importStar2(require("fs")); var url_1 = require("url"); var utils = __importStar2(require_cacheUtils()); var uploadUtils_1 = require_uploadUtils(); @@ -92933,7 +92933,7 @@ Other caches with similar key:`); return __awaiter2(this, void 0, void 0, function* () { const fileSize = utils.getArchiveFileSizeInBytes(archivePath); const resourceUrl = getCacheApiUrl(`caches/${cacheId.toString()}`); - const fd = fs17.openSync(archivePath, "r"); + const fd = fs14.openSync(archivePath, "r"); const uploadOptions = (0, options_1.getUploadOptions)(options); const concurrency = utils.assertDefined("uploadConcurrency", uploadOptions.uploadConcurrency); const maxChunkSize = utils.assertDefined("uploadChunkSize", uploadOptions.uploadChunkSize); @@ -92947,7 +92947,7 @@ Other caches with similar key:`); const start = offset; const end = offset + chunkSize - 1; offset += maxChunkSize; - yield uploadChunk(httpClient, resourceUrl, () => fs17.createReadStream(archivePath, { + yield uploadChunk(httpClient, resourceUrl, () => fs14.createReadStream(archivePath, { fd, start, end, @@ -92958,7 +92958,7 @@ Other caches with similar key:`); } }))); } finally { - fs17.closeSync(fd); + fs14.closeSync(fd); } return; }); @@ -96255,8 +96255,8 @@ var require_deferred = __commonJS({ */ constructor(preventUnhandledRejectionWarning = true) { this._state = DeferredState.PENDING; - this._promise = new Promise((resolve8, reject) => { - this._resolve = resolve8; + this._promise = new Promise((resolve7, reject) => { + this._resolve = resolve7; this._reject = reject; }); if (preventUnhandledRejectionWarning) { @@ -96471,11 +96471,11 @@ var require_unary_call = __commonJS({ "use strict"; var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { - return value instanceof P ? value : new P(function(resolve8) { - resolve8(value); + return value instanceof P ? value : new P(function(resolve7) { + resolve7(value); }); } - return new (P || (P = Promise))(function(resolve8, reject) { + return new (P || (P = Promise))(function(resolve7, reject) { function fulfilled(value) { try { step(generator.next(value)); @@ -96491,7 +96491,7 @@ var require_unary_call = __commonJS({ } } function step(result) { - result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); + result.done ? resolve7(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); @@ -96540,11 +96540,11 @@ var require_server_streaming_call = __commonJS({ "use strict"; var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { - return value instanceof P ? value : new P(function(resolve8) { - resolve8(value); + return value instanceof P ? value : new P(function(resolve7) { + resolve7(value); }); } - return new (P || (P = Promise))(function(resolve8, reject) { + return new (P || (P = Promise))(function(resolve7, reject) { function fulfilled(value) { try { step(generator.next(value)); @@ -96560,7 +96560,7 @@ var require_server_streaming_call = __commonJS({ } } function step(result) { - result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); + result.done ? resolve7(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); @@ -96610,11 +96610,11 @@ var require_client_streaming_call = __commonJS({ "use strict"; var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { - return value instanceof P ? value : new P(function(resolve8) { - resolve8(value); + return value instanceof P ? value : new P(function(resolve7) { + resolve7(value); }); } - return new (P || (P = Promise))(function(resolve8, reject) { + return new (P || (P = Promise))(function(resolve7, reject) { function fulfilled(value) { try { step(generator.next(value)); @@ -96630,7 +96630,7 @@ var require_client_streaming_call = __commonJS({ } } function step(result) { - result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); + result.done ? resolve7(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); @@ -96679,11 +96679,11 @@ var require_duplex_streaming_call = __commonJS({ "use strict"; var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { - return value instanceof P ? value : new P(function(resolve8) { - resolve8(value); + return value instanceof P ? value : new P(function(resolve7) { + resolve7(value); }); } - return new (P || (P = Promise))(function(resolve8, reject) { + return new (P || (P = Promise))(function(resolve7, reject) { function fulfilled(value) { try { step(generator.next(value)); @@ -96699,7 +96699,7 @@ var require_duplex_streaming_call = __commonJS({ } } function step(result) { - result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); + result.done ? resolve7(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); @@ -96747,11 +96747,11 @@ var require_test_transport = __commonJS({ "use strict"; var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { - return value instanceof P ? value : new P(function(resolve8) { - resolve8(value); + return value instanceof P ? value : new P(function(resolve7) { + resolve7(value); }); } - return new (P || (P = Promise))(function(resolve8, reject) { + return new (P || (P = Promise))(function(resolve7, reject) { function fulfilled(value) { try { step(generator.next(value)); @@ -96767,7 +96767,7 @@ var require_test_transport = __commonJS({ } } function step(result) { - result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); + result.done ? resolve7(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); @@ -96848,7 +96848,7 @@ var require_test_transport = __commonJS({ * The returned promise resolves when the stream is closed. It should * not reject. If it does, code is broken. */ - streamResponses(method, stream2, abort) { + streamResponses(method, stream, abort) { return __awaiter2(this, void 0, void 0, function* () { const messages = []; if (this.data.response === void 0) { @@ -96865,31 +96865,31 @@ var require_test_transport = __commonJS({ try { yield delay2(this.responseDelay, abort)(void 0); } catch (error3) { - stream2.notifyError(error3); + stream.notifyError(error3); return; } if (this.data.response instanceof rpc_error_1.RpcError) { - stream2.notifyError(this.data.response); + stream.notifyError(this.data.response); return; } for (let msg of messages) { - stream2.notifyMessage(msg); + stream.notifyMessage(msg); try { yield delay2(this.betweenResponseDelay, abort)(void 0); } catch (error3) { - stream2.notifyError(error3); + stream.notifyError(error3); return; } } if (this.data.status instanceof rpc_error_1.RpcError) { - stream2.notifyError(this.data.status); + stream.notifyError(this.data.status); return; } if (this.data.trailers instanceof rpc_error_1.RpcError) { - stream2.notifyError(this.data.trailers); + stream.notifyError(this.data.trailers); return; } - stream2.notifyComplete(); + stream.notifyComplete(); }); } // Creates a promise for response status from the mock data. @@ -96964,11 +96964,11 @@ var require_test_transport = __commonJS({ responseTrailer: "test" }; function delay2(ms, abort) { - return (v) => new Promise((resolve8, reject) => { + return (v) => new Promise((resolve7, reject) => { if (abort === null || abort === void 0 ? void 0 : abort.aborted) { reject(new rpc_error_1.RpcError("user cancel", "CANCELLED")); } else { - const id = setTimeout(() => resolve8(v), ms); + const id = setTimeout(() => resolve7(v), ms); if (abort) { abort.addEventListener("abort", (ev) => { clearTimeout(id); @@ -97966,11 +97966,11 @@ var require_cacheTwirpClient = __commonJS({ "use strict"; var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { - return value instanceof P ? value : new P(function(resolve8) { - resolve8(value); + return value instanceof P ? value : new P(function(resolve7) { + resolve7(value); }); } - return new (P || (P = Promise))(function(resolve8, reject) { + return new (P || (P = Promise))(function(resolve7, reject) { function fulfilled(value) { try { step(generator.next(value)); @@ -97986,7 +97986,7 @@ var require_cacheTwirpClient = __commonJS({ } } function step(result) { - result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); + result.done ? resolve7(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); @@ -98126,7 +98126,7 @@ var require_cacheTwirpClient = __commonJS({ } sleep(milliseconds) { return __awaiter2(this, void 0, void 0, function* () { - return new Promise((resolve8) => setTimeout(resolve8, milliseconds)); + return new Promise((resolve7) => setTimeout(resolve7, milliseconds)); }); } getExponentialRetryTimeMilliseconds(attempt) { @@ -98191,11 +98191,11 @@ var require_tar = __commonJS({ })(); var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { - return value instanceof P ? value : new P(function(resolve8) { - resolve8(value); + return value instanceof P ? value : new P(function(resolve7) { + resolve7(value); }); } - return new (P || (P = Promise))(function(resolve8, reject) { + return new (P || (P = Promise))(function(resolve7, reject) { function fulfilled(value) { try { step(generator.next(value)); @@ -98211,7 +98211,7 @@ var require_tar = __commonJS({ } } function step(result) { - result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); + result.done ? resolve7(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); @@ -98223,7 +98223,7 @@ var require_tar = __commonJS({ var exec_1 = require_exec(); var io7 = __importStar2(require_io()); var fs_1 = require("fs"); - var path16 = __importStar2(require("path")); + var path13 = __importStar2(require("path")); var utils = __importStar2(require_cacheUtils()); var constants_1 = require_constants12(); var IS_WINDOWS = process.platform === "win32"; @@ -98269,13 +98269,13 @@ var require_tar = __commonJS({ const BSD_TAR_ZSTD = tarPath.type === constants_1.ArchiveToolType.BSD && compressionMethod !== constants_1.CompressionMethod.Gzip && IS_WINDOWS; switch (type2) { case "create": - args.push("--posix", "-cf", BSD_TAR_ZSTD ? tarFile : cacheFileName.replace(new RegExp(`\\${path16.sep}`, "g"), "/"), "--exclude", BSD_TAR_ZSTD ? tarFile : cacheFileName.replace(new RegExp(`\\${path16.sep}`, "g"), "/"), "-P", "-C", workingDirectory.replace(new RegExp(`\\${path16.sep}`, "g"), "/"), "--files-from", constants_1.ManifestFilename); + args.push("--posix", "-cf", BSD_TAR_ZSTD ? tarFile : cacheFileName.replace(new RegExp(`\\${path13.sep}`, "g"), "/"), "--exclude", BSD_TAR_ZSTD ? tarFile : cacheFileName.replace(new RegExp(`\\${path13.sep}`, "g"), "/"), "-P", "-C", workingDirectory.replace(new RegExp(`\\${path13.sep}`, "g"), "/"), "--files-from", constants_1.ManifestFilename); break; case "extract": - args.push("-xf", BSD_TAR_ZSTD ? tarFile : archivePath.replace(new RegExp(`\\${path16.sep}`, "g"), "/"), "-P", "-C", workingDirectory.replace(new RegExp(`\\${path16.sep}`, "g"), "/")); + args.push("-xf", BSD_TAR_ZSTD ? tarFile : archivePath.replace(new RegExp(`\\${path13.sep}`, "g"), "/"), "-P", "-C", workingDirectory.replace(new RegExp(`\\${path13.sep}`, "g"), "/")); break; case "list": - args.push("-tf", BSD_TAR_ZSTD ? tarFile : archivePath.replace(new RegExp(`\\${path16.sep}`, "g"), "/"), "-P"); + args.push("-tf", BSD_TAR_ZSTD ? tarFile : archivePath.replace(new RegExp(`\\${path13.sep}`, "g"), "/"), "-P"); break; } if (tarPath.type === constants_1.ArchiveToolType.GNU) { @@ -98321,7 +98321,7 @@ var require_tar = __commonJS({ return BSD_TAR_ZSTD ? [ "zstd -d --long=30 --force -o", constants_1.TarFilename, - archivePath.replace(new RegExp(`\\${path16.sep}`, "g"), "/") + archivePath.replace(new RegExp(`\\${path13.sep}`, "g"), "/") ] : [ "--use-compress-program", IS_WINDOWS ? '"zstd -d --long=30"' : "unzstd --long=30" @@ -98330,7 +98330,7 @@ var require_tar = __commonJS({ return BSD_TAR_ZSTD ? [ "zstd -d --force -o", constants_1.TarFilename, - archivePath.replace(new RegExp(`\\${path16.sep}`, "g"), "/") + archivePath.replace(new RegExp(`\\${path13.sep}`, "g"), "/") ] : ["--use-compress-program", IS_WINDOWS ? '"zstd -d"' : "unzstd"]; default: return ["-z"]; @@ -98345,7 +98345,7 @@ var require_tar = __commonJS({ case constants_1.CompressionMethod.Zstd: return BSD_TAR_ZSTD ? [ "zstd -T0 --long=30 --force -o", - cacheFileName.replace(new RegExp(`\\${path16.sep}`, "g"), "/"), + cacheFileName.replace(new RegExp(`\\${path13.sep}`, "g"), "/"), constants_1.TarFilename ] : [ "--use-compress-program", @@ -98354,7 +98354,7 @@ var require_tar = __commonJS({ case constants_1.CompressionMethod.ZstdWithoutLong: return BSD_TAR_ZSTD ? [ "zstd -T0 --force -o", - cacheFileName.replace(new RegExp(`\\${path16.sep}`, "g"), "/"), + cacheFileName.replace(new RegExp(`\\${path13.sep}`, "g"), "/"), constants_1.TarFilename ] : ["--use-compress-program", IS_WINDOWS ? '"zstd -T0"' : "zstdmt"]; default: @@ -98392,7 +98392,7 @@ var require_tar = __commonJS({ } function createTar(archiveFolder, sourceDirectories, compressionMethod) { return __awaiter2(this, void 0, void 0, function* () { - (0, fs_1.writeFileSync)(path16.join(archiveFolder, constants_1.ManifestFilename), sourceDirectories.join("\n")); + (0, fs_1.writeFileSync)(path13.join(archiveFolder, constants_1.ManifestFilename), sourceDirectories.join("\n")); const commands = yield getCommands(compressionMethod, "create"); yield execCommands(commands, archiveFolder); }); @@ -98443,11 +98443,11 @@ var require_cache5 = __commonJS({ })(); var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { - return value instanceof P ? value : new P(function(resolve8) { - resolve8(value); + return value instanceof P ? value : new P(function(resolve7) { + resolve7(value); }); } - return new (P || (P = Promise))(function(resolve8, reject) { + return new (P || (P = Promise))(function(resolve7, reject) { function fulfilled(value) { try { step(generator.next(value)); @@ -98463,7 +98463,7 @@ var require_cache5 = __commonJS({ } } function step(result) { - result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); + result.done ? resolve7(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); @@ -98474,7 +98474,7 @@ var require_cache5 = __commonJS({ exports2.restoreCache = restoreCache4; exports2.saveCache = saveCache4; var core15 = __importStar2(require_core()); - var path16 = __importStar2(require("path")); + var path13 = __importStar2(require("path")); var utils = __importStar2(require_cacheUtils()); var cacheHttpClient = __importStar2(require_cacheHttpClient()); var cacheTwirpClient = __importStar2(require_cacheTwirpClient()); @@ -98569,7 +98569,7 @@ var require_cache5 = __commonJS({ core15.info("Lookup only - skipping download"); return cacheEntry.cacheKey; } - archivePath = path16.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod)); + archivePath = path13.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod)); core15.debug(`Archive Path: ${archivePath}`); yield cacheHttpClient.downloadCache(cacheEntry.archiveLocation, archivePath, options); if (core15.isDebug()) { @@ -98638,7 +98638,7 @@ var require_cache5 = __commonJS({ core15.info("Lookup only - skipping download"); return response.matchedKey; } - archivePath = path16.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod)); + archivePath = path13.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod)); core15.debug(`Archive path: ${archivePath}`); core15.debug(`Starting download of archive to: ${archivePath}`); yield cacheHttpClient.downloadCache(response.signedDownloadUrl, archivePath, options); @@ -98700,7 +98700,7 @@ var require_cache5 = __commonJS({ throw new Error(`Path Validation Error: Path(s) specified in the action for caching do(es) not exist, hence no cache is being saved.`); } const archiveFolder = yield utils.createTempDirectory(); - const archivePath = path16.join(archiveFolder, utils.getCacheFileName(compressionMethod)); + const archivePath = path13.join(archiveFolder, utils.getCacheFileName(compressionMethod)); core15.debug(`Archive Path: ${archivePath}`); try { yield (0, tar_1.createTar)(archiveFolder, cachePaths, compressionMethod); @@ -98764,7 +98764,7 @@ var require_cache5 = __commonJS({ throw new Error(`Path Validation Error: Path(s) specified in the action for caching do(es) not exist, hence no cache is being saved.`); } const archiveFolder = yield utils.createTempDirectory(); - const archivePath = path16.join(archiveFolder, utils.getCacheFileName(compressionMethod)); + const archivePath = path13.join(archiveFolder, utils.getCacheFileName(compressionMethod)); core15.debug(`Archive Path: ${archivePath}`); try { yield (0, tar_1.createTar)(archiveFolder, cachePaths, compressionMethod); @@ -98881,11 +98881,11 @@ var require_manifest = __commonJS({ })(); var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { - return value instanceof P ? value : new P(function(resolve8) { - resolve8(value); + return value instanceof P ? value : new P(function(resolve7) { + resolve7(value); }); } - return new (P || (P = Promise))(function(resolve8, reject) { + return new (P || (P = Promise))(function(resolve7, reject) { function fulfilled(value) { try { step(generator.next(value)); @@ -98901,7 +98901,7 @@ var require_manifest = __commonJS({ } } function step(result) { - result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); + result.done ? resolve7(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); @@ -98912,12 +98912,12 @@ var require_manifest = __commonJS({ exports2._readLinuxVersionFile = _readLinuxVersionFile; var semver9 = __importStar2(require_semver2()); var core_1 = require_core(); - var os5 = require("os"); + var os4 = require("os"); var cp = require("child_process"); - var fs17 = require("fs"); + var fs14 = require("fs"); function _findMatch(versionSpec, stable, candidates, archFilter) { return __awaiter2(this, void 0, void 0, function* () { - const platFilter = os5.platform(); + const platFilter = os4.platform(); let result; let match; let file; @@ -98953,7 +98953,7 @@ var require_manifest = __commonJS({ }); } function _getOsVersion() { - const plat = os5.platform(); + const plat = os4.platform(); let version = ""; if (plat === "darwin") { version = cp.execSync("sw_vers -productVersion").toString(); @@ -98976,10 +98976,10 @@ var require_manifest = __commonJS({ const lsbReleaseFile = "/etc/lsb-release"; const osReleaseFile = "/etc/os-release"; let contents = ""; - if (fs17.existsSync(lsbReleaseFile)) { - contents = fs17.readFileSync(lsbReleaseFile).toString(); - } else if (fs17.existsSync(osReleaseFile)) { - contents = fs17.readFileSync(osReleaseFile).toString(); + if (fs14.existsSync(lsbReleaseFile)) { + contents = fs14.readFileSync(lsbReleaseFile).toString(); + } else if (fs14.existsSync(osReleaseFile)) { + contents = fs14.readFileSync(osReleaseFile).toString(); } return contents; } @@ -99029,11 +99029,11 @@ var require_retry_helper = __commonJS({ })(); var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { - return value instanceof P ? value : new P(function(resolve8) { - resolve8(value); + return value instanceof P ? value : new P(function(resolve7) { + resolve7(value); }); } - return new (P || (P = Promise))(function(resolve8, reject) { + return new (P || (P = Promise))(function(resolve7, reject) { function fulfilled(value) { try { step(generator.next(value)); @@ -99049,7 +99049,7 @@ var require_retry_helper = __commonJS({ } } function step(result) { - result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); + result.done ? resolve7(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); @@ -99094,7 +99094,7 @@ var require_retry_helper = __commonJS({ } sleep(seconds) { return __awaiter2(this, void 0, void 0, function* () { - return new Promise((resolve8) => setTimeout(resolve8, seconds * 1e3)); + return new Promise((resolve7) => setTimeout(resolve7, seconds * 1e3)); }); } }; @@ -99145,11 +99145,11 @@ var require_tool_cache = __commonJS({ })(); var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { - return value instanceof P ? value : new P(function(resolve8) { - resolve8(value); + return value instanceof P ? value : new P(function(resolve7) { + resolve7(value); }); } - return new (P || (P = Promise))(function(resolve8, reject) { + return new (P || (P = Promise))(function(resolve7, reject) { function fulfilled(value) { try { step(generator.next(value)); @@ -99165,7 +99165,7 @@ var require_tool_cache = __commonJS({ } } function step(result) { - result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); + result.done ? resolve7(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); @@ -99188,13 +99188,13 @@ var require_tool_cache = __commonJS({ var core15 = __importStar2(require_core()); var io7 = __importStar2(require_io()); var crypto3 = __importStar2(require("crypto")); - var fs17 = __importStar2(require("fs")); + var fs14 = __importStar2(require("fs")); var mm = __importStar2(require_manifest()); - var os5 = __importStar2(require("os")); - var path16 = __importStar2(require("path")); + var os4 = __importStar2(require("os")); + var path13 = __importStar2(require("path")); var httpm = __importStar2(require_lib()); var semver9 = __importStar2(require_semver2()); - var stream2 = __importStar2(require("stream")); + var stream = __importStar2(require("stream")); var util = __importStar2(require("util")); var assert_1 = require("assert"); var exec_1 = require_exec(); @@ -99212,8 +99212,8 @@ var require_tool_cache = __commonJS({ var userAgent2 = "actions/tool-cache"; function downloadTool2(url2, dest, auth2, headers) { return __awaiter2(this, void 0, void 0, function* () { - dest = dest || path16.join(_getTempDirectory(), crypto3.randomUUID()); - yield io7.mkdirP(path16.dirname(dest)); + dest = dest || path13.join(_getTempDirectory(), crypto3.randomUUID()); + yield io7.mkdirP(path13.dirname(dest)); core15.debug(`Downloading ${url2}`); core15.debug(`Destination ${dest}`); const maxAttempts = 3; @@ -99234,7 +99234,7 @@ var require_tool_cache = __commonJS({ } function downloadToolAttempt(url2, dest, auth2, headers) { return __awaiter2(this, void 0, void 0, function* () { - if (fs17.existsSync(dest)) { + if (fs14.existsSync(dest)) { throw new Error(`Destination file path ${dest} already exists`); } const http = new httpm.HttpClient(userAgent2, [], { @@ -99253,12 +99253,12 @@ var require_tool_cache = __commonJS({ core15.debug(`Failed to download from "${url2}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`); throw err; } - const pipeline = util.promisify(stream2.pipeline); + 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, fs17.createWriteStream(dest)); + yield pipeline(readStream, fs14.createWriteStream(dest)); core15.debug("download complete"); succeeded = true; return dest; @@ -99303,7 +99303,7 @@ var require_tool_cache = __commonJS({ process.chdir(originalCwd); } } else { - const escapedScript = path16.join(__dirname, "..", "scripts", "Invoke-7zdec.ps1").replace(/'/g, "''").replace(/"|\n|\r/g, ""); + const escapedScript = path13.join(__dirname, "..", "scripts", "Invoke-7zdec.ps1").replace(/'/g, "''").replace(/"|\n|\r/g, ""); 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}'`; @@ -99464,61 +99464,61 @@ var require_tool_cache = __commonJS({ yield (0, exec_1.exec)(`"${unzipPath}"`, args, { cwd: dest }); }); } - function cacheDir(sourceDir, tool, version, arch2) { + function cacheDir(sourceDir, tool, version, arch) { return __awaiter2(this, void 0, void 0, function* () { version = semver9.clean(version) || version; - arch2 = arch2 || os5.arch(); - core15.debug(`Caching tool ${tool} ${version} ${arch2}`); + arch = arch || os4.arch(); + core15.debug(`Caching tool ${tool} ${version} ${arch}`); core15.debug(`source dir: ${sourceDir}`); - if (!fs17.statSync(sourceDir).isDirectory()) { + if (!fs14.statSync(sourceDir).isDirectory()) { throw new Error("sourceDir is not a directory"); } - const destPath = yield _createToolPath(tool, version, arch2); - for (const itemName of fs17.readdirSync(sourceDir)) { - const s = path16.join(sourceDir, itemName); + const destPath = yield _createToolPath(tool, version, arch); + for (const itemName of fs14.readdirSync(sourceDir)) { + const s = path13.join(sourceDir, itemName); yield io7.cp(s, destPath, { recursive: true }); } - _completeToolPath(tool, version, arch2); + _completeToolPath(tool, version, arch); return destPath; }); } - function cacheFile(sourceFile, targetFile, tool, version, arch2) { + function cacheFile(sourceFile, targetFile, tool, version, arch) { return __awaiter2(this, void 0, void 0, function* () { version = semver9.clean(version) || version; - arch2 = arch2 || os5.arch(); - core15.debug(`Caching tool ${tool} ${version} ${arch2}`); + arch = arch || os4.arch(); + core15.debug(`Caching tool ${tool} ${version} ${arch}`); core15.debug(`source file: ${sourceFile}`); - if (!fs17.statSync(sourceFile).isFile()) { + if (!fs14.statSync(sourceFile).isFile()) { throw new Error("sourceFile is not a file"); } - const destFolder = yield _createToolPath(tool, version, arch2); - const destPath = path16.join(destFolder, targetFile); + const destFolder = yield _createToolPath(tool, version, arch); + const destPath = path13.join(destFolder, targetFile); core15.debug(`destination file ${destPath}`); yield io7.cp(sourceFile, destPath); - _completeToolPath(tool, version, arch2); + _completeToolPath(tool, version, arch); return destFolder; }); } - function find2(toolName, versionSpec, arch2) { + function find2(toolName, versionSpec, arch) { if (!toolName) { throw new Error("toolName parameter is required"); } if (!versionSpec) { throw new Error("versionSpec parameter is required"); } - arch2 = arch2 || os5.arch(); + arch = arch || os4.arch(); if (!isExplicitVersion(versionSpec)) { - const localVersions = findAllVersions2(toolName, arch2); + const localVersions = findAllVersions2(toolName, arch); const match = evaluateVersions(localVersions, versionSpec); versionSpec = match; } let toolPath = ""; if (versionSpec) { versionSpec = semver9.clean(versionSpec) || ""; - const cachePath = path16.join(_getCacheDirectory(), toolName, versionSpec, arch2); + const cachePath = path13.join(_getCacheDirectory(), toolName, versionSpec, arch); core15.debug(`checking cache: ${cachePath}`); - if (fs17.existsSync(cachePath) && fs17.existsSync(`${cachePath}.complete`)) { - core15.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch2}`); + if (fs14.existsSync(cachePath) && fs14.existsSync(`${cachePath}.complete`)) { + core15.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch}`); toolPath = cachePath; } else { core15.debug("not found"); @@ -99526,16 +99526,16 @@ var require_tool_cache = __commonJS({ } return toolPath; } - function findAllVersions2(toolName, arch2) { + function findAllVersions2(toolName, arch) { const versions = []; - arch2 = arch2 || os5.arch(); - const toolPath = path16.join(_getCacheDirectory(), toolName); - if (fs17.existsSync(toolPath)) { - const children = fs17.readdirSync(toolPath); + arch = arch || os4.arch(); + const toolPath = path13.join(_getCacheDirectory(), toolName); + if (fs14.existsSync(toolPath)) { + const children = fs14.readdirSync(toolPath); for (const child of children) { if (isExplicitVersion(child)) { - const fullPath = path16.join(toolPath, child, arch2 || ""); - if (fs17.existsSync(fullPath) && fs17.existsSync(`${fullPath}.complete`)) { + const fullPath = path13.join(toolPath, child, arch || ""); + if (fs14.existsSync(fullPath) && fs14.existsSync(`${fullPath}.complete`)) { versions.push(child); } } @@ -99578,7 +99578,7 @@ var require_tool_cache = __commonJS({ }); } function findFromManifest(versionSpec_1, stable_1, manifest_1) { - return __awaiter2(this, arguments, void 0, function* (versionSpec, stable, manifest, archFilter = os5.arch()) { + return __awaiter2(this, arguments, void 0, function* (versionSpec, stable, manifest, archFilter = os4.arch()) { const match = yield mm._findMatch(versionSpec, stable, manifest, archFilter); return match; }); @@ -99586,15 +99586,15 @@ var require_tool_cache = __commonJS({ function _createExtractFolder(dest) { return __awaiter2(this, void 0, void 0, function* () { if (!dest) { - dest = path16.join(_getTempDirectory(), crypto3.randomUUID()); + dest = path13.join(_getTempDirectory(), crypto3.randomUUID()); } yield io7.mkdirP(dest); return dest; }); } - function _createToolPath(tool, version, arch2) { + function _createToolPath(tool, version, arch) { return __awaiter2(this, void 0, void 0, function* () { - const folderPath = path16.join(_getCacheDirectory(), tool, semver9.clean(version) || version, arch2 || ""); + const folderPath = path13.join(_getCacheDirectory(), tool, semver9.clean(version) || version, arch || ""); core15.debug(`destination ${folderPath}`); const markerPath = `${folderPath}.complete`; yield io7.rmRF(folderPath); @@ -99603,10 +99603,10 @@ var require_tool_cache = __commonJS({ return folderPath; }); } - function _completeToolPath(tool, version, arch2) { - const folderPath = path16.join(_getCacheDirectory(), tool, semver9.clean(version) || version, arch2 || ""); + function _completeToolPath(tool, version, arch) { + const folderPath = path13.join(_getCacheDirectory(), tool, semver9.clean(version) || version, arch || ""); const markerPath = `${folderPath}.complete`; - fs17.writeFileSync(markerPath, ""); + fs14.writeFileSync(markerPath, ""); core15.debug("finished caching tool"); } function isExplicitVersion(versionSpec) { @@ -100124,8 +100124,8 @@ var require_follow_redirects = __commonJS({ } return parsed; } - function resolveUrl(relative2, base) { - return useNativeURL ? new URL2(relative2, base) : parseUrl2(url2.resolve(base, relative2)); + function resolveUrl(relative, base) { + return useNativeURL ? new URL2(relative, base) : parseUrl2(url2.resolve(base, relative)); } function validateUrl(input) { if (/^\[/.test(input.hostname) && !/^\[[:0-9a-f]+\]$/i.test(input.hostname)) { @@ -103113,14 +103113,13 @@ __export(analyze_action_exports, { runPromise: () => runPromise }); module.exports = __toCommonJS(analyze_action_exports); -var fs16 = __toESM(require("fs")); +var fs13 = __toESM(require("fs")); var import_path4 = __toESM(require("path")); -var import_perf_hooks3 = require("perf_hooks"); +var import_perf_hooks2 = require("perf_hooks"); var core14 = __toESM(require_core()); // src/actions-util.ts var fs2 = __toESM(require("fs")); -var path2 = __toESM(require("path")); var core4 = __toESM(require_core()); var toolrunner = __toESM(require_toolrunner()); var github = __toESM(require_github()); @@ -103142,21 +103141,21 @@ async function getFolderSize(itemPath, options) { getFolderSize.loose = async (itemPath, options) => await core(itemPath, options); getFolderSize.strict = async (itemPath, options) => await core(itemPath, options, { strict: true }); async function core(rootItemPath, options = {}, returnType = {}) { - const fs17 = options.fs || await import("node:fs/promises"); + const fs14 = options.fs || await import("node:fs/promises"); let folderSize = 0n; const foundInos = /* @__PURE__ */ new Set(); const errors = []; await processItem(rootItemPath); async function processItem(itemPath) { if (options.ignore?.test(itemPath)) return; - const stats = returnType.strict ? await fs17.lstat(itemPath, { bigint: true }) : await fs17.lstat(itemPath, { bigint: true }).catch((error3) => errors.push(error3)); + const stats = returnType.strict ? await fs14.lstat(itemPath, { bigint: true }) : await fs14.lstat(itemPath, { bigint: true }).catch((error3) => errors.push(error3)); if (typeof stats !== "object") return; if (!foundInos.has(stats.ino)) { foundInos.add(stats.ino); folderSize += stats.size; } if (stats.isDirectory()) { - const directoryItems = returnType.strict ? await fs17.readdir(itemPath) : await fs17.readdir(itemPath).catch((error3) => errors.push(error3)); + const directoryItems = returnType.strict ? await fs14.readdir(itemPath) : await fs14.readdir(itemPath).catch((error3) => errors.push(error3)); if (typeof directoryItems !== "object") return; await Promise.all( directoryItems.map( @@ -105778,7 +105777,6 @@ var safeDump = renamed("safeDump", "dump"); // src/util.ts var semver = __toESM(require_semver2()); var BASE_DATABASE_OIDS_FILE_NAME = "base-database-oids.json"; -var BROKEN_VERSIONS = ["0.0.0-20211207"]; var GITHUB_DOTCOM_URL = "https://github.com"; var DEFAULT_RESERVED_RAM_SCALING_FACTOR = 0.05; var MINIMUM_CGROUP_MEMORY_LIMIT_BYTES = 1024 * 1024; @@ -106127,16 +106125,13 @@ async function bundleDb(config, language, codeql, dbName) { } async function delay(milliseconds, opts) { const { allowProcessExit } = opts || {}; - return new Promise((resolve8) => { - const timer = setTimeout(resolve8, milliseconds); + return new Promise((resolve7) => { + const timer = setTimeout(resolve7, milliseconds); if (allowProcessExit) { timer.unref(); } }); } -function isGoodVersion(versionSpec) { - return !BROKEN_VERSIONS.includes(versionSpec); -} function isInTestMode() { return process.env["CODEQL_ACTION_TEST_MODE" /* TEST_MODE */] === "true"; } @@ -106254,27 +106249,6 @@ function satisfiesGHESVersion(ghesVersion, range, defaultIfInvalid) { function cloneObject(obj) { return JSON.parse(JSON.stringify(obj)); } -async function cleanUpPath(file, name, logger) { - logger.debug(`Cleaning up ${name}.`); - try { - await fs.promises.rm(file, { - force: true, - recursive: true - }); - } catch (e) { - logger.warning(`Failed to clean up ${name}: ${e}.`); - } -} -async function isBinaryAccessible(binary2, logger) { - try { - await io.which(binary2, true); - logger.debug(`Found ${binary2}.`); - return true; - } catch (e) { - logger.debug(`Could not find ${binary2}: ${e}`); - return false; - } -} async function asyncSome(array, predicate) { const results = await Promise.all(array.map(predicate)); return results.some((result) => result); @@ -106308,15 +106282,6 @@ function getActionVersion() { function getWorkflowEventName() { return getRequiredEnvParam("GITHUB_EVENT_NAME"); } -function isRunningLocalAction() { - const relativeScriptPath = getRelativeScriptPath(); - return relativeScriptPath.startsWith("..") || path2.isAbsolute(relativeScriptPath); -} -function getRelativeScriptPath() { - const runnerTemp = getRequiredEnvParam("RUNNER_TEMP"); - const actionsDirectory = path2.join(path2.dirname(runnerTemp), "_actions"); - return path2.relative(actionsDirectory, __filename); -} function getWorkflowEvent() { const eventJsonFile = getRequiredEnvParam("GITHUB_EVENT_PATH"); try { @@ -106566,9 +106531,9 @@ var SarifScanOrder = [ ]; // src/analyze.ts -var fs12 = __toESM(require("fs")); -var path12 = __toESM(require("path")); -var import_perf_hooks2 = require("perf_hooks"); +var fs9 = __toESM(require("fs")); +var path9 = __toESM(require("path")); +var import_perf_hooks = require("perf_hooks"); var io5 = __toESM(require_io()); // src/autobuild.ts @@ -106707,14 +106672,6 @@ function getApiDetails() { function getApiClient() { return createApiClientWithDetails(getApiDetails()); } -function getAuthorizationHeaderFor(logger, apiDetails, url2) { - if (url2.startsWith(`${apiDetails.url}/`) || apiDetails.apiURL && url2.startsWith(`${apiDetails.apiURL}/`)) { - logger.debug(`Providing an authorization token.`); - return `token ${apiDetails.auth}`; - } - logger.debug(`Not using an authorization token.`); - return void 0; -} var cachedGitHubVersion = void 0; async function getGitHubVersionFromApi(apiClient, apiDetails) { if (parseGitHubUrl(apiDetails.url) === GITHUB_DOTCOM_URL) { @@ -106848,8 +106805,8 @@ function wrapApiConfigurationError(e) { } // src/codeql.ts -var fs11 = __toESM(require("fs")); -var path11 = __toESM(require("path")); +var fs8 = __toESM(require("fs")); +var path8 = __toESM(require("path")); var core10 = __toESM(require_core()); var toolrunner3 = __toESM(require_toolrunner()); @@ -107071,7 +107028,7 @@ function getCliConfigCategoryIfExists(cliError) { } function isUnsupportedPlatform() { return !SUPPORTED_PLATFORMS.some( - ([platform2, arch2]) => platform2 === process.platform && arch2 === process.arch + ([platform2, arch]) => platform2 === process.platform && arch === process.arch ); } function getUnsupportedPlatformError(cliError) { @@ -107097,7 +107054,7 @@ function wrapCliConfigurationError(cliError) { // src/config-utils.ts var fs6 = __toESM(require("fs")); -var path7 = __toESM(require("path")); +var path6 = __toESM(require("path")); // src/caching-utils.ts var crypto2 = __toESM(require("crypto")); @@ -107152,21 +107109,9 @@ async function withGroupAsync(groupName, f) { core7.endGroup(); } } -function formatDuration(durationMs) { - if (durationMs < 1e3) { - return `${durationMs}ms`; - } - if (durationMs < 60 * 1e3) { - return `${(durationMs / 1e3).toFixed(1)}s`; - } - const minutes = Math.floor(durationMs / (60 * 1e3)); - const seconds = Math.floor(durationMs % (60 * 1e3) / 1e3); - return `${minutes}m${seconds}s`; -} // src/diagnostics.ts var unwrittenDiagnostics = []; -var unwrittenDefaultLanguageDiagnostics = []; function makeDiagnostic(id, name, data = void 0) { return { ...data, @@ -107186,19 +107131,6 @@ function addDiagnostic(config, language, diagnostic) { unwrittenDiagnostics.push({ diagnostic, language }); } } -function addNoLanguageDiagnostic(config, diagnostic) { - if (config !== void 0) { - addDiagnostic( - config, - // Arbitrarily choose the first language. We could also choose all languages, but that - // increases the risk of misinterpreting the data. - config.languages[0], - diagnostic - ); - } else { - unwrittenDefaultLanguageDiagnostics.push(diagnostic); - } -} function writeDiagnostic(config, language, diagnostic) { const logger = getActionsLogger(); const databasePath = language ? getCodeQLDatabasePath(config, language) : config.dbLocation; @@ -107223,11 +107155,11 @@ function writeDiagnostic(config, language, diagnostic) { // src/diff-informed-analysis-utils.ts var fs5 = __toESM(require("fs")); -var path6 = __toESM(require("path")); +var path5 = __toESM(require("path")); // src/feature-flags.ts var fs4 = __toESM(require("fs")); -var path5 = __toESM(require("path")); +var path4 = __toESM(require("path")); var semver5 = __toESM(require_semver2()); // src/defaults.json @@ -107236,7 +107168,7 @@ var cliVersion = "2.24.2"; // src/overlay-database-utils.ts var fs3 = __toESM(require("fs")); -var path4 = __toESM(require("path")); +var path3 = __toESM(require("path")); var actionsCache = __toESM(require_cache5()); // src/git-utils.ts @@ -107364,8 +107296,8 @@ var getFileOidsUnderPath = async function(basePath) { const match = line.match(regex); if (match) { const oid = match[1]; - const path16 = decodeGitFilePath(match[2]); - fileOidMap[path16] = oid; + const path13 = decodeGitFilePath(match[2]); + fileOidMap[path13] = oid; } else { throw new Error(`Unexpected "git ls-files" output: ${line}`); } @@ -107471,7 +107403,7 @@ async function writeOverlayChangesFile(config, sourceRoot, logger) { `Found ${changedFiles.length} changed file(s) under ${sourceRoot}.` ); const changedFilesJson = JSON.stringify({ changes: changedFiles }); - const overlayChangesFile = path4.join( + const overlayChangesFile = path3.join( getTemporaryDirectory(), "overlay-changes.json" ); @@ -107640,7 +107572,6 @@ function isSupportedToolsFeature(versionInfo, feature) { // src/feature-flags.ts var DEFAULT_VERSION_FEATURE_FLAG_PREFIX = "default_codeql_version_"; var DEFAULT_VERSION_FEATURE_FLAG_SUFFIX = "_enabled"; -var CODEQL_VERSION_ZSTD_BUNDLE = "2.19.0"; var featureConfig = { ["allow_toolcache_input" /* AllowToolcacheInput */]: { defaultValue: false, @@ -107978,7 +107909,7 @@ var Features = class extends OfflineFeatures { super(logger); this.gitHubFeatureFlags = new GitHubFeatureFlags( repositoryNwo, - path5.join(tempDir, FEATURE_FLAGS_FILE_NAME), + path4.join(tempDir, FEATURE_FLAGS_FILE_NAME), logger ); } @@ -108211,7 +108142,7 @@ async function getDiffInformedAnalysisBranches(codeql, features, logger) { return branches; } function getDiffRangesJsonFilePath() { - return path6.join(getTemporaryDirectory(), "pr-diff-range.json"); + return path5.join(getTemporaryDirectory(), "pr-diff-range.json"); } function writeDiffRangesJsonFile(logger, ranges) { const jsonContents = JSON.stringify(ranges, null, 2); @@ -108291,7 +108222,7 @@ Error Response: ${JSON.stringify(error3.response, null, 2)}` } } function getDiffRanges(fileDiff, logger) { - const filename = path6.join(getRequiredInput("checkout_path"), fileDiff.filename).replaceAll(path6.sep, "/"); + const filename = path5.join(getRequiredInput("checkout_path"), fileDiff.filename).replaceAll(path5.sep, "/"); if (fileDiff.patch === void 0) { if (fileDiff.changes === 0) { return []; @@ -108498,7 +108429,7 @@ var OVERLAY_ANALYSIS_CODE_SCANNING_FEATURES = { swift: "overlay_analysis_code_scanning_swift" /* OverlayAnalysisCodeScanningSwift */ }; function getPathToParsedConfigFile(tempDir) { - return path7.join(tempDir, "config"); + return path6.join(tempDir, "config"); } async function getConfig(tempDir, logger) { const configFile = getPathToParsedConfigFile(tempDir); @@ -108556,953 +108487,27 @@ function getPrimaryAnalysisConfig(config) { } // src/setup-codeql.ts -var fs9 = __toESM(require("fs")); -var path9 = __toESM(require("path")); var toolcache3 = __toESM(require_tool_cache()); var import_fast_deep_equal = __toESM(require_fast_deep_equal()); var semver8 = __toESM(require_semver2()); -// node_modules/uuid/dist-node/stringify.js -var byteToHex = []; -for (let i = 0; i < 256; ++i) { - byteToHex.push((i + 256).toString(16).slice(1)); -} -function unsafeStringify(arr, offset = 0) { - return (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(); -} - -// node_modules/uuid/dist-node/rng.js -var import_node_crypto = require("node:crypto"); -var rnds8Pool = new Uint8Array(256); -var poolPtr = rnds8Pool.length; -function rng() { - if (poolPtr > rnds8Pool.length - 16) { - (0, import_node_crypto.randomFillSync)(rnds8Pool); - poolPtr = 0; - } - return rnds8Pool.slice(poolPtr, poolPtr += 16); -} - -// node_modules/uuid/dist-node/native.js -var import_node_crypto2 = require("node:crypto"); -var native_default = { randomUUID: import_node_crypto2.randomUUID }; - -// node_modules/uuid/dist-node/v4.js -function _v4(options, buf, offset) { - options = options || {}; - const rnds = options.random ?? options.rng?.() ?? rng(); - if (rnds.length < 16) { - throw new Error("Random bytes length must be >= 16"); - } - rnds[6] = rnds[6] & 15 | 64; - rnds[8] = rnds[8] & 63 | 128; - if (buf) { - offset = offset || 0; - if (offset < 0 || offset + 16 > buf.length) { - throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`); - } - for (let i = 0; i < 16; ++i) { - buf[offset + i] = rnds[i]; - } - return buf; - } - return unsafeStringify(rnds); -} -function v4(options, buf, offset) { - if (native_default.randomUUID && !buf && !options) { - return native_default.randomUUID(); - } - return _v4(options, buf, offset); -} -var v4_default = v4; - // src/tar.ts -var import_child_process = require("child_process"); -var fs7 = __toESM(require("fs")); -var stream = __toESM(require("stream")); var import_toolrunner = __toESM(require_toolrunner()); var io4 = __toESM(require_io()); var toolcache = __toESM(require_tool_cache()); var semver6 = __toESM(require_semver2()); -var MIN_REQUIRED_BSD_TAR_VERSION = "3.4.3"; -var MIN_REQUIRED_GNU_TAR_VERSION = "1.31"; -async function getTarVersion() { - const tar = await io4.which("tar", true); - let stdout = ""; - const exitCode = await new import_toolrunner.ToolRunner(tar, ["--version"], { - listeners: { - stdout: (data) => { - stdout += data.toString(); - } - } - }).exec(); - if (exitCode !== 0) { - throw new Error("Failed to call tar --version"); - } - if (stdout.includes("GNU tar")) { - const match = stdout.match(/tar \(GNU tar\) ([0-9.]+)/); - if (!match?.[1]) { - throw new Error("Failed to parse output of tar --version."); - } - return { type: "gnu", version: match[1] }; - } else if (stdout.includes("bsdtar")) { - const match = stdout.match(/bsdtar ([0-9.]+)/); - if (!match?.[1]) { - throw new Error("Failed to parse output of tar --version."); - } - return { type: "bsd", version: match[1] }; - } else { - throw new Error("Unknown tar version"); - } -} -async function isZstdAvailable(logger) { - const foundZstdBinary = await isBinaryAccessible("zstd", logger); - try { - const tarVersion = await getTarVersion(); - const { type: type2, version } = tarVersion; - logger.info(`Found ${type2} tar version ${version}.`); - switch (type2) { - case "gnu": - return { - available: foundZstdBinary && // GNU tar only uses major and minor version numbers - semver6.gte( - semver6.coerce(version), - semver6.coerce(MIN_REQUIRED_GNU_TAR_VERSION) - ), - foundZstdBinary, - version: tarVersion - }; - case "bsd": - return { - available: foundZstdBinary && // Do a loose comparison since these version numbers don't contain - // a patch version number. - semver6.gte(version, MIN_REQUIRED_BSD_TAR_VERSION), - foundZstdBinary, - version: tarVersion - }; - default: - assertNever(type2); - } - } catch (e) { - logger.warning( - `Failed to determine tar version, therefore will assume zstd is not available. The underlying error was: ${e}` - ); - return { available: false, foundZstdBinary }; - } -} -async function extract(tarPath, dest, compressionMethod, tarVersion, logger) { - fs7.mkdirSync(dest, { recursive: true }); - switch (compressionMethod) { - case "gzip": - return await toolcache.extractTar(tarPath, dest); - case "zstd": { - if (!tarVersion) { - throw new Error( - "Could not determine tar version, which is required to extract a Zstandard archive." - ); - } - await extractTarZst(tarPath, dest, tarVersion, logger); - return dest; - } - } -} -async function extractTarZst(tar, dest, tarVersion, logger) { - logger.debug( - `Extracting to ${dest}.${tar instanceof stream.Readable ? ` Input stream has high water mark ${tar.readableHighWaterMark}.` : ""}` - ); - try { - const args = ["-x", "--zstd", "--ignore-zeros"]; - if (tarVersion.type === "gnu") { - args.push("--warning=no-unknown-keyword"); - args.push("--overwrite"); - } - args.push("-f", tar instanceof stream.Readable ? "-" : tar, "-C", dest); - process.stdout.write(`[command]tar ${args.join(" ")} -`); - await new Promise((resolve8, reject) => { - const tarProcess = (0, import_child_process.spawn)("tar", args, { stdio: "pipe" }); - let stdout = ""; - tarProcess.stdout?.on("data", (data) => { - stdout += data.toString(); - process.stdout.write(data); - }); - let stderr = ""; - tarProcess.stderr?.on("data", (data) => { - stderr += data.toString(); - process.stdout.write(data); - }); - tarProcess.on("error", (err) => { - reject(new Error(`Error while extracting tar: ${err}`)); - }); - if (tar instanceof stream.Readable) { - tar.pipe(tarProcess.stdin).on("error", (err) => { - reject( - new Error(`Error while downloading and extracting tar: ${err}`) - ); - }); - } - tarProcess.on("exit", (code) => { - if (code !== 0) { - reject( - new CommandInvocationError( - "tar", - args, - code ?? void 0, - stdout, - stderr - ) - ); - } - resolve8(); - }); - }); - } catch (e) { - await cleanUpPath(dest, "extraction destination directory", logger); - throw e; - } -} -var KNOWN_EXTENSIONS = { - "tar.gz": "gzip", - "tar.zst": "zstd" -}; -function inferCompressionMethod(tarPath) { - for (const [ext, method] of Object.entries(KNOWN_EXTENSIONS)) { - if (tarPath.endsWith(`.${ext}`)) { - return method; - } - } - return void 0; -} // src/tools-download.ts -var fs8 = __toESM(require("fs")); -var os2 = __toESM(require("os")); -var path8 = __toESM(require("path")); -var import_perf_hooks = require("perf_hooks"); var core9 = __toESM(require_core()); var import_http_client = __toESM(require_lib()); var toolcache2 = __toESM(require_tool_cache()); var import_follow_redirects = __toESM(require_follow_redirects()); var semver7 = __toESM(require_semver2()); var STREAMING_HIGH_WATERMARK_BYTES = 4 * 1024 * 1024; -var TOOLCACHE_TOOL_NAME = "CodeQL"; -function makeDownloadFirstToolsDownloadDurations(downloadDurationMs, extractionDurationMs) { - return { - combinedDurationMs: downloadDurationMs + extractionDurationMs, - downloadDurationMs, - extractionDurationMs, - streamExtraction: false - }; -} -function makeStreamedToolsDownloadDurations(combinedDurationMs) { - return { - combinedDurationMs, - downloadDurationMs: void 0, - extractionDurationMs: void 0, - streamExtraction: true - }; -} -async function downloadAndExtract(codeqlURL, compressionMethod, dest, authorization, headers, tarVersion, logger) { - logger.info( - `Downloading CodeQL tools from ${codeqlURL} . This may take a while.` - ); - try { - if (compressionMethod === "zstd" && process.platform === "linux") { - logger.info(`Streaming the extraction of the CodeQL bundle.`); - const toolsInstallStart = import_perf_hooks.performance.now(); - await downloadAndExtractZstdWithStreaming( - codeqlURL, - dest, - authorization, - headers, - tarVersion, - logger - ); - const combinedDurationMs = Math.round( - import_perf_hooks.performance.now() - toolsInstallStart - ); - logger.info( - `Finished downloading and extracting CodeQL bundle to ${dest} (${formatDuration( - combinedDurationMs - )}).` - ); - return { - compressionMethod, - toolsUrl: sanitizeUrlForStatusReport(codeqlURL), - ...makeStreamedToolsDownloadDurations(combinedDurationMs) - }; - } - } catch (e) { - core9.warning( - `Failed to download and extract CodeQL bundle using streaming with error: ${getErrorMessage(e)}` - ); - core9.warning(`Falling back to downloading the bundle before extracting.`); - await cleanUpPath(dest, "CodeQL bundle", logger); - } - const toolsDownloadStart = import_perf_hooks.performance.now(); - const archivedBundlePath = await toolcache2.downloadTool( - codeqlURL, - void 0, - authorization, - headers - ); - const downloadDurationMs = Math.round(import_perf_hooks.performance.now() - toolsDownloadStart); - logger.info( - `Finished downloading CodeQL bundle to ${archivedBundlePath} (${formatDuration( - downloadDurationMs - )}).` - ); - let extractionDurationMs; - try { - logger.info("Extracting CodeQL bundle."); - const extractionStart = import_perf_hooks.performance.now(); - await extract( - archivedBundlePath, - dest, - compressionMethod, - tarVersion, - logger - ); - extractionDurationMs = Math.round(import_perf_hooks.performance.now() - extractionStart); - logger.info( - `Finished extracting CodeQL bundle to ${dest} (${formatDuration( - extractionDurationMs - )}).` - ); - } finally { - await cleanUpPath(archivedBundlePath, "CodeQL bundle archive", logger); - } - return { - compressionMethod, - toolsUrl: sanitizeUrlForStatusReport(codeqlURL), - ...makeDownloadFirstToolsDownloadDurations( - downloadDurationMs, - extractionDurationMs - ) - }; -} -async function downloadAndExtractZstdWithStreaming(codeqlURL, dest, authorization, headers, tarVersion, logger) { - fs8.mkdirSync(dest, { recursive: true }); - const agent = new import_http_client.HttpClient().getAgent(codeqlURL); - headers = Object.assign( - { "User-Agent": "CodeQL Action" }, - authorization ? { authorization } : {}, - headers - ); - const response = await new Promise( - (resolve8) => import_follow_redirects.https.get( - codeqlURL, - { - headers, - // Increase the high water mark to improve performance. - highWaterMark: STREAMING_HIGH_WATERMARK_BYTES, - // Use the agent to respect proxy settings. - agent - }, - (r) => resolve8(r) - ) - ); - if (response.statusCode !== 200) { - throw new Error( - `Failed to download CodeQL bundle from ${codeqlURL}. HTTP status code: ${response.statusCode}.` - ); - } - await extractTarZst(response, dest, tarVersion, logger); -} -function getToolcacheDirectory(version) { - return path8.join( - getRequiredEnvParam("RUNNER_TOOL_CACHE"), - TOOLCACHE_TOOL_NAME, - semver7.clean(version) || version, - os2.arch() || "" - ); -} -function writeToolcacheMarkerFile(extractedPath, logger) { - const markerFilePath = `${extractedPath}.complete`; - fs8.writeFileSync(markerFilePath, ""); - logger.info(`Created toolcache marker file ${markerFilePath}`); -} -function sanitizeUrlForStatusReport(url2) { - return ["github/codeql-action", "dsp-testing/codeql-cli-nightlies"].some( - (repo) => url2.startsWith(`https://github.com/${repo}/releases/download/`) - ) ? url2 : "sanitized-value"; -} - -// src/setup-codeql.ts -var CODEQL_DEFAULT_ACTION_REPOSITORY = "github/codeql-action"; -var CODEQL_NIGHTLIES_REPOSITORY_OWNER = "dsp-testing"; -var CODEQL_NIGHTLIES_REPOSITORY_NAME = "codeql-cli-nightlies"; -var CODEQL_BUNDLE_VERSION_ALIAS = ["linked", "latest"]; -var CODEQL_NIGHTLY_TOOLS_INPUTS = ["nightly", "nightly-latest"]; -var CODEQL_TOOLCACHE_INPUT = "toolcache"; -function getCodeQLBundleExtension(compressionMethod) { - switch (compressionMethod) { - case "gzip": - return ".tar.gz"; - case "zstd": - return ".tar.zst"; - default: - assertNever(compressionMethod); - } -} -function getCodeQLBundleName(compressionMethod) { - const extension = getCodeQLBundleExtension(compressionMethod); - let platform2; - if (process.platform === "win32") { - platform2 = "win64"; - } else if (process.platform === "linux") { - platform2 = "linux64"; - } else if (process.platform === "darwin") { - platform2 = "osx64"; - } else { - return `codeql-bundle${extension}`; - } - return `codeql-bundle-${platform2}${extension}`; -} -function getCodeQLActionRepository(logger) { - if (isRunningLocalAction()) { - logger.info( - "The CodeQL Action is checked out locally. Using the default CodeQL Action repository." - ); - return CODEQL_DEFAULT_ACTION_REPOSITORY; - } - return getRequiredEnvParam("GITHUB_ACTION_REPOSITORY"); -} -async function getCodeQLBundleDownloadURL(tagName, apiDetails, compressionMethod, logger) { - const codeQLActionRepository = getCodeQLActionRepository(logger); - const potentialDownloadSources = [ - // This GitHub instance, and this Action. - [apiDetails.url, codeQLActionRepository], - // This GitHub instance, and the canonical Action. - [apiDetails.url, CODEQL_DEFAULT_ACTION_REPOSITORY], - // GitHub.com, and the canonical Action. - [GITHUB_DOTCOM_URL, CODEQL_DEFAULT_ACTION_REPOSITORY] - ]; - const uniqueDownloadSources = potentialDownloadSources.filter( - (source, index, self2) => { - return !self2.slice(0, index).some((other) => (0, import_fast_deep_equal.default)(source, other)); - } - ); - const codeQLBundleName = getCodeQLBundleName(compressionMethod); - for (const downloadSource of uniqueDownloadSources) { - const [apiURL, repository] = downloadSource; - if (apiURL === GITHUB_DOTCOM_URL && repository === CODEQL_DEFAULT_ACTION_REPOSITORY) { - break; - } - const [repositoryOwner, repositoryName] = repository.split("/"); - try { - const release2 = await getApiClient().rest.repos.getReleaseByTag({ - owner: repositoryOwner, - repo: repositoryName, - tag: tagName - }); - for (const asset of release2.data.assets) { - if (asset.name === codeQLBundleName) { - logger.info( - `Found CodeQL bundle ${codeQLBundleName} in ${repository} on ${apiURL} with URL ${asset.url}.` - ); - return asset.url; - } - } - } catch (e) { - logger.info( - `Looked for CodeQL bundle ${codeQLBundleName} in ${repository} on ${apiURL} but got error ${e}.` - ); - } - } - return `https://github.com/${CODEQL_DEFAULT_ACTION_REPOSITORY}/releases/download/${tagName}/${codeQLBundleName}`; -} -function tryGetBundleVersionFromTagName(tagName, logger) { - const match = tagName.match(/^codeql-bundle-(.*)$/); - if (match === null || match.length < 2) { - logger.debug(`Could not determine bundle version from tag ${tagName}.`); - return void 0; - } - return match[1]; -} -function tryGetTagNameFromUrl(url2, logger) { - const matches = [...url2.matchAll(/\/(codeql-bundle-[^/]*)\//g)]; - if (matches.length === 0) { - logger.debug(`Could not determine tag name for URL ${url2}.`); - return void 0; - } - const match = matches[matches.length - 1]; - if (match?.length !== 2) { - logger.debug( - `Could not determine tag name for URL ${url2}. Matched ${JSON.stringify( - match - )}.` - ); - return void 0; - } - return match[1]; -} -function convertToSemVer(version, logger) { - if (!semver8.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 = semver8.clean(version); - if (!s) { - throw new Error(`Bundle version ${version} is not in SemVer format.`); - } - return s; -} -async function findOverridingToolsInCache(humanReadableVersion, logger) { - const candidates = toolcache3.findAllVersions("CodeQL").filter(isGoodVersion).map((version) => ({ - folder: toolcache3.find("CodeQL", version), - version - })).filter(({ folder }) => fs9.existsSync(path9.join(folder, "pinned-version"))); - if (candidates.length === 1) { - const candidate = candidates[0]; - logger.debug( - `CodeQL tools version ${candidate.version} in toolcache overriding version ${humanReadableVersion}.` - ); - return { - codeqlFolder: candidate.folder, - sourceType: "toolcache", - toolsVersion: candidate.version - }; - } else if (candidates.length === 0) { - logger.debug( - "Did not find any candidate pinned versions of the CodeQL tools in the toolcache." - ); - } else { - logger.debug( - "Could not use CodeQL tools from the toolcache since more than one candidate pinned version was found in the toolcache." - ); - } - return void 0; -} -async function getCodeQLSource(toolsInput, defaultCliVersion, apiDetails, variant, tarSupportsZstd, features, logger) { - if (toolsInput && !isReservedToolsValue(toolsInput) && !toolsInput.startsWith("http")) { - logger.info(`Using CodeQL CLI from local path ${toolsInput}`); - const compressionMethod2 = inferCompressionMethod(toolsInput); - if (compressionMethod2 === void 0) { - throw new ConfigurationError( - `Could not infer compression method from path ${toolsInput}. Please specify a path ending in '.tar.gz' or '.tar.zst'.` - ); - } - return { - codeqlTarPath: toolsInput, - compressionMethod: compressionMethod2, - sourceType: "local", - toolsVersion: "local" - }; - } - let cliVersion2; - let tagName; - let url2; - const canForceNightlyWithFF = isDynamicWorkflow() || isInTestMode(); - const forceNightlyValueFF = await features.getValue("force_nightly" /* ForceNightly */); - const forceNightly = forceNightlyValueFF && canForceNightlyWithFF; - const nightlyRequestedByToolsInput = toolsInput !== void 0 && CODEQL_NIGHTLY_TOOLS_INPUTS.includes(toolsInput); - if (forceNightly || nightlyRequestedByToolsInput) { - if (forceNightly) { - logger.info( - `Using the latest CodeQL CLI nightly, as forced by the ${"force_nightly" /* ForceNightly */} feature flag.` - ); - addNoLanguageDiagnostic( - void 0, - makeDiagnostic( - "codeql-action/forced-nightly-cli", - "A nightly release of CodeQL was used", - { - markdownMessage: "GitHub configured this analysis to use a nightly release of CodeQL to allow you to preview changes from an upcoming release.\n\nNightly releases do not undergo the same validation as regular releases and may lead to analysis instability.\n\nIf use of a nightly CodeQL release for this analysis is unexpected, please contact GitHub support.", - visibility: { - cliSummaryTable: true, - statusPage: true, - telemetry: true - }, - severity: "note" - } - ) - ); - } else { - logger.info( - `Using the latest CodeQL CLI nightly, as requested by 'tools: ${toolsInput}'.` - ); - } - toolsInput = await getNightlyToolsUrl(logger); - } - const forceShippedTools = toolsInput && CODEQL_BUNDLE_VERSION_ALIAS.includes(toolsInput); - if (forceShippedTools) { - cliVersion2 = cliVersion; - tagName = bundleVersion; - logger.info( - `'tools: ${toolsInput}' was requested, so using CodeQL version ${cliVersion2}, the version shipped with the Action.` - ); - if (toolsInput === "latest") { - logger.warning( - "`tools: latest` has been renamed to `tools: linked`, but the old name is still supported. No action is required." - ); - } - } else if (toolsInput !== void 0 && toolsInput === CODEQL_TOOLCACHE_INPUT) { - let latestToolcacheVersion; - const allowToolcacheValueFF = await features.getValue( - "allow_toolcache_input" /* AllowToolcacheInput */ - ); - const allowToolcacheValue = allowToolcacheValueFF && (isDynamicWorkflow() || isInTestMode()); - if (allowToolcacheValue) { - logger.info( - `Attempting to use the latest CodeQL CLI version in the toolcache, as requested by 'tools: ${toolsInput}'.` - ); - latestToolcacheVersion = getLatestToolcacheVersion(logger); - if (latestToolcacheVersion) { - cliVersion2 = latestToolcacheVersion; - } - } - if (latestToolcacheVersion === void 0) { - if (allowToolcacheValue) { - logger.info( - `Found no CodeQL CLI in the toolcache, ignoring 'tools: ${toolsInput}'...` - ); - } else { - if (allowToolcacheValueFF) { - logger.warning( - `Ignoring 'tools: ${toolsInput}' because the workflow was not triggered dynamically.` - ); - } else { - logger.info( - `Ignoring 'tools: ${toolsInput}' because the feature is not enabled.` - ); - } - } - cliVersion2 = defaultCliVersion.cliVersion; - tagName = defaultCliVersion.tagName; - } - } else if (toolsInput !== void 0) { - tagName = tryGetTagNameFromUrl(toolsInput, logger); - url2 = toolsInput; - if (tagName) { - const bundleVersion3 = tryGetBundleVersionFromTagName(tagName, logger); - if (bundleVersion3 && semver8.valid(bundleVersion3)) { - cliVersion2 = convertToSemVer(bundleVersion3, logger); - } - } - } else { - cliVersion2 = defaultCliVersion.cliVersion; - tagName = defaultCliVersion.tagName; - } - const bundleVersion2 = tagName && tryGetBundleVersionFromTagName(tagName, logger); - const humanReadableVersion = cliVersion2 ?? (bundleVersion2 && convertToSemVer(bundleVersion2, logger)) ?? tagName ?? url2 ?? "unknown"; - logger.debug( - `Attempting to obtain CodeQL tools. CLI version: ${cliVersion2 ?? "unknown"}, bundle tag name: ${tagName ?? "unknown"}, URL: ${url2 ?? "unspecified"}.` - ); - let codeqlFolder; - if (cliVersion2) { - codeqlFolder = toolcache3.find("CodeQL", cliVersion2); - if (!codeqlFolder) { - logger.debug( - `Didn't find a version of the CodeQL tools in the toolcache with a version number exactly matching ${cliVersion2}.` - ); - const allVersions = toolcache3.findAllVersions("CodeQL"); - logger.debug( - `Found the following versions of the CodeQL tools in the toolcache: ${JSON.stringify( - allVersions - )}.` - ); - const candidateVersions = allVersions.filter( - (version) => version.startsWith(`${cliVersion2}-`) - ); - if (candidateVersions.length === 1) { - logger.debug( - `Exactly one version of the CodeQL tools starting with ${cliVersion2} found in the toolcache, using that.` - ); - codeqlFolder = toolcache3.find("CodeQL", candidateVersions[0]); - } else if (candidateVersions.length === 0) { - logger.debug( - `Didn't find any versions of the CodeQL tools starting with ${cliVersion2} in the toolcache. Trying next fallback method.` - ); - } else { - logger.warning( - `Found ${candidateVersions.length} versions of the CodeQL tools starting with ${cliVersion2} in the toolcache, but at most one was expected.` - ); - logger.debug("Trying next fallback method."); - } - } - } - if (!codeqlFolder && tagName) { - const fallbackVersion = await tryGetFallbackToolcacheVersion( - cliVersion2, - tagName, - logger - ); - if (fallbackVersion) { - codeqlFolder = toolcache3.find("CodeQL", fallbackVersion); - } else { - logger.debug( - `Could not determine a fallback toolcache version number for CodeQL tools version ${humanReadableVersion}.` - ); - } - } - if (codeqlFolder) { - logger.info( - `Found CodeQL tools version ${humanReadableVersion} in the toolcache.` - ); - } else { - logger.info( - `Did not find CodeQL tools version ${humanReadableVersion} in the toolcache.` - ); - } - if (codeqlFolder) { - if (cliVersion2) { - logger.info( - `Using CodeQL CLI version ${cliVersion2} from toolcache at ${codeqlFolder}` - ); - } else { - logger.info(`Using CodeQL CLI from toolcache at ${codeqlFolder}`); - } - return { - codeqlFolder, - sourceType: "toolcache", - toolsVersion: cliVersion2 ?? humanReadableVersion - }; - } - if (variant === "GitHub Enterprise Server" /* GHES */ && !forceShippedTools && !toolsInput) { - const result = await findOverridingToolsInCache( - humanReadableVersion, - logger - ); - if (result !== void 0) { - return result; - } - } - let compressionMethod; - if (!url2) { - compressionMethod = cliVersion2 !== void 0 && await useZstdBundle(cliVersion2, tarSupportsZstd) ? "zstd" : "gzip"; - url2 = await getCodeQLBundleDownloadURL( - tagName, - apiDetails, - compressionMethod, - logger - ); - } else { - const method = inferCompressionMethod(url2); - if (method === void 0) { - throw new ConfigurationError( - `Could not infer compression method from URL ${url2}. Please specify a URL ending in '.tar.gz' or '.tar.zst'.` - ); - } - compressionMethod = method; - } - if (cliVersion2) { - logger.info(`Using CodeQL CLI version ${cliVersion2} sourced from ${url2} .`); - } else { - logger.info(`Using CodeQL CLI sourced from ${url2} .`); - } - return { - bundleVersion: tagName && tryGetBundleVersionFromTagName(tagName, logger), - cliVersion: cliVersion2, - codeqlURL: url2, - compressionMethod, - sourceType: "download", - toolsVersion: cliVersion2 ?? humanReadableVersion - }; -} -async function tryGetFallbackToolcacheVersion(cliVersion2, tagName, logger) { - const bundleVersion2 = tryGetBundleVersionFromTagName(tagName, logger); - if (!bundleVersion2) { - return void 0; - } - const fallbackVersion = convertToSemVer(bundleVersion2, logger); - logger.debug( - `Computed a fallback toolcache version number of ${fallbackVersion} for CodeQL version ${cliVersion2 ?? tagName}.` - ); - return fallbackVersion; -} -var downloadCodeQL = async function(codeqlURL, compressionMethod, maybeBundleVersion, maybeCliVersion, apiDetails, tarVersion, tempDir, logger) { - const parsedCodeQLURL = new URL(codeqlURL); - const searchParams = new URLSearchParams(parsedCodeQLURL.search); - const headers = { - accept: "application/octet-stream" - }; - let authorization = void 0; - if (searchParams.has("token")) { - logger.debug("CodeQL tools URL contains an authorization token."); - } else { - authorization = getAuthorizationHeaderFor( - logger, - apiDetails, - codeqlURL - ); - } - const toolcacheInfo = getToolcacheDestinationInfo( - maybeBundleVersion, - maybeCliVersion, - logger - ); - const extractedBundlePath = toolcacheInfo?.path ?? getTempExtractionDir(tempDir); - const statusReport = await downloadAndExtract( - codeqlURL, - compressionMethod, - extractedBundlePath, - authorization, - { "User-Agent": "CodeQL Action", ...headers }, - tarVersion, - logger - ); - if (!toolcacheInfo) { - logger.debug( - `Could not cache CodeQL tools because we could not determine the bundle version from the URL ${codeqlURL}.` - ); - return { - codeqlFolder: extractedBundlePath, - statusReport, - toolsVersion: maybeCliVersion ?? "unknown" - }; - } - writeToolcacheMarkerFile(toolcacheInfo.path, logger); - return { - codeqlFolder: extractedBundlePath, - statusReport, - toolsVersion: maybeCliVersion ?? toolcacheInfo.version - }; -}; -function getToolcacheDestinationInfo(maybeBundleVersion, maybeCliVersion, logger) { - if (maybeBundleVersion) { - const version = getCanonicalToolcacheVersion( - maybeCliVersion, - maybeBundleVersion, - logger - ); - return { - path: getToolcacheDirectory(version), - version - }; - } - return void 0; -} -function getCanonicalToolcacheVersion(cliVersion2, bundleVersion2, logger) { - if (!cliVersion2?.match(/^[0-9]+\.[0-9]+\.[0-9]+$/)) { - return convertToSemVer(bundleVersion2, logger); - } - return cliVersion2; -} -async function setupCodeQLBundle(toolsInput, apiDetails, tempDir, variant, defaultCliVersion, features, logger) { - if (!await isBinaryAccessible("tar", logger)) { - throw new ConfigurationError( - "Could not find tar in PATH, so unable to extract CodeQL bundle." - ); - } - const zstdAvailability = await isZstdAvailable(logger); - const source = await getCodeQLSource( - toolsInput, - defaultCliVersion, - apiDetails, - variant, - zstdAvailability.available, - features, - logger - ); - let codeqlFolder; - let toolsVersion = source.toolsVersion; - let toolsDownloadStatusReport; - let toolsSource; - switch (source.sourceType) { - case "local": { - codeqlFolder = await extract( - source.codeqlTarPath, - getTempExtractionDir(tempDir), - source.compressionMethod, - zstdAvailability.version, - logger - ); - toolsSource = "LOCAL" /* Local */; - break; - } - case "toolcache": - codeqlFolder = source.codeqlFolder; - logger.debug(`CodeQL found in cache ${codeqlFolder}`); - toolsSource = "TOOLCACHE" /* Toolcache */; - break; - case "download": { - const result = await downloadCodeQL( - source.codeqlURL, - source.compressionMethod, - source.bundleVersion, - source.cliVersion, - apiDetails, - zstdAvailability.version, - tempDir, - logger - ); - toolsVersion = result.toolsVersion; - codeqlFolder = result.codeqlFolder; - toolsDownloadStatusReport = result.statusReport; - toolsSource = "DOWNLOAD" /* Download */; - break; - } - default: - assertNever(source); - } - return { - codeqlFolder, - toolsDownloadStatusReport, - toolsSource, - toolsVersion, - zstdAvailability - }; -} -async function useZstdBundle(cliVersion2, tarSupportsZstd) { - return ( - // In testing, gzip performs better than zstd on Windows. - process.platform !== "win32" && tarSupportsZstd && semver8.gte(cliVersion2, CODEQL_VERSION_ZSTD_BUNDLE) - ); -} -function getTempExtractionDir(tempDir) { - return path9.join(tempDir, v4_default()); -} -async function getNightlyToolsUrl(logger) { - const zstdAvailability = await isZstdAvailable(logger); - const compressionMethod = await useZstdBundle( - CODEQL_VERSION_ZSTD_BUNDLE, - zstdAvailability.available - ) ? "zstd" : "gzip"; - try { - const release2 = await getApiClient().rest.repos.listReleases({ - owner: CODEQL_NIGHTLIES_REPOSITORY_OWNER, - repo: CODEQL_NIGHTLIES_REPOSITORY_NAME, - per_page: 1, - page: 1, - prerelease: true - }); - const latestRelease = release2.data[0]; - if (!latestRelease) { - throw new Error("Could not find the latest nightly release."); - } - return `https://github.com/${CODEQL_NIGHTLIES_REPOSITORY_OWNER}/${CODEQL_NIGHTLIES_REPOSITORY_NAME}/releases/download/${latestRelease.tag_name}/${getCodeQLBundleName(compressionMethod)}`; - } catch (e) { - throw new Error( - `Failed to retrieve the latest nightly release: ${wrapError(e)}` - ); - } -} -function getLatestToolcacheVersion(logger) { - const allVersions = toolcache3.findAllVersions("CodeQL").sort((a, b) => semver8.compare(b, a)); - logger.debug( - `Found the following versions of the CodeQL tools in the toolcache: ${JSON.stringify( - allVersions - )}.` - ); - if (allVersions.length > 0) { - const latestToolcacheVersion = allVersions[0]; - logger.info( - `CLI version ${latestToolcacheVersion} is the latest version in the toolcache.` - ); - return latestToolcacheVersion; - } - return void 0; -} -function isReservedToolsValue(tools) { - return CODEQL_BUNDLE_VERSION_ALIAS.includes(tools) || CODEQL_NIGHTLY_TOOLS_INPUTS.includes(tools) || tools === CODEQL_TOOLCACHE_INPUT; -} // src/tracer-config.ts -var fs10 = __toESM(require("fs")); -var path10 = __toESM(require("path")); +var fs7 = __toESM(require("fs")); +var path7 = __toESM(require("path")); async function shouldEnableIndirectTracing(codeql, config) { if (config.buildMode === "none" /* None */) { return false; @@ -109517,18 +108522,18 @@ async function endTracingForCluster(codeql, config, logger) { logger.info( "Unsetting build tracing environment variables. Subsequent steps of this job will not be traced." ); - const envVariablesFile = path10.resolve( + const envVariablesFile = path7.resolve( config.dbLocation, "temp/tracingEnvironment/end-tracing.json" ); - if (!fs10.existsSync(envVariablesFile)) { + if (!fs7.existsSync(envVariablesFile)) { throw new Error( `Environment file for ending tracing not found: ${envVariablesFile}` ); } try { const endTracingEnvVariables = JSON.parse( - fs10.readFileSync(envVariablesFile, "utf8") + fs7.readFileSync(envVariablesFile, "utf8") ); for (const [key, value] of Object.entries(endTracingEnvVariables)) { if (value !== null) { @@ -109552,54 +108557,6 @@ var GHES_VERSION_MOST_RECENTLY_DEPRECATED = "3.13"; var GHES_MOST_RECENT_DEPRECATION_DATE = "2025-06-19"; var EXTRACTION_DEBUG_MODE_VERBOSITY = "progress++"; var CODEQL_VERSION_CACHE_CLEANUP = "2.17.1"; -async function setupCodeQL(toolsInput, apiDetails, tempDir, variant, defaultCliVersion, features, logger, checkVersion) { - try { - const { - codeqlFolder, - toolsDownloadStatusReport, - toolsSource, - toolsVersion, - zstdAvailability - } = await setupCodeQLBundle( - toolsInput, - apiDetails, - tempDir, - variant, - defaultCliVersion, - features, - logger - ); - logger.debug( - `Bundle download status report: ${JSON.stringify( - toolsDownloadStatusReport - )}` - ); - let codeqlCmd = path11.join(codeqlFolder, "codeql", "codeql"); - if (process.platform === "win32") { - codeqlCmd += ".exe"; - } else if (process.platform !== "linux" && process.platform !== "darwin") { - throw new ConfigurationError( - `Unsupported platform: ${process.platform}` - ); - } - cachedCodeQL = await getCodeQLForCmd(codeqlCmd, checkVersion); - return { - codeql: cachedCodeQL, - toolsDownloadStatusReport, - toolsSource, - toolsVersion, - zstdAvailability - }; - } catch (rawError) { - const e = wrapApiConfigurationError(rawError); - const ErrorClass = e instanceof ConfigurationError || e instanceof Error && e.message.includes("ENOSPC") ? ConfigurationError : Error; - throw new ErrorClass( - `Unable to download and extract CodeQL CLI: ${getErrorMessage(e)}${e instanceof Error && e.stack ? ` - -Details: ${e.stack}` : ""}` - ); - } -} async function getCodeQL(cmd) { if (cachedCodeQL === void 0) { cachedCodeQL = await getCodeQLForCmd(cmd, true); @@ -109636,12 +108593,12 @@ async function getCodeQLForCmd(cmd, checkVersion) { }, async isTracedLanguage(language) { const extractorPath = await this.resolveExtractor(language); - const tracingConfigPath = path11.join( + const tracingConfigPath = path8.join( extractorPath, "tools", "tracing-config.lua" ); - return fs11.existsSync(tracingConfigPath); + return fs8.existsSync(tracingConfigPath); }, async isScannedLanguage(language) { return !await this.isTracedLanguage(language); @@ -109718,7 +108675,7 @@ async function getCodeQLForCmd(cmd, checkVersion) { }, async runAutobuild(config, language) { applyAutobuildAzurePipelinesTimeoutFix(); - const autobuildCmd = path11.join( + const autobuildCmd = path8.join( await this.resolveExtractor(language), "tools", process.platform === "win32" ? "autobuild.cmd" : "autobuild.sh" @@ -110117,7 +109074,7 @@ async function writeCodeScanningConfigFile(config, logger) { logger.startGroup("Augmented user configuration file contents"); logger.info(dump(augmentedConfig)); logger.endGroup(); - fs11.writeFileSync(codeScanningConfigFile, dump(augmentedConfig)); + fs8.writeFileSync(codeScanningConfigFile, dump(augmentedConfig)); return codeScanningConfigFile; } var TRAP_CACHE_SIZE_MB = 1024; @@ -110140,7 +109097,7 @@ async function getTrapCachingExtractorConfigArgsForLang(config, language) { ]; } function getGeneratedCodeScanningConfigPath(config) { - return path11.resolve(config.tempDir, "user-config.yaml"); + return path8.resolve(config.tempDir, "user-config.yaml"); } function getExtractionVerbosityArguments(enableDebugLogging) { return enableDebugLogging ? [`--verbosity=${EXTRACTION_DEBUG_MODE_VERBOSITY}`] : []; @@ -110207,7 +109164,7 @@ async function runAutobuild(config, language, logger) { } // src/dependency-caching.ts -var os3 = __toESM(require("os")); +var os2 = __toESM(require("os")); var import_path2 = require("path"); var actionsCache3 = __toESM(require_cache5()); var glob = __toESM(require_glob()); @@ -110219,9 +109176,9 @@ function getJavaTempDependencyDir() { async function getJavaDependencyDirs() { return [ // Maven - (0, import_path2.join)(os3.homedir(), ".m2", "repository"), + (0, import_path2.join)(os2.homedir(), ".m2", "repository"), // Gradle - (0, import_path2.join)(os3.homedir(), ".gradle", "caches"), + (0, import_path2.join)(os2.homedir(), ".gradle", "caches"), // CodeQL Java build-mode: none getJavaTempDependencyDir() ]; @@ -110232,7 +109189,7 @@ function getCsharpTempDependencyDir() { async function getCsharpDependencyDirs(codeql, features) { const dirs = [ // Nuget - (0, import_path2.join)(os3.homedir(), ".nuget", "packages") + (0, import_path2.join)(os2.homedir(), ".nuget", "packages") ]; if (await features.getValue("csharp_cache_bmn" /* CsharpCacheBuildModeNone */, codeql)) { dirs.push(getCsharpTempDependencyDir()); @@ -110287,7 +109244,7 @@ var defaultCacheConfigs = { getHashPatterns: getCsharpHashPatterns }, go: { - getDependencyPaths: async () => [(0, import_path2.join)(os3.homedir(), "go", "pkg", "mod")], + getDependencyPaths: async () => [(0, import_path2.join)(os2.homedir(), "go", "pkg", "mod")], getHashPatterns: async () => internal.makePatternCheck(["**/go.sum"]) } }; @@ -110464,7 +109421,7 @@ function dbIsFinalized(config, language, logger) { const dbPath = getCodeQLDatabasePath(config, language); try { const dbInfo = load( - fs12.readFileSync(path12.resolve(dbPath, "codeql-database.yml"), "utf8") + fs9.readFileSync(path9.resolve(dbPath, "codeql-database.yml"), "utf8") ); return !("inProgress" in dbInfo); } catch { @@ -110475,10 +109432,10 @@ function dbIsFinalized(config, language, logger) { } } async function finalizeDatabaseCreation(codeql, features, config, threadsFlag, memoryFlag, logger) { - const extractionStart = import_perf_hooks2.performance.now(); + const extractionStart = import_perf_hooks.performance.now(); await runExtraction(codeql, features, config, logger); - const extractionTime = import_perf_hooks2.performance.now() - extractionStart; - const trapImportStart = import_perf_hooks2.performance.now(); + const extractionTime = import_perf_hooks.performance.now() - extractionStart; + const trapImportStart = import_perf_hooks.performance.now(); for (const language of config.languages) { if (dbIsFinalized(config, language, logger)) { logger.info( @@ -110495,7 +109452,7 @@ async function finalizeDatabaseCreation(codeql, features, config, threadsFlag, m logger.endGroup(); } } - const trapImportTime = import_perf_hooks2.performance.now() - trapImportStart; + const trapImportTime = import_perf_hooks.performance.now() - trapImportStart; return { scanned_language_extraction_duration_ms: Math.round(extractionTime), trap_import_duration_ms: Math.round(trapImportTime) @@ -110530,10 +109487,10 @@ function writeDiffRangeDataExtensionPack(logger, ranges) { if (ranges.length === 0) { ranges = [{ path: "", startLine: 0, endLine: 0 }]; } - const diffRangeDir = path12.join(getTemporaryDirectory(), "pr-diff-range"); - fs12.mkdirSync(diffRangeDir, { recursive: true }); - fs12.writeFileSync( - path12.join(diffRangeDir, "qlpack.yml"), + const diffRangeDir = path9.join(getTemporaryDirectory(), "pr-diff-range"); + fs9.mkdirSync(diffRangeDir, { recursive: true }); + fs9.writeFileSync( + path9.join(diffRangeDir, "qlpack.yml"), ` name: codeql-action/pr-diff-range version: 0.0.0 @@ -110565,8 +109522,8 @@ extensions: data = ' - ["", 0, 0]\n'; } const extensionContents = header + data; - const extensionFilePath = path12.join(diffRangeDir, "pr-diff-range.yml"); - fs12.writeFileSync(extensionFilePath, extensionContents); + const extensionFilePath = path9.join(diffRangeDir, "pr-diff-range.yml"); + fs9.writeFileSync(extensionFilePath, extensionContents); logger.debug( `Wrote pr-diff-range extension pack to ${extensionFilePath}: ${extensionContents}` @@ -110690,7 +109647,7 @@ async function runQueries(sarifFolder, memoryFlag, threadsFlag, diffRangePackDir async function runInterpretResultsFor(analysis, language, queries, enableDebugLogging) { logger.info(`Interpreting ${analysis.name} results for ${language}`); const category = analysis.fixCategory(logger, automationDetailsId); - const sarifFile = path12.join( + const sarifFile = path9.join( sarifFolder, addSarifExtension(analysis, language) ); @@ -110719,7 +109676,7 @@ async function runQueries(sarifFolder, memoryFlag, threadsFlag, diffRangePackDir } function getPerQueryAlertCounts(sarifPath) { const sarifObject = JSON.parse( - fs12.readFileSync(sarifPath, "utf8") + fs9.readFileSync(sarifPath, "utf8") ); const perQueryAlertCounts = {}; for (const sarifRun of sarifObject.runs) { @@ -110737,13 +109694,13 @@ async function runQueries(sarifFolder, memoryFlag, threadsFlag, diffRangePackDir } async function runFinalize(features, outputDir, threadsFlag, memoryFlag, codeql, config, logger) { try { - await fs12.promises.rm(outputDir, { force: true, recursive: true }); + await fs9.promises.rm(outputDir, { force: true, recursive: true }); } catch (error3) { if (error3?.code !== "ENOENT") { throw error3; } } - await fs12.promises.mkdir(outputDir, { recursive: true }); + await fs9.promises.mkdir(outputDir, { recursive: true }); const timings = await finalizeDatabaseCreation( codeql, features, @@ -110787,7 +109744,7 @@ async function warnIfGoInstalledAfterInit(config, logger) { } // src/database-upload.ts -var fs13 = __toESM(require("fs")); +var fs10 = __toESM(require("fs")); async function cleanupAndUploadDatabases(repositoryNwo, codeql, config, apiDetails, features, logger) { if (getRequiredInput("upload-database") !== "true") { logger.debug("Database upload disabled in workflow. Skipping upload."); @@ -110828,8 +109785,8 @@ async function cleanupAndUploadDatabases(repositoryNwo, codeql, config, apiDetai let bundledDbSize = void 0; try { const bundledDb = await bundleDb(config, language, codeql, language); - bundledDbSize = fs13.statSync(bundledDb).size; - const bundledDbReadStream = fs13.createReadStream(bundledDb); + bundledDbSize = fs10.statSync(bundledDb).size; + const bundledDbReadStream = fs10.createReadStream(bundledDb); const commitOid = await getCommitOid( getRequiredInput("checkout_path") ); @@ -110878,7 +109835,7 @@ async function cleanupAndUploadDatabases(repositoryNwo, codeql, config, apiDetai } // src/status-report.ts -var os4 = __toESM(require("os")); +var os3 = __toESM(require("os")); var core12 = __toESM(require_core()); function isFirstPartyAnalysis(actionName) { if (actionName !== "upload-sarif" /* UploadSarif */) { @@ -110984,7 +109941,7 @@ async function createStatusReportBase(actionName, status, actionStartedAt, confi statusReport.runner_arch = process.env["RUNNER_ARCH"]; } if (!(runnerOs === "Linux" && isSelfHostedRunner())) { - statusReport.runner_os_release = os4.release(); + statusReport.runner_os_release = os3.release(); } if (codeQlCliVersion !== void 0) { statusReport.codeql_version = codeQlCliVersion.version; @@ -111085,15 +110042,15 @@ async function sendUnhandledErrorStatusReport(actionName, actionStartedAt, error } // src/upload-lib.ts -var fs15 = __toESM(require("fs")); -var path14 = __toESM(require("path")); +var fs12 = __toESM(require("fs")); +var path11 = __toESM(require("path")); var url = __toESM(require("url")); var import_zlib = __toESM(require("zlib")); var core13 = __toESM(require_core()); var jsonschema2 = __toESM(require_lib2()); // src/fingerprints.ts -var fs14 = __toESM(require("fs")); +var fs11 = __toESM(require("fs")); var import_path3 = __toESM(require("path")); // node_modules/long/index.js @@ -112081,7 +111038,7 @@ async function hash(callback, filepath) { } updateHash(current); }; - const readStream = fs14.createReadStream(filepath, "utf8"); + const readStream = fs11.createReadStream(filepath, "utf8"); for await (const data of readStream) { for (let i = 0; i < data.length; ++i) { processCharacter(data.charCodeAt(i)); @@ -112156,11 +111113,11 @@ function resolveUriToFile(location, artifacts, sourceRoot, logger) { if (!import_path3.default.isAbsolute(uri)) { uri = srcRootPrefix + uri; } - if (!fs14.existsSync(uri)) { + if (!fs11.existsSync(uri)) { logger.debug(`Unable to compute fingerprint for non-existent file: ${uri}`); return void 0; } - if (fs14.statSync(uri).isDirectory()) { + if (fs11.statSync(uri).isDirectory()) { logger.debug(`Unable to compute fingerprint for directory: ${uri}`); return void 0; } @@ -112217,34 +111174,6 @@ async function addFingerprints(sarif, sourceRoot, logger) { // src/init.ts var toolrunner4 = __toESM(require_toolrunner()); var io6 = __toESM(require_io()); -async function initCodeQL(toolsInput, apiDetails, tempDir, variant, defaultCliVersion, features, logger) { - logger.startGroup("Setup CodeQL tools"); - const { - codeql, - toolsDownloadStatusReport, - toolsSource, - toolsVersion, - zstdAvailability - } = await setupCodeQL( - toolsInput, - apiDetails, - tempDir, - variant, - defaultCliVersion, - features, - logger, - true - ); - await codeql.printVersion(); - logger.endGroup(); - return { - codeql, - toolsDownloadStatusReport, - toolsSource, - toolsVersion, - zstdAvailability - }; -} // src/upload-lib.ts var GENERIC_403_MSG = "The repo on which this action is running has not opted-in to CodeQL code scanning."; @@ -112258,7 +111187,7 @@ function combineSarifFiles(sarifFiles, logger) { for (const sarifFile of sarifFiles) { logger.debug(`Loading SARIF file: ${sarifFile}`); const sarifObject = JSON.parse( - fs15.readFileSync(sarifFile, "utf8") + fs12.readFileSync(sarifFile, "utf8") ); if (combinedSarif.version === null) { combinedSarif.version = sarifObject.version; @@ -112327,35 +111256,10 @@ async function shouldDisableCombineSarifFiles(sarifObjects, githubVersion) { } return true; } -async function minimalInitCodeQL(logger, gitHubVersion, features) { - logger.info( - "Initializing CodeQL since the 'init' Action was not called before this step." - ); - const apiDetails = { - auth: getRequiredInput("token"), - externalRepoAuth: getOptionalInput("external-repository-token"), - url: getRequiredEnvParam("GITHUB_SERVER_URL"), - apiURL: getRequiredEnvParam("GITHUB_API_URL") - }; - const codeQLDefaultVersionInfo = await features.getDefaultCliVersion( - gitHubVersion.type - ); - const initCodeQLResult = await initCodeQL( - void 0, - // There is no tools input on the upload action - apiDetails, - getTemporaryDirectory(), - gitHubVersion.type, - codeQLDefaultVersionInfo, - features, - logger - ); - return initCodeQLResult.codeql; -} -async function combineSarifFilesUsingCLI(sarifFiles, gitHubVersion, features, logger) { +async function combineSarifFilesUsingCLI(sarifFiles, gitHubVersion, _features, logger, getCodeQL2, tempDir) { logger.info("Combining SARIF files using the CodeQL CLI"); const sarifObjects = sarifFiles.map((sarifFile) => { - return JSON.parse(fs15.readFileSync(sarifFile, "utf8")); + return JSON.parse(fs12.readFileSync(sarifFile, "utf8")); }); const deprecationWarningMessage = gitHubVersion.type === "GitHub Enterprise Server" /* GHES */ ? "and will be removed in GitHub Enterprise Server 3.18" : "and will be removed in July 2025"; const deprecationMoreInformationMessage = "For more information, see https://github.blog/changelog/2024-05-06-code-scanning-will-stop-combining-runs-from-a-single-upload"; @@ -112375,23 +111279,15 @@ async function combineSarifFilesUsingCLI(sarifFiles, gitHubVersion, features, lo } return combineSarifFiles(sarifFiles, logger); } - let codeQL; - let tempDir = getTemporaryDirectory(); - const config = await getConfig(tempDir, logger); - if (config !== void 0) { - codeQL = await getCodeQL(config.codeQLCmd); - tempDir = config.tempDir; - } else { - codeQL = await minimalInitCodeQL(logger, gitHubVersion, features); - } - const baseTempDir = path14.resolve(tempDir, "combined-sarif"); - fs15.mkdirSync(baseTempDir, { recursive: true }); - const outputDirectory = fs15.mkdtempSync(path14.resolve(baseTempDir, "output-")); - const outputFile = path14.resolve(outputDirectory, "combined-sarif.sarif"); + const codeQL = await getCodeQL2(); + const baseTempDir = path11.resolve(tempDir, "combined-sarif"); + fs12.mkdirSync(baseTempDir, { recursive: true }); + const outputDirectory = fs12.mkdtempSync(path11.resolve(baseTempDir, "output-")); + const outputFile = path11.resolve(outputDirectory, "combined-sarif.sarif"); await codeQL.mergeResults(sarifFiles, outputFile, { mergeRunsFromEqualCategory: true }); - return JSON.parse(fs15.readFileSync(outputFile, "utf8")); + return JSON.parse(fs12.readFileSync(outputFile, "utf8")); } function populateRunAutomationDetails(sarif, category, analysis_key, environment) { const automationID = getAutomationID2(category, analysis_key, environment); @@ -112420,7 +111316,7 @@ function getAutomationID2(category, analysis_key, environment) { async function uploadPayload(payload, repositoryNwo, logger, analysis) { logger.info("Uploading results"); if (shouldSkipSarifUpload()) { - const payloadSaveFile = path14.join( + const payloadSaveFile = path11.join( getTemporaryDirectory(), `payload-${analysis.kind}.json` ); @@ -112428,7 +111324,7 @@ async function uploadPayload(payload, repositoryNwo, logger, analysis) { `SARIF upload disabled by an environment variable. Saving to ${payloadSaveFile}` ); logger.info(`Payload: ${JSON.stringify(payload, null, 2)}`); - fs15.writeFileSync(payloadSaveFile, JSON.stringify(payload, null, 2)); + fs12.writeFileSync(payloadSaveFile, JSON.stringify(payload, null, 2)); return "dummy-sarif-id"; } const client = getApiClient(); @@ -112462,12 +111358,12 @@ async function uploadPayload(payload, repositoryNwo, logger, analysis) { function findSarifFilesInDir(sarifPath, isSarif) { const sarifFiles = []; const walkSarifFiles = (dir) => { - const entries = fs15.readdirSync(dir, { withFileTypes: true }); + const entries = fs12.readdirSync(dir, { withFileTypes: true }); for (const entry of entries) { if (entry.isFile() && isSarif(entry.name)) { - sarifFiles.push(path14.resolve(dir, entry.name)); + sarifFiles.push(path11.resolve(dir, entry.name)); } else if (entry.isDirectory()) { - walkSarifFiles(path14.resolve(dir, entry.name)); + walkSarifFiles(path11.resolve(dir, entry.name)); } } }; @@ -112475,7 +111371,7 @@ function findSarifFilesInDir(sarifPath, isSarif) { return sarifFiles; } async function getGroupedSarifFilePaths(logger, sarifPath) { - const stats = fs15.statSync(sarifPath, { throwIfNoEntry: false }); + const stats = fs12.statSync(sarifPath, { throwIfNoEntry: false }); if (stats === void 0) { throw new ConfigurationError(`Path does not exist: ${sarifPath}`); } @@ -112483,7 +111379,7 @@ async function getGroupedSarifFilePaths(logger, sarifPath) { if (stats.isDirectory()) { let unassignedSarifFiles = findSarifFilesInDir( sarifPath, - (name) => path14.extname(name) === ".sarif" + (name) => path11.extname(name) === ".sarif" ); logger.debug( `Found the following .sarif files in ${sarifPath}: ${unassignedSarifFiles.join(", ")}` @@ -112540,7 +111436,7 @@ function countResultsInSarif(sarif) { } function readSarifFile(sarifFilePath) { try { - return JSON.parse(fs15.readFileSync(sarifFilePath, "utf8")); + return JSON.parse(fs12.readFileSync(sarifFilePath, "utf8")); } catch (e) { throw new InvalidSarifUploadError( `Invalid SARIF. JSON syntax error: ${getErrorMessage(e)}` @@ -112609,7 +111505,7 @@ function buildPayload(commitOid, ref, analysisKey, analysisName, zippedSarif, wo payloadObj.base_sha = mergeBaseCommitOid; } else if (process.env.GITHUB_EVENT_PATH) { const githubEvent = JSON.parse( - fs15.readFileSync(process.env.GITHUB_EVENT_PATH, "utf8") + fs12.readFileSync(process.env.GITHUB_EVENT_PATH, "utf8") ); payloadObj.base_ref = `refs/heads/${githubEvent.pull_request.base.ref}`; payloadObj.base_sha = githubEvent.pull_request.base.sha; @@ -112617,7 +111513,7 @@ function buildPayload(commitOid, ref, analysisKey, analysisName, zippedSarif, wo } return payloadObj; } -async function postProcessSarifFiles(logger, features, checkoutPath, sarifPaths, category, analysis) { +async function postProcessSarifFiles(logger, features, getCodeQL2, tempPath, checkoutPath, sarifPaths, category, analysis) { logger.info(`Post-processing sarif files: ${JSON.stringify(sarifPaths)}`); const gitHubVersion = await getGitHubVersion(); let sarif; @@ -112631,7 +111527,9 @@ async function postProcessSarifFiles(logger, features, checkoutPath, sarifPaths, sarifPaths, gitHubVersion, features, - logger + logger, + getCodeQL2, + tempPath ); } else { const sarifPath = sarifPaths[0]; @@ -112713,19 +111611,19 @@ async function uploadPostProcessedFiles(logger, checkoutPath, uploadTarget, post }; } function dumpSarifFile(sarifPayload, outputDir, logger, uploadTarget) { - if (!fs15.existsSync(outputDir)) { - fs15.mkdirSync(outputDir, { recursive: true }); - } else if (!fs15.lstatSync(outputDir).isDirectory()) { + if (!fs12.existsSync(outputDir)) { + fs12.mkdirSync(outputDir, { recursive: true }); + } else if (!fs12.lstatSync(outputDir).isDirectory()) { throw new ConfigurationError( `The path that processed SARIF files should be written to exists, but is not a directory: ${outputDir}` ); } - const outputFile = path14.resolve( + const outputFile = path11.resolve( outputDir, `upload${uploadTarget.sarifExtension}` ); logger.info(`Writing processed SARIF file to ${outputFile}`); - fs15.writeFileSync(outputFile, sarifPayload); + fs12.writeFileSync(outputFile, sarifPayload); } var STATUS_CHECK_FREQUENCY_MILLISECONDS = 5 * 1e3; var STATUS_CHECK_TIMEOUT_MILLISECONDS = 2 * 60 * 1e3; @@ -112868,7 +111766,7 @@ function filterAlertsByDiffRange(logger, sarif) { if (!locationUri || locationStartLine === void 0) { return false; } - const locationPath = path14.join(checkoutPath, locationUri).replaceAll(path14.sep, "/"); + const locationPath = path11.join(checkoutPath, locationUri).replaceAll(path11.sep, "/"); return diffRanges.some( (range) => range.path === locationPath && (range.startLine <= locationStartLine && range.endLine >= locationStartLine || range.startLine === 0 && range.endLine === 0) ); @@ -112880,7 +111778,7 @@ function filterAlertsByDiffRange(logger, sarif) { } // src/upload-sarif.ts -async function postProcessAndUploadSarif(logger, features, uploadKind, checkoutPath, sarifPath, category, postProcessedOutputPath) { +async function postProcessAndUploadSarif(logger, tempPath, features, getCodeQL2, uploadKind, checkoutPath, sarifPath, category, postProcessedOutputPath) { const sarifGroups = await getGroupedSarifFilePaths( logger, sarifPath @@ -112893,6 +111791,8 @@ async function postProcessAndUploadSarif(logger, features, uploadKind, checkoutP const postProcessingResults = await postProcessSarifFiles( logger, features, + getCodeQL2, + tempPath, checkoutPath, sarifFiles, category, @@ -112961,7 +111861,7 @@ function doesGoExtractionOutputExist(config) { "go" /* go */ ); const trapDirectory = import_path4.default.join(golangDbDirectory, "trap", "go" /* go */); - return fs16.existsSync(trapDirectory) && fs16.readdirSync(trapDirectory).some( + return fs13.existsSync(trapDirectory) && fs13.readdirSync(trapDirectory).some( (fileName) => [ ".trap", ".trap.gz", @@ -113124,7 +112024,9 @@ async function run(startedAt2) { const category = getOptionalInput("category"); uploadResults = await postProcessAndUploadSarif( logger, + config.tempDir, features, + async () => codeql, uploadKind, checkoutPath, outputDir, @@ -113155,9 +112057,9 @@ async function run(startedAt2) { features, logger ); - const trapCacheUploadStartTime = import_perf_hooks3.performance.now(); + const trapCacheUploadStartTime = import_perf_hooks2.performance.now(); didUploadTrapCaches = await uploadTrapCaches(codeql, config, logger); - trapCacheUploadTime = import_perf_hooks3.performance.now() - trapCacheUploadStartTime; + trapCacheUploadTime = import_perf_hooks2.performance.now() - trapCacheUploadStartTime; trapCacheCleanupTelemetry = await cleanupTrapCaches( config, features, diff --git a/lib/init-action-post.js b/lib/init-action-post.js index c5e72a6c5..209eb22fa 100644 --- a/lib/init-action-post.js +++ b/lib/init-action-post.js @@ -108,11 +108,11 @@ var require_command = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.issueCommand = issueCommand; exports2.issue = issue; - var os4 = __importStar2(require("os")); + var os3 = __importStar2(require("os")); var utils_1 = require_utils(); function issueCommand(command, properties, message) { const cmd = new Command(command, properties, message); - process.stdout.write(cmd.toString() + os4.EOL); + process.stdout.write(cmd.toString() + os3.EOL); } function issue(name, message = "") { issueCommand(name, {}, message); @@ -204,18 +204,18 @@ var require_file_command = __commonJS({ exports2.issueFileCommand = issueFileCommand; exports2.prepareKeyValueMessage = prepareKeyValueMessage; var crypto2 = __importStar2(require("crypto")); - var fs18 = __importStar2(require("fs")); - var os4 = __importStar2(require("os")); + var fs15 = __importStar2(require("fs")); + var os3 = __importStar2(require("os")); var utils_1 = require_utils(); function issueFileCommand(command, message) { const filePath = process.env[`GITHUB_${command}`]; if (!filePath) { throw new Error(`Unable to find environment variable for file command ${command}`); } - if (!fs18.existsSync(filePath)) { + if (!fs15.existsSync(filePath)) { throw new Error(`Missing file at path: ${filePath}`); } - fs18.appendFileSync(filePath, `${(0, utils_1.toCommandValue)(message)}${os4.EOL}`, { + fs15.appendFileSync(filePath, `${(0, utils_1.toCommandValue)(message)}${os3.EOL}`, { encoding: "utf8" }); } @@ -228,7 +228,7 @@ var require_file_command = __commonJS({ if (convertedValue.includes(delimiter)) { throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`); } - return `${key}<<${delimiter}${os4.EOL}${convertedValue}${os4.EOL}${delimiter}`; + return `${key}<<${delimiter}${os3.EOL}${convertedValue}${os3.EOL}${delimiter}`; } } }); @@ -1228,7 +1228,7 @@ var require_util = __commonJS({ var assert = require("node:assert"); var { kDestroyed, kBodyUsed, kListeners, kBody } = require_symbols(); var { IncomingMessage } = require("node:http"); - var stream2 = require("node:stream"); + var stream = require("node:stream"); var net = require("node:net"); var { Blob: Blob2 } = require("node:buffer"); var nodeUtil = require("node:util"); @@ -1337,14 +1337,14 @@ var require_util = __commonJS({ } const port = url2.port != null ? url2.port : url2.protocol === "https:" ? 443 : 80; let origin = url2.origin != null ? url2.origin : `${url2.protocol || ""}//${url2.hostname || ""}:${port}`; - let path17 = url2.path != null ? url2.path : `${url2.pathname || ""}${url2.search || ""}`; + let path14 = url2.path != null ? url2.path : `${url2.pathname || ""}${url2.search || ""}`; if (origin[origin.length - 1] === "/") { origin = origin.slice(0, origin.length - 1); } - if (path17 && path17[0] !== "/") { - path17 = `/${path17}`; + if (path14 && path14[0] !== "/") { + path14 = `/${path14}`; } - return new URL(`${origin}${path17}`); + return new URL(`${origin}${path14}`); } if (!isHttpOrHttpsPrefixed(url2.origin || url2.protocol)) { throw new InvalidArgumentError("Invalid URL protocol: the URL must start with `http:` or `https:`."); @@ -1402,24 +1402,24 @@ var require_util = __commonJS({ return null; } function isDestroyed(body) { - return body && !!(body.destroyed || body[kDestroyed] || stream2.isDestroyed?.(body)); + return body && !!(body.destroyed || body[kDestroyed] || stream.isDestroyed?.(body)); } - function destroy(stream3, err) { - if (stream3 == null || !isStream(stream3) || isDestroyed(stream3)) { + function destroy(stream2, err) { + if (stream2 == null || !isStream(stream2) || isDestroyed(stream2)) { return; } - if (typeof stream3.destroy === "function") { - if (Object.getPrototypeOf(stream3).constructor === IncomingMessage) { - stream3.socket = null; + if (typeof stream2.destroy === "function") { + if (Object.getPrototypeOf(stream2).constructor === IncomingMessage) { + stream2.socket = null; } - stream3.destroy(err); + stream2.destroy(err); } else if (err) { queueMicrotask(() => { - stream3.emit("error", err); + stream2.emit("error", err); }); } - if (stream3.destroyed !== true) { - stream3[kDestroyed] = true; + if (stream2.destroyed !== true) { + stream2[kDestroyed] = true; } } var KEEPALIVE_TIMEOUT_EXPR = /timeout=(\d+)/; @@ -1518,13 +1518,13 @@ var require_util = __commonJS({ } } function isDisturbed(body) { - return !!(body && (stream2.isDisturbed(body) || body[kBodyUsed])); + return !!(body && (stream.isDisturbed(body) || body[kBodyUsed])); } function isErrored(body) { - return !!(body && stream2.isErrored(body)); + return !!(body && stream.isErrored(body)); } function isReadable(body) { - return !!(body && stream2.isReadable(body)); + return !!(body && stream.isReadable(body)); } function getSocketInfo(socket) { return { @@ -1795,39 +1795,39 @@ var require_diagnostics = __commonJS({ }); diagnosticsChannel.channel("undici:client:sendHeaders").subscribe((evt) => { const { - request: { method, path: path17, origin } + request: { method, path: path14, origin } } = evt; - debuglog("sending request to %s %s/%s", method, origin, path17); + debuglog("sending request to %s %s/%s", method, origin, path14); }); diagnosticsChannel.channel("undici:request:headers").subscribe((evt) => { const { - request: { method, path: path17, origin }, + request: { method, path: path14, origin }, response: { statusCode } } = evt; debuglog( "received response to %s %s/%s - HTTP %d", method, origin, - path17, + path14, statusCode ); }); diagnosticsChannel.channel("undici:request:trailers").subscribe((evt) => { const { - request: { method, path: path17, origin } + request: { method, path: path14, origin } } = evt; - debuglog("trailers received from %s %s/%s", method, origin, path17); + debuglog("trailers received from %s %s/%s", method, origin, path14); }); diagnosticsChannel.channel("undici:request:error").subscribe((evt) => { const { - request: { method, path: path17, origin }, + request: { method, path: path14, origin }, error: error3 } = evt; debuglog( "request to %s %s/%s errored - %s", method, origin, - path17, + path14, error3.message ); }); @@ -1876,9 +1876,9 @@ var require_diagnostics = __commonJS({ }); diagnosticsChannel.channel("undici:client:sendHeaders").subscribe((evt) => { const { - request: { method, path: path17, origin } + request: { method, path: path14, origin } } = evt; - debuglog("sending request to %s %s/%s", method, origin, path17); + debuglog("sending request to %s %s/%s", method, origin, path14); }); } diagnosticsChannel.channel("undici:websocket:open").subscribe((evt) => { @@ -1941,7 +1941,7 @@ var require_request = __commonJS({ var kHandler = /* @__PURE__ */ Symbol("handler"); var Request = class { constructor(origin, { - path: path17, + path: path14, method, body, headers, @@ -1956,11 +1956,11 @@ var require_request = __commonJS({ expectContinue, servername }, handler2) { - if (typeof path17 !== "string") { + if (typeof path14 !== "string") { throw new InvalidArgumentError("path must be a string"); - } else if (path17[0] !== "/" && !(path17.startsWith("http://") || path17.startsWith("https://")) && method !== "CONNECT") { + } else if (path14[0] !== "/" && !(path14.startsWith("http://") || path14.startsWith("https://")) && method !== "CONNECT") { throw new InvalidArgumentError("path must be an absolute URL or start with a slash"); - } else if (invalidPathRegex.test(path17)) { + } else if (invalidPathRegex.test(path14)) { throw new InvalidArgumentError("invalid request path"); } if (typeof method !== "string") { @@ -2023,7 +2023,7 @@ var require_request = __commonJS({ this.completed = false; this.aborted = false; this.upgrade = upgrade || null; - this.path = query ? buildURL(path17, query) : path17; + this.path = query ? buildURL(path14, query) : path14; this.origin = origin; this.idempotent = idempotent == null ? method === "HEAD" || method === "GET" : idempotent; this.blocking = blocking == null ? false : blocking; @@ -4256,7 +4256,7 @@ var require_util2 = __commonJS({ var { redirectStatusSet, referrerPolicySet: referrerPolicyTokens, badPortsSet } = require_constants3(); var { getGlobalOrigin } = require_global(); var { collectASequenceOfCodePoints, collectAnHTTPQuotedString, removeChars, parseMIMEType } = require_data_url(); - var { performance: performance3 } = require("node:perf_hooks"); + var { performance: performance2 } = require("node:perf_hooks"); var { isBlobLike, ReadableStreamFrom, isValidHTTPToken, normalizedMethodRecordsBase } = require_util(); var assert = require("node:assert"); var { isUint8Array } = require("node:util/types"); @@ -4415,7 +4415,7 @@ var require_util2 = __commonJS({ }; } function coarsenedSharedCurrentTime(crossOriginIsolatedCapability) { - return coarsenTime(performance3.now(), crossOriginIsolatedCapability); + return coarsenTime(performance2.now(), crossOriginIsolatedCapability); } function createOpaqueTimingInfo(timingInfo) { return { @@ -4813,8 +4813,8 @@ var require_util2 = __commonJS({ errorSteps(e); } } - function isReadableStreamLike(stream2) { - return stream2 instanceof ReadableStream || stream2[Symbol.toStringTag] === "ReadableStream" && typeof stream2.tee === "function"; + function isReadableStreamLike(stream) { + return stream instanceof ReadableStream || stream[Symbol.toStringTag] === "ReadableStream" && typeof stream.tee === "function"; } function readableStreamClose(controller) { try { @@ -5630,20 +5630,20 @@ var require_body = __commonJS({ var streamRegistry; if (hasFinalizationRegistry) { streamRegistry = new FinalizationRegistry((weakRef) => { - const stream2 = weakRef.deref(); - if (stream2 && !stream2.locked && !isDisturbed(stream2) && !isErrored(stream2)) { - stream2.cancel("Response object has been garbage collected").catch(noop3); + const stream = weakRef.deref(); + if (stream && !stream.locked && !isDisturbed(stream) && !isErrored(stream)) { + stream.cancel("Response object has been garbage collected").catch(noop3); } }); } function extractBody(object, keepalive = false) { - let stream2 = null; + let stream = null; if (object instanceof ReadableStream) { - stream2 = object; + stream = object; } else if (isBlobLike(object)) { - stream2 = object.stream(); + stream = object.stream(); } else { - stream2 = new ReadableStream({ + stream = new ReadableStream({ async pull(controller) { const buffer = typeof source === "string" ? textEncoder.encode(source) : source; if (buffer.byteLength) { @@ -5656,7 +5656,7 @@ var require_body = __commonJS({ type: "bytes" }); } - assert(isReadableStreamLike(stream2)); + assert(isReadableStreamLike(stream)); let action = null; let source = null; let length = null; @@ -5735,14 +5735,14 @@ Content-Type: ${value.type || "application/octet-stream"}\r "Response body object should not be disturbed or locked" ); } - stream2 = object instanceof ReadableStream ? object : ReadableStreamFrom(object); + stream = object instanceof ReadableStream ? object : ReadableStreamFrom(object); } if (typeof source === "string" || util.isBuffer(source)) { length = Buffer.byteLength(source); } if (action != null) { let iterator2; - stream2 = new ReadableStream({ + stream = new ReadableStream({ async start() { iterator2 = action(object)[Symbol.asyncIterator](); }, @@ -5754,7 +5754,7 @@ Content-Type: ${value.type || "application/octet-stream"}\r controller.byobRequest?.respond(0); }); } else { - if (!isErrored(stream2)) { + if (!isErrored(stream)) { const buffer = new Uint8Array(value); if (buffer.byteLength) { controller.enqueue(buffer); @@ -5769,7 +5769,7 @@ Content-Type: ${value.type || "application/octet-stream"}\r type: "bytes" }); } - const body = { stream: stream2, source, length }; + const body = { stream, source, length }; return [body, type2]; } function safelyExtractBody(object, keepalive = false) { @@ -6536,7 +6536,7 @@ var require_client_h1 = __commonJS({ return method !== "GET" && method !== "HEAD" && method !== "OPTIONS" && method !== "TRACE" && method !== "CONNECT"; } function writeH1(client, request2) { - const { method, path: path17, host, upgrade, blocking, reset } = request2; + const { method, path: path14, host, upgrade, blocking, reset } = request2; let { body, headers, contentLength } = request2; const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH" || method === "QUERY" || method === "PROPFIND" || method === "PROPPATCH"; if (util.isFormDataLike(body)) { @@ -6602,7 +6602,7 @@ var require_client_h1 = __commonJS({ if (blocking) { socket[kBlocking] = true; } - let header = `${method} ${path17} HTTP/1.1\r + let header = `${method} ${path14} HTTP/1.1\r `; if (typeof host === "string") { header += `host: ${host}\r @@ -7128,7 +7128,7 @@ var require_client_h2 = __commonJS({ } function writeH2(client, request2) { const session = client[kHTTP2Session]; - const { method, path: path17, host, upgrade, expectContinue, signal, headers: reqHeaders } = request2; + const { method, path: path14, host, upgrade, expectContinue, signal, headers: reqHeaders } = request2; let { body } = request2; if (upgrade) { util.errorRequest(client, request2, new Error("Upgrade not supported for H2")); @@ -7150,7 +7150,7 @@ var require_client_h2 = __commonJS({ headers[key] = val; } } - let stream2; + let stream; const { hostname, port } = client[kUrl]; headers[HTTP2_HEADER_AUTHORITY] = host || `${hostname}${port ? `:${port}` : ""}`; headers[HTTP2_HEADER_METHOD] = method; @@ -7160,8 +7160,8 @@ var require_client_h2 = __commonJS({ } err = err || new RequestAbortedError(); util.errorRequest(client, request2, err); - if (stream2 != null) { - util.destroy(stream2, err); + if (stream != null) { + util.destroy(stream, err); } util.destroy(body, err); client[kQueue][client[kRunningIdx]++] = null; @@ -7177,25 +7177,25 @@ var require_client_h2 = __commonJS({ } if (method === "CONNECT") { session.ref(); - stream2 = session.request(headers, { endStream: false, signal }); - if (stream2.id && !stream2.pending) { - request2.onUpgrade(null, null, stream2); + stream = session.request(headers, { endStream: false, signal }); + if (stream.id && !stream.pending) { + request2.onUpgrade(null, null, stream); ++session[kOpenStreams]; client[kQueue][client[kRunningIdx]++] = null; } else { - stream2.once("ready", () => { - request2.onUpgrade(null, null, stream2); + stream.once("ready", () => { + request2.onUpgrade(null, null, stream); ++session[kOpenStreams]; client[kQueue][client[kRunningIdx]++] = null; }); } - stream2.once("close", () => { + stream.once("close", () => { session[kOpenStreams] -= 1; if (session[kOpenStreams] === 0) session.unref(); }); return true; } - headers[HTTP2_HEADER_PATH] = path17; + headers[HTTP2_HEADER_PATH] = path14; headers[HTTP2_HEADER_SCHEME] = "https"; const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH"; if (body && typeof body.read === "function") { @@ -7230,36 +7230,36 @@ var require_client_h2 = __commonJS({ const shouldEndStream = method === "GET" || method === "HEAD" || body === null; if (expectContinue) { headers[HTTP2_HEADER_EXPECT] = "100-continue"; - stream2 = session.request(headers, { endStream: shouldEndStream, signal }); - stream2.once("continue", writeBodyH2); + stream = session.request(headers, { endStream: shouldEndStream, signal }); + stream.once("continue", writeBodyH2); } else { - stream2 = session.request(headers, { + stream = session.request(headers, { endStream: shouldEndStream, signal }); writeBodyH2(); } ++session[kOpenStreams]; - stream2.once("response", (headers2) => { + stream.once("response", (headers2) => { const { [HTTP2_HEADER_STATUS]: statusCode, ...realHeaders } = headers2; request2.onResponseStarted(); if (request2.aborted) { const err = new RequestAbortedError(); util.errorRequest(client, request2, err); - util.destroy(stream2, err); + util.destroy(stream, err); return; } - if (request2.onHeaders(Number(statusCode), parseH2Headers(realHeaders), stream2.resume.bind(stream2), "") === false) { - stream2.pause(); + if (request2.onHeaders(Number(statusCode), parseH2Headers(realHeaders), stream.resume.bind(stream), "") === false) { + stream.pause(); } - stream2.on("data", (chunk) => { + stream.on("data", (chunk) => { if (request2.onData(chunk) === false) { - stream2.pause(); + stream.pause(); } }); }); - stream2.once("end", () => { - if (stream2.state?.state == null || stream2.state.state < 6) { + stream.once("end", () => { + if (stream.state?.state == null || stream.state.state < 6) { request2.onComplete([]); } if (session[kOpenStreams] === 0) { @@ -7270,16 +7270,16 @@ var require_client_h2 = __commonJS({ client[kPendingIdx] = client[kRunningIdx]; client[kResume](); }); - stream2.once("close", () => { + stream.once("close", () => { session[kOpenStreams] -= 1; if (session[kOpenStreams] === 0) { session.unref(); } }); - stream2.once("error", function(err) { + stream.once("error", function(err) { abort(err); }); - stream2.once("frameError", (type2, code) => { + stream.once("frameError", (type2, code) => { abort(new InformationalError(`HTTP/2: "frameError" received - type ${type2}, code ${code}`)); }); return true; @@ -7287,7 +7287,7 @@ var require_client_h2 = __commonJS({ if (!body || contentLength === 0) { writeBuffer( abort, - stream2, + stream, null, client, request2, @@ -7298,7 +7298,7 @@ var require_client_h2 = __commonJS({ } else if (util.isBuffer(body)) { writeBuffer( abort, - stream2, + stream, body, client, request2, @@ -7310,7 +7310,7 @@ var require_client_h2 = __commonJS({ if (typeof body.stream === "function") { writeIterable( abort, - stream2, + stream, body.stream(), client, request2, @@ -7321,7 +7321,7 @@ var require_client_h2 = __commonJS({ } else { writeBlob( abort, - stream2, + stream, body, client, request2, @@ -7335,7 +7335,7 @@ var require_client_h2 = __commonJS({ abort, client[kSocket], expectsPayload, - stream2, + stream, body, client, request2, @@ -7344,7 +7344,7 @@ var require_client_h2 = __commonJS({ } else if (util.isIterable(body)) { writeIterable( abort, - stream2, + stream, body, client, request2, @@ -7548,9 +7548,9 @@ var require_redirect_handler = __commonJS({ return this.handler.onHeaders(statusCode, headers, resume, statusText); } const { origin, pathname, search } = util.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin))); - const path17 = search ? `${pathname}${search}` : pathname; + const path14 = search ? `${pathname}${search}` : pathname; this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin); - this.opts.path = path17; + this.opts.path = path14; this.opts.origin = origin; this.opts.maxRedirections = 0; this.opts.query = null; @@ -8784,10 +8784,10 @@ var require_proxy_agent = __commonJS({ }; const { origin, - path: path17 = "/", + path: path14 = "/", headers = {} } = opts; - opts.path = origin + path17; + opts.path = origin + path14; if (!("host" in headers) && !("Host" in headers)) { const { host } = new URL2(origin); headers.host = host; @@ -9421,7 +9421,7 @@ var require_readable = __commonJS({ "node_modules/@actions/http-client/node_modules/undici/lib/api/readable.js"(exports2, module2) { "use strict"; var assert = require("node:assert"); - var { Readable: Readable2 } = require("node:stream"); + var { Readable } = require("node:stream"); var { RequestAbortedError, NotSupportedError, InvalidArgumentError, AbortError } = require_errors(); var util = require_util(); var { ReadableStreamFrom } = require_util(); @@ -9433,7 +9433,7 @@ var require_readable = __commonJS({ var kContentLength = /* @__PURE__ */ Symbol("kContentLength"); var noop3 = () => { }; - var BodyReadable = class extends Readable2 { + var BodyReadable = class extends Readable { constructor({ resume, abort, @@ -9578,13 +9578,13 @@ var require_readable = __commonJS({ function isUnusable(self2) { return util.isDisturbed(self2) || isLocked(self2); } - async function consume(stream2, type2) { - assert(!stream2[kConsume]); + async function consume(stream, type2) { + assert(!stream[kConsume]); return new Promise((resolve8, reject) => { - if (isUnusable(stream2)) { - const rState = stream2._readableState; + if (isUnusable(stream)) { + const rState = stream._readableState; if (rState.destroyed && rState.closeEmitted === false) { - stream2.on("error", (err) => { + stream.on("error", (err) => { reject(err); }).on("close", () => { reject(new TypeError("unusable")); @@ -9594,22 +9594,22 @@ var require_readable = __commonJS({ } } else { queueMicrotask(() => { - stream2[kConsume] = { + stream[kConsume] = { type: type2, - stream: stream2, + stream, resolve: resolve8, reject, length: 0, body: [] }; - stream2.on("error", function(err) { + stream.on("error", function(err) { consumeFinish(this[kConsume], err); }).on("close", function() { if (this[kConsume].body !== null) { consumeFinish(this[kConsume], new RequestAbortedError()); } }); - consumeStart(stream2[kConsume]); + consumeStart(stream[kConsume]); }); } }); @@ -9667,7 +9667,7 @@ var require_readable = __commonJS({ return buffer; } function consumeEnd(consume2) { - const { type: type2, body, resolve: resolve8, stream: stream2, length } = consume2; + const { type: type2, body, resolve: resolve8, stream, length } = consume2; try { if (type2 === "text") { resolve8(chunksDecode(body, length)); @@ -9676,13 +9676,13 @@ var require_readable = __commonJS({ } else if (type2 === "arrayBuffer") { resolve8(chunksConcat(body, length).buffer); } else if (type2 === "blob") { - resolve8(new Blob(body, { type: stream2[kContentType] })); + resolve8(new Blob(body, { type: stream[kContentType] })); } else if (type2 === "bytes") { resolve8(chunksConcat(body, length)); } consumeFinish(consume2); } catch (err) { - stream2.destroy(err); + stream.destroy(err); } } function consumePush(consume2, chunk) { @@ -9775,7 +9775,7 @@ var require_api_request = __commonJS({ "node_modules/@actions/http-client/node_modules/undici/lib/api/api-request.js"(exports2, module2) { "use strict"; var assert = require("node:assert"); - var { Readable: Readable2 } = require_readable(); + var { Readable } = require_readable(); var { InvalidArgumentError, RequestAbortedError } = require_errors(); var util = require_util(); var { getResolveErrorBodyCallback } = require_util3(); @@ -9870,7 +9870,7 @@ var require_api_request = __commonJS({ const parsedHeaders = responseHeaders === "raw" ? util.parseHeaders(rawHeaders) : headers; const contentType = parsedHeaders["content-type"]; const contentLength = parsedHeaders["content-length"]; - const res = new Readable2({ + const res = new Readable({ resume, abort, contentType, @@ -10158,10 +10158,10 @@ var require_api_stream = __commonJS({ } } }; - function stream2(opts, factory, callback) { + function stream(opts, factory, callback) { if (callback === void 0) { return new Promise((resolve8, reject) => { - stream2.call(this, opts, factory, (err, data) => { + stream.call(this, opts, factory, (err, data) => { return err ? reject(err) : resolve8(data); }); }); @@ -10176,7 +10176,7 @@ var require_api_stream = __commonJS({ queueMicrotask(() => callback(err, { opaque })); } } - module2.exports = stream2; + module2.exports = stream; } }); @@ -10185,7 +10185,7 @@ var require_api_pipeline = __commonJS({ "node_modules/@actions/http-client/node_modules/undici/lib/api/api-pipeline.js"(exports2, module2) { "use strict"; var { - Readable: Readable2, + Readable, Duplex, PassThrough } = require("node:stream"); @@ -10199,7 +10199,7 @@ var require_api_pipeline = __commonJS({ var { addSignal, removeSignal } = require_abort_signal(); var assert = require("node:assert"); var kResume = /* @__PURE__ */ Symbol("resume"); - var PipelineRequest = class extends Readable2 { + var PipelineRequest = class extends Readable { constructor() { super({ autoDestroy: true }); this[kResume] = null; @@ -10216,7 +10216,7 @@ var require_api_pipeline = __commonJS({ callback(err); } }; - var PipelineResponse = class extends Readable2 { + var PipelineResponse = class extends Readable { constructor(resume) { super({ autoDestroy: true }); this[kResume] = resume; @@ -10708,20 +10708,20 @@ var require_mock_utils = __commonJS({ } return true; } - function safeUrl(path17) { - if (typeof path17 !== "string") { - return path17; + function safeUrl(path14) { + if (typeof path14 !== "string") { + return path14; } - const pathSegments = path17.split("?"); + const pathSegments = path14.split("?"); if (pathSegments.length !== 2) { - return path17; + return path14; } const qp = new URLSearchParams(pathSegments.pop()); qp.sort(); return [...pathSegments, qp.toString()].join("?"); } - function matchKey(mockDispatch2, { path: path17, method, body, headers }) { - const pathMatch = matchValue(mockDispatch2.path, path17); + function matchKey(mockDispatch2, { path: path14, method, body, headers }) { + const pathMatch = matchValue(mockDispatch2.path, path14); const methodMatch = matchValue(mockDispatch2.method, method); const bodyMatch = typeof mockDispatch2.body !== "undefined" ? matchValue(mockDispatch2.body, body) : true; const headersMatch = matchHeaders(mockDispatch2, headers); @@ -10743,7 +10743,7 @@ var require_mock_utils = __commonJS({ function getMockDispatch(mockDispatches, key) { const basePath = key.query ? buildURL(key.path, key.query) : key.path; const resolvedPath = typeof basePath === "string" ? safeUrl(basePath) : basePath; - let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path: path17 }) => matchValue(safeUrl(path17), resolvedPath)); + let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path: path14 }) => matchValue(safeUrl(path14), resolvedPath)); if (matchedMockDispatches.length === 0) { throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`); } @@ -10781,9 +10781,9 @@ var require_mock_utils = __commonJS({ } } function buildKey(opts) { - const { path: path17, method, body, headers, query } = opts; + const { path: path14, method, body, headers, query } = opts; return { - path: path17, + path: path14, method, body, headers, @@ -11246,10 +11246,10 @@ var require_pending_interceptors_formatter = __commonJS({ } format(pendingInterceptors) { const withPrettyHeaders = pendingInterceptors.map( - ({ method, path: path17, data: { statusCode }, persist, times, timesInvoked, origin }) => ({ + ({ method, path: path14, data: { statusCode }, persist, times, timesInvoked, origin }) => ({ Method: method, Origin: origin, - Path: path17, + Path: path14, "Status code": statusCode, Persistent: persist ? PERSISTENT : NOT_PERSISTENT, Invocations: timesInvoked, @@ -13541,7 +13541,7 @@ var require_fetch = __commonJS({ subresourceSet } = require_constants3(); var EE = require("node:events"); - var { Readable: Readable2, pipeline, finished } = require("node:stream"); + var { Readable, pipeline, finished } = require("node:stream"); var { addAbortListener, isErrored, isReadable, bufferToLowerCasedHeaderName } = require_util(); var { dataURLProcessor, serializeAMimeType, minimizeSupportedMimeType } = require_data_url(); var { getGlobalDispatcher } = require_global2(); @@ -14326,7 +14326,7 @@ var require_fetch = __commonJS({ fetchParams.controller.abort(reason); } }; - const stream2 = new ReadableStream( + const stream = new ReadableStream( { async start(controller) { fetchParams.controller.controller = controller; @@ -14340,7 +14340,7 @@ var require_fetch = __commonJS({ type: "bytes" } ); - response.body = { stream: stream2, source: null, length: null }; + response.body = { stream, source: null, length: null }; fetchParams.controller.onAborted = onAborted; fetchParams.controller.on("terminated", onAborted); fetchParams.controller.resume = async () => { @@ -14375,7 +14375,7 @@ var require_fetch = __commonJS({ if (buffer.byteLength) { fetchParams.controller.controller.enqueue(buffer); } - if (isErrored(stream2)) { + if (isErrored(stream)) { fetchParams.controller.terminate(); return; } @@ -14387,13 +14387,13 @@ var require_fetch = __commonJS({ function onAborted(reason) { if (isAborted(fetchParams)) { response.aborted = true; - if (isReadable(stream2)) { + if (isReadable(stream)) { fetchParams.controller.controller.error( fetchParams.controller.serializedAbortReason ); } } else { - if (isReadable(stream2)) { + if (isReadable(stream)) { fetchParams.controller.controller.error(new TypeError("terminated", { cause: isErrorLike(reason) ? reason : void 0 })); @@ -14442,7 +14442,7 @@ var require_fetch = __commonJS({ headersList.append(bufferToLowerCasedHeaderName(rawHeaders[i]), rawHeaders[i + 1].toString("latin1"), true); } location = headersList.get("location", true); - this.body = new Readable2({ read: resume }); + this.body = new Readable({ read: resume }); const decoders = []; const willFollow = location && request2.redirect === "follow" && redirectStatusSet.has(status); if (request2.method !== "HEAD" && request2.method !== "CONNECT" && !nullBodyStatus.includes(status) && !willFollow) { @@ -14946,8 +14946,8 @@ var require_util4 = __commonJS({ fr[kState] = "loading"; fr[kResult] = null; fr[kError] = null; - const stream2 = blob.stream(); - const reader = stream2.getReader(); + const stream = blob.stream(); + const reader = stream.getReader(); const bytes = []; let chunkPromise = reader.read(); let isFirstChunk = true; @@ -15606,8 +15606,8 @@ var require_cache = __commonJS({ const clonedResponse = cloneResponse(innerResponse); const bodyReadPromise = createDeferredPromise(); if (innerResponse.body != null) { - const stream2 = innerResponse.body.stream; - const reader = stream2.getReader(); + const stream = innerResponse.body.stream; + const reader = stream.getReader(); readAllBytes(reader).then(bodyReadPromise.resolve, bodyReadPromise.reject); } else { bodyReadPromise.resolve(void 0); @@ -16130,9 +16130,9 @@ var require_util6 = __commonJS({ } } } - function validateCookiePath(path17) { - for (let i = 0; i < path17.length; ++i) { - const code = path17.charCodeAt(i); + function validateCookiePath(path14) { + for (let i = 0; i < path14.length; ++i) { + const code = path14.charCodeAt(i); if (code < 32 || // exclude CTLs (0-31) code === 127 || // DEL code === 59) { @@ -17031,7 +17031,7 @@ var require_frame = __commonJS({ } catch { crypto2 = { // not full compatibility, but minimum. - randomFillSync: function randomFillSync2(buffer2, _offset, _size) { + randomFillSync: function randomFillSync(buffer2, _offset, _size) { for (let i = 0; i < buffer2.length; ++i) { buffer2[i] = Math.random() * 255 | 0; } @@ -18726,11 +18726,11 @@ var require_undici = __commonJS({ if (typeof opts.path !== "string") { throw new InvalidArgumentError("invalid opts.path"); } - let path17 = opts.path; + let path14 = opts.path; if (!opts.path.startsWith("/")) { - path17 = `/${path17}`; + path14 = `/${path14}`; } - url2 = new URL(util.parseOrigin(url2).origin + path17); + url2 = new URL(util.parseOrigin(url2).origin + path14); } else { if (!opts) { opts = typeof url2 === "object" ? url2 : {}; @@ -19054,9 +19054,9 @@ var require_lib = __commonJS({ return this.request("HEAD", requestUrl, null, additionalHeaders || {}); }); } - sendStream(verb, requestUrl, stream2, additionalHeaders) { + sendStream(verb, requestUrl, stream, additionalHeaders) { return __awaiter2(this, void 0, void 0, function* () { - return this.request(verb, requestUrl, stream2, additionalHeaders); + return this.request(verb, requestUrl, stream, additionalHeaders); }); } /** @@ -20033,7 +20033,7 @@ var require_path_utils = __commonJS({ exports2.toPosixPath = toPosixPath; exports2.toWin32Path = toWin32Path; exports2.toPlatformPath = toPlatformPath; - var path17 = __importStar2(require("path")); + var path14 = __importStar2(require("path")); function toPosixPath(pth) { return pth.replace(/[\\]/g, "/"); } @@ -20041,7 +20041,7 @@ var require_path_utils = __commonJS({ return pth.replace(/[/]/g, "\\"); } function toPlatformPath(pth) { - return pth.replace(/[/\\]/g, path17.sep); + return pth.replace(/[/\\]/g, path14.sep); } } }); @@ -20123,13 +20123,13 @@ var require_io_util = __commonJS({ exports2.isRooted = isRooted; exports2.tryGetExecutablePath = tryGetExecutablePath; exports2.getCmdPath = getCmdPath; - var fs18 = __importStar2(require("fs")); - var path17 = __importStar2(require("path")); - _a = fs18.promises, exports2.chmod = _a.chmod, exports2.copyFile = _a.copyFile, exports2.lstat = _a.lstat, exports2.mkdir = _a.mkdir, exports2.open = _a.open, exports2.readdir = _a.readdir, exports2.rename = _a.rename, exports2.rm = _a.rm, exports2.rmdir = _a.rmdir, exports2.stat = _a.stat, exports2.symlink = _a.symlink, exports2.unlink = _a.unlink; + var fs15 = __importStar2(require("fs")); + var path14 = __importStar2(require("path")); + _a = fs15.promises, exports2.chmod = _a.chmod, exports2.copyFile = _a.copyFile, exports2.lstat = _a.lstat, exports2.mkdir = _a.mkdir, exports2.open = _a.open, exports2.readdir = _a.readdir, exports2.rename = _a.rename, exports2.rm = _a.rm, exports2.rmdir = _a.rmdir, exports2.stat = _a.stat, exports2.symlink = _a.symlink, exports2.unlink = _a.unlink; exports2.IS_WINDOWS = process.platform === "win32"; function readlink(fsPath) { return __awaiter2(this, void 0, void 0, function* () { - const result = yield fs18.promises.readlink(fsPath); + const result = yield fs15.promises.readlink(fsPath); if (exports2.IS_WINDOWS && !result.endsWith("\\")) { return `${result}\\`; } @@ -20137,7 +20137,7 @@ var require_io_util = __commonJS({ }); } exports2.UV_FS_O_EXLOCK = 268435456; - exports2.READONLY = fs18.constants.O_RDONLY; + exports2.READONLY = fs15.constants.O_RDONLY; function exists(fsPath) { return __awaiter2(this, void 0, void 0, function* () { try { @@ -20179,7 +20179,7 @@ var require_io_util = __commonJS({ } if (stats && stats.isFile()) { if (exports2.IS_WINDOWS) { - const upperExt = path17.extname(filePath).toUpperCase(); + const upperExt = path14.extname(filePath).toUpperCase(); if (extensions.some((validExt) => validExt.toUpperCase() === upperExt)) { return filePath; } @@ -20203,11 +20203,11 @@ var require_io_util = __commonJS({ if (stats && stats.isFile()) { if (exports2.IS_WINDOWS) { try { - const directory = path17.dirname(filePath); - const upperName = path17.basename(filePath).toUpperCase(); + const directory = path14.dirname(filePath); + const upperName = path14.basename(filePath).toUpperCase(); for (const actualName of yield (0, exports2.readdir)(directory)) { if (upperName === actualName.toUpperCase()) { - filePath = path17.join(directory, actualName); + filePath = path14.join(directory, actualName); break; } } @@ -20319,7 +20319,7 @@ var require_io = __commonJS({ exports2.which = which7; exports2.findInPath = findInPath; var assert_1 = require("assert"); - var path17 = __importStar2(require("path")); + var path14 = __importStar2(require("path")); var ioUtil = __importStar2(require_io_util()); function cp(source_1, dest_1) { return __awaiter2(this, arguments, void 0, function* (source, dest, options = {}) { @@ -20328,7 +20328,7 @@ var require_io = __commonJS({ if (destStat && destStat.isFile() && !force) { return; } - const newDest = destStat && destStat.isDirectory() && copySourceDirectory ? path17.join(dest, path17.basename(source)) : dest; + const newDest = destStat && destStat.isDirectory() && copySourceDirectory ? path14.join(dest, path14.basename(source)) : dest; if (!(yield ioUtil.exists(source))) { throw new Error(`no such file or directory: ${source}`); } @@ -20340,7 +20340,7 @@ var require_io = __commonJS({ yield cpDirRecursive(source, newDest, 0, force); } } else { - if (path17.relative(source, newDest) === "") { + if (path14.relative(source, newDest) === "") { throw new Error(`'${newDest}' and '${source}' are the same file`); } yield copyFile2(source, newDest, force); @@ -20352,7 +20352,7 @@ var require_io = __commonJS({ if (yield ioUtil.exists(dest)) { let destExists = true; if (yield ioUtil.isDirectory(dest)) { - dest = path17.join(dest, path17.basename(source)); + dest = path14.join(dest, path14.basename(source)); destExists = yield ioUtil.exists(dest); } if (destExists) { @@ -20363,7 +20363,7 @@ var require_io = __commonJS({ } } } - yield mkdirP(path17.dirname(dest)); + yield mkdirP(path14.dirname(dest)); yield ioUtil.rename(source, dest); }); } @@ -20422,7 +20422,7 @@ var require_io = __commonJS({ } const extensions = []; if (ioUtil.IS_WINDOWS && process.env["PATHEXT"]) { - for (const extension of process.env["PATHEXT"].split(path17.delimiter)) { + for (const extension of process.env["PATHEXT"].split(path14.delimiter)) { if (extension) { extensions.push(extension); } @@ -20435,12 +20435,12 @@ var require_io = __commonJS({ } return []; } - if (tool.includes(path17.sep)) { + if (tool.includes(path14.sep)) { return []; } const directories = []; if (process.env.PATH) { - for (const p of process.env.PATH.split(path17.delimiter)) { + for (const p of process.env.PATH.split(path14.delimiter)) { if (p) { directories.push(p); } @@ -20448,7 +20448,7 @@ var require_io = __commonJS({ } const matches = []; for (const directory of directories) { - const filePath = yield ioUtil.tryGetExecutablePath(path17.join(directory, tool), extensions); + const filePath = yield ioUtil.tryGetExecutablePath(path14.join(directory, tool), extensions); if (filePath) { matches.push(filePath); } @@ -20575,10 +20575,10 @@ var require_toolrunner = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.ToolRunner = void 0; exports2.argStringToArray = argStringToArray; - var os4 = __importStar2(require("os")); + var os3 = __importStar2(require("os")); var events = __importStar2(require("events")); var child = __importStar2(require("child_process")); - var path17 = __importStar2(require("path")); + var path14 = __importStar2(require("path")); var io7 = __importStar2(require_io()); var ioUtil = __importStar2(require_io_util()); var timers_1 = require("timers"); @@ -20630,12 +20630,12 @@ var require_toolrunner = __commonJS({ _processLineBuffer(data, strBuffer, onLine) { try { let s = strBuffer + data.toString(); - let n = s.indexOf(os4.EOL); + let n = s.indexOf(os3.EOL); while (n > -1) { const line = s.substring(0, n); onLine(line); - s = s.substring(n + os4.EOL.length); - n = s.indexOf(os4.EOL); + s = s.substring(n + os3.EOL.length); + n = s.indexOf(os3.EOL); } return s; } catch (err) { @@ -20793,7 +20793,7 @@ var require_toolrunner = __commonJS({ exec() { return __awaiter2(this, void 0, void 0, function* () { if (!ioUtil.isRooted(this.toolPath) && (this.toolPath.includes("/") || IS_WINDOWS && this.toolPath.includes("\\"))) { - this.toolPath = path17.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath); + this.toolPath = path14.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath); } this.toolPath = yield io7.which(this.toolPath, true); return new Promise((resolve8, reject) => __awaiter2(this, void 0, void 0, function* () { @@ -20804,7 +20804,7 @@ var require_toolrunner = __commonJS({ } const optionsNonNull = this._cloneExecOptions(this.options); if (!optionsNonNull.silent && optionsNonNull.outStream) { - optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os4.EOL); + optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os3.EOL); } const state = new ExecState(optionsNonNull, this.toolPath); state.on("debug", (message) => { @@ -21345,8 +21345,8 @@ var require_core = __commonJS({ var command_1 = require_command(); var file_command_1 = require_file_command(); var utils_1 = require_utils(); - var os4 = __importStar2(require("os")); - var path17 = __importStar2(require("path")); + var os3 = __importStar2(require("os")); + var path14 = __importStar2(require("path")); var oidc_utils_1 = require_oidc_utils(); var ExitCode; (function(ExitCode2) { @@ -21372,7 +21372,7 @@ var require_core = __commonJS({ } else { (0, command_1.issueCommand)("add-path", {}, inputPath); } - process.env["PATH"] = `${inputPath}${path17.delimiter}${process.env["PATH"]}`; + process.env["PATH"] = `${inputPath}${path14.delimiter}${process.env["PATH"]}`; } function getInput2(name, options) { const val = process.env[`INPUT_${name.replace(/ /g, "_").toUpperCase()}`] || ""; @@ -21407,7 +21407,7 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``); if (filePath) { return (0, file_command_1.issueFileCommand)("OUTPUT", (0, file_command_1.prepareKeyValueMessage)(name, value)); } - process.stdout.write(os4.EOL); + process.stdout.write(os3.EOL); (0, command_1.issueCommand)("set-output", { name }, (0, utils_1.toCommandValue)(value)); } function setCommandEcho(enabled) { @@ -21433,7 +21433,7 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``); (0, command_1.issueCommand)("notice", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); } function info7(message) { - process.stdout.write(message + os4.EOL); + process.stdout.write(message + os3.EOL); } function startGroup4(name) { (0, command_1.issue)("group", name); @@ -21509,8 +21509,8 @@ var require_context = __commonJS({ if ((0, fs_1.existsSync)(process.env.GITHUB_EVENT_PATH)) { this.payload = JSON.parse((0, fs_1.readFileSync)(process.env.GITHUB_EVENT_PATH, { encoding: "utf8" })); } else { - const path17 = process.env.GITHUB_EVENT_PATH; - process.stdout.write(`GITHUB_EVENT_PATH ${path17} does not exist${os_1.EOL}`); + const path14 = process.env.GITHUB_EVENT_PATH; + process.stdout.write(`GITHUB_EVENT_PATH ${path14} does not exist${os_1.EOL}`); } } this.eventName = process.env.GITHUB_EVENT_NAME; @@ -22226,7 +22226,7 @@ var require_util9 = __commonJS({ var assert = require("node:assert"); var { kDestroyed, kBodyUsed, kListeners, kBody } = require_symbols6(); var { IncomingMessage } = require("node:http"); - var stream2 = require("node:stream"); + var stream = require("node:stream"); var net = require("node:net"); var { Blob: Blob2 } = require("node:buffer"); var nodeUtil = require("node:util"); @@ -22335,14 +22335,14 @@ var require_util9 = __commonJS({ } const port = url2.port != null ? url2.port : url2.protocol === "https:" ? 443 : 80; let origin = url2.origin != null ? url2.origin : `${url2.protocol || ""}//${url2.hostname || ""}:${port}`; - let path17 = url2.path != null ? url2.path : `${url2.pathname || ""}${url2.search || ""}`; + let path14 = url2.path != null ? url2.path : `${url2.pathname || ""}${url2.search || ""}`; if (origin[origin.length - 1] === "/") { origin = origin.slice(0, origin.length - 1); } - if (path17 && path17[0] !== "/") { - path17 = `/${path17}`; + if (path14 && path14[0] !== "/") { + path14 = `/${path14}`; } - return new URL(`${origin}${path17}`); + return new URL(`${origin}${path14}`); } if (!isHttpOrHttpsPrefixed(url2.origin || url2.protocol)) { throw new InvalidArgumentError("Invalid URL protocol: the URL must start with `http:` or `https:`."); @@ -22400,24 +22400,24 @@ var require_util9 = __commonJS({ return null; } function isDestroyed(body) { - return body && !!(body.destroyed || body[kDestroyed] || stream2.isDestroyed?.(body)); + return body && !!(body.destroyed || body[kDestroyed] || stream.isDestroyed?.(body)); } - function destroy(stream3, err) { - if (stream3 == null || !isStream(stream3) || isDestroyed(stream3)) { + function destroy(stream2, err) { + if (stream2 == null || !isStream(stream2) || isDestroyed(stream2)) { return; } - if (typeof stream3.destroy === "function") { - if (Object.getPrototypeOf(stream3).constructor === IncomingMessage) { - stream3.socket = null; + if (typeof stream2.destroy === "function") { + if (Object.getPrototypeOf(stream2).constructor === IncomingMessage) { + stream2.socket = null; } - stream3.destroy(err); + stream2.destroy(err); } else if (err) { queueMicrotask(() => { - stream3.emit("error", err); + stream2.emit("error", err); }); } - if (stream3.destroyed !== true) { - stream3[kDestroyed] = true; + if (stream2.destroyed !== true) { + stream2[kDestroyed] = true; } } var KEEPALIVE_TIMEOUT_EXPR = /timeout=(\d+)/; @@ -22516,13 +22516,13 @@ var require_util9 = __commonJS({ } } function isDisturbed(body) { - return !!(body && (stream2.isDisturbed(body) || body[kBodyUsed])); + return !!(body && (stream.isDisturbed(body) || body[kBodyUsed])); } function isErrored(body) { - return !!(body && stream2.isErrored(body)); + return !!(body && stream.isErrored(body)); } function isReadable(body) { - return !!(body && stream2.isReadable(body)); + return !!(body && stream.isReadable(body)); } function getSocketInfo(socket) { return { @@ -22793,39 +22793,39 @@ var require_diagnostics2 = __commonJS({ }); diagnosticsChannel.channel("undici:client:sendHeaders").subscribe((evt) => { const { - request: { method, path: path17, origin } + request: { method, path: path14, origin } } = evt; - debuglog("sending request to %s %s/%s", method, origin, path17); + debuglog("sending request to %s %s/%s", method, origin, path14); }); diagnosticsChannel.channel("undici:request:headers").subscribe((evt) => { const { - request: { method, path: path17, origin }, + request: { method, path: path14, origin }, response: { statusCode } } = evt; debuglog( "received response to %s %s/%s - HTTP %d", method, origin, - path17, + path14, statusCode ); }); diagnosticsChannel.channel("undici:request:trailers").subscribe((evt) => { const { - request: { method, path: path17, origin } + request: { method, path: path14, origin } } = evt; - debuglog("trailers received from %s %s/%s", method, origin, path17); + debuglog("trailers received from %s %s/%s", method, origin, path14); }); diagnosticsChannel.channel("undici:request:error").subscribe((evt) => { const { - request: { method, path: path17, origin }, + request: { method, path: path14, origin }, error: error3 } = evt; debuglog( "request to %s %s/%s errored - %s", method, origin, - path17, + path14, error3.message ); }); @@ -22874,9 +22874,9 @@ var require_diagnostics2 = __commonJS({ }); diagnosticsChannel.channel("undici:client:sendHeaders").subscribe((evt) => { const { - request: { method, path: path17, origin } + request: { method, path: path14, origin } } = evt; - debuglog("sending request to %s %s/%s", method, origin, path17); + debuglog("sending request to %s %s/%s", method, origin, path14); }); } diagnosticsChannel.channel("undici:websocket:open").subscribe((evt) => { @@ -22939,7 +22939,7 @@ var require_request3 = __commonJS({ var kHandler = /* @__PURE__ */ Symbol("handler"); var Request = class { constructor(origin, { - path: path17, + path: path14, method, body, headers, @@ -22954,11 +22954,11 @@ var require_request3 = __commonJS({ expectContinue, servername }, handler2) { - if (typeof path17 !== "string") { + if (typeof path14 !== "string") { throw new InvalidArgumentError("path must be a string"); - } else if (path17[0] !== "/" && !(path17.startsWith("http://") || path17.startsWith("https://")) && method !== "CONNECT") { + } else if (path14[0] !== "/" && !(path14.startsWith("http://") || path14.startsWith("https://")) && method !== "CONNECT") { throw new InvalidArgumentError("path must be an absolute URL or start with a slash"); - } else if (invalidPathRegex.test(path17)) { + } else if (invalidPathRegex.test(path14)) { throw new InvalidArgumentError("invalid request path"); } if (typeof method !== "string") { @@ -23021,7 +23021,7 @@ var require_request3 = __commonJS({ this.completed = false; this.aborted = false; this.upgrade = upgrade || null; - this.path = query ? buildURL(path17, query) : path17; + this.path = query ? buildURL(path14, query) : path14; this.origin = origin; this.idempotent = idempotent == null ? method === "HEAD" || method === "GET" : idempotent; this.blocking = blocking == null ? false : blocking; @@ -25254,7 +25254,7 @@ var require_util10 = __commonJS({ var { redirectStatusSet, referrerPolicySet: referrerPolicyTokens, badPortsSet } = require_constants8(); var { getGlobalOrigin } = require_global3(); var { collectASequenceOfCodePoints, collectAnHTTPQuotedString, removeChars, parseMIMEType } = require_data_url2(); - var { performance: performance3 } = require("node:perf_hooks"); + var { performance: performance2 } = require("node:perf_hooks"); var { isBlobLike, ReadableStreamFrom, isValidHTTPToken, normalizedMethodRecordsBase } = require_util9(); var assert = require("node:assert"); var { isUint8Array } = require("node:util/types"); @@ -25413,7 +25413,7 @@ var require_util10 = __commonJS({ }; } function coarsenedSharedCurrentTime(crossOriginIsolatedCapability) { - return coarsenTime(performance3.now(), crossOriginIsolatedCapability); + return coarsenTime(performance2.now(), crossOriginIsolatedCapability); } function createOpaqueTimingInfo(timingInfo) { return { @@ -25811,8 +25811,8 @@ var require_util10 = __commonJS({ errorSteps(e); } } - function isReadableStreamLike(stream2) { - return stream2 instanceof ReadableStream || stream2[Symbol.toStringTag] === "ReadableStream" && typeof stream2.tee === "function"; + function isReadableStreamLike(stream) { + return stream instanceof ReadableStream || stream[Symbol.toStringTag] === "ReadableStream" && typeof stream.tee === "function"; } function readableStreamClose(controller) { try { @@ -26628,20 +26628,20 @@ var require_body2 = __commonJS({ var streamRegistry; if (hasFinalizationRegistry) { streamRegistry = new FinalizationRegistry((weakRef) => { - const stream2 = weakRef.deref(); - if (stream2 && !stream2.locked && !isDisturbed(stream2) && !isErrored(stream2)) { - stream2.cancel("Response object has been garbage collected").catch(noop3); + const stream = weakRef.deref(); + if (stream && !stream.locked && !isDisturbed(stream) && !isErrored(stream)) { + stream.cancel("Response object has been garbage collected").catch(noop3); } }); } function extractBody(object, keepalive = false) { - let stream2 = null; + let stream = null; if (object instanceof ReadableStream) { - stream2 = object; + stream = object; } else if (isBlobLike(object)) { - stream2 = object.stream(); + stream = object.stream(); } else { - stream2 = new ReadableStream({ + stream = new ReadableStream({ async pull(controller) { const buffer = typeof source === "string" ? textEncoder.encode(source) : source; if (buffer.byteLength) { @@ -26654,7 +26654,7 @@ var require_body2 = __commonJS({ type: "bytes" }); } - assert(isReadableStreamLike(stream2)); + assert(isReadableStreamLike(stream)); let action = null; let source = null; let length = null; @@ -26733,14 +26733,14 @@ Content-Type: ${value.type || "application/octet-stream"}\r "Response body object should not be disturbed or locked" ); } - stream2 = object instanceof ReadableStream ? object : ReadableStreamFrom(object); + stream = object instanceof ReadableStream ? object : ReadableStreamFrom(object); } if (typeof source === "string" || util.isBuffer(source)) { length = Buffer.byteLength(source); } if (action != null) { let iterator2; - stream2 = new ReadableStream({ + stream = new ReadableStream({ async start() { iterator2 = action(object)[Symbol.asyncIterator](); }, @@ -26752,7 +26752,7 @@ Content-Type: ${value.type || "application/octet-stream"}\r controller.byobRequest?.respond(0); }); } else { - if (!isErrored(stream2)) { + if (!isErrored(stream)) { const buffer = new Uint8Array(value); if (buffer.byteLength) { controller.enqueue(buffer); @@ -26767,7 +26767,7 @@ Content-Type: ${value.type || "application/octet-stream"}\r type: "bytes" }); } - const body = { stream: stream2, source, length }; + const body = { stream, source, length }; return [body, type2]; } function safelyExtractBody(object, keepalive = false) { @@ -27534,7 +27534,7 @@ var require_client_h12 = __commonJS({ return method !== "GET" && method !== "HEAD" && method !== "OPTIONS" && method !== "TRACE" && method !== "CONNECT"; } function writeH1(client, request2) { - const { method, path: path17, host, upgrade, blocking, reset } = request2; + const { method, path: path14, host, upgrade, blocking, reset } = request2; let { body, headers, contentLength } = request2; const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH" || method === "QUERY" || method === "PROPFIND" || method === "PROPPATCH"; if (util.isFormDataLike(body)) { @@ -27600,7 +27600,7 @@ var require_client_h12 = __commonJS({ if (blocking) { socket[kBlocking] = true; } - let header = `${method} ${path17} HTTP/1.1\r + let header = `${method} ${path14} HTTP/1.1\r `; if (typeof host === "string") { header += `host: ${host}\r @@ -28126,7 +28126,7 @@ var require_client_h22 = __commonJS({ } function writeH2(client, request2) { const session = client[kHTTP2Session]; - const { method, path: path17, host, upgrade, expectContinue, signal, headers: reqHeaders } = request2; + const { method, path: path14, host, upgrade, expectContinue, signal, headers: reqHeaders } = request2; let { body } = request2; if (upgrade) { util.errorRequest(client, request2, new Error("Upgrade not supported for H2")); @@ -28148,7 +28148,7 @@ var require_client_h22 = __commonJS({ headers[key] = val; } } - let stream2; + let stream; const { hostname, port } = client[kUrl]; headers[HTTP2_HEADER_AUTHORITY] = host || `${hostname}${port ? `:${port}` : ""}`; headers[HTTP2_HEADER_METHOD] = method; @@ -28158,8 +28158,8 @@ var require_client_h22 = __commonJS({ } err = err || new RequestAbortedError(); util.errorRequest(client, request2, err); - if (stream2 != null) { - util.destroy(stream2, err); + if (stream != null) { + util.destroy(stream, err); } util.destroy(body, err); client[kQueue][client[kRunningIdx]++] = null; @@ -28175,25 +28175,25 @@ var require_client_h22 = __commonJS({ } if (method === "CONNECT") { session.ref(); - stream2 = session.request(headers, { endStream: false, signal }); - if (stream2.id && !stream2.pending) { - request2.onUpgrade(null, null, stream2); + stream = session.request(headers, { endStream: false, signal }); + if (stream.id && !stream.pending) { + request2.onUpgrade(null, null, stream); ++session[kOpenStreams]; client[kQueue][client[kRunningIdx]++] = null; } else { - stream2.once("ready", () => { - request2.onUpgrade(null, null, stream2); + stream.once("ready", () => { + request2.onUpgrade(null, null, stream); ++session[kOpenStreams]; client[kQueue][client[kRunningIdx]++] = null; }); } - stream2.once("close", () => { + stream.once("close", () => { session[kOpenStreams] -= 1; if (session[kOpenStreams] === 0) session.unref(); }); return true; } - headers[HTTP2_HEADER_PATH] = path17; + headers[HTTP2_HEADER_PATH] = path14; headers[HTTP2_HEADER_SCHEME] = "https"; const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH"; if (body && typeof body.read === "function") { @@ -28228,36 +28228,36 @@ var require_client_h22 = __commonJS({ const shouldEndStream = method === "GET" || method === "HEAD" || body === null; if (expectContinue) { headers[HTTP2_HEADER_EXPECT] = "100-continue"; - stream2 = session.request(headers, { endStream: shouldEndStream, signal }); - stream2.once("continue", writeBodyH2); + stream = session.request(headers, { endStream: shouldEndStream, signal }); + stream.once("continue", writeBodyH2); } else { - stream2 = session.request(headers, { + stream = session.request(headers, { endStream: shouldEndStream, signal }); writeBodyH2(); } ++session[kOpenStreams]; - stream2.once("response", (headers2) => { + stream.once("response", (headers2) => { const { [HTTP2_HEADER_STATUS]: statusCode, ...realHeaders } = headers2; request2.onResponseStarted(); if (request2.aborted) { const err = new RequestAbortedError(); util.errorRequest(client, request2, err); - util.destroy(stream2, err); + util.destroy(stream, err); return; } - if (request2.onHeaders(Number(statusCode), parseH2Headers(realHeaders), stream2.resume.bind(stream2), "") === false) { - stream2.pause(); + if (request2.onHeaders(Number(statusCode), parseH2Headers(realHeaders), stream.resume.bind(stream), "") === false) { + stream.pause(); } - stream2.on("data", (chunk) => { + stream.on("data", (chunk) => { if (request2.onData(chunk) === false) { - stream2.pause(); + stream.pause(); } }); }); - stream2.once("end", () => { - if (stream2.state?.state == null || stream2.state.state < 6) { + stream.once("end", () => { + if (stream.state?.state == null || stream.state.state < 6) { request2.onComplete([]); } if (session[kOpenStreams] === 0) { @@ -28268,16 +28268,16 @@ var require_client_h22 = __commonJS({ client[kPendingIdx] = client[kRunningIdx]; client[kResume](); }); - stream2.once("close", () => { + stream.once("close", () => { session[kOpenStreams] -= 1; if (session[kOpenStreams] === 0) { session.unref(); } }); - stream2.once("error", function(err) { + stream.once("error", function(err) { abort(err); }); - stream2.once("frameError", (type2, code) => { + stream.once("frameError", (type2, code) => { abort(new InformationalError(`HTTP/2: "frameError" received - type ${type2}, code ${code}`)); }); return true; @@ -28285,7 +28285,7 @@ var require_client_h22 = __commonJS({ if (!body || contentLength === 0) { writeBuffer( abort, - stream2, + stream, null, client, request2, @@ -28296,7 +28296,7 @@ var require_client_h22 = __commonJS({ } else if (util.isBuffer(body)) { writeBuffer( abort, - stream2, + stream, body, client, request2, @@ -28308,7 +28308,7 @@ var require_client_h22 = __commonJS({ if (typeof body.stream === "function") { writeIterable( abort, - stream2, + stream, body.stream(), client, request2, @@ -28319,7 +28319,7 @@ var require_client_h22 = __commonJS({ } else { writeBlob( abort, - stream2, + stream, body, client, request2, @@ -28333,7 +28333,7 @@ var require_client_h22 = __commonJS({ abort, client[kSocket], expectsPayload, - stream2, + stream, body, client, request2, @@ -28342,7 +28342,7 @@ var require_client_h22 = __commonJS({ } else if (util.isIterable(body)) { writeIterable( abort, - stream2, + stream, body, client, request2, @@ -28546,9 +28546,9 @@ var require_redirect_handler2 = __commonJS({ return this.handler.onHeaders(statusCode, headers, resume, statusText); } const { origin, pathname, search } = util.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin))); - const path17 = search ? `${pathname}${search}` : pathname; + const path14 = search ? `${pathname}${search}` : pathname; this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin); - this.opts.path = path17; + this.opts.path = path14; this.opts.origin = origin; this.opts.maxRedirections = 0; this.opts.query = null; @@ -29782,10 +29782,10 @@ var require_proxy_agent2 = __commonJS({ }; const { origin, - path: path17 = "/", + path: path14 = "/", headers = {} } = opts; - opts.path = origin + path17; + opts.path = origin + path14; if (!("host" in headers) && !("Host" in headers)) { const { host } = new URL2(origin); headers.host = host; @@ -30419,7 +30419,7 @@ var require_readable2 = __commonJS({ "node_modules/@actions/github/node_modules/undici/lib/api/readable.js"(exports2, module2) { "use strict"; var assert = require("node:assert"); - var { Readable: Readable2 } = require("node:stream"); + var { Readable } = require("node:stream"); var { RequestAbortedError, NotSupportedError, InvalidArgumentError, AbortError } = require_errors2(); var util = require_util9(); var { ReadableStreamFrom } = require_util9(); @@ -30431,7 +30431,7 @@ var require_readable2 = __commonJS({ var kContentLength = /* @__PURE__ */ Symbol("kContentLength"); var noop3 = () => { }; - var BodyReadable = class extends Readable2 { + var BodyReadable = class extends Readable { constructor({ resume, abort, @@ -30576,13 +30576,13 @@ var require_readable2 = __commonJS({ function isUnusable(self2) { return util.isDisturbed(self2) || isLocked(self2); } - async function consume(stream2, type2) { - assert(!stream2[kConsume]); + async function consume(stream, type2) { + assert(!stream[kConsume]); return new Promise((resolve8, reject) => { - if (isUnusable(stream2)) { - const rState = stream2._readableState; + if (isUnusable(stream)) { + const rState = stream._readableState; if (rState.destroyed && rState.closeEmitted === false) { - stream2.on("error", (err) => { + stream.on("error", (err) => { reject(err); }).on("close", () => { reject(new TypeError("unusable")); @@ -30592,22 +30592,22 @@ var require_readable2 = __commonJS({ } } else { queueMicrotask(() => { - stream2[kConsume] = { + stream[kConsume] = { type: type2, - stream: stream2, + stream, resolve: resolve8, reject, length: 0, body: [] }; - stream2.on("error", function(err) { + stream.on("error", function(err) { consumeFinish(this[kConsume], err); }).on("close", function() { if (this[kConsume].body !== null) { consumeFinish(this[kConsume], new RequestAbortedError()); } }); - consumeStart(stream2[kConsume]); + consumeStart(stream[kConsume]); }); } }); @@ -30665,7 +30665,7 @@ var require_readable2 = __commonJS({ return buffer; } function consumeEnd(consume2) { - const { type: type2, body, resolve: resolve8, stream: stream2, length } = consume2; + const { type: type2, body, resolve: resolve8, stream, length } = consume2; try { if (type2 === "text") { resolve8(chunksDecode(body, length)); @@ -30674,13 +30674,13 @@ var require_readable2 = __commonJS({ } else if (type2 === "arrayBuffer") { resolve8(chunksConcat(body, length).buffer); } else if (type2 === "blob") { - resolve8(new Blob(body, { type: stream2[kContentType] })); + resolve8(new Blob(body, { type: stream[kContentType] })); } else if (type2 === "bytes") { resolve8(chunksConcat(body, length)); } consumeFinish(consume2); } catch (err) { - stream2.destroy(err); + stream.destroy(err); } } function consumePush(consume2, chunk) { @@ -30773,7 +30773,7 @@ var require_api_request2 = __commonJS({ "node_modules/@actions/github/node_modules/undici/lib/api/api-request.js"(exports2, module2) { "use strict"; var assert = require("node:assert"); - var { Readable: Readable2 } = require_readable2(); + var { Readable } = require_readable2(); var { InvalidArgumentError, RequestAbortedError } = require_errors2(); var util = require_util9(); var { getResolveErrorBodyCallback } = require_util11(); @@ -30868,7 +30868,7 @@ var require_api_request2 = __commonJS({ const parsedHeaders = responseHeaders === "raw" ? util.parseHeaders(rawHeaders) : headers; const contentType = parsedHeaders["content-type"]; const contentLength = parsedHeaders["content-length"]; - const res = new Readable2({ + const res = new Readable({ resume, abort, contentType, @@ -31156,10 +31156,10 @@ var require_api_stream2 = __commonJS({ } } }; - function stream2(opts, factory, callback) { + function stream(opts, factory, callback) { if (callback === void 0) { return new Promise((resolve8, reject) => { - stream2.call(this, opts, factory, (err, data) => { + stream.call(this, opts, factory, (err, data) => { return err ? reject(err) : resolve8(data); }); }); @@ -31174,7 +31174,7 @@ var require_api_stream2 = __commonJS({ queueMicrotask(() => callback(err, { opaque })); } } - module2.exports = stream2; + module2.exports = stream; } }); @@ -31183,7 +31183,7 @@ var require_api_pipeline2 = __commonJS({ "node_modules/@actions/github/node_modules/undici/lib/api/api-pipeline.js"(exports2, module2) { "use strict"; var { - Readable: Readable2, + Readable, Duplex, PassThrough } = require("node:stream"); @@ -31197,7 +31197,7 @@ var require_api_pipeline2 = __commonJS({ var { addSignal, removeSignal } = require_abort_signal2(); var assert = require("node:assert"); var kResume = /* @__PURE__ */ Symbol("resume"); - var PipelineRequest = class extends Readable2 { + var PipelineRequest = class extends Readable { constructor() { super({ autoDestroy: true }); this[kResume] = null; @@ -31214,7 +31214,7 @@ var require_api_pipeline2 = __commonJS({ callback(err); } }; - var PipelineResponse = class extends Readable2 { + var PipelineResponse = class extends Readable { constructor(resume) { super({ autoDestroy: true }); this[kResume] = resume; @@ -31706,20 +31706,20 @@ var require_mock_utils2 = __commonJS({ } return true; } - function safeUrl(path17) { - if (typeof path17 !== "string") { - return path17; + function safeUrl(path14) { + if (typeof path14 !== "string") { + return path14; } - const pathSegments = path17.split("?"); + const pathSegments = path14.split("?"); if (pathSegments.length !== 2) { - return path17; + return path14; } const qp = new URLSearchParams(pathSegments.pop()); qp.sort(); return [...pathSegments, qp.toString()].join("?"); } - function matchKey(mockDispatch2, { path: path17, method, body, headers }) { - const pathMatch = matchValue(mockDispatch2.path, path17); + function matchKey(mockDispatch2, { path: path14, method, body, headers }) { + const pathMatch = matchValue(mockDispatch2.path, path14); const methodMatch = matchValue(mockDispatch2.method, method); const bodyMatch = typeof mockDispatch2.body !== "undefined" ? matchValue(mockDispatch2.body, body) : true; const headersMatch = matchHeaders(mockDispatch2, headers); @@ -31741,7 +31741,7 @@ var require_mock_utils2 = __commonJS({ function getMockDispatch(mockDispatches, key) { const basePath = key.query ? buildURL(key.path, key.query) : key.path; const resolvedPath = typeof basePath === "string" ? safeUrl(basePath) : basePath; - let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path: path17 }) => matchValue(safeUrl(path17), resolvedPath)); + let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path: path14 }) => matchValue(safeUrl(path14), resolvedPath)); if (matchedMockDispatches.length === 0) { throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`); } @@ -31779,9 +31779,9 @@ var require_mock_utils2 = __commonJS({ } } function buildKey(opts) { - const { path: path17, method, body, headers, query } = opts; + const { path: path14, method, body, headers, query } = opts; return { - path: path17, + path: path14, method, body, headers, @@ -32244,10 +32244,10 @@ var require_pending_interceptors_formatter2 = __commonJS({ } format(pendingInterceptors) { const withPrettyHeaders = pendingInterceptors.map( - ({ method, path: path17, data: { statusCode }, persist, times, timesInvoked, origin }) => ({ + ({ method, path: path14, data: { statusCode }, persist, times, timesInvoked, origin }) => ({ Method: method, Origin: origin, - Path: path17, + Path: path14, "Status code": statusCode, Persistent: persist ? PERSISTENT : NOT_PERSISTENT, Invocations: timesInvoked, @@ -34539,7 +34539,7 @@ var require_fetch2 = __commonJS({ subresourceSet } = require_constants8(); var EE = require("node:events"); - var { Readable: Readable2, pipeline, finished } = require("node:stream"); + var { Readable, pipeline, finished } = require("node:stream"); var { addAbortListener, isErrored, isReadable, bufferToLowerCasedHeaderName } = require_util9(); var { dataURLProcessor, serializeAMimeType, minimizeSupportedMimeType } = require_data_url2(); var { getGlobalDispatcher } = require_global4(); @@ -35324,7 +35324,7 @@ var require_fetch2 = __commonJS({ fetchParams.controller.abort(reason); } }; - const stream2 = new ReadableStream( + const stream = new ReadableStream( { async start(controller) { fetchParams.controller.controller = controller; @@ -35338,7 +35338,7 @@ var require_fetch2 = __commonJS({ type: "bytes" } ); - response.body = { stream: stream2, source: null, length: null }; + response.body = { stream, source: null, length: null }; fetchParams.controller.onAborted = onAborted; fetchParams.controller.on("terminated", onAborted); fetchParams.controller.resume = async () => { @@ -35373,7 +35373,7 @@ var require_fetch2 = __commonJS({ if (buffer.byteLength) { fetchParams.controller.controller.enqueue(buffer); } - if (isErrored(stream2)) { + if (isErrored(stream)) { fetchParams.controller.terminate(); return; } @@ -35385,13 +35385,13 @@ var require_fetch2 = __commonJS({ function onAborted(reason) { if (isAborted(fetchParams)) { response.aborted = true; - if (isReadable(stream2)) { + if (isReadable(stream)) { fetchParams.controller.controller.error( fetchParams.controller.serializedAbortReason ); } } else { - if (isReadable(stream2)) { + if (isReadable(stream)) { fetchParams.controller.controller.error(new TypeError("terminated", { cause: isErrorLike(reason) ? reason : void 0 })); @@ -35440,7 +35440,7 @@ var require_fetch2 = __commonJS({ headersList.append(bufferToLowerCasedHeaderName(rawHeaders[i]), rawHeaders[i + 1].toString("latin1"), true); } location = headersList.get("location", true); - this.body = new Readable2({ read: resume }); + this.body = new Readable({ read: resume }); const decoders = []; const willFollow = location && request2.redirect === "follow" && redirectStatusSet.has(status); if (request2.method !== "HEAD" && request2.method !== "CONNECT" && !nullBodyStatus.includes(status) && !willFollow) { @@ -35944,8 +35944,8 @@ var require_util12 = __commonJS({ fr[kState] = "loading"; fr[kResult] = null; fr[kError] = null; - const stream2 = blob.stream(); - const reader = stream2.getReader(); + const stream = blob.stream(); + const reader = stream.getReader(); const bytes = []; let chunkPromise = reader.read(); let isFirstChunk = true; @@ -36604,8 +36604,8 @@ var require_cache2 = __commonJS({ const clonedResponse = cloneResponse(innerResponse); const bodyReadPromise = createDeferredPromise(); if (innerResponse.body != null) { - const stream2 = innerResponse.body.stream; - const reader = stream2.getReader(); + const stream = innerResponse.body.stream; + const reader = stream.getReader(); readAllBytes(reader).then(bodyReadPromise.resolve, bodyReadPromise.reject); } else { bodyReadPromise.resolve(void 0); @@ -37128,9 +37128,9 @@ var require_util14 = __commonJS({ } } } - function validateCookiePath(path17) { - for (let i = 0; i < path17.length; ++i) { - const code = path17.charCodeAt(i); + function validateCookiePath(path14) { + for (let i = 0; i < path14.length; ++i) { + const code = path14.charCodeAt(i); if (code < 32 || // exclude CTLs (0-31) code === 127 || // DEL code === 59) { @@ -38029,7 +38029,7 @@ var require_frame2 = __commonJS({ } catch { crypto2 = { // not full compatibility, but minimum. - randomFillSync: function randomFillSync2(buffer2, _offset, _size) { + randomFillSync: function randomFillSync(buffer2, _offset, _size) { for (let i = 0; i < buffer2.length; ++i) { buffer2[i] = Math.random() * 255 | 0; } @@ -39724,11 +39724,11 @@ var require_undici2 = __commonJS({ if (typeof opts.path !== "string") { throw new InvalidArgumentError("invalid opts.path"); } - let path17 = opts.path; + let path14 = opts.path; if (!opts.path.startsWith("/")) { - path17 = `/${path17}`; + path14 = `/${path14}`; } - url2 = new URL(util.parseOrigin(url2).origin + path17); + url2 = new URL(util.parseOrigin(url2).origin + path14); } else { if (!opts) { opts = typeof url2 === "object" ? url2 : {}; @@ -47414,14 +47414,14 @@ var require_helpers = __commonJS({ "node_modules/jsonschema/lib/helpers.js"(exports2, module2) { "use strict"; var uri = require("url"); - var ValidationError = exports2.ValidationError = function ValidationError2(message, instance, schema2, path17, name, argument) { - if (Array.isArray(path17)) { - this.path = path17; - this.property = path17.reduce(function(sum, item) { + var ValidationError = exports2.ValidationError = function ValidationError2(message, instance, schema2, path14, name, argument) { + if (Array.isArray(path14)) { + this.path = path14; + this.property = path14.reduce(function(sum, item) { return sum + makeSuffix(item); }, "instance"); - } else if (path17 !== void 0) { - this.property = path17; + } else if (path14 !== void 0) { + this.property = path14; } if (message) { this.message = message; @@ -47512,16 +47512,16 @@ var require_helpers = __commonJS({ name: { value: "SchemaError", enumerable: false } } ); - var SchemaContext = exports2.SchemaContext = function SchemaContext2(schema2, options, path17, base, schemas) { + var SchemaContext = exports2.SchemaContext = function SchemaContext2(schema2, options, path14, base, schemas) { this.schema = schema2; this.options = options; - if (Array.isArray(path17)) { - this.path = path17; - this.propertyPath = path17.reduce(function(sum, item) { + if (Array.isArray(path14)) { + this.path = path14; + this.propertyPath = path14.reduce(function(sum, item) { return sum + makeSuffix(item); }, "instance"); } else { - this.propertyPath = path17; + this.propertyPath = path14; } this.base = base; this.schemas = schemas; @@ -47530,10 +47530,10 @@ var require_helpers = __commonJS({ return uri.resolve(this.base, target); }; SchemaContext.prototype.makeChild = function makeChild(schema2, propertyName) { - var path17 = propertyName === void 0 ? this.path : this.path.concat([propertyName]); + var path14 = propertyName === void 0 ? this.path : this.path.concat([propertyName]); var id = schema2.$id || schema2.id; var base = uri.resolve(this.base, id || ""); - var ctx = new SchemaContext(schema2, this.options, path17, base, Object.create(this.schemas)); + var ctx = new SchemaContext(schema2, this.options, path14, base, Object.create(this.schemas)); if (id && !ctx.schemas[base]) { ctx.schemas[base] = schema2; } @@ -48836,7 +48836,7 @@ var require_internal_path_helper = __commonJS({ exports2.hasRoot = hasRoot; exports2.normalizeSeparators = normalizeSeparators; exports2.safeTrimTrailingSeparator = safeTrimTrailingSeparator; - var path17 = __importStar2(require("path")); + var path14 = __importStar2(require("path")); var assert_1 = __importDefault2(require("assert")); var IS_WINDOWS = process.platform === "win32"; function dirname4(p) { @@ -48844,7 +48844,7 @@ var require_internal_path_helper = __commonJS({ if (IS_WINDOWS && /^\\\\[^\\]+(\\[^\\]+)?$/.test(p)) { return p; } - let result = path17.dirname(p); + let result = path14.dirname(p); if (IS_WINDOWS && /^\\\\[^\\]+\\[^\\]+\\$/.test(result)) { result = safeTrimTrailingSeparator(result); } @@ -48881,7 +48881,7 @@ var require_internal_path_helper = __commonJS({ (0, assert_1.default)(hasAbsoluteRoot(root), `ensureAbsoluteRoot parameter 'root' must have an absolute root`); if (root.endsWith("/") || IS_WINDOWS && root.endsWith("\\")) { } else { - root += path17.sep; + root += path14.sep; } return root + itemPath; } @@ -48915,10 +48915,10 @@ var require_internal_path_helper = __commonJS({ return ""; } p = normalizeSeparators(p); - if (!p.endsWith(path17.sep)) { + if (!p.endsWith(path14.sep)) { return p; } - if (p === path17.sep) { + if (p === path14.sep) { return p; } if (IS_WINDOWS && /^[A-Z]:\\$/i.test(p)) { @@ -49263,7 +49263,7 @@ var require_minimatch = __commonJS({ "node_modules/minimatch/minimatch.js"(exports2, module2) { module2.exports = minimatch; minimatch.Minimatch = Minimatch; - var path17 = (function() { + var path14 = (function() { try { return require("path"); } catch (e) { @@ -49271,7 +49271,7 @@ var require_minimatch = __commonJS({ })() || { sep: "/" }; - minimatch.sep = path17.sep; + minimatch.sep = path14.sep; var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {}; var expand2 = require_brace_expansion(); var plTypes = { @@ -49360,8 +49360,8 @@ var require_minimatch = __commonJS({ assertValidPattern(pattern); if (!options) options = {}; pattern = pattern.trim(); - if (!options.allowWindowsEscape && path17.sep !== "/") { - pattern = pattern.split(path17.sep).join("/"); + if (!options.allowWindowsEscape && path14.sep !== "/") { + pattern = pattern.split(path14.sep).join("/"); } this.options = options; this.set = []; @@ -49730,8 +49730,8 @@ var require_minimatch = __commonJS({ if (this.empty) return f === ""; if (f === "/" && partial) return true; var options = this.options; - if (path17.sep !== "/") { - f = f.split(path17.sep).join("/"); + if (path14.sep !== "/") { + f = f.split(path14.sep).join("/"); } f = f.split(slashSplit); this.debug(this.pattern, "split", f); @@ -49877,7 +49877,7 @@ var require_internal_path = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.Path = void 0; - var path17 = __importStar2(require("path")); + var path14 = __importStar2(require("path")); var pathHelper = __importStar2(require_internal_path_helper()); var assert_1 = __importDefault2(require("assert")); var IS_WINDOWS = process.platform === "win32"; @@ -49892,12 +49892,12 @@ var require_internal_path = __commonJS({ (0, assert_1.default)(itemPath, `Parameter 'itemPath' must not be empty`); itemPath = pathHelper.safeTrimTrailingSeparator(itemPath); if (!pathHelper.hasRoot(itemPath)) { - this.segments = itemPath.split(path17.sep); + this.segments = itemPath.split(path14.sep); } else { let remaining = itemPath; let dir = pathHelper.dirname(remaining); while (dir !== remaining) { - const basename2 = path17.basename(remaining); + const basename2 = path14.basename(remaining); this.segments.unshift(basename2); remaining = dir; dir = pathHelper.dirname(remaining); @@ -49915,7 +49915,7 @@ var require_internal_path = __commonJS({ (0, assert_1.default)(segment === pathHelper.dirname(segment), `Parameter 'itemPath' root segment contains information for multiple segments`); this.segments.push(segment); } else { - (0, assert_1.default)(!segment.includes(path17.sep), `Parameter 'itemPath' contains unexpected path separators`); + (0, assert_1.default)(!segment.includes(path14.sep), `Parameter 'itemPath' contains unexpected path separators`); this.segments.push(segment); } } @@ -49926,12 +49926,12 @@ var require_internal_path = __commonJS({ */ toString() { let result = this.segments[0]; - let skipSlash = result.endsWith(path17.sep) || IS_WINDOWS && /^[A-Z]:$/i.test(result); + let skipSlash = result.endsWith(path14.sep) || IS_WINDOWS && /^[A-Z]:$/i.test(result); for (let i = 1; i < this.segments.length; i++) { if (skipSlash) { skipSlash = false; } else { - result += path17.sep; + result += path14.sep; } result += this.segments[i]; } @@ -49988,8 +49988,8 @@ var require_internal_pattern = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.Pattern = void 0; - var os4 = __importStar2(require("os")); - var path17 = __importStar2(require("path")); + var os3 = __importStar2(require("os")); + var path14 = __importStar2(require("path")); var pathHelper = __importStar2(require_internal_path_helper()); var assert_1 = __importDefault2(require("assert")); var minimatch_1 = require_minimatch(); @@ -50018,7 +50018,7 @@ var require_internal_pattern = __commonJS({ } pattern = _Pattern.fixupPattern(pattern, homedir); this.segments = new internal_path_1.Path(pattern).segments; - this.trailingSeparator = pathHelper.normalizeSeparators(pattern).endsWith(path17.sep); + this.trailingSeparator = pathHelper.normalizeSeparators(pattern).endsWith(path14.sep); pattern = pathHelper.safeTrimTrailingSeparator(pattern); let foundGlob = false; const searchSegments = this.segments.map((x) => _Pattern.getLiteral(x)).filter((x) => !foundGlob && !(foundGlob = x === "")); @@ -50042,8 +50042,8 @@ var require_internal_pattern = __commonJS({ match(itemPath) { if (this.segments[this.segments.length - 1] === "**") { itemPath = pathHelper.normalizeSeparators(itemPath); - if (!itemPath.endsWith(path17.sep) && this.isImplicitPattern === false) { - itemPath = `${itemPath}${path17.sep}`; + if (!itemPath.endsWith(path14.sep) && this.isImplicitPattern === false) { + itemPath = `${itemPath}${path14.sep}`; } } else { itemPath = pathHelper.safeTrimTrailingSeparator(itemPath); @@ -50078,10 +50078,10 @@ var require_internal_pattern = __commonJS({ (0, assert_1.default)(literalSegments.every((x, i) => (x !== "." || i === 0) && x !== ".."), `Invalid pattern '${pattern}'. Relative pathing '.' and '..' is not allowed.`); (0, assert_1.default)(!pathHelper.hasRoot(pattern) || literalSegments[0], `Invalid pattern '${pattern}'. Root segment must not contain globs.`); pattern = pathHelper.normalizeSeparators(pattern); - if (pattern === "." || pattern.startsWith(`.${path17.sep}`)) { + if (pattern === "." || pattern.startsWith(`.${path14.sep}`)) { pattern = _Pattern.globEscape(process.cwd()) + pattern.substr(1); - } else if (pattern === "~" || pattern.startsWith(`~${path17.sep}`)) { - homedir = homedir || os4.homedir(); + } else if (pattern === "~" || pattern.startsWith(`~${path14.sep}`)) { + homedir = homedir || os3.homedir(); (0, assert_1.default)(homedir, "Unable to determine HOME directory"); (0, assert_1.default)(pathHelper.hasAbsoluteRoot(homedir), `Expected HOME directory to be a rooted path. Actual '${homedir}'`); pattern = _Pattern.globEscape(homedir) + pattern.substr(1); @@ -50164,8 +50164,8 @@ var require_internal_search_state = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.SearchState = void 0; var SearchState = class { - constructor(path17, level) { - this.path = path17; + constructor(path14, level) { + this.path = path14; this.level = level; } }; @@ -50307,9 +50307,9 @@ var require_internal_globber = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.DefaultGlobber = void 0; var core17 = __importStar2(require_core()); - var fs18 = __importStar2(require("fs")); + var fs15 = __importStar2(require("fs")); var globOptionsHelper = __importStar2(require_internal_glob_options_helper()); - var path17 = __importStar2(require("path")); + var path14 = __importStar2(require("path")); var patternHelper = __importStar2(require_internal_pattern_helper()); var internal_match_kind_1 = require_internal_match_kind(); var internal_pattern_1 = require_internal_pattern(); @@ -50361,7 +50361,7 @@ var require_internal_globber = __commonJS({ for (const searchPath of patternHelper.getSearchPaths(patterns)) { core17.debug(`Search path '${searchPath}'`); try { - yield __await2(fs18.promises.lstat(searchPath)); + yield __await2(fs15.promises.lstat(searchPath)); } catch (err) { if (err.code === "ENOENT") { continue; @@ -50385,7 +50385,7 @@ var require_internal_globber = __commonJS({ if (!stats) { continue; } - if (options.excludeHiddenFiles && path17.basename(item.path).match(/^\./)) { + if (options.excludeHiddenFiles && path14.basename(item.path).match(/^\./)) { continue; } if (stats.isDirectory()) { @@ -50395,7 +50395,7 @@ var require_internal_globber = __commonJS({ continue; } const childLevel = item.level + 1; - const childItems = (yield __await2(fs18.promises.readdir(item.path))).map((x) => new internal_search_state_1.SearchState(path17.join(item.path, x), childLevel)); + const childItems = (yield __await2(fs15.promises.readdir(item.path))).map((x) => new internal_search_state_1.SearchState(path14.join(item.path, x), childLevel)); stack.push(...childItems.reverse()); } else if (match & internal_match_kind_1.MatchKind.File) { yield yield __await2(item.path); @@ -50430,7 +50430,7 @@ var require_internal_globber = __commonJS({ let stats; if (options.followSymbolicLinks) { try { - stats = yield fs18.promises.stat(item.path); + stats = yield fs15.promises.stat(item.path); } catch (err) { if (err.code === "ENOENT") { if (options.omitBrokenSymbolicLinks) { @@ -50442,10 +50442,10 @@ var require_internal_globber = __commonJS({ throw err; } } else { - stats = yield fs18.promises.lstat(item.path); + stats = yield fs15.promises.lstat(item.path); } if (stats.isDirectory() && options.followSymbolicLinks) { - const realPath = yield fs18.promises.realpath(item.path); + const realPath = yield fs15.promises.realpath(item.path); while (traversalChain.length >= item.level) { traversalChain.pop(); } @@ -50554,10 +50554,10 @@ var require_internal_hash_files = __commonJS({ exports2.hashFiles = hashFiles2; var crypto2 = __importStar2(require("crypto")); var core17 = __importStar2(require_core()); - var fs18 = __importStar2(require("fs")); - var stream2 = __importStar2(require("stream")); + var fs15 = __importStar2(require("fs")); + var stream = __importStar2(require("stream")); var util = __importStar2(require("util")); - var path17 = __importStar2(require("path")); + var path14 = __importStar2(require("path")); function hashFiles2(globber_1, currentWorkspace_1) { return __awaiter2(this, arguments, void 0, function* (globber, currentWorkspace, verbose = false) { var _a, e_1, _b, _c; @@ -50573,17 +50573,17 @@ var require_internal_hash_files = __commonJS({ _e = false; const file = _c; writeDelegate(file); - if (!file.startsWith(`${githubWorkspace}${path17.sep}`)) { + if (!file.startsWith(`${githubWorkspace}${path14.sep}`)) { writeDelegate(`Ignore '${file}' since it is not under GITHUB_WORKSPACE.`); continue; } - if (fs18.statSync(file).isDirectory()) { + if (fs15.statSync(file).isDirectory()) { writeDelegate(`Skip directory '${file}'.`); continue; } const hash2 = crypto2.createHash("sha256"); - const pipeline = util.promisify(stream2.pipeline); - yield pipeline(fs18.createReadStream(file), hash2); + const pipeline = util.promisify(stream.pipeline); + yield pipeline(fs15.createReadStream(file), hash2); result.write(hash2.digest()); count++; if (!hasMatch) { @@ -51958,8 +51958,8 @@ var require_cacheUtils = __commonJS({ var glob2 = __importStar2(require_glob()); var io7 = __importStar2(require_io()); var crypto2 = __importStar2(require("crypto")); - var fs18 = __importStar2(require("fs")); - var path17 = __importStar2(require("path")); + var fs15 = __importStar2(require("fs")); + var path14 = __importStar2(require("path")); var semver9 = __importStar2(require_semver3()); var util = __importStar2(require("util")); var constants_1 = require_constants12(); @@ -51979,15 +51979,15 @@ var require_cacheUtils = __commonJS({ baseLocation = "/home"; } } - tempDirectory = path17.join(baseLocation, "actions", "temp"); + tempDirectory = path14.join(baseLocation, "actions", "temp"); } - const dest = path17.join(tempDirectory, crypto2.randomUUID()); + const dest = path14.join(tempDirectory, crypto2.randomUUID()); yield io7.mkdirP(dest); return dest; }); } function getArchiveFileSizeInBytes(filePath) { - return fs18.statSync(filePath).size; + return fs15.statSync(filePath).size; } function resolvePaths(patterns) { return __awaiter2(this, void 0, void 0, function* () { @@ -52003,7 +52003,7 @@ var require_cacheUtils = __commonJS({ _c = _g.value; _e = false; const file = _c; - const relativeFile = path17.relative(workspace, file).replace(new RegExp(`\\${path17.sep}`, "g"), "/"); + const relativeFile = path14.relative(workspace, file).replace(new RegExp(`\\${path14.sep}`, "g"), "/"); core17.debug(`Matched: ${relativeFile}`); if (relativeFile === "") { paths.push("."); @@ -52025,7 +52025,7 @@ var require_cacheUtils = __commonJS({ } function unlinkFile(filePath) { return __awaiter2(this, void 0, void 0, function* () { - return util.promisify(fs18.unlink)(filePath); + return util.promisify(fs15.unlink)(filePath); }); } function getVersion(app_1) { @@ -52067,7 +52067,7 @@ var require_cacheUtils = __commonJS({ } function getGnuTarPathOnWindows() { return __awaiter2(this, void 0, void 0, function* () { - if (fs18.existsSync(constants_1.GnuTarPathOnWindows)) { + if (fs15.existsSync(constants_1.GnuTarPathOnWindows)) { return constants_1.GnuTarPathOnWindows; } const versionOutput = yield getVersion("tar"); @@ -52530,13 +52530,13 @@ function __disposeResources(env) { } return next(); } -function __rewriteRelativeImportExtension(path17, preserveJsx) { - if (typeof path17 === "string" && /^\.\.?\//.test(path17)) { - return path17.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function(m, tsx, d, ext, cm) { +function __rewriteRelativeImportExtension(path14, preserveJsx) { + if (typeof path14 === "string" && /^\.\.?\//.test(path14)) { + return path14.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function(m, tsx, d, ext, cm) { return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : d + ext + "." + cm.toLowerCase() + "js"; }); } - return path17; + return path14; } var extendStatics, __assign, __createBinding, __setModuleDefault, ownKeys, _SuppressedError, tslib_es6_default; var init_tslib_es6 = __esm({ @@ -53041,8 +53041,8 @@ var require_uuidUtils = __commonJS({ "node_modules/@typespec/ts-http-runtime/dist/commonjs/util/uuidUtils.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.randomUUID = randomUUID2; - function randomUUID2() { + exports2.randomUUID = randomUUID; + function randomUUID() { return crypto.randomUUID(); } } @@ -53606,20 +53606,20 @@ var require_nodeHttpClient = __commonJS({ function isReadableStream(body) { return body && typeof body.pipe === "function"; } - function isStreamComplete(stream2) { - if (stream2.readable === false) { + function isStreamComplete(stream) { + if (stream.readable === false) { return Promise.resolve(); } return new Promise((resolve8) => { const handler2 = () => { resolve8(); - stream2.removeListener("close", handler2); - stream2.removeListener("end", handler2); - stream2.removeListener("error", handler2); + stream.removeListener("close", handler2); + stream.removeListener("end", handler2); + stream.removeListener("error", handler2); }; - stream2.on("close", handler2); - stream2.on("end", handler2); - stream2.on("error", handler2); + stream.on("close", handler2); + stream.on("end", handler2); + stream.on("error", handler2); }); } function isArrayBuffer(body) { @@ -53838,33 +53838,33 @@ var require_nodeHttpClient = __commonJS({ } return headers; } - function getDecodedResponseStream(stream2, headers) { + function getDecodedResponseStream(stream, headers) { const contentEncoding = headers.get("Content-Encoding"); if (contentEncoding === "gzip") { const unzip = node_zlib_1.default.createGunzip(); - stream2.pipe(unzip); + stream.pipe(unzip); return unzip; } else if (contentEncoding === "deflate") { const inflate = node_zlib_1.default.createInflate(); - stream2.pipe(inflate); + stream.pipe(inflate); return inflate; } - return stream2; + return stream; } - function streamToText(stream2) { + function streamToText(stream) { return new Promise((resolve8, reject) => { const buffer = []; - stream2.on("data", (chunk) => { + stream.on("data", (chunk) => { if (Buffer.isBuffer(chunk)) { buffer.push(chunk); } else { buffer.push(Buffer.from(chunk)); } }); - stream2.on("end", () => { + stream.on("end", () => { resolve8(Buffer.concat(buffer).toString("utf8")); }); - stream2.on("error", (e) => { + stream.on("error", (e) => { if (e && e?.name === "AbortError") { reject(e); } else { @@ -54983,7 +54983,7 @@ var require_has_flag = __commonJS({ var require_supports_color = __commonJS({ "node_modules/supports-color/index.js"(exports2, module2) { "use strict"; - var os4 = require("os"); + var os3 = require("os"); var tty = require("tty"); var hasFlag = require_has_flag(); var { env } = process; @@ -55031,7 +55031,7 @@ var require_supports_color = __commonJS({ return min; } if (process.platform === "win32") { - const osRelease = os4.release().split("."); + const osRelease = os3.release().split("."); if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) { return Number(osRelease[2]) >= 14931 ? 3 : 2; } @@ -55069,8 +55069,8 @@ var require_supports_color = __commonJS({ } return min; } - function getSupportLevel(stream2) { - const level = supportsColor(stream2, stream2 && stream2.isTTY); + function getSupportLevel(stream) { + const level = supportsColor(stream, stream && stream.isTTY); return translateLevel(level); } module2.exports = { @@ -55301,18 +55301,18 @@ var require_helpers3 = __commonJS({ exports2.req = exports2.json = exports2.toBuffer = void 0; var http = __importStar2(require("http")); var https2 = __importStar2(require("https")); - async function toBuffer(stream2) { + async function toBuffer(stream) { let length = 0; const chunks = []; - for await (const chunk of stream2) { + for await (const chunk of stream) { length += chunk.length; chunks.push(chunk); } return Buffer.concat(chunks, length); } exports2.toBuffer = toBuffer; - async function json2(stream2) { - const buf = await toBuffer(stream2); + async function json2(stream) { + const buf = await toBuffer(stream); const str2 = buf.toString("utf8"); try { return JSON.parse(str2); @@ -56121,12 +56121,12 @@ var require_concat = __commonJS({ webStream.values = streamAsyncIterator.bind(webStream); } } - function ensureNodeStream(stream2) { - if (stream2 instanceof ReadableStream) { - makeAsyncIterable(stream2); - return stream_1.Readable.fromWeb(stream2); + function ensureNodeStream(stream) { + if (stream instanceof ReadableStream) { + makeAsyncIterable(stream); + return stream_1.Readable.fromWeb(stream); } else { - return stream2; + return stream; } } function toStream(source) { @@ -56142,8 +56142,8 @@ var require_concat = __commonJS({ return function() { const streams = sources.map((x) => typeof x === "function" ? x() : x).map(toStream); return stream_1.Readable.from((async function* () { - for (const stream2 of streams) { - for await (const chunk of stream2) { + for (const stream of streams) { + for await (const chunk of stream) { yield chunk; } } @@ -56678,9 +56678,9 @@ var require_sendRequest = __commonJS({ try { const response = await pipeline.sendRequest(httpClient, request2); const headers = response.headers.toJSON(); - const stream2 = response.readableStreamBody ?? response.browserStreamBody; - const parsedBody = options.responseAsStream || stream2 !== void 0 ? void 0 : getResponseBody(response); - const body = stream2 ?? parsedBody; + const stream = response.readableStreamBody ?? response.browserStreamBody; + const parsedBody = options.responseAsStream || stream !== void 0 ? void 0 : getResponseBody(response); + const body = stream ?? parsedBody; if (options?.onResponse) { options.onResponse({ ...response, request: request2, rawHeaders: headers, parsedBody }); } @@ -56950,8 +56950,8 @@ var require_getClient = __commonJS({ } const { allowInsecureConnection, httpClient } = clientOptions; const endpointUrl = clientOptions.endpoint ?? endpoint2; - const client = (path17, ...args) => { - const getUrl = (requestOptions) => (0, urlHelpers_js_1.buildRequestUrl)(endpointUrl, path17, args, { allowInsecureConnection, ...requestOptions }); + const client = (path14, ...args) => { + const getUrl = (requestOptions) => (0, urlHelpers_js_1.buildRequestUrl)(endpointUrl, path14, args, { allowInsecureConnection, ...requestOptions }); return { get: (requestOptions = {}) => { return buildOperation("GET", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); @@ -57785,7 +57785,7 @@ var require_commonjs4 = __commonJS({ exports2.getRandomIntegerInclusive = getRandomIntegerInclusive; exports2.isError = isError; exports2.isObject = isObject2; - exports2.randomUUID = randomUUID2; + exports2.randomUUID = randomUUID; exports2.uint8ArrayToString = uint8ArrayToString; exports2.stringToUint8Array = stringToUint8Array; var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); @@ -57834,7 +57834,7 @@ var require_commonjs4 = __commonJS({ function isObject2(input) { return tspRuntime.isObject(input); } - function randomUUID2() { + function randomUUID() { return tspRuntime.randomUUID(); } exports2.isBrowser = tspRuntime.isBrowser; @@ -57892,7 +57892,7 @@ var require_file3 = __commonJS({ return blob; } } - function createFileFromStream(stream2, name, options = {}) { + function createFileFromStream(stream, name, options = {}) { return { ...unimplementedMethods, type: options.type ?? "", @@ -57901,13 +57901,13 @@ var require_file3 = __commonJS({ size: options.size ?? -1, name, stream: () => { - const s = stream2(); + const s = stream(); if (isNodeReadableStream(s)) { throw new Error("Not supported: a Node stream was provided as input to createFileFromStream."); } return s; }, - [rawContent]: stream2 + [rawContent]: stream }; } function createFile(content, name, options = {}) { @@ -60822,15 +60822,15 @@ var require_urlHelpers2 = __commonJS({ let isAbsolutePath = false; let requestUrl = replaceAll(baseUri, urlReplacements); if (operationSpec.path) { - let path17 = replaceAll(operationSpec.path, urlReplacements); - if (operationSpec.path === "/{nextLink}" && path17.startsWith("/")) { - path17 = path17.substring(1); + let path14 = replaceAll(operationSpec.path, urlReplacements); + if (operationSpec.path === "/{nextLink}" && path14.startsWith("/")) { + path14 = path14.substring(1); } - if (isAbsoluteUrl(path17)) { - requestUrl = path17; + if (isAbsoluteUrl(path14)) { + requestUrl = path14; isAbsolutePath = true; } else { - requestUrl = appendPath(requestUrl, path17); + requestUrl = appendPath(requestUrl, path14); } } const { queryParams, sequenceParams } = calculateQueryParameters(operationSpec, operationArguments, fallbackObject); @@ -60876,9 +60876,9 @@ var require_urlHelpers2 = __commonJS({ } const searchStart = pathToAppend.indexOf("?"); if (searchStart !== -1) { - const path17 = pathToAppend.substring(0, searchStart); + const path14 = pathToAppend.substring(0, searchStart); const search = pathToAppend.substring(searchStart + 1); - newPath = newPath + path17; + newPath = newPath + path14; if (search) { parsedUrl.search = parsedUrl.search ? `${parsedUrl.search}&${search}` : search; } @@ -63129,10 +63129,10 @@ var require_utils_common = __commonJS({ var constants_js_1 = require_constants15(); function escapeURLPath(url2) { const urlParsed = new URL(url2); - let path17 = urlParsed.pathname; - path17 = path17 || "/"; - path17 = escape(path17); - urlParsed.pathname = path17; + let path14 = urlParsed.pathname; + path14 = path14 || "/"; + path14 = escape(path14); + urlParsed.pathname = path14; return urlParsed.toString(); } function getProxyUriFromDevConnString(connectionString) { @@ -63217,9 +63217,9 @@ var require_utils_common = __commonJS({ } function appendToURLPath(url2, name) { const urlParsed = new URL(url2); - let path17 = urlParsed.pathname; - path17 = path17 ? path17.endsWith("/") ? `${path17}${name}` : `${path17}/${name}` : name; - urlParsed.pathname = path17; + let path14 = urlParsed.pathname; + path14 = path14 ? path14.endsWith("/") ? `${path14}${name}` : `${path14}/${name}` : name; + urlParsed.pathname = path14; return urlParsed.toString(); } function setURLParameter(url2, name, value) { @@ -64446,9 +64446,9 @@ var require_StorageSharedKeyCredentialPolicy = __commonJS({ * @param request - */ getCanonicalizedResourceString(request2) { - const path17 = (0, utils_common_js_1.getURLPath)(request2.url) || "/"; + const path14 = (0, utils_common_js_1.getURLPath)(request2.url) || "/"; let canonicalizedResourceString = ""; - canonicalizedResourceString += `/${this.factory.accountName}${path17}`; + canonicalizedResourceString += `/${this.factory.accountName}${path14}`; const queries = (0, utils_common_js_1.getURLQueries)(request2.url); const lowercaseQueries = {}; if (queries) { @@ -65187,10 +65187,10 @@ var require_utils_common2 = __commonJS({ var constants_js_1 = require_constants16(); function escapeURLPath(url2) { const urlParsed = new URL(url2); - let path17 = urlParsed.pathname; - path17 = path17 || "/"; - path17 = escape(path17); - urlParsed.pathname = path17; + let path14 = urlParsed.pathname; + path14 = path14 || "/"; + path14 = escape(path14); + urlParsed.pathname = path14; return urlParsed.toString(); } function getProxyUriFromDevConnString(connectionString) { @@ -65275,9 +65275,9 @@ var require_utils_common2 = __commonJS({ } function appendToURLPath(url2, name) { const urlParsed = new URL(url2); - let path17 = urlParsed.pathname; - path17 = path17 ? path17.endsWith("/") ? `${path17}${name}` : `${path17}/${name}` : name; - urlParsed.pathname = path17; + let path14 = urlParsed.pathname; + path14 = path14 ? path14.endsWith("/") ? `${path14}${name}` : `${path14}/${name}` : name; + urlParsed.pathname = path14; return urlParsed.toString(); } function setURLParameter(url2, name, value) { @@ -66198,9 +66198,9 @@ var require_StorageSharedKeyCredentialPolicy2 = __commonJS({ * @param request - */ getCanonicalizedResourceString(request2) { - const path17 = (0, utils_common_js_1.getURLPath)(request2.url) || "/"; + const path14 = (0, utils_common_js_1.getURLPath)(request2.url) || "/"; let canonicalizedResourceString = ""; - canonicalizedResourceString += `/${this.factory.accountName}${path17}`; + canonicalizedResourceString += `/${this.factory.accountName}${path14}`; const queries = (0, utils_common_js_1.getURLQueries)(request2.url); const lowercaseQueries = {}; if (queries) { @@ -66830,9 +66830,9 @@ var require_StorageSharedKeyCredentialPolicyV2 = __commonJS({ return canonicalizedHeadersStringToSign; } function getCanonicalizedResourceString(request2) { - const path17 = (0, utils_common_js_1.getURLPath)(request2.url) || "/"; + const path14 = (0, utils_common_js_1.getURLPath)(request2.url) || "/"; let canonicalizedResourceString = ""; - canonicalizedResourceString += `/${options.accountName}${path17}`; + canonicalizedResourceString += `/${options.accountName}${path14}`; const queries = (0, utils_common_js_1.getURLQueries)(request2.url); const lowercaseQueries = {}; if (queries) { @@ -67177,9 +67177,9 @@ var require_StorageSharedKeyCredentialPolicyV22 = __commonJS({ return canonicalizedHeadersStringToSign; } function getCanonicalizedResourceString(request2) { - const path17 = (0, utils_common_js_1.getURLPath)(request2.url) || "/"; + const path14 = (0, utils_common_js_1.getURLPath)(request2.url) || "/"; let canonicalizedResourceString = ""; - canonicalizedResourceString += `/${options.accountName}${path17}`; + canonicalizedResourceString += `/${options.accountName}${path14}`; const queries = (0, utils_common_js_1.getURLQueries)(request2.url); const lowercaseQueries = {}; if (queries) { @@ -83105,8 +83105,8 @@ var require_AvroParser = __commonJS({ * @param length - * @param options - */ - static async readFixedBytes(stream2, length, options = {}) { - const bytes = await stream2.read(length, { abortSignal: options.abortSignal }); + static async readFixedBytes(stream, length, options = {}) { + const bytes = await stream.read(length, { abortSignal: options.abortSignal }); if (bytes.length !== length) { throw new Error("Hit stream end."); } @@ -83118,19 +83118,19 @@ var require_AvroParser = __commonJS({ * @param stream - * @param options - */ - static async readByte(stream2, options = {}) { - const buf = await _AvroParser.readFixedBytes(stream2, 1, options); + static async readByte(stream, options = {}) { + const buf = await _AvroParser.readFixedBytes(stream, 1, options); return buf[0]; } // int and long are stored in variable-length zig-zag coding. // variable-length: https://lucene.apache.org/core/3_5_0/fileformats.html#VInt // zig-zag: https://developers.google.com/protocol-buffers/docs/encoding?csw=1#types - static async readZigZagLong(stream2, options = {}) { + static async readZigZagLong(stream, options = {}) { let zigZagEncoded = 0; let significanceInBit = 0; let byte, haveMoreByte, significanceInFloat; do { - byte = await _AvroParser.readByte(stream2, options); + byte = await _AvroParser.readByte(stream, options); haveMoreByte = byte & 128; zigZagEncoded |= (byte & 127) << significanceInBit; significanceInBit += 7; @@ -83139,7 +83139,7 @@ var require_AvroParser = __commonJS({ zigZagEncoded = zigZagEncoded; significanceInFloat = 268435456; do { - byte = await _AvroParser.readByte(stream2, options); + byte = await _AvroParser.readByte(stream, options); zigZagEncoded += (byte & 127) * significanceInFloat; significanceInFloat *= 128; } while (byte & 128); @@ -83151,17 +83151,17 @@ var require_AvroParser = __commonJS({ } return zigZagEncoded >> 1 ^ -(zigZagEncoded & 1); } - static async readLong(stream2, options = {}) { - return _AvroParser.readZigZagLong(stream2, options); + static async readLong(stream, options = {}) { + return _AvroParser.readZigZagLong(stream, options); } - static async readInt(stream2, options = {}) { - return _AvroParser.readZigZagLong(stream2, options); + static async readInt(stream, options = {}) { + return _AvroParser.readZigZagLong(stream, options); } static async readNull() { return null; } - static async readBoolean(stream2, options = {}) { - const b = await _AvroParser.readByte(stream2, options); + static async readBoolean(stream, options = {}) { + const b = await _AvroParser.readByte(stream, options); if (b === 1) { return true; } else if (b === 0) { @@ -83170,53 +83170,53 @@ var require_AvroParser = __commonJS({ throw new Error("Byte was not a boolean."); } } - static async readFloat(stream2, options = {}) { - const u8arr = await _AvroParser.readFixedBytes(stream2, 4, options); + static async readFloat(stream, options = {}) { + const u8arr = await _AvroParser.readFixedBytes(stream, 4, options); const view = new DataView(u8arr.buffer, u8arr.byteOffset, u8arr.byteLength); return view.getFloat32(0, true); } - static async readDouble(stream2, options = {}) { - const u8arr = await _AvroParser.readFixedBytes(stream2, 8, options); + static async readDouble(stream, options = {}) { + const u8arr = await _AvroParser.readFixedBytes(stream, 8, options); const view = new DataView(u8arr.buffer, u8arr.byteOffset, u8arr.byteLength); return view.getFloat64(0, true); } - static async readBytes(stream2, options = {}) { - const size = await _AvroParser.readLong(stream2, options); + static async readBytes(stream, options = {}) { + const size = await _AvroParser.readLong(stream, options); if (size < 0) { throw new Error("Bytes size was negative."); } - return stream2.read(size, { abortSignal: options.abortSignal }); + return stream.read(size, { abortSignal: options.abortSignal }); } - static async readString(stream2, options = {}) { - const u8arr = await _AvroParser.readBytes(stream2, options); + static async readString(stream, options = {}) { + const u8arr = await _AvroParser.readBytes(stream, options); const utf8decoder = new TextDecoder(); return utf8decoder.decode(u8arr); } - static async readMapPair(stream2, readItemMethod, options = {}) { - const key = await _AvroParser.readString(stream2, options); - const value = await readItemMethod(stream2, options); + static async readMapPair(stream, readItemMethod, options = {}) { + const key = await _AvroParser.readString(stream, options); + const value = await readItemMethod(stream, options); return { key, value }; } - static async readMap(stream2, readItemMethod, options = {}) { + static async readMap(stream, readItemMethod, options = {}) { const readPairMethod = (s, opts = {}) => { return _AvroParser.readMapPair(s, readItemMethod, opts); }; - const pairs2 = await _AvroParser.readArray(stream2, readPairMethod, options); + const pairs2 = await _AvroParser.readArray(stream, readPairMethod, options); const dict = {}; for (const pair of pairs2) { dict[pair.key] = pair.value; } return dict; } - static async readArray(stream2, readItemMethod, options = {}) { + static async readArray(stream, readItemMethod, options = {}) { const items = []; - for (let count = await _AvroParser.readLong(stream2, options); count !== 0; count = await _AvroParser.readLong(stream2, options)) { + for (let count = await _AvroParser.readLong(stream, options); count !== 0; count = await _AvroParser.readLong(stream, options)) { if (count < 0) { - await _AvroParser.readLong(stream2, options); + await _AvroParser.readLong(stream, options); count = -count; } while (count--) { - const item = await readItemMethod(stream2, options); + const item = await readItemMethod(stream, options); items.push(item); } } @@ -83328,24 +83328,24 @@ var require_AvroParser = __commonJS({ this._primitive = primitive; } // eslint-disable-next-line @typescript-eslint/no-wrapper-object-types - read(stream2, options = {}) { + read(stream, options = {}) { switch (this._primitive) { case AvroPrimitive.NULL: return AvroParser.readNull(); case AvroPrimitive.BOOLEAN: - return AvroParser.readBoolean(stream2, options); + return AvroParser.readBoolean(stream, options); case AvroPrimitive.INT: - return AvroParser.readInt(stream2, options); + return AvroParser.readInt(stream, options); case AvroPrimitive.LONG: - return AvroParser.readLong(stream2, options); + return AvroParser.readLong(stream, options); case AvroPrimitive.FLOAT: - return AvroParser.readFloat(stream2, options); + return AvroParser.readFloat(stream, options); case AvroPrimitive.DOUBLE: - return AvroParser.readDouble(stream2, options); + return AvroParser.readDouble(stream, options); case AvroPrimitive.BYTES: - return AvroParser.readBytes(stream2, options); + return AvroParser.readBytes(stream, options); case AvroPrimitive.STRING: - return AvroParser.readString(stream2, options); + return AvroParser.readString(stream, options); default: throw new Error("Unknown Avro Primitive"); } @@ -83358,8 +83358,8 @@ var require_AvroParser = __commonJS({ this._symbols = symbols; } // eslint-disable-next-line @typescript-eslint/no-wrapper-object-types - async read(stream2, options = {}) { - const value = await AvroParser.readInt(stream2, options); + async read(stream, options = {}) { + const value = await AvroParser.readInt(stream, options); return this._symbols[value]; } }; @@ -83369,9 +83369,9 @@ var require_AvroParser = __commonJS({ super(); this._types = types; } - async read(stream2, options = {}) { - const typeIndex = await AvroParser.readInt(stream2, options); - return this._types[typeIndex].read(stream2, options); + async read(stream, options = {}) { + const typeIndex = await AvroParser.readInt(stream, options); + return this._types[typeIndex].read(stream, options); } }; var AvroMapType = class extends AvroType { @@ -83381,11 +83381,11 @@ var require_AvroParser = __commonJS({ this._itemType = itemType; } // eslint-disable-next-line @typescript-eslint/no-wrapper-object-types - read(stream2, options = {}) { + read(stream, options = {}) { const readItemMethod = (s, opts) => { return this._itemType.read(s, opts); }; - return AvroParser.readMap(stream2, readItemMethod, options); + return AvroParser.readMap(stream, readItemMethod, options); } }; var AvroRecordType = class extends AvroType { @@ -83397,12 +83397,12 @@ var require_AvroParser = __commonJS({ this._name = name; } // eslint-disable-next-line @typescript-eslint/no-wrapper-object-types - async read(stream2, options = {}) { + async read(stream, options = {}) { const record = {}; record["$schema"] = this._name; for (const key in this._fields) { if (Object.prototype.hasOwnProperty.call(this._fields, key)) { - record[key] = await this._fields[key].read(stream2, options); + record[key] = await this._fields[key].read(stream, options); } } return record; @@ -85656,18 +85656,18 @@ var require_utils7 = __commonJS({ var node_fs_1 = tslib_1.__importDefault(require("node:fs")); var node_util_1 = tslib_1.__importDefault(require("node:util")); var constants_js_1 = require_constants15(); - async function streamToBuffer(stream2, buffer, offset, end, encoding) { + async function streamToBuffer(stream, buffer, offset, end, encoding) { let pos = 0; const count = end - offset; return new Promise((resolve8, reject) => { const timeout = setTimeout(() => reject(new Error(`The operation cannot be completed in timeout.`)), constants_js_1.REQUEST_TIMEOUT); - stream2.on("readable", () => { + stream.on("readable", () => { if (pos >= count) { clearTimeout(timeout); resolve8(); return; } - let chunk = stream2.read(); + let chunk = stream.read(); if (!chunk) { return; } @@ -85678,25 +85678,25 @@ var require_utils7 = __commonJS({ buffer.fill(chunk.slice(0, chunkLength), offset + pos, offset + pos + chunkLength); pos += chunkLength; }); - stream2.on("end", () => { + stream.on("end", () => { clearTimeout(timeout); if (pos < count) { reject(new Error(`Stream drains before getting enough data needed. Data read: ${pos}, data need: ${count}`)); } resolve8(); }); - stream2.on("error", (msg) => { + stream.on("error", (msg) => { clearTimeout(timeout); reject(msg); }); }); } - async function streamToBuffer2(stream2, buffer, encoding) { + async function streamToBuffer2(stream, buffer, encoding) { let pos = 0; const bufferSize = buffer.length; return new Promise((resolve8, reject) => { - stream2.on("readable", () => { - let chunk = stream2.read(); + stream.on("readable", () => { + let chunk = stream.read(); if (!chunk) { return; } @@ -85710,10 +85710,10 @@ var require_utils7 = __commonJS({ buffer.fill(chunk, pos, pos + chunk.length); pos += chunk.length; }); - stream2.on("end", () => { + stream.on("end", () => { resolve8(pos); }); - stream2.on("error", reject); + stream.on("error", reject); }); } async function streamToBuffer3(readableStream, encoding) { @@ -86551,8 +86551,8 @@ var require_Clients = __commonJS({ customerProvidedKey: options.customerProvidedKey, tracingOptions: updatedOptions.tracingOptions }); - const stream2 = response.readableStreamBody; - await (0, utils_js_1.streamToBuffer)(stream2, buffer, off - offset, chunkEnd - offset); + const stream = response.readableStreamBody; + await (0, utils_js_1.streamToBuffer)(stream, buffer, off - offset, chunkEnd - offset); transferProgress += chunkEnd - off; if (options.onProgress) { options.onProgress({ loadedBytes: transferProgress }); @@ -87655,7 +87655,7 @@ var require_Clients = __commonJS({ * @param options - Options to Upload Stream to Block Blob operation. * @returns Response data for the Blob Upload operation. */ - async uploadStream(stream2, bufferSize = constants_js_1.DEFAULT_BLOCK_BUFFER_SIZE_BYTES, maxConcurrency = 5, options = {}) { + async uploadStream(stream, bufferSize = constants_js_1.DEFAULT_BLOCK_BUFFER_SIZE_BYTES, maxConcurrency = 5, options = {}) { if (!options.blobHTTPHeaders) { options.blobHTTPHeaders = {}; } @@ -87668,7 +87668,7 @@ var require_Clients = __commonJS({ let transferProgress = 0; const blockList = []; const scheduler = new storage_common_1.BufferScheduler( - stream2, + stream, bufferSize, maxConcurrency, async (body, length) => { @@ -88834,8 +88834,8 @@ var require_BlobBatch = __commonJS({ if (this.operationCount >= constants_js_1.BATCH_MAX_REQUEST) { throw new RangeError(`Cannot exceed ${constants_js_1.BATCH_MAX_REQUEST} sub requests in a single batch`); } - const path17 = (0, utils_common_js_1.getURLPath)(subRequest.url); - if (!path17 || path17 === "") { + const path14 = (0, utils_common_js_1.getURLPath)(subRequest.url); + if (!path14 || path14 === "") { throw new RangeError(`Invalid url for sub request: '${subRequest.url}'`); } } @@ -88913,8 +88913,8 @@ var require_BlobBatchClient = __commonJS({ pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipeline, options); } const storageClientContext = new StorageContextClient_js_1.StorageContextClient(url2, (0, Pipeline_js_1.getCoreClientOptions)(pipeline)); - const path17 = (0, utils_common_js_1.getURLPath)(url2); - if (path17 && path17 !== "/") { + const path14 = (0, utils_common_js_1.getURLPath)(url2); + if (path14 && path14 !== "/") { this.serviceOrContainerContext = storageClientContext.container; } else { this.serviceOrContainerContext = storageClientContext.service; @@ -92201,8 +92201,8 @@ var require_downloadUtils = __commonJS({ var http_client_1 = require_lib(); var storage_blob_1 = require_commonjs15(); var buffer = __importStar2(require("buffer")); - var fs18 = __importStar2(require("fs")); - var stream2 = __importStar2(require("stream")); + var fs15 = __importStar2(require("fs")); + var stream = __importStar2(require("stream")); var util = __importStar2(require("util")); var utils = __importStar2(require_cacheUtils()); var constants_1 = require_constants12(); @@ -92210,7 +92210,7 @@ var require_downloadUtils = __commonJS({ var abort_controller_1 = require_dist4(); function pipeResponseToStream(response, output) { return __awaiter2(this, void 0, void 0, function* () { - const pipeline = util.promisify(stream2.pipeline); + const pipeline = util.promisify(stream.pipeline); yield pipeline(response.message, output); }); } @@ -92312,7 +92312,7 @@ var require_downloadUtils = __commonJS({ exports2.DownloadProgress = DownloadProgress; function downloadCacheHttpClient(archiveLocation, archivePath) { return __awaiter2(this, void 0, void 0, function* () { - const writeStream = fs18.createWriteStream(archivePath); + const writeStream = fs15.createWriteStream(archivePath); const httpClient = new http_client_1.HttpClient("actions/cache"); const downloadResponse = yield (0, requestUtils_1.retryHttpClientResponse)("downloadCache", () => __awaiter2(this, void 0, void 0, function* () { return httpClient.get(archiveLocation); @@ -92337,7 +92337,7 @@ var require_downloadUtils = __commonJS({ function downloadCacheHttpClientConcurrent(archiveLocation, archivePath, options) { return __awaiter2(this, void 0, void 0, function* () { var _a; - const archiveDescriptor = yield fs18.promises.open(archivePath, "w"); + const archiveDescriptor = yield fs15.promises.open(archivePath, "w"); const httpClient = new http_client_1.HttpClient("actions/cache", void 0, { socketTimeout: options.timeoutInMs, keepAlive: true @@ -92453,7 +92453,7 @@ var require_downloadUtils = __commonJS({ } else { const maxSegmentSize = Math.min(134217728, buffer.constants.MAX_LENGTH); const downloadProgress = new DownloadProgress(contentLength); - const fd = fs18.openSync(archivePath, "w"); + const fd = fs15.openSync(archivePath, "w"); try { downloadProgress.startDisplayTimer(); const controller = new abort_controller_1.AbortController(); @@ -92471,12 +92471,12 @@ var require_downloadUtils = __commonJS({ controller.abort(); throw new Error("Aborting cache download as the download time exceeded the timeout."); } else if (Buffer.isBuffer(result)) { - fs18.writeFileSync(fd, result); + fs15.writeFileSync(fd, result); } } } finally { downloadProgress.stopDisplayTimer(); - fs18.closeSync(fd); + fs15.closeSync(fd); } } }); @@ -92798,7 +92798,7 @@ var require_cacheHttpClient = __commonJS({ var core17 = __importStar2(require_core()); var http_client_1 = require_lib(); var auth_1 = require_auth(); - var fs18 = __importStar2(require("fs")); + var fs15 = __importStar2(require("fs")); var url_1 = require("url"); var utils = __importStar2(require_cacheUtils()); var uploadUtils_1 = require_uploadUtils(); @@ -92933,7 +92933,7 @@ Other caches with similar key:`); return __awaiter2(this, void 0, void 0, function* () { const fileSize = utils.getArchiveFileSizeInBytes(archivePath); const resourceUrl = getCacheApiUrl(`caches/${cacheId.toString()}`); - const fd = fs18.openSync(archivePath, "r"); + const fd = fs15.openSync(archivePath, "r"); const uploadOptions = (0, options_1.getUploadOptions)(options); const concurrency = utils.assertDefined("uploadConcurrency", uploadOptions.uploadConcurrency); const maxChunkSize = utils.assertDefined("uploadChunkSize", uploadOptions.uploadChunkSize); @@ -92947,7 +92947,7 @@ Other caches with similar key:`); const start = offset; const end = offset + chunkSize - 1; offset += maxChunkSize; - yield uploadChunk(httpClient, resourceUrl, () => fs18.createReadStream(archivePath, { + yield uploadChunk(httpClient, resourceUrl, () => fs15.createReadStream(archivePath, { fd, start, end, @@ -92958,7 +92958,7 @@ Other caches with similar key:`); } }))); } finally { - fs18.closeSync(fd); + fs15.closeSync(fd); } return; }); @@ -96848,7 +96848,7 @@ var require_test_transport = __commonJS({ * The returned promise resolves when the stream is closed. It should * not reject. If it does, code is broken. */ - streamResponses(method, stream2, abort) { + streamResponses(method, stream, abort) { return __awaiter2(this, void 0, void 0, function* () { const messages = []; if (this.data.response === void 0) { @@ -96865,31 +96865,31 @@ var require_test_transport = __commonJS({ try { yield delay2(this.responseDelay, abort)(void 0); } catch (error3) { - stream2.notifyError(error3); + stream.notifyError(error3); return; } if (this.data.response instanceof rpc_error_1.RpcError) { - stream2.notifyError(this.data.response); + stream.notifyError(this.data.response); return; } for (let msg of messages) { - stream2.notifyMessage(msg); + stream.notifyMessage(msg); try { yield delay2(this.betweenResponseDelay, abort)(void 0); } catch (error3) { - stream2.notifyError(error3); + stream.notifyError(error3); return; } } if (this.data.status instanceof rpc_error_1.RpcError) { - stream2.notifyError(this.data.status); + stream.notifyError(this.data.status); return; } if (this.data.trailers instanceof rpc_error_1.RpcError) { - stream2.notifyError(this.data.trailers); + stream.notifyError(this.data.trailers); return; } - stream2.notifyComplete(); + stream.notifyComplete(); }); } // Creates a promise for response status from the mock data. @@ -98223,7 +98223,7 @@ var require_tar = __commonJS({ var exec_1 = require_exec(); var io7 = __importStar2(require_io()); var fs_1 = require("fs"); - var path17 = __importStar2(require("path")); + var path14 = __importStar2(require("path")); var utils = __importStar2(require_cacheUtils()); var constants_1 = require_constants12(); var IS_WINDOWS = process.platform === "win32"; @@ -98269,13 +98269,13 @@ var require_tar = __commonJS({ const BSD_TAR_ZSTD = tarPath.type === constants_1.ArchiveToolType.BSD && compressionMethod !== constants_1.CompressionMethod.Gzip && IS_WINDOWS; switch (type2) { case "create": - args.push("--posix", "-cf", BSD_TAR_ZSTD ? tarFile : cacheFileName.replace(new RegExp(`\\${path17.sep}`, "g"), "/"), "--exclude", BSD_TAR_ZSTD ? tarFile : cacheFileName.replace(new RegExp(`\\${path17.sep}`, "g"), "/"), "-P", "-C", workingDirectory.replace(new RegExp(`\\${path17.sep}`, "g"), "/"), "--files-from", constants_1.ManifestFilename); + args.push("--posix", "-cf", BSD_TAR_ZSTD ? tarFile : cacheFileName.replace(new RegExp(`\\${path14.sep}`, "g"), "/"), "--exclude", BSD_TAR_ZSTD ? tarFile : cacheFileName.replace(new RegExp(`\\${path14.sep}`, "g"), "/"), "-P", "-C", workingDirectory.replace(new RegExp(`\\${path14.sep}`, "g"), "/"), "--files-from", constants_1.ManifestFilename); break; case "extract": - args.push("-xf", BSD_TAR_ZSTD ? tarFile : archivePath.replace(new RegExp(`\\${path17.sep}`, "g"), "/"), "-P", "-C", workingDirectory.replace(new RegExp(`\\${path17.sep}`, "g"), "/")); + args.push("-xf", BSD_TAR_ZSTD ? tarFile : archivePath.replace(new RegExp(`\\${path14.sep}`, "g"), "/"), "-P", "-C", workingDirectory.replace(new RegExp(`\\${path14.sep}`, "g"), "/")); break; case "list": - args.push("-tf", BSD_TAR_ZSTD ? tarFile : archivePath.replace(new RegExp(`\\${path17.sep}`, "g"), "/"), "-P"); + args.push("-tf", BSD_TAR_ZSTD ? tarFile : archivePath.replace(new RegExp(`\\${path14.sep}`, "g"), "/"), "-P"); break; } if (tarPath.type === constants_1.ArchiveToolType.GNU) { @@ -98321,7 +98321,7 @@ var require_tar = __commonJS({ return BSD_TAR_ZSTD ? [ "zstd -d --long=30 --force -o", constants_1.TarFilename, - archivePath.replace(new RegExp(`\\${path17.sep}`, "g"), "/") + archivePath.replace(new RegExp(`\\${path14.sep}`, "g"), "/") ] : [ "--use-compress-program", IS_WINDOWS ? '"zstd -d --long=30"' : "unzstd --long=30" @@ -98330,7 +98330,7 @@ var require_tar = __commonJS({ return BSD_TAR_ZSTD ? [ "zstd -d --force -o", constants_1.TarFilename, - archivePath.replace(new RegExp(`\\${path17.sep}`, "g"), "/") + archivePath.replace(new RegExp(`\\${path14.sep}`, "g"), "/") ] : ["--use-compress-program", IS_WINDOWS ? '"zstd -d"' : "unzstd"]; default: return ["-z"]; @@ -98345,7 +98345,7 @@ var require_tar = __commonJS({ case constants_1.CompressionMethod.Zstd: return BSD_TAR_ZSTD ? [ "zstd -T0 --long=30 --force -o", - cacheFileName.replace(new RegExp(`\\${path17.sep}`, "g"), "/"), + cacheFileName.replace(new RegExp(`\\${path14.sep}`, "g"), "/"), constants_1.TarFilename ] : [ "--use-compress-program", @@ -98354,7 +98354,7 @@ var require_tar = __commonJS({ case constants_1.CompressionMethod.ZstdWithoutLong: return BSD_TAR_ZSTD ? [ "zstd -T0 --force -o", - cacheFileName.replace(new RegExp(`\\${path17.sep}`, "g"), "/"), + cacheFileName.replace(new RegExp(`\\${path14.sep}`, "g"), "/"), constants_1.TarFilename ] : ["--use-compress-program", IS_WINDOWS ? '"zstd -T0"' : "zstdmt"]; default: @@ -98392,7 +98392,7 @@ var require_tar = __commonJS({ } function createTar(archiveFolder, sourceDirectories, compressionMethod) { return __awaiter2(this, void 0, void 0, function* () { - (0, fs_1.writeFileSync)(path17.join(archiveFolder, constants_1.ManifestFilename), sourceDirectories.join("\n")); + (0, fs_1.writeFileSync)(path14.join(archiveFolder, constants_1.ManifestFilename), sourceDirectories.join("\n")); const commands = yield getCommands(compressionMethod, "create"); yield execCommands(commands, archiveFolder); }); @@ -98474,7 +98474,7 @@ var require_cache5 = __commonJS({ exports2.restoreCache = restoreCache4; exports2.saveCache = saveCache4; var core17 = __importStar2(require_core()); - var path17 = __importStar2(require("path")); + var path14 = __importStar2(require("path")); var utils = __importStar2(require_cacheUtils()); var cacheHttpClient = __importStar2(require_cacheHttpClient()); var cacheTwirpClient = __importStar2(require_cacheTwirpClient()); @@ -98569,7 +98569,7 @@ var require_cache5 = __commonJS({ core17.info("Lookup only - skipping download"); return cacheEntry.cacheKey; } - archivePath = path17.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod)); + archivePath = path14.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod)); core17.debug(`Archive Path: ${archivePath}`); yield cacheHttpClient.downloadCache(cacheEntry.archiveLocation, archivePath, options); if (core17.isDebug()) { @@ -98638,7 +98638,7 @@ var require_cache5 = __commonJS({ core17.info("Lookup only - skipping download"); return response.matchedKey; } - archivePath = path17.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod)); + archivePath = path14.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod)); core17.debug(`Archive path: ${archivePath}`); core17.debug(`Starting download of archive to: ${archivePath}`); yield cacheHttpClient.downloadCache(response.signedDownloadUrl, archivePath, options); @@ -98700,7 +98700,7 @@ var require_cache5 = __commonJS({ throw new Error(`Path Validation Error: Path(s) specified in the action for caching do(es) not exist, hence no cache is being saved.`); } const archiveFolder = yield utils.createTempDirectory(); - const archivePath = path17.join(archiveFolder, utils.getCacheFileName(compressionMethod)); + const archivePath = path14.join(archiveFolder, utils.getCacheFileName(compressionMethod)); core17.debug(`Archive Path: ${archivePath}`); try { yield (0, tar_1.createTar)(archiveFolder, cachePaths, compressionMethod); @@ -98764,7 +98764,7 @@ var require_cache5 = __commonJS({ throw new Error(`Path Validation Error: Path(s) specified in the action for caching do(es) not exist, hence no cache is being saved.`); } const archiveFolder = yield utils.createTempDirectory(); - const archivePath = path17.join(archiveFolder, utils.getCacheFileName(compressionMethod)); + const archivePath = path14.join(archiveFolder, utils.getCacheFileName(compressionMethod)); core17.debug(`Archive Path: ${archivePath}`); try { yield (0, tar_1.createTar)(archiveFolder, cachePaths, compressionMethod); @@ -98912,12 +98912,12 @@ var require_manifest = __commonJS({ exports2._readLinuxVersionFile = _readLinuxVersionFile; var semver9 = __importStar2(require_semver2()); var core_1 = require_core(); - var os4 = require("os"); + var os3 = require("os"); var cp = require("child_process"); - var fs18 = require("fs"); + var fs15 = require("fs"); function _findMatch(versionSpec, stable, candidates, archFilter) { return __awaiter2(this, void 0, void 0, function* () { - const platFilter = os4.platform(); + const platFilter = os3.platform(); let result; let match; let file; @@ -98953,7 +98953,7 @@ var require_manifest = __commonJS({ }); } function _getOsVersion() { - const plat = os4.platform(); + const plat = os3.platform(); let version = ""; if (plat === "darwin") { version = cp.execSync("sw_vers -productVersion").toString(); @@ -98976,10 +98976,10 @@ var require_manifest = __commonJS({ const lsbReleaseFile = "/etc/lsb-release"; const osReleaseFile = "/etc/os-release"; let contents = ""; - if (fs18.existsSync(lsbReleaseFile)) { - contents = fs18.readFileSync(lsbReleaseFile).toString(); - } else if (fs18.existsSync(osReleaseFile)) { - contents = fs18.readFileSync(osReleaseFile).toString(); + if (fs15.existsSync(lsbReleaseFile)) { + contents = fs15.readFileSync(lsbReleaseFile).toString(); + } else if (fs15.existsSync(osReleaseFile)) { + contents = fs15.readFileSync(osReleaseFile).toString(); } return contents; } @@ -99188,13 +99188,13 @@ var require_tool_cache = __commonJS({ var core17 = __importStar2(require_core()); var io7 = __importStar2(require_io()); var crypto2 = __importStar2(require("crypto")); - var fs18 = __importStar2(require("fs")); + var fs15 = __importStar2(require("fs")); var mm = __importStar2(require_manifest()); - var os4 = __importStar2(require("os")); - var path17 = __importStar2(require("path")); + var os3 = __importStar2(require("os")); + var path14 = __importStar2(require("path")); var httpm = __importStar2(require_lib()); var semver9 = __importStar2(require_semver2()); - var stream2 = __importStar2(require("stream")); + var stream = __importStar2(require("stream")); var util = __importStar2(require("util")); var assert_1 = require("assert"); var exec_1 = require_exec(); @@ -99212,8 +99212,8 @@ var require_tool_cache = __commonJS({ var userAgent2 = "actions/tool-cache"; function downloadTool2(url2, dest, auth2, headers) { return __awaiter2(this, void 0, void 0, function* () { - dest = dest || path17.join(_getTempDirectory(), crypto2.randomUUID()); - yield io7.mkdirP(path17.dirname(dest)); + dest = dest || path14.join(_getTempDirectory(), crypto2.randomUUID()); + yield io7.mkdirP(path14.dirname(dest)); core17.debug(`Downloading ${url2}`); core17.debug(`Destination ${dest}`); const maxAttempts = 3; @@ -99234,7 +99234,7 @@ var require_tool_cache = __commonJS({ } function downloadToolAttempt(url2, dest, auth2, headers) { return __awaiter2(this, void 0, void 0, function* () { - if (fs18.existsSync(dest)) { + if (fs15.existsSync(dest)) { throw new Error(`Destination file path ${dest} already exists`); } const http = new httpm.HttpClient(userAgent2, [], { @@ -99253,12 +99253,12 @@ var require_tool_cache = __commonJS({ core17.debug(`Failed to download from "${url2}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`); throw err; } - const pipeline = util.promisify(stream2.pipeline); + 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, fs18.createWriteStream(dest)); + yield pipeline(readStream, fs15.createWriteStream(dest)); core17.debug("download complete"); succeeded = true; return dest; @@ -99303,7 +99303,7 @@ var require_tool_cache = __commonJS({ process.chdir(originalCwd); } } else { - const escapedScript = path17.join(__dirname, "..", "scripts", "Invoke-7zdec.ps1").replace(/'/g, "''").replace(/"|\n|\r/g, ""); + const escapedScript = path14.join(__dirname, "..", "scripts", "Invoke-7zdec.ps1").replace(/'/g, "''").replace(/"|\n|\r/g, ""); 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}'`; @@ -99464,61 +99464,61 @@ var require_tool_cache = __commonJS({ yield (0, exec_1.exec)(`"${unzipPath}"`, args, { cwd: dest }); }); } - function cacheDir(sourceDir, tool, version, arch2) { + function cacheDir(sourceDir, tool, version, arch) { return __awaiter2(this, void 0, void 0, function* () { version = semver9.clean(version) || version; - arch2 = arch2 || os4.arch(); - core17.debug(`Caching tool ${tool} ${version} ${arch2}`); + arch = arch || os3.arch(); + core17.debug(`Caching tool ${tool} ${version} ${arch}`); core17.debug(`source dir: ${sourceDir}`); - if (!fs18.statSync(sourceDir).isDirectory()) { + if (!fs15.statSync(sourceDir).isDirectory()) { throw new Error("sourceDir is not a directory"); } - const destPath = yield _createToolPath(tool, version, arch2); - for (const itemName of fs18.readdirSync(sourceDir)) { - const s = path17.join(sourceDir, itemName); + const destPath = yield _createToolPath(tool, version, arch); + for (const itemName of fs15.readdirSync(sourceDir)) { + const s = path14.join(sourceDir, itemName); yield io7.cp(s, destPath, { recursive: true }); } - _completeToolPath(tool, version, arch2); + _completeToolPath(tool, version, arch); return destPath; }); } - function cacheFile(sourceFile, targetFile, tool, version, arch2) { + function cacheFile(sourceFile, targetFile, tool, version, arch) { return __awaiter2(this, void 0, void 0, function* () { version = semver9.clean(version) || version; - arch2 = arch2 || os4.arch(); - core17.debug(`Caching tool ${tool} ${version} ${arch2}`); + arch = arch || os3.arch(); + core17.debug(`Caching tool ${tool} ${version} ${arch}`); core17.debug(`source file: ${sourceFile}`); - if (!fs18.statSync(sourceFile).isFile()) { + if (!fs15.statSync(sourceFile).isFile()) { throw new Error("sourceFile is not a file"); } - const destFolder = yield _createToolPath(tool, version, arch2); - const destPath = path17.join(destFolder, targetFile); + const destFolder = yield _createToolPath(tool, version, arch); + const destPath = path14.join(destFolder, targetFile); core17.debug(`destination file ${destPath}`); yield io7.cp(sourceFile, destPath); - _completeToolPath(tool, version, arch2); + _completeToolPath(tool, version, arch); return destFolder; }); } - function find2(toolName, versionSpec, arch2) { + function find2(toolName, versionSpec, arch) { if (!toolName) { throw new Error("toolName parameter is required"); } if (!versionSpec) { throw new Error("versionSpec parameter is required"); } - arch2 = arch2 || os4.arch(); + arch = arch || os3.arch(); if (!isExplicitVersion(versionSpec)) { - const localVersions = findAllVersions2(toolName, arch2); + const localVersions = findAllVersions2(toolName, arch); const match = evaluateVersions(localVersions, versionSpec); versionSpec = match; } let toolPath = ""; if (versionSpec) { versionSpec = semver9.clean(versionSpec) || ""; - const cachePath = path17.join(_getCacheDirectory(), toolName, versionSpec, arch2); + const cachePath = path14.join(_getCacheDirectory(), toolName, versionSpec, arch); core17.debug(`checking cache: ${cachePath}`); - if (fs18.existsSync(cachePath) && fs18.existsSync(`${cachePath}.complete`)) { - core17.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch2}`); + if (fs15.existsSync(cachePath) && fs15.existsSync(`${cachePath}.complete`)) { + core17.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch}`); toolPath = cachePath; } else { core17.debug("not found"); @@ -99526,16 +99526,16 @@ var require_tool_cache = __commonJS({ } return toolPath; } - function findAllVersions2(toolName, arch2) { + function findAllVersions2(toolName, arch) { const versions = []; - arch2 = arch2 || os4.arch(); - const toolPath = path17.join(_getCacheDirectory(), toolName); - if (fs18.existsSync(toolPath)) { - const children = fs18.readdirSync(toolPath); + arch = arch || os3.arch(); + const toolPath = path14.join(_getCacheDirectory(), toolName); + if (fs15.existsSync(toolPath)) { + const children = fs15.readdirSync(toolPath); for (const child of children) { if (isExplicitVersion(child)) { - const fullPath = path17.join(toolPath, child, arch2 || ""); - if (fs18.existsSync(fullPath) && fs18.existsSync(`${fullPath}.complete`)) { + const fullPath = path14.join(toolPath, child, arch || ""); + if (fs15.existsSync(fullPath) && fs15.existsSync(`${fullPath}.complete`)) { versions.push(child); } } @@ -99578,7 +99578,7 @@ var require_tool_cache = __commonJS({ }); } function findFromManifest(versionSpec_1, stable_1, manifest_1) { - return __awaiter2(this, arguments, void 0, function* (versionSpec, stable, manifest, archFilter = os4.arch()) { + return __awaiter2(this, arguments, void 0, function* (versionSpec, stable, manifest, archFilter = os3.arch()) { const match = yield mm._findMatch(versionSpec, stable, manifest, archFilter); return match; }); @@ -99586,15 +99586,15 @@ var require_tool_cache = __commonJS({ function _createExtractFolder(dest) { return __awaiter2(this, void 0, void 0, function* () { if (!dest) { - dest = path17.join(_getTempDirectory(), crypto2.randomUUID()); + dest = path14.join(_getTempDirectory(), crypto2.randomUUID()); } yield io7.mkdirP(dest); return dest; }); } - function _createToolPath(tool, version, arch2) { + function _createToolPath(tool, version, arch) { return __awaiter2(this, void 0, void 0, function* () { - const folderPath = path17.join(_getCacheDirectory(), tool, semver9.clean(version) || version, arch2 || ""); + const folderPath = path14.join(_getCacheDirectory(), tool, semver9.clean(version) || version, arch || ""); core17.debug(`destination ${folderPath}`); const markerPath = `${folderPath}.complete`; yield io7.rmRF(folderPath); @@ -99603,10 +99603,10 @@ var require_tool_cache = __commonJS({ return folderPath; }); } - function _completeToolPath(tool, version, arch2) { - const folderPath = path17.join(_getCacheDirectory(), tool, semver9.clean(version) || version, arch2 || ""); + function _completeToolPath(tool, version, arch) { + const folderPath = path14.join(_getCacheDirectory(), tool, semver9.clean(version) || version, arch || ""); const markerPath = `${folderPath}.complete`; - fs18.writeFileSync(markerPath, ""); + fs15.writeFileSync(markerPath, ""); core17.debug("finished caching tool"); } function isExplicitVersion(versionSpec) { @@ -102386,13 +102386,13 @@ These characters are not allowed in the artifact name due to limitations with ce (0, core_1.info)(`Artifact name is valid!`); } exports2.validateArtifactName = validateArtifactName; - function validateFilePath(path17) { - if (!path17) { + function validateFilePath(path14) { + if (!path14) { throw new Error(`Provided file path input during validation is empty`); } for (const [invalidCharacterKey, errorMessageForCharacter] of invalidArtifactFilePathCharacters) { - if (path17.includes(invalidCharacterKey)) { - throw new Error(`The path for one of the files in artifact is not valid: ${path17}. Contains the following character: ${errorMessageForCharacter} + if (path14.includes(invalidCharacterKey)) { + throw new Error(`The path for one of the files in artifact is not valid: ${path14}. Contains the following character: ${errorMessageForCharacter} Invalid characters include: ${Array.from(invalidArtifactFilePathCharacters.values()).toString()} @@ -102937,15 +102937,15 @@ var require_upload_zip_specification = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getUploadZipSpecification = exports2.validateRootDirectory = void 0; - var fs18 = __importStar2(require("fs")); + var fs15 = __importStar2(require("fs")); var core_1 = require_core(); var path_1 = require("path"); var path_and_artifact_name_validation_1 = require_path_and_artifact_name_validation(); function validateRootDirectory(rootDirectory) { - if (!fs18.existsSync(rootDirectory)) { + if (!fs15.existsSync(rootDirectory)) { throw new Error(`The provided rootDirectory ${rootDirectory} does not exist`); } - if (!fs18.statSync(rootDirectory).isDirectory()) { + if (!fs15.statSync(rootDirectory).isDirectory()) { throw new Error(`The provided rootDirectory ${rootDirectory} is not a valid directory`); } (0, core_1.info)(`Root directory input is valid!`); @@ -102956,7 +102956,7 @@ var require_upload_zip_specification = __commonJS({ rootDirectory = (0, path_1.normalize)(rootDirectory); rootDirectory = (0, path_1.resolve)(rootDirectory); for (let file of filesToZip) { - const stats = fs18.lstatSync(file, { throwIfNoEntry: false }); + const stats = fs15.lstatSync(file, { throwIfNoEntry: false }); if (!stats) { throw new Error(`File ${file} does not exist`); } @@ -103053,7 +103053,7 @@ var require_blob_upload = __commonJS({ var config_1 = require_config2(); var core17 = __importStar2(require_core()); var crypto2 = __importStar2(require("crypto")); - var stream2 = __importStar2(require("stream")); + var stream = __importStar2(require("stream")); var errors_1 = require_errors4(); function uploadZipToBlobStorage(authenticatedUploadURL, zipUploadStream) { return __awaiter2(this, void 0, void 0, function* () { @@ -103089,7 +103089,7 @@ var require_blob_upload = __commonJS({ abortSignal: abortController.signal }; let sha256Hash = void 0; - const uploadStream = new stream2.PassThrough(); + const uploadStream = new stream.PassThrough(); const hashStream = crypto2.createHash("sha256"); zipUploadStream.pipe(uploadStream); zipUploadStream.pipe(hashStream).setEncoding("hex"); @@ -103293,8 +103293,8 @@ var require_minimatch2 = __commonJS({ return new Minimatch(pattern, options).match(p); }; module2.exports = minimatch; - var path17 = require_path(); - minimatch.sep = path17.sep; + var path14 = require_path(); + minimatch.sep = path14.sep; var GLOBSTAR = /* @__PURE__ */ Symbol("globstar **"); minimatch.GLOBSTAR = GLOBSTAR; var expand2 = require_brace_expansion2(); @@ -103803,8 +103803,8 @@ var require_minimatch2 = __commonJS({ if (this.empty) return f === ""; if (f === "/" && partial) return true; const options = this.options; - if (path17.sep !== "/") { - f = f.split(path17.sep).join("/"); + if (path14.sep !== "/") { + f = f.split(path14.sep).join("/"); } f = f.split(slashSplit); this.debug(this.pattern, "split", f); @@ -103842,13 +103842,13 @@ var require_minimatch2 = __commonJS({ var require_readdir_glob = __commonJS({ "node_modules/readdir-glob/index.js"(exports2, module2) { module2.exports = readdirGlob; - var fs18 = require("fs"); + var fs15 = require("fs"); var { EventEmitter } = require("events"); var { Minimatch } = require_minimatch2(); var { resolve: resolve8 } = require("path"); function readdir(dir, strict) { return new Promise((resolve9, reject) => { - fs18.readdir(dir, { withFileTypes: true }, (err, files) => { + fs15.readdir(dir, { withFileTypes: true }, (err, files) => { if (err) { switch (err.code) { case "ENOTDIR": @@ -103881,7 +103881,7 @@ var require_readdir_glob = __commonJS({ } function stat(file, followSymlinks) { return new Promise((resolve9, reject) => { - const statFunc = followSymlinks ? fs18.stat : fs18.lstat; + const statFunc = followSymlinks ? fs15.stat : fs15.lstat; statFunc(file, (err, stats) => { if (err) { switch (err.code) { @@ -103902,8 +103902,8 @@ var require_readdir_glob = __commonJS({ }); }); } - async function* exploreWalkAsync(dir, path17, followSymlinks, useStat, shouldSkip, strict) { - let files = await readdir(path17 + dir, strict); + async function* exploreWalkAsync(dir, path14, followSymlinks, useStat, shouldSkip, strict) { + let files = await readdir(path14 + dir, strict); for (const file of files) { let name = file.name; if (name === void 0) { @@ -103912,7 +103912,7 @@ var require_readdir_glob = __commonJS({ } const filename = dir + "/" + name; const relative2 = filename.slice(1); - const absolute = path17 + "/" + relative2; + const absolute = path14 + "/" + relative2; let stats = null; if (useStat || followSymlinks) { stats = await stat(absolute, followSymlinks); @@ -103926,15 +103926,15 @@ var require_readdir_glob = __commonJS({ if (stats.isDirectory()) { if (!shouldSkip(relative2)) { yield { relative: relative2, absolute, stats }; - yield* exploreWalkAsync(filename, path17, followSymlinks, useStat, shouldSkip, false); + yield* exploreWalkAsync(filename, path14, followSymlinks, useStat, shouldSkip, false); } } else { yield { relative: relative2, absolute, stats }; } } } - async function* explore(path17, followSymlinks, useStat, shouldSkip) { - yield* exploreWalkAsync("", path17, followSymlinks, useStat, shouldSkip, true); + async function* explore(path14, followSymlinks, useStat, shouldSkip) { + yield* exploreWalkAsync("", path14, followSymlinks, useStat, shouldSkip, true); } function readOptions(options) { return { @@ -105946,54 +105946,54 @@ var require_polyfills = __commonJS({ } var chdir; module2.exports = patch; - function patch(fs18) { + function patch(fs15) { if (constants.hasOwnProperty("O_SYMLINK") && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) { - patchLchmod(fs18); + patchLchmod(fs15); } - if (!fs18.lutimes) { - patchLutimes(fs18); + if (!fs15.lutimes) { + patchLutimes(fs15); } - fs18.chown = chownFix(fs18.chown); - fs18.fchown = chownFix(fs18.fchown); - fs18.lchown = chownFix(fs18.lchown); - fs18.chmod = chmodFix(fs18.chmod); - fs18.fchmod = chmodFix(fs18.fchmod); - fs18.lchmod = chmodFix(fs18.lchmod); - fs18.chownSync = chownFixSync(fs18.chownSync); - fs18.fchownSync = chownFixSync(fs18.fchownSync); - fs18.lchownSync = chownFixSync(fs18.lchownSync); - fs18.chmodSync = chmodFixSync(fs18.chmodSync); - fs18.fchmodSync = chmodFixSync(fs18.fchmodSync); - fs18.lchmodSync = chmodFixSync(fs18.lchmodSync); - fs18.stat = statFix(fs18.stat); - fs18.fstat = statFix(fs18.fstat); - fs18.lstat = statFix(fs18.lstat); - fs18.statSync = statFixSync(fs18.statSync); - fs18.fstatSync = statFixSync(fs18.fstatSync); - fs18.lstatSync = statFixSync(fs18.lstatSync); - if (fs18.chmod && !fs18.lchmod) { - fs18.lchmod = function(path17, mode, cb) { + fs15.chown = chownFix(fs15.chown); + fs15.fchown = chownFix(fs15.fchown); + fs15.lchown = chownFix(fs15.lchown); + fs15.chmod = chmodFix(fs15.chmod); + fs15.fchmod = chmodFix(fs15.fchmod); + fs15.lchmod = chmodFix(fs15.lchmod); + fs15.chownSync = chownFixSync(fs15.chownSync); + fs15.fchownSync = chownFixSync(fs15.fchownSync); + fs15.lchownSync = chownFixSync(fs15.lchownSync); + fs15.chmodSync = chmodFixSync(fs15.chmodSync); + fs15.fchmodSync = chmodFixSync(fs15.fchmodSync); + fs15.lchmodSync = chmodFixSync(fs15.lchmodSync); + fs15.stat = statFix(fs15.stat); + fs15.fstat = statFix(fs15.fstat); + fs15.lstat = statFix(fs15.lstat); + fs15.statSync = statFixSync(fs15.statSync); + fs15.fstatSync = statFixSync(fs15.fstatSync); + fs15.lstatSync = statFixSync(fs15.lstatSync); + if (fs15.chmod && !fs15.lchmod) { + fs15.lchmod = function(path14, mode, cb) { if (cb) process.nextTick(cb); }; - fs18.lchmodSync = function() { + fs15.lchmodSync = function() { }; } - if (fs18.chown && !fs18.lchown) { - fs18.lchown = function(path17, uid, gid, cb) { + if (fs15.chown && !fs15.lchown) { + fs15.lchown = function(path14, uid, gid, cb) { if (cb) process.nextTick(cb); }; - fs18.lchownSync = function() { + fs15.lchownSync = function() { }; } if (platform === "win32") { - fs18.rename = typeof fs18.rename !== "function" ? fs18.rename : (function(fs$rename) { + fs15.rename = typeof fs15.rename !== "function" ? fs15.rename : (function(fs$rename) { function rename(from, to, cb) { var start = Date.now(); var backoff = 0; fs$rename(from, to, function CB(er) { if (er && (er.code === "EACCES" || er.code === "EPERM") && Date.now() - start < 6e4) { setTimeout(function() { - fs18.stat(to, function(stater, st) { + fs15.stat(to, function(stater, st) { if (stater && stater.code === "ENOENT") fs$rename(from, to, CB); else @@ -106009,9 +106009,9 @@ var require_polyfills = __commonJS({ } if (Object.setPrototypeOf) Object.setPrototypeOf(rename, fs$rename); return rename; - })(fs18.rename); + })(fs15.rename); } - fs18.read = typeof fs18.read !== "function" ? fs18.read : (function(fs$read) { + fs15.read = typeof fs15.read !== "function" ? fs15.read : (function(fs$read) { function read(fd, buffer, offset, length, position, callback_) { var callback; if (callback_ && typeof callback_ === "function") { @@ -106019,22 +106019,22 @@ var require_polyfills = __commonJS({ callback = function(er, _2, __) { if (er && er.code === "EAGAIN" && eagCounter < 10) { eagCounter++; - return fs$read.call(fs18, fd, buffer, offset, length, position, callback); + return fs$read.call(fs15, fd, buffer, offset, length, position, callback); } callback_.apply(this, arguments); }; } - return fs$read.call(fs18, fd, buffer, offset, length, position, callback); + return fs$read.call(fs15, fd, buffer, offset, length, position, callback); } if (Object.setPrototypeOf) Object.setPrototypeOf(read, fs$read); return read; - })(fs18.read); - fs18.readSync = typeof fs18.readSync !== "function" ? fs18.readSync : /* @__PURE__ */ (function(fs$readSync) { + })(fs15.read); + fs15.readSync = typeof fs15.readSync !== "function" ? fs15.readSync : /* @__PURE__ */ (function(fs$readSync) { return function(fd, buffer, offset, length, position) { var eagCounter = 0; while (true) { try { - return fs$readSync.call(fs18, fd, buffer, offset, length, position); + return fs$readSync.call(fs15, fd, buffer, offset, length, position); } catch (er) { if (er.code === "EAGAIN" && eagCounter < 10) { eagCounter++; @@ -106044,11 +106044,11 @@ var require_polyfills = __commonJS({ } } }; - })(fs18.readSync); - function patchLchmod(fs19) { - fs19.lchmod = function(path17, mode, callback) { - fs19.open( - path17, + })(fs15.readSync); + function patchLchmod(fs16) { + fs16.lchmod = function(path14, mode, callback) { + fs16.open( + path14, constants.O_WRONLY | constants.O_SYMLINK, mode, function(err, fd) { @@ -106056,80 +106056,80 @@ var require_polyfills = __commonJS({ if (callback) callback(err); return; } - fs19.fchmod(fd, mode, function(err2) { - fs19.close(fd, function(err22) { + fs16.fchmod(fd, mode, function(err2) { + fs16.close(fd, function(err22) { if (callback) callback(err2 || err22); }); }); } ); }; - fs19.lchmodSync = function(path17, mode) { - var fd = fs19.openSync(path17, constants.O_WRONLY | constants.O_SYMLINK, mode); + fs16.lchmodSync = function(path14, mode) { + var fd = fs16.openSync(path14, constants.O_WRONLY | constants.O_SYMLINK, mode); var threw = true; var ret; try { - ret = fs19.fchmodSync(fd, mode); + ret = fs16.fchmodSync(fd, mode); threw = false; } finally { if (threw) { try { - fs19.closeSync(fd); + fs16.closeSync(fd); } catch (er) { } } else { - fs19.closeSync(fd); + fs16.closeSync(fd); } } return ret; }; } - function patchLutimes(fs19) { - if (constants.hasOwnProperty("O_SYMLINK") && fs19.futimes) { - fs19.lutimes = function(path17, at, mt, cb) { - fs19.open(path17, constants.O_SYMLINK, function(er, fd) { + function patchLutimes(fs16) { + if (constants.hasOwnProperty("O_SYMLINK") && fs16.futimes) { + fs16.lutimes = function(path14, at, mt, cb) { + fs16.open(path14, constants.O_SYMLINK, function(er, fd) { if (er) { if (cb) cb(er); return; } - fs19.futimes(fd, at, mt, function(er2) { - fs19.close(fd, function(er22) { + fs16.futimes(fd, at, mt, function(er2) { + fs16.close(fd, function(er22) { if (cb) cb(er2 || er22); }); }); }); }; - fs19.lutimesSync = function(path17, at, mt) { - var fd = fs19.openSync(path17, constants.O_SYMLINK); + fs16.lutimesSync = function(path14, at, mt) { + var fd = fs16.openSync(path14, constants.O_SYMLINK); var ret; var threw = true; try { - ret = fs19.futimesSync(fd, at, mt); + ret = fs16.futimesSync(fd, at, mt); threw = false; } finally { if (threw) { try { - fs19.closeSync(fd); + fs16.closeSync(fd); } catch (er) { } } else { - fs19.closeSync(fd); + fs16.closeSync(fd); } } return ret; }; - } else if (fs19.futimes) { - fs19.lutimes = function(_a, _b, _c, cb) { + } else if (fs16.futimes) { + fs16.lutimes = function(_a, _b, _c, cb) { if (cb) process.nextTick(cb); }; - fs19.lutimesSync = function() { + fs16.lutimesSync = function() { }; } } function chmodFix(orig) { if (!orig) return orig; return function(target, mode, cb) { - return orig.call(fs18, target, mode, function(er) { + return orig.call(fs15, target, mode, function(er) { if (chownErOk(er)) er = null; if (cb) cb.apply(this, arguments); }); @@ -106139,7 +106139,7 @@ var require_polyfills = __commonJS({ if (!orig) return orig; return function(target, mode) { try { - return orig.call(fs18, target, mode); + return orig.call(fs15, target, mode); } catch (er) { if (!chownErOk(er)) throw er; } @@ -106148,7 +106148,7 @@ var require_polyfills = __commonJS({ function chownFix(orig) { if (!orig) return orig; return function(target, uid, gid, cb) { - return orig.call(fs18, target, uid, gid, function(er) { + return orig.call(fs15, target, uid, gid, function(er) { if (chownErOk(er)) er = null; if (cb) cb.apply(this, arguments); }); @@ -106158,7 +106158,7 @@ var require_polyfills = __commonJS({ if (!orig) return orig; return function(target, uid, gid) { try { - return orig.call(fs18, target, uid, gid); + return orig.call(fs15, target, uid, gid); } catch (er) { if (!chownErOk(er)) throw er; } @@ -106178,13 +106178,13 @@ var require_polyfills = __commonJS({ } if (cb) cb.apply(this, arguments); } - return options ? orig.call(fs18, target, options, callback) : orig.call(fs18, target, callback); + return options ? orig.call(fs15, target, options, callback) : orig.call(fs15, target, callback); }; } function statFixSync(orig) { if (!orig) return orig; return function(target, options) { - var stats = options ? orig.call(fs18, target, options) : orig.call(fs18, target); + var stats = options ? orig.call(fs15, target, options) : orig.call(fs15, target); if (stats) { if (stats.uid < 0) stats.uid += 4294967296; if (stats.gid < 0) stats.gid += 4294967296; @@ -106213,16 +106213,16 @@ var require_legacy_streams = __commonJS({ "node_modules/graceful-fs/legacy-streams.js"(exports2, module2) { var Stream = require("stream").Stream; module2.exports = legacy; - function legacy(fs18) { + function legacy(fs15) { return { ReadStream, WriteStream }; - function ReadStream(path17, options) { - if (!(this instanceof ReadStream)) return new ReadStream(path17, options); + function ReadStream(path14, options) { + if (!(this instanceof ReadStream)) return new ReadStream(path14, options); Stream.call(this); var self2 = this; - this.path = path17; + this.path = path14; this.fd = null; this.readable = true; this.paused = false; @@ -106256,7 +106256,7 @@ var require_legacy_streams = __commonJS({ }); return; } - fs18.open(this.path, this.flags, this.mode, function(err, fd) { + fs15.open(this.path, this.flags, this.mode, function(err, fd) { if (err) { self2.emit("error", err); self2.readable = false; @@ -106267,10 +106267,10 @@ var require_legacy_streams = __commonJS({ self2._read(); }); } - function WriteStream(path17, options) { - if (!(this instanceof WriteStream)) return new WriteStream(path17, options); + function WriteStream(path14, options) { + if (!(this instanceof WriteStream)) return new WriteStream(path14, options); Stream.call(this); - this.path = path17; + this.path = path14; this.fd = null; this.writable = true; this.flags = "w"; @@ -106295,7 +106295,7 @@ var require_legacy_streams = __commonJS({ this.busy = false; this._queue = []; if (this.fd === null) { - this._open = fs18.open; + this._open = fs15.open; this._queue.push([this._open, this.path, this.flags, this.mode, void 0]); this.flush(); } @@ -106330,7 +106330,7 @@ var require_clone = __commonJS({ // node_modules/graceful-fs/graceful-fs.js var require_graceful_fs = __commonJS({ "node_modules/graceful-fs/graceful-fs.js"(exports2, module2) { - var fs18 = require("fs"); + var fs15 = require("fs"); var polyfills = require_polyfills(); var legacy = require_legacy_streams(); var clone = require_clone(); @@ -106362,12 +106362,12 @@ var require_graceful_fs = __commonJS({ m = "GFS4: " + m.split(/\n/).join("\nGFS4: "); console.error(m); }; - if (!fs18[gracefulQueue]) { + if (!fs15[gracefulQueue]) { queue = global[gracefulQueue] || []; - publishQueue(fs18, queue); - fs18.close = (function(fs$close) { + publishQueue(fs15, queue); + fs15.close = (function(fs$close) { function close(fd, cb) { - return fs$close.call(fs18, fd, function(err) { + return fs$close.call(fs15, fd, function(err) { if (!err) { resetQueue(); } @@ -106379,48 +106379,48 @@ var require_graceful_fs = __commonJS({ value: fs$close }); return close; - })(fs18.close); - fs18.closeSync = (function(fs$closeSync) { + })(fs15.close); + fs15.closeSync = (function(fs$closeSync) { function closeSync(fd) { - fs$closeSync.apply(fs18, arguments); + fs$closeSync.apply(fs15, arguments); resetQueue(); } Object.defineProperty(closeSync, previousSymbol, { value: fs$closeSync }); return closeSync; - })(fs18.closeSync); + })(fs15.closeSync); if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) { process.on("exit", function() { - debug5(fs18[gracefulQueue]); - require("assert").equal(fs18[gracefulQueue].length, 0); + debug5(fs15[gracefulQueue]); + require("assert").equal(fs15[gracefulQueue].length, 0); }); } } var queue; if (!global[gracefulQueue]) { - publishQueue(global, fs18[gracefulQueue]); + publishQueue(global, fs15[gracefulQueue]); } - module2.exports = patch(clone(fs18)); - if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs18.__patched) { - module2.exports = patch(fs18); - fs18.__patched = true; + module2.exports = patch(clone(fs15)); + if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs15.__patched) { + module2.exports = patch(fs15); + fs15.__patched = true; } - function patch(fs19) { - polyfills(fs19); - fs19.gracefulify = patch; - fs19.createReadStream = createReadStream2; - fs19.createWriteStream = createWriteStream3; - var fs$readFile = fs19.readFile; - fs19.readFile = readFile; - function readFile(path17, options, cb) { + function patch(fs16) { + polyfills(fs16); + fs16.gracefulify = patch; + fs16.createReadStream = createReadStream2; + fs16.createWriteStream = createWriteStream3; + var fs$readFile = fs16.readFile; + fs16.readFile = readFile; + function readFile(path14, options, cb) { if (typeof options === "function") cb = options, options = null; - return go$readFile(path17, options, cb); - function go$readFile(path18, options2, cb2, startTime) { - return fs$readFile(path18, options2, function(err) { + return go$readFile(path14, options, cb); + function go$readFile(path15, options2, cb2, startTime) { + return fs$readFile(path15, options2, function(err) { if (err && (err.code === "EMFILE" || err.code === "ENFILE")) - enqueue([go$readFile, [path18, options2, cb2], err, startTime || Date.now(), Date.now()]); + enqueue([go$readFile, [path15, options2, cb2], err, startTime || Date.now(), Date.now()]); else { if (typeof cb2 === "function") cb2.apply(this, arguments); @@ -106428,16 +106428,16 @@ var require_graceful_fs = __commonJS({ }); } } - var fs$writeFile = fs19.writeFile; - fs19.writeFile = writeFile; - function writeFile(path17, data, options, cb) { + var fs$writeFile = fs16.writeFile; + fs16.writeFile = writeFile; + function writeFile(path14, data, options, cb) { if (typeof options === "function") cb = options, options = null; - return go$writeFile(path17, data, options, cb); - function go$writeFile(path18, data2, options2, cb2, startTime) { - return fs$writeFile(path18, data2, options2, function(err) { + return go$writeFile(path14, data, options, cb); + function go$writeFile(path15, data2, options2, cb2, startTime) { + return fs$writeFile(path15, data2, options2, function(err) { if (err && (err.code === "EMFILE" || err.code === "ENFILE")) - enqueue([go$writeFile, [path18, data2, options2, cb2], err, startTime || Date.now(), Date.now()]); + enqueue([go$writeFile, [path15, data2, options2, cb2], err, startTime || Date.now(), Date.now()]); else { if (typeof cb2 === "function") cb2.apply(this, arguments); @@ -106445,17 +106445,17 @@ var require_graceful_fs = __commonJS({ }); } } - var fs$appendFile = fs19.appendFile; + var fs$appendFile = fs16.appendFile; if (fs$appendFile) - fs19.appendFile = appendFile; - function appendFile(path17, data, options, cb) { + fs16.appendFile = appendFile; + function appendFile(path14, data, options, cb) { if (typeof options === "function") cb = options, options = null; - return go$appendFile(path17, data, options, cb); - function go$appendFile(path18, data2, options2, cb2, startTime) { - return fs$appendFile(path18, data2, options2, function(err) { + return go$appendFile(path14, data, options, cb); + function go$appendFile(path15, data2, options2, cb2, startTime) { + return fs$appendFile(path15, data2, options2, function(err) { if (err && (err.code === "EMFILE" || err.code === "ENFILE")) - enqueue([go$appendFile, [path18, data2, options2, cb2], err, startTime || Date.now(), Date.now()]); + enqueue([go$appendFile, [path15, data2, options2, cb2], err, startTime || Date.now(), Date.now()]); else { if (typeof cb2 === "function") cb2.apply(this, arguments); @@ -106463,9 +106463,9 @@ var require_graceful_fs = __commonJS({ }); } } - var fs$copyFile = fs19.copyFile; + var fs$copyFile = fs16.copyFile; if (fs$copyFile) - fs19.copyFile = copyFile2; + fs16.copyFile = copyFile2; function copyFile2(src, dest, flags, cb) { if (typeof flags === "function") { cb = flags; @@ -106483,34 +106483,34 @@ var require_graceful_fs = __commonJS({ }); } } - var fs$readdir = fs19.readdir; - fs19.readdir = readdir; + var fs$readdir = fs16.readdir; + fs16.readdir = readdir; var noReaddirOptionVersions = /^v[0-5]\./; - function readdir(path17, options, cb) { + function readdir(path14, options, cb) { if (typeof options === "function") cb = options, options = null; - var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(path18, options2, cb2, startTime) { - return fs$readdir(path18, fs$readdirCallback( - path18, + var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(path15, options2, cb2, startTime) { + return fs$readdir(path15, fs$readdirCallback( + path15, options2, cb2, startTime )); - } : function go$readdir2(path18, options2, cb2, startTime) { - return fs$readdir(path18, options2, fs$readdirCallback( - path18, + } : function go$readdir2(path15, options2, cb2, startTime) { + return fs$readdir(path15, options2, fs$readdirCallback( + path15, options2, cb2, startTime )); }; - return go$readdir(path17, options, cb); - function fs$readdirCallback(path18, options2, cb2, startTime) { + return go$readdir(path14, options, cb); + function fs$readdirCallback(path15, options2, cb2, startTime) { return function(err, files) { if (err && (err.code === "EMFILE" || err.code === "ENFILE")) enqueue([ go$readdir, - [path18, options2, cb2], + [path15, options2, cb2], err, startTime || Date.now(), Date.now() @@ -106525,21 +106525,21 @@ var require_graceful_fs = __commonJS({ } } if (process.version.substr(0, 4) === "v0.8") { - var legStreams = legacy(fs19); + var legStreams = legacy(fs16); ReadStream = legStreams.ReadStream; WriteStream = legStreams.WriteStream; } - var fs$ReadStream = fs19.ReadStream; + var fs$ReadStream = fs16.ReadStream; if (fs$ReadStream) { ReadStream.prototype = Object.create(fs$ReadStream.prototype); ReadStream.prototype.open = ReadStream$open; } - var fs$WriteStream = fs19.WriteStream; + var fs$WriteStream = fs16.WriteStream; if (fs$WriteStream) { WriteStream.prototype = Object.create(fs$WriteStream.prototype); WriteStream.prototype.open = WriteStream$open; } - Object.defineProperty(fs19, "ReadStream", { + Object.defineProperty(fs16, "ReadStream", { get: function() { return ReadStream; }, @@ -106549,7 +106549,7 @@ var require_graceful_fs = __commonJS({ enumerable: true, configurable: true }); - Object.defineProperty(fs19, "WriteStream", { + Object.defineProperty(fs16, "WriteStream", { get: function() { return WriteStream; }, @@ -106560,7 +106560,7 @@ var require_graceful_fs = __commonJS({ configurable: true }); var FileReadStream = ReadStream; - Object.defineProperty(fs19, "FileReadStream", { + Object.defineProperty(fs16, "FileReadStream", { get: function() { return FileReadStream; }, @@ -106571,7 +106571,7 @@ var require_graceful_fs = __commonJS({ configurable: true }); var FileWriteStream = WriteStream; - Object.defineProperty(fs19, "FileWriteStream", { + Object.defineProperty(fs16, "FileWriteStream", { get: function() { return FileWriteStream; }, @@ -106581,7 +106581,7 @@ var require_graceful_fs = __commonJS({ enumerable: true, configurable: true }); - function ReadStream(path17, options) { + function ReadStream(path14, options) { if (this instanceof ReadStream) return fs$ReadStream.apply(this, arguments), this; else @@ -106601,7 +106601,7 @@ var require_graceful_fs = __commonJS({ } }); } - function WriteStream(path17, options) { + function WriteStream(path14, options) { if (this instanceof WriteStream) return fs$WriteStream.apply(this, arguments), this; else @@ -106619,22 +106619,22 @@ var require_graceful_fs = __commonJS({ } }); } - function createReadStream2(path17, options) { - return new fs19.ReadStream(path17, options); + function createReadStream2(path14, options) { + return new fs16.ReadStream(path14, options); } - function createWriteStream3(path17, options) { - return new fs19.WriteStream(path17, options); + function createWriteStream3(path14, options) { + return new fs16.WriteStream(path14, options); } - var fs$open = fs19.open; - fs19.open = open; - function open(path17, flags, mode, cb) { + var fs$open = fs16.open; + fs16.open = open; + function open(path14, flags, mode, cb) { if (typeof mode === "function") cb = mode, mode = null; - return go$open(path17, flags, mode, cb); - function go$open(path18, flags2, mode2, cb2, startTime) { - return fs$open(path18, flags2, mode2, function(err, fd) { + return go$open(path14, flags, mode, cb); + function go$open(path15, flags2, mode2, cb2, startTime) { + return fs$open(path15, flags2, mode2, function(err, fd) { if (err && (err.code === "EMFILE" || err.code === "ENFILE")) - enqueue([go$open, [path18, flags2, mode2, cb2], err, startTime || Date.now(), Date.now()]); + enqueue([go$open, [path15, flags2, mode2, cb2], err, startTime || Date.now(), Date.now()]); else { if (typeof cb2 === "function") cb2.apply(this, arguments); @@ -106642,20 +106642,20 @@ var require_graceful_fs = __commonJS({ }); } } - return fs19; + return fs16; } function enqueue(elem) { debug5("ENQUEUE", elem[0].name, elem[1]); - fs18[gracefulQueue].push(elem); + fs15[gracefulQueue].push(elem); retry2(); } var retryTimer; function resetQueue() { var now = Date.now(); - for (var i = 0; i < fs18[gracefulQueue].length; ++i) { - if (fs18[gracefulQueue][i].length > 2) { - fs18[gracefulQueue][i][3] = now; - fs18[gracefulQueue][i][4] = now; + for (var i = 0; i < fs15[gracefulQueue].length; ++i) { + if (fs15[gracefulQueue][i].length > 2) { + fs15[gracefulQueue][i][3] = now; + fs15[gracefulQueue][i][4] = now; } } retry2(); @@ -106663,9 +106663,9 @@ var require_graceful_fs = __commonJS({ function retry2() { clearTimeout(retryTimer); retryTimer = void 0; - if (fs18[gracefulQueue].length === 0) + if (fs15[gracefulQueue].length === 0) return; - var elem = fs18[gracefulQueue].shift(); + var elem = fs15[gracefulQueue].shift(); var fn = elem[0]; var args = elem[1]; var err = elem[2]; @@ -106687,7 +106687,7 @@ var require_graceful_fs = __commonJS({ debug5("RETRY", fn.name, args); fn.apply(null, args.concat([startTime])); } else { - fs18[gracefulQueue].push(elem); + fs15[gracefulQueue].push(elem); } } if (retryTimer === void 0) { @@ -106701,11 +106701,11 @@ var require_graceful_fs = __commonJS({ var require_is_stream = __commonJS({ "node_modules/archiver-utils/node_modules/is-stream/index.js"(exports2, module2) { "use strict"; - var isStream = (stream2) => stream2 !== null && typeof stream2 === "object" && typeof stream2.pipe === "function"; - isStream.writable = (stream2) => isStream(stream2) && stream2.writable !== false && typeof stream2._write === "function" && typeof stream2._writableState === "object"; - isStream.readable = (stream2) => isStream(stream2) && stream2.readable !== false && typeof stream2._read === "function" && typeof stream2._readableState === "object"; - isStream.duplex = (stream2) => isStream.writable(stream2) && isStream.readable(stream2); - isStream.transform = (stream2) => isStream.duplex(stream2) && typeof stream2._transform === "function"; + var isStream = (stream) => stream !== null && typeof stream === "object" && typeof stream.pipe === "function"; + isStream.writable = (stream) => isStream(stream) && stream.writable !== false && typeof stream._write === "function" && typeof stream._writableState === "object"; + isStream.readable = (stream) => isStream(stream) && stream.readable !== false && typeof stream._read === "function" && typeof stream._readableState === "object"; + isStream.duplex = (stream) => isStream.writable(stream) && isStream.readable(stream); + isStream.transform = (stream) => isStream.duplex(stream) && typeof stream._transform === "function"; module2.exports = isStream; } }); @@ -106987,7 +106987,7 @@ var require_BufferList = __commonJS({ this.head = this.tail = null; this.length = 0; }; - BufferList.prototype.join = function join15(s) { + BufferList.prototype.join = function join13(s) { if (this.length === 0) return ""; var p = this.head; var ret = "" + p.data; @@ -107131,10 +107131,10 @@ var require_stream_writable = __commonJS({ util.inherits(Writable, Stream); function nop() { } - function WritableState(options, stream2) { + function WritableState(options, stream) { Duplex = Duplex || require_stream_duplex(); options = options || {}; - var isDuplex = stream2 instanceof Duplex; + var isDuplex = stream instanceof Duplex; this.objectMode = !!options.objectMode; if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode; var hwm = options.highWaterMark; @@ -107159,7 +107159,7 @@ var require_stream_writable = __commonJS({ this.sync = true; this.bufferProcessing = false; this.onwrite = function(er) { - onwrite(stream2, er); + onwrite(stream, er); }; this.writecb = null; this.writelen = 0; @@ -107223,12 +107223,12 @@ var require_stream_writable = __commonJS({ Writable.prototype.pipe = function() { this.emit("error", new Error("Cannot pipe, not readable")); }; - function writeAfterEnd(stream2, cb) { + function writeAfterEnd(stream, cb) { var er = new Error("write after end"); - stream2.emit("error", er); + stream.emit("error", er); pna.nextTick(cb, er); } - function validChunk(stream2, state, chunk, cb) { + function validChunk(stream, state, chunk, cb) { var valid3 = true; var er = false; if (chunk === null) { @@ -107237,7 +107237,7 @@ var require_stream_writable = __commonJS({ er = new TypeError("Invalid non-string/buffer chunk"); } if (er) { - stream2.emit("error", er); + stream.emit("error", er); pna.nextTick(cb, er); valid3 = false; } @@ -107296,7 +107296,7 @@ var require_stream_writable = __commonJS({ return this._writableState.highWaterMark; } }); - function writeOrBuffer(stream2, state, isBuf, chunk, encoding, cb) { + function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) { if (!isBuf) { var newChunk = decodeChunk(state, chunk, encoding); if (chunk !== newChunk) { @@ -107325,31 +107325,31 @@ var require_stream_writable = __commonJS({ } state.bufferedRequestCount += 1; } else { - doWrite(stream2, state, false, len, chunk, encoding, cb); + doWrite(stream, state, false, len, chunk, encoding, cb); } return ret; } - function doWrite(stream2, state, writev, len, chunk, encoding, cb) { + function doWrite(stream, state, writev, len, chunk, encoding, cb) { state.writelen = len; state.writecb = cb; state.writing = true; state.sync = true; - if (writev) stream2._writev(chunk, state.onwrite); - else stream2._write(chunk, encoding, state.onwrite); + if (writev) stream._writev(chunk, state.onwrite); + else stream._write(chunk, encoding, state.onwrite); state.sync = false; } - function onwriteError(stream2, state, sync, er, cb) { + function onwriteError(stream, state, sync, er, cb) { --state.pendingcb; if (sync) { pna.nextTick(cb, er); - pna.nextTick(finishMaybe, stream2, state); - stream2._writableState.errorEmitted = true; - stream2.emit("error", er); + pna.nextTick(finishMaybe, stream, state); + stream._writableState.errorEmitted = true; + stream.emit("error", er); } else { cb(er); - stream2._writableState.errorEmitted = true; - stream2.emit("error", er); - finishMaybe(stream2, state); + stream._writableState.errorEmitted = true; + stream.emit("error", er); + finishMaybe(stream, state); } } function onwriteStateUpdate(state) { @@ -107358,40 +107358,40 @@ var require_stream_writable = __commonJS({ state.length -= state.writelen; state.writelen = 0; } - function onwrite(stream2, er) { - var state = stream2._writableState; + function onwrite(stream, er) { + var state = stream._writableState; var sync = state.sync; var cb = state.writecb; onwriteStateUpdate(state); - if (er) onwriteError(stream2, state, sync, er, cb); + if (er) onwriteError(stream, state, sync, er, cb); else { var finished = needFinish(state); if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) { - clearBuffer(stream2, state); + clearBuffer(stream, state); } if (sync) { - asyncWrite(afterWrite, stream2, state, finished, cb); + asyncWrite(afterWrite, stream, state, finished, cb); } else { - afterWrite(stream2, state, finished, cb); + afterWrite(stream, state, finished, cb); } } } - function afterWrite(stream2, state, finished, cb) { - if (!finished) onwriteDrain(stream2, state); + function afterWrite(stream, state, finished, cb) { + if (!finished) onwriteDrain(stream, state); state.pendingcb--; cb(); - finishMaybe(stream2, state); + finishMaybe(stream, state); } - function onwriteDrain(stream2, state) { + function onwriteDrain(stream, state) { if (state.length === 0 && state.needDrain) { state.needDrain = false; - stream2.emit("drain"); + stream.emit("drain"); } } - function clearBuffer(stream2, state) { + function clearBuffer(stream, state) { state.bufferProcessing = true; var entry = state.bufferedRequest; - if (stream2._writev && entry && entry.next) { + if (stream._writev && entry && entry.next) { var l = state.bufferedRequestCount; var buffer = new Array(l); var holder = state.corkedRequestsFree; @@ -107405,7 +107405,7 @@ var require_stream_writable = __commonJS({ count += 1; } buffer.allBuffers = allBuffers; - doWrite(stream2, state, true, state.length, buffer, "", holder.finish); + doWrite(stream, state, true, state.length, buffer, "", holder.finish); state.pendingcb++; state.lastBufferedRequest = null; if (holder.next) { @@ -107421,7 +107421,7 @@ var require_stream_writable = __commonJS({ var encoding = entry.encoding; var cb = entry.callback; var len = state.objectMode ? 1 : chunk.length; - doWrite(stream2, state, false, len, chunk, encoding, cb); + doWrite(stream, state, false, len, chunk, encoding, cb); entry = entry.next; state.bufferedRequestCount--; if (state.writing) { @@ -107457,49 +107457,49 @@ var require_stream_writable = __commonJS({ function needFinish(state) { return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing; } - function callFinal(stream2, state) { - stream2._final(function(err) { + function callFinal(stream, state) { + stream._final(function(err) { state.pendingcb--; if (err) { - stream2.emit("error", err); + stream.emit("error", err); } state.prefinished = true; - stream2.emit("prefinish"); - finishMaybe(stream2, state); + stream.emit("prefinish"); + finishMaybe(stream, state); }); } - function prefinish(stream2, state) { + function prefinish(stream, state) { if (!state.prefinished && !state.finalCalled) { - if (typeof stream2._final === "function") { + if (typeof stream._final === "function") { state.pendingcb++; state.finalCalled = true; - pna.nextTick(callFinal, stream2, state); + pna.nextTick(callFinal, stream, state); } else { state.prefinished = true; - stream2.emit("prefinish"); + stream.emit("prefinish"); } } } - function finishMaybe(stream2, state) { + function finishMaybe(stream, state) { var need = needFinish(state); if (need) { - prefinish(stream2, state); + prefinish(stream, state); if (state.pendingcb === 0) { state.finished = true; - stream2.emit("finish"); + stream.emit("finish"); } } return need; } - function endWritable(stream2, state, cb) { + function endWritable(stream, state, cb) { state.ending = true; - finishMaybe(stream2, state); + finishMaybe(stream, state); if (cb) { if (state.finished) pna.nextTick(cb); - else stream2.once("finish", cb); + else stream.once("finish", cb); } state.ended = true; - stream2.writable = false; + stream.writable = false; } function onCorkedFinish(corkReq, state, err) { var entry = corkReq.entry; @@ -107550,9 +107550,9 @@ var require_stream_duplex = __commonJS({ module2.exports = Duplex; var util = Object.create(require_util20()); util.inherits = require_inherits(); - var Readable2 = require_stream_readable(); + var Readable = require_stream_readable(); var Writable = require_stream_writable(); - util.inherits(Duplex, Readable2); + util.inherits(Duplex, Readable); { keys = objectKeys(Writable.prototype); for (v = 0; v < keys.length; v++) { @@ -107565,7 +107565,7 @@ var require_stream_duplex = __commonJS({ var v; function Duplex(options) { if (!(this instanceof Duplex)) return new Duplex(options); - Readable2.call(this, options); + Readable.call(this, options); Writable.call(this, options); if (options && options.readable === false) this.readable = false; if (options && options.writable === false) this.writable = false; @@ -107855,10 +107855,10 @@ var require_stream_readable = __commonJS({ "node_modules/lazystream/node_modules/readable-stream/lib/_stream_readable.js"(exports2, module2) { "use strict"; var pna = require_process_nextick_args(); - module2.exports = Readable2; + module2.exports = Readable; var isArray = require_isarray(); var Duplex; - Readable2.ReadableState = ReadableState; + Readable.ReadableState = ReadableState; var EE = require("events").EventEmitter; var EElistenerCount = function(emitter, type2) { return emitter.listeners(type2).length; @@ -107886,7 +107886,7 @@ var require_stream_readable = __commonJS({ var BufferList = require_BufferList(); var destroyImpl = require_destroy(); var StringDecoder; - util.inherits(Readable2, Stream); + util.inherits(Readable, Stream); var kProxyEvents = ["error", "close", "destroy", "pause", "resume"]; function prependListener(emitter, event, fn) { if (typeof emitter.prependListener === "function") return emitter.prependListener(event, fn); @@ -107894,10 +107894,10 @@ var require_stream_readable = __commonJS({ else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn); else emitter._events[event] = [fn, emitter._events[event]]; } - function ReadableState(options, stream2) { + function ReadableState(options, stream) { Duplex = Duplex || require_stream_duplex(); options = options || {}; - var isDuplex = stream2 instanceof Duplex; + var isDuplex = stream instanceof Duplex; this.objectMode = !!options.objectMode; if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode; var hwm = options.highWaterMark; @@ -107932,9 +107932,9 @@ var require_stream_readable = __commonJS({ this.encoding = options.encoding; } } - function Readable2(options) { + function Readable(options) { Duplex = Duplex || require_stream_duplex(); - if (!(this instanceof Readable2)) return new Readable2(options); + if (!(this instanceof Readable)) return new Readable(options); this._readableState = new ReadableState(options, this); this.readable = true; if (options) { @@ -107943,7 +107943,7 @@ var require_stream_readable = __commonJS({ } Stream.call(this); } - Object.defineProperty(Readable2.prototype, "destroyed", { + Object.defineProperty(Readable.prototype, "destroyed", { get: function() { if (this._readableState === void 0) { return false; @@ -107957,13 +107957,13 @@ var require_stream_readable = __commonJS({ this._readableState.destroyed = value; } }); - Readable2.prototype.destroy = destroyImpl.destroy; - Readable2.prototype._undestroy = destroyImpl.undestroy; - Readable2.prototype._destroy = function(err, cb) { + Readable.prototype.destroy = destroyImpl.destroy; + Readable.prototype._undestroy = destroyImpl.undestroy; + Readable.prototype._destroy = function(err, cb) { this.push(null); cb(err); }; - Readable2.prototype.push = function(chunk, encoding) { + Readable.prototype.push = function(chunk, encoding) { var state = this._readableState; var skipChunkCheck; if (!state.objectMode) { @@ -107980,36 +107980,36 @@ var require_stream_readable = __commonJS({ } return readableAddChunk(this, chunk, encoding, false, skipChunkCheck); }; - Readable2.prototype.unshift = function(chunk) { + Readable.prototype.unshift = function(chunk) { return readableAddChunk(this, chunk, null, true, false); }; - function readableAddChunk(stream2, chunk, encoding, addToFront, skipChunkCheck) { - var state = stream2._readableState; + function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) { + var state = stream._readableState; if (chunk === null) { state.reading = false; - onEofChunk(stream2, state); + onEofChunk(stream, state); } else { var er; if (!skipChunkCheck) er = chunkInvalid(state, chunk); if (er) { - stream2.emit("error", er); + stream.emit("error", er); } else if (state.objectMode || chunk && chunk.length > 0) { if (typeof chunk !== "string" && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer2.prototype) { chunk = _uint8ArrayToBuffer(chunk); } if (addToFront) { - if (state.endEmitted) stream2.emit("error", new Error("stream.unshift() after end event")); - else addChunk(stream2, state, chunk, true); + if (state.endEmitted) stream.emit("error", new Error("stream.unshift() after end event")); + else addChunk(stream, state, chunk, true); } else if (state.ended) { - stream2.emit("error", new Error("stream.push() after EOF")); + stream.emit("error", new Error("stream.push() after EOF")); } else { state.reading = false; if (state.decoder && !encoding) { chunk = state.decoder.write(chunk); - if (state.objectMode || chunk.length !== 0) addChunk(stream2, state, chunk, false); - else maybeReadMore(stream2, state); + if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false); + else maybeReadMore(stream, state); } else { - addChunk(stream2, state, chunk, false); + addChunk(stream, state, chunk, false); } } } else if (!addToFront) { @@ -108018,17 +108018,17 @@ var require_stream_readable = __commonJS({ } return needMoreData(state); } - function addChunk(stream2, state, chunk, addToFront) { + function addChunk(stream, state, chunk, addToFront) { if (state.flowing && state.length === 0 && !state.sync) { - stream2.emit("data", chunk); - stream2.read(0); + stream.emit("data", chunk); + stream.read(0); } else { state.length += state.objectMode ? 1 : chunk.length; if (addToFront) state.buffer.unshift(chunk); else state.buffer.push(chunk); - if (state.needReadable) emitReadable(stream2); + if (state.needReadable) emitReadable(stream); } - maybeReadMore(stream2, state); + maybeReadMore(stream, state); } function chunkInvalid(state, chunk) { var er; @@ -108040,10 +108040,10 @@ var require_stream_readable = __commonJS({ function needMoreData(state) { return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0); } - Readable2.prototype.isPaused = function() { + Readable.prototype.isPaused = function() { return this._readableState.flowing === false; }; - Readable2.prototype.setEncoding = function(enc) { + Readable.prototype.setEncoding = function(enc) { if (!StringDecoder) StringDecoder = require_string_decoder().StringDecoder; this._readableState.decoder = new StringDecoder(enc); this._readableState.encoding = enc; @@ -108079,7 +108079,7 @@ var require_stream_readable = __commonJS({ } return state.length; } - Readable2.prototype.read = function(n) { + Readable.prototype.read = function(n) { debug5("read", n); n = parseInt(n, 10); var state = this._readableState; @@ -108130,7 +108130,7 @@ var require_stream_readable = __commonJS({ if (ret !== null) this.emit("data", ret); return ret; }; - function onEofChunk(stream2, state) { + function onEofChunk(stream, state) { if (state.ended) return; if (state.decoder) { var chunk = state.decoder.end(); @@ -108140,44 +108140,44 @@ var require_stream_readable = __commonJS({ } } state.ended = true; - emitReadable(stream2); + emitReadable(stream); } - function emitReadable(stream2) { - var state = stream2._readableState; + function emitReadable(stream) { + var state = stream._readableState; state.needReadable = false; if (!state.emittedReadable) { debug5("emitReadable", state.flowing); state.emittedReadable = true; - if (state.sync) pna.nextTick(emitReadable_, stream2); - else emitReadable_(stream2); + if (state.sync) pna.nextTick(emitReadable_, stream); + else emitReadable_(stream); } } - function emitReadable_(stream2) { + function emitReadable_(stream) { debug5("emit readable"); - stream2.emit("readable"); - flow(stream2); + stream.emit("readable"); + flow(stream); } - function maybeReadMore(stream2, state) { + function maybeReadMore(stream, state) { if (!state.readingMore) { state.readingMore = true; - pna.nextTick(maybeReadMore_, stream2, state); + pna.nextTick(maybeReadMore_, stream, state); } } - function maybeReadMore_(stream2, state) { + function maybeReadMore_(stream, state) { var len = state.length; while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) { debug5("maybeReadMore read 0"); - stream2.read(0); + stream.read(0); if (len === state.length) break; else len = state.length; } state.readingMore = false; } - Readable2.prototype._read = function(n) { + Readable.prototype._read = function(n) { this.emit("error", new Error("_read() is not implemented")); }; - Readable2.prototype.pipe = function(dest, pipeOpts) { + Readable.prototype.pipe = function(dest, pipeOpts) { var src = this; var state = this._readableState; switch (state.pipesCount) { @@ -108282,7 +108282,7 @@ var require_stream_readable = __commonJS({ } }; } - Readable2.prototype.unpipe = function(dest) { + Readable.prototype.unpipe = function(dest) { var state = this._readableState; var unpipeInfo = { hasUnpiped: false }; if (state.pipesCount === 0) return this; @@ -108314,7 +108314,7 @@ var require_stream_readable = __commonJS({ dest.emit("unpipe", this, unpipeInfo); return this; }; - Readable2.prototype.on = function(ev, fn) { + Readable.prototype.on = function(ev, fn) { var res = Stream.prototype.on.call(this, ev, fn); if (ev === "data") { if (this._readableState.flowing !== false) this.resume(); @@ -108332,12 +108332,12 @@ var require_stream_readable = __commonJS({ } return res; }; - Readable2.prototype.addListener = Readable2.prototype.on; + Readable.prototype.addListener = Readable.prototype.on; function nReadingNextTick(self2) { debug5("readable nexttick read 0"); self2.read(0); } - Readable2.prototype.resume = function() { + Readable.prototype.resume = function() { var state = this._readableState; if (!state.flowing) { debug5("resume"); @@ -108346,24 +108346,24 @@ var require_stream_readable = __commonJS({ } return this; }; - function resume(stream2, state) { + function resume(stream, state) { if (!state.resumeScheduled) { state.resumeScheduled = true; - pna.nextTick(resume_, stream2, state); + pna.nextTick(resume_, stream, state); } } - function resume_(stream2, state) { + function resume_(stream, state) { if (!state.reading) { debug5("resume read 0"); - stream2.read(0); + stream.read(0); } state.resumeScheduled = false; state.awaitDrain = 0; - stream2.emit("resume"); - flow(stream2); - if (state.flowing && !state.reading) stream2.read(0); + stream.emit("resume"); + flow(stream); + if (state.flowing && !state.reading) stream.read(0); } - Readable2.prototype.pause = function() { + Readable.prototype.pause = function() { debug5("call pause flowing=%j", this._readableState.flowing); if (false !== this._readableState.flowing) { debug5("pause"); @@ -108372,17 +108372,17 @@ var require_stream_readable = __commonJS({ } return this; }; - function flow(stream2) { - var state = stream2._readableState; + function flow(stream) { + var state = stream._readableState; debug5("flow", state.flowing); - while (state.flowing && stream2.read() !== null) { + while (state.flowing && stream.read() !== null) { } } - Readable2.prototype.wrap = function(stream2) { + Readable.prototype.wrap = function(stream) { var _this = this; var state = this._readableState; var paused = false; - stream2.on("end", function() { + stream.on("end", function() { debug5("wrapped end"); if (state.decoder && !state.ended) { var chunk = state.decoder.end(); @@ -108390,7 +108390,7 @@ var require_stream_readable = __commonJS({ } _this.push(null); }); - stream2.on("data", function(chunk) { + stream.on("data", function(chunk) { debug5("wrapped data"); if (state.decoder) chunk = state.decoder.write(chunk); if (state.objectMode && (chunk === null || chunk === void 0)) return; @@ -108398,31 +108398,31 @@ var require_stream_readable = __commonJS({ var ret = _this.push(chunk); if (!ret) { paused = true; - stream2.pause(); + stream.pause(); } }); - for (var i in stream2) { - if (this[i] === void 0 && typeof stream2[i] === "function") { + for (var i in stream) { + if (this[i] === void 0 && typeof stream[i] === "function") { this[i] = /* @__PURE__ */ (function(method) { return function() { - return stream2[method].apply(stream2, arguments); + return stream[method].apply(stream, arguments); }; })(i); } } for (var n = 0; n < kProxyEvents.length; n++) { - stream2.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n])); + stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n])); } this._read = function(n2) { debug5("wrapped _read", n2); if (paused) { paused = false; - stream2.resume(); + stream.resume(); } }; return this; }; - Object.defineProperty(Readable2.prototype, "readableHighWaterMark", { + Object.defineProperty(Readable.prototype, "readableHighWaterMark", { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail @@ -108431,7 +108431,7 @@ var require_stream_readable = __commonJS({ return this._readableState.highWaterMark; } }); - Readable2._fromList = fromList; + Readable._fromList = fromList; function fromList(n, state) { if (state.length === 0) return null; var ret; @@ -108512,19 +108512,19 @@ var require_stream_readable = __commonJS({ list.length -= c; return ret; } - function endReadable(stream2) { - var state = stream2._readableState; + function endReadable(stream) { + var state = stream._readableState; if (state.length > 0) throw new Error('"endReadable()" called on non-empty stream'); if (!state.endEmitted) { state.ended = true; - pna.nextTick(endReadableNT, state, stream2); + pna.nextTick(endReadableNT, state, stream); } } - function endReadableNT(state, stream2) { + function endReadableNT(state, stream) { if (!state.endEmitted && state.length === 0) { state.endEmitted = true; - stream2.readable = false; - stream2.emit("end"); + stream.readable = false; + stream.emit("end"); } } function indexOf(xs, x) { @@ -108625,13 +108625,13 @@ var require_stream_transform = __commonJS({ _this2.emit("close"); }); }; - function done(stream2, er, data) { - if (er) return stream2.emit("error", er); + function done(stream, er, data) { + if (er) return stream.emit("error", er); if (data != null) - stream2.push(data); - if (stream2._writableState.length) throw new Error("Calling transform done when ws.length != 0"); - if (stream2._transformState.transforming) throw new Error("Calling transform done when still transforming"); - return stream2.push(null); + stream.push(data); + if (stream._writableState.length) throw new Error("Calling transform done when ws.length != 0"); + if (stream._transformState.transforming) throw new Error("Calling transform done when still transforming"); + return stream.push(null); } } }); @@ -108693,10 +108693,10 @@ var require_lazystream = __commonJS({ var util = require("util"); var PassThrough = require_passthrough(); module2.exports = { - Readable: Readable2, + Readable, Writable }; - util.inherits(Readable2, PassThrough); + util.inherits(Readable, PassThrough); util.inherits(Writable, PassThrough); function beforeFirstCall(instance, method, callback) { instance[method] = function() { @@ -108705,9 +108705,9 @@ var require_lazystream = __commonJS({ return this[method].apply(this, arguments); }; } - function Readable2(fn, options) { - if (!(this instanceof Readable2)) - return new Readable2(fn, options); + function Readable(fn, options) { + if (!(this instanceof Readable)) + return new Readable(fn, options); PassThrough.call(this, options); beforeFirstCall(this, "_read", function() { var source = fn.call(this, options); @@ -108735,22 +108735,22 @@ var require_lazystream = __commonJS({ // node_modules/normalize-path/index.js var require_normalize_path = __commonJS({ "node_modules/normalize-path/index.js"(exports2, module2) { - module2.exports = function(path17, stripTrailing) { - if (typeof path17 !== "string") { + module2.exports = function(path14, stripTrailing) { + if (typeof path14 !== "string") { throw new TypeError("expected path to be a string"); } - if (path17 === "\\" || path17 === "/") return "/"; - var len = path17.length; - if (len <= 1) return path17; + if (path14 === "\\" || path14 === "/") return "/"; + var len = path14.length; + if (len <= 1) return path14; var prefix = ""; - if (len > 4 && path17[3] === "\\") { - var ch = path17[2]; - if ((ch === "?" || ch === ".") && path17.slice(0, 2) === "\\\\") { - path17 = path17.slice(2); + if (len > 4 && path14[3] === "\\") { + var ch = path14[2]; + if ((ch === "?" || ch === ".") && path14.slice(0, 2) === "\\\\") { + path14 = path14.slice(2); prefix = "//"; } } - var segs = path17.split(/[/\\]+/); + var segs = path14.split(/[/\\]+/); if (stripTrailing !== false && segs[segs.length - 1] === "") { segs.pop(); } @@ -111085,132 +111085,132 @@ var require_utils8 = __commonJS({ if (isAsync === false) return typeof obj[SymbolIterator] === "function"; return typeof obj[SymbolAsyncIterator] === "function" || typeof obj[SymbolIterator] === "function"; } - function isDestroyed(stream2) { - if (!isNodeStream(stream2)) return null; - const wState = stream2._writableState; - const rState = stream2._readableState; + function isDestroyed(stream) { + if (!isNodeStream(stream)) return null; + const wState = stream._writableState; + const rState = stream._readableState; const state = wState || rState; - return !!(stream2.destroyed || stream2[kIsDestroyed] || state !== null && state !== void 0 && state.destroyed); + return !!(stream.destroyed || stream[kIsDestroyed] || state !== null && state !== void 0 && state.destroyed); } - function isWritableEnded(stream2) { - if (!isWritableNodeStream(stream2)) return null; - if (stream2.writableEnded === true) return true; - const wState = stream2._writableState; + function isWritableEnded(stream) { + if (!isWritableNodeStream(stream)) return null; + if (stream.writableEnded === true) return true; + const wState = stream._writableState; if (wState !== null && wState !== void 0 && wState.errored) return false; if (typeof (wState === null || wState === void 0 ? void 0 : wState.ended) !== "boolean") return null; return wState.ended; } - function isWritableFinished(stream2, strict) { - if (!isWritableNodeStream(stream2)) return null; - if (stream2.writableFinished === true) return true; - const wState = stream2._writableState; + function isWritableFinished(stream, strict) { + if (!isWritableNodeStream(stream)) return null; + if (stream.writableFinished === true) return true; + const wState = stream._writableState; if (wState !== null && wState !== void 0 && wState.errored) return false; if (typeof (wState === null || wState === void 0 ? void 0 : wState.finished) !== "boolean") return null; return !!(wState.finished || strict === false && wState.ended === true && wState.length === 0); } - function isReadableEnded(stream2) { - if (!isReadableNodeStream(stream2)) return null; - if (stream2.readableEnded === true) return true; - const rState = stream2._readableState; + function isReadableEnded(stream) { + if (!isReadableNodeStream(stream)) return null; + if (stream.readableEnded === true) return true; + const rState = stream._readableState; if (!rState || rState.errored) return false; if (typeof (rState === null || rState === void 0 ? void 0 : rState.ended) !== "boolean") return null; return rState.ended; } - function isReadableFinished(stream2, strict) { - if (!isReadableNodeStream(stream2)) return null; - const rState = stream2._readableState; + function isReadableFinished(stream, strict) { + if (!isReadableNodeStream(stream)) return null; + const rState = stream._readableState; if (rState !== null && rState !== void 0 && rState.errored) return false; if (typeof (rState === null || rState === void 0 ? void 0 : rState.endEmitted) !== "boolean") return null; return !!(rState.endEmitted || strict === false && rState.ended === true && rState.length === 0); } - function isReadable(stream2) { - if (stream2 && stream2[kIsReadable] != null) return stream2[kIsReadable]; - if (typeof (stream2 === null || stream2 === void 0 ? void 0 : stream2.readable) !== "boolean") return null; - if (isDestroyed(stream2)) return false; - return isReadableNodeStream(stream2) && stream2.readable && !isReadableFinished(stream2); + function isReadable(stream) { + if (stream && stream[kIsReadable] != null) return stream[kIsReadable]; + if (typeof (stream === null || stream === void 0 ? void 0 : stream.readable) !== "boolean") return null; + if (isDestroyed(stream)) return false; + return isReadableNodeStream(stream) && stream.readable && !isReadableFinished(stream); } - function isWritable(stream2) { - if (stream2 && stream2[kIsWritable] != null) return stream2[kIsWritable]; - if (typeof (stream2 === null || stream2 === void 0 ? void 0 : stream2.writable) !== "boolean") return null; - if (isDestroyed(stream2)) return false; - return isWritableNodeStream(stream2) && stream2.writable && !isWritableEnded(stream2); + function isWritable(stream) { + if (stream && stream[kIsWritable] != null) return stream[kIsWritable]; + if (typeof (stream === null || stream === void 0 ? void 0 : stream.writable) !== "boolean") return null; + if (isDestroyed(stream)) return false; + return isWritableNodeStream(stream) && stream.writable && !isWritableEnded(stream); } - function isFinished(stream2, opts) { - if (!isNodeStream(stream2)) { + function isFinished(stream, opts) { + if (!isNodeStream(stream)) { return null; } - if (isDestroyed(stream2)) { + if (isDestroyed(stream)) { return true; } - if ((opts === null || opts === void 0 ? void 0 : opts.readable) !== false && isReadable(stream2)) { + if ((opts === null || opts === void 0 ? void 0 : opts.readable) !== false && isReadable(stream)) { return false; } - if ((opts === null || opts === void 0 ? void 0 : opts.writable) !== false && isWritable(stream2)) { + if ((opts === null || opts === void 0 ? void 0 : opts.writable) !== false && isWritable(stream)) { return false; } return true; } - function isWritableErrored(stream2) { + function isWritableErrored(stream) { var _stream$_writableStat, _stream$_writableStat2; - if (!isNodeStream(stream2)) { + if (!isNodeStream(stream)) { return null; } - if (stream2.writableErrored) { - return stream2.writableErrored; + if (stream.writableErrored) { + return stream.writableErrored; } - return (_stream$_writableStat = (_stream$_writableStat2 = stream2._writableState) === null || _stream$_writableStat2 === void 0 ? void 0 : _stream$_writableStat2.errored) !== null && _stream$_writableStat !== void 0 ? _stream$_writableStat : null; + return (_stream$_writableStat = (_stream$_writableStat2 = stream._writableState) === null || _stream$_writableStat2 === void 0 ? void 0 : _stream$_writableStat2.errored) !== null && _stream$_writableStat !== void 0 ? _stream$_writableStat : null; } - function isReadableErrored(stream2) { + function isReadableErrored(stream) { var _stream$_readableStat, _stream$_readableStat2; - if (!isNodeStream(stream2)) { + if (!isNodeStream(stream)) { return null; } - if (stream2.readableErrored) { - return stream2.readableErrored; + if (stream.readableErrored) { + return stream.readableErrored; } - return (_stream$_readableStat = (_stream$_readableStat2 = stream2._readableState) === null || _stream$_readableStat2 === void 0 ? void 0 : _stream$_readableStat2.errored) !== null && _stream$_readableStat !== void 0 ? _stream$_readableStat : null; + return (_stream$_readableStat = (_stream$_readableStat2 = stream._readableState) === null || _stream$_readableStat2 === void 0 ? void 0 : _stream$_readableStat2.errored) !== null && _stream$_readableStat !== void 0 ? _stream$_readableStat : null; } - function isClosed(stream2) { - if (!isNodeStream(stream2)) { + function isClosed(stream) { + if (!isNodeStream(stream)) { return null; } - if (typeof stream2.closed === "boolean") { - return stream2.closed; + if (typeof stream.closed === "boolean") { + return stream.closed; } - const wState = stream2._writableState; - const rState = stream2._readableState; + const wState = stream._writableState; + const rState = stream._readableState; if (typeof (wState === null || wState === void 0 ? void 0 : wState.closed) === "boolean" || typeof (rState === null || rState === void 0 ? void 0 : rState.closed) === "boolean") { return (wState === null || wState === void 0 ? void 0 : wState.closed) || (rState === null || rState === void 0 ? void 0 : rState.closed); } - if (typeof stream2._closed === "boolean" && isOutgoingMessage(stream2)) { - return stream2._closed; + if (typeof stream._closed === "boolean" && isOutgoingMessage(stream)) { + return stream._closed; } return null; } - function isOutgoingMessage(stream2) { - return typeof stream2._closed === "boolean" && typeof stream2._defaultKeepAlive === "boolean" && typeof stream2._removedConnection === "boolean" && typeof stream2._removedContLen === "boolean"; + function isOutgoingMessage(stream) { + return typeof stream._closed === "boolean" && typeof stream._defaultKeepAlive === "boolean" && typeof stream._removedConnection === "boolean" && typeof stream._removedContLen === "boolean"; } - function isServerResponse(stream2) { - return typeof stream2._sent100 === "boolean" && isOutgoingMessage(stream2); + function isServerResponse(stream) { + return typeof stream._sent100 === "boolean" && isOutgoingMessage(stream); } - function isServerRequest(stream2) { + function isServerRequest(stream) { var _stream$req; - return typeof stream2._consuming === "boolean" && typeof stream2._dumped === "boolean" && ((_stream$req = stream2.req) === null || _stream$req === void 0 ? void 0 : _stream$req.upgradeOrConnect) === void 0; + return typeof stream._consuming === "boolean" && typeof stream._dumped === "boolean" && ((_stream$req = stream.req) === null || _stream$req === void 0 ? void 0 : _stream$req.upgradeOrConnect) === void 0; } - function willEmitClose(stream2) { - if (!isNodeStream(stream2)) return null; - const wState = stream2._writableState; - const rState = stream2._readableState; + function willEmitClose(stream) { + if (!isNodeStream(stream)) return null; + const wState = stream._writableState; + const rState = stream._readableState; const state = wState || rState; - return !state && isServerResponse(stream2) || !!(state && state.autoDestroy && state.emitClose && state.closed === false); + return !state && isServerResponse(stream) || !!(state && state.autoDestroy && state.emitClose && state.closed === false); } - function isDisturbed(stream2) { + function isDisturbed(stream) { var _stream$kIsDisturbed; - return !!(stream2 && ((_stream$kIsDisturbed = stream2[kIsDisturbed]) !== null && _stream$kIsDisturbed !== void 0 ? _stream$kIsDisturbed : stream2.readableDidRead || stream2.readableAborted)); + return !!(stream && ((_stream$kIsDisturbed = stream[kIsDisturbed]) !== null && _stream$kIsDisturbed !== void 0 ? _stream$kIsDisturbed : stream.readableDidRead || stream.readableAborted)); } - function isErrored(stream2) { + function isErrored(stream) { var _ref, _ref2, _ref3, _ref4, _ref5, _stream$kIsErrored, _stream$_readableStat3, _stream$_writableStat3, _stream$_readableStat4, _stream$_writableStat4; - return !!(stream2 && ((_ref = (_ref2 = (_ref3 = (_ref4 = (_ref5 = (_stream$kIsErrored = stream2[kIsErrored]) !== null && _stream$kIsErrored !== void 0 ? _stream$kIsErrored : stream2.readableErrored) !== null && _ref5 !== void 0 ? _ref5 : stream2.writableErrored) !== null && _ref4 !== void 0 ? _ref4 : (_stream$_readableStat3 = stream2._readableState) === null || _stream$_readableStat3 === void 0 ? void 0 : _stream$_readableStat3.errorEmitted) !== null && _ref3 !== void 0 ? _ref3 : (_stream$_writableStat3 = stream2._writableState) === null || _stream$_writableStat3 === void 0 ? void 0 : _stream$_writableStat3.errorEmitted) !== null && _ref2 !== void 0 ? _ref2 : (_stream$_readableStat4 = stream2._readableState) === null || _stream$_readableStat4 === void 0 ? void 0 : _stream$_readableStat4.errored) !== null && _ref !== void 0 ? _ref : (_stream$_writableStat4 = stream2._writableState) === null || _stream$_writableStat4 === void 0 ? void 0 : _stream$_writableStat4.errored)); + return !!(stream && ((_ref = (_ref2 = (_ref3 = (_ref4 = (_ref5 = (_stream$kIsErrored = stream[kIsErrored]) !== null && _stream$kIsErrored !== void 0 ? _stream$kIsErrored : stream.readableErrored) !== null && _ref5 !== void 0 ? _ref5 : stream.writableErrored) !== null && _ref4 !== void 0 ? _ref4 : (_stream$_readableStat3 = stream._readableState) === null || _stream$_readableStat3 === void 0 ? void 0 : _stream$_readableStat3.errorEmitted) !== null && _ref3 !== void 0 ? _ref3 : (_stream$_writableStat3 = stream._writableState) === null || _stream$_writableStat3 === void 0 ? void 0 : _stream$_writableStat3.errorEmitted) !== null && _ref2 !== void 0 ? _ref2 : (_stream$_readableStat4 = stream._readableState) === null || _stream$_readableStat4 === void 0 ? void 0 : _stream$_readableStat4.errored) !== null && _ref !== void 0 ? _ref : (_stream$_writableStat4 = stream._writableState) === null || _stream$_writableStat4 === void 0 ? void 0 : _stream$_writableStat4.errored)); } module2.exports = { isDestroyed, @@ -111275,12 +111275,12 @@ var require_end_of_stream = __commonJS({ kIsClosedPromise } = require_utils8(); var addAbortListener; - function isRequest(stream2) { - return stream2.setHeader && typeof stream2.abort === "function"; + function isRequest(stream) { + return stream.setHeader && typeof stream.abort === "function"; } var nop = () => { }; - function eos(stream2, options, callback) { + function eos(stream, options, callback) { var _options$readable, _options$writable; if (arguments.length === 2) { callback = options; @@ -111293,133 +111293,133 @@ var require_end_of_stream = __commonJS({ validateFunction(callback, "callback"); validateAbortSignal(options.signal, "options.signal"); callback = once(callback); - if (isReadableStream(stream2) || isWritableStream(stream2)) { - return eosWeb(stream2, options, callback); + if (isReadableStream(stream) || isWritableStream(stream)) { + return eosWeb(stream, options, callback); } - if (!isNodeStream(stream2)) { - throw new ERR_INVALID_ARG_TYPE2("stream", ["ReadableStream", "WritableStream", "Stream"], stream2); + if (!isNodeStream(stream)) { + throw new ERR_INVALID_ARG_TYPE2("stream", ["ReadableStream", "WritableStream", "Stream"], stream); } - const readable = (_options$readable = options.readable) !== null && _options$readable !== void 0 ? _options$readable : isReadableNodeStream(stream2); - const writable = (_options$writable = options.writable) !== null && _options$writable !== void 0 ? _options$writable : isWritableNodeStream(stream2); - const wState = stream2._writableState; - const rState = stream2._readableState; + const readable = (_options$readable = options.readable) !== null && _options$readable !== void 0 ? _options$readable : isReadableNodeStream(stream); + const writable = (_options$writable = options.writable) !== null && _options$writable !== void 0 ? _options$writable : isWritableNodeStream(stream); + const wState = stream._writableState; + const rState = stream._readableState; const onlegacyfinish = () => { - if (!stream2.writable) { + if (!stream.writable) { onfinish(); } }; - let willEmitClose = _willEmitClose(stream2) && isReadableNodeStream(stream2) === readable && isWritableNodeStream(stream2) === writable; - let writableFinished = isWritableFinished(stream2, false); + let willEmitClose = _willEmitClose(stream) && isReadableNodeStream(stream) === readable && isWritableNodeStream(stream) === writable; + let writableFinished = isWritableFinished(stream, false); const onfinish = () => { writableFinished = true; - if (stream2.destroyed) { + if (stream.destroyed) { willEmitClose = false; } - if (willEmitClose && (!stream2.readable || readable)) { + if (willEmitClose && (!stream.readable || readable)) { return; } if (!readable || readableFinished) { - callback.call(stream2); + callback.call(stream); } }; - let readableFinished = isReadableFinished(stream2, false); + let readableFinished = isReadableFinished(stream, false); const onend = () => { readableFinished = true; - if (stream2.destroyed) { + if (stream.destroyed) { willEmitClose = false; } - if (willEmitClose && (!stream2.writable || writable)) { + if (willEmitClose && (!stream.writable || writable)) { return; } if (!writable || writableFinished) { - callback.call(stream2); + callback.call(stream); } }; const onerror = (err) => { - callback.call(stream2, err); + callback.call(stream, err); }; - let closed = isClosed(stream2); + let closed = isClosed(stream); const onclose = () => { closed = true; - const errored = isWritableErrored(stream2) || isReadableErrored(stream2); + const errored = isWritableErrored(stream) || isReadableErrored(stream); if (errored && typeof errored !== "boolean") { - return callback.call(stream2, errored); + return callback.call(stream, errored); } - if (readable && !readableFinished && isReadableNodeStream(stream2, true)) { - if (!isReadableFinished(stream2, false)) return callback.call(stream2, new ERR_STREAM_PREMATURE_CLOSE()); + if (readable && !readableFinished && isReadableNodeStream(stream, true)) { + if (!isReadableFinished(stream, false)) return callback.call(stream, new ERR_STREAM_PREMATURE_CLOSE()); } if (writable && !writableFinished) { - if (!isWritableFinished(stream2, false)) return callback.call(stream2, new ERR_STREAM_PREMATURE_CLOSE()); + if (!isWritableFinished(stream, false)) return callback.call(stream, new ERR_STREAM_PREMATURE_CLOSE()); } - callback.call(stream2); + callback.call(stream); }; const onclosed = () => { closed = true; - const errored = isWritableErrored(stream2) || isReadableErrored(stream2); + const errored = isWritableErrored(stream) || isReadableErrored(stream); if (errored && typeof errored !== "boolean") { - return callback.call(stream2, errored); + return callback.call(stream, errored); } - callback.call(stream2); + callback.call(stream); }; const onrequest = () => { - stream2.req.on("finish", onfinish); + stream.req.on("finish", onfinish); }; - if (isRequest(stream2)) { - stream2.on("complete", onfinish); + if (isRequest(stream)) { + stream.on("complete", onfinish); if (!willEmitClose) { - stream2.on("abort", onclose); + stream.on("abort", onclose); } - if (stream2.req) { + if (stream.req) { onrequest(); } else { - stream2.on("request", onrequest); + stream.on("request", onrequest); } } else if (writable && !wState) { - stream2.on("end", onlegacyfinish); - stream2.on("close", onlegacyfinish); + stream.on("end", onlegacyfinish); + stream.on("close", onlegacyfinish); } - if (!willEmitClose && typeof stream2.aborted === "boolean") { - stream2.on("aborted", onclose); + if (!willEmitClose && typeof stream.aborted === "boolean") { + stream.on("aborted", onclose); } - stream2.on("end", onend); - stream2.on("finish", onfinish); + stream.on("end", onend); + stream.on("finish", onfinish); if (options.error !== false) { - stream2.on("error", onerror); + stream.on("error", onerror); } - stream2.on("close", onclose); + stream.on("close", onclose); if (closed) { process2.nextTick(onclose); } else if (wState !== null && wState !== void 0 && wState.errorEmitted || rState !== null && rState !== void 0 && rState.errorEmitted) { if (!willEmitClose) { process2.nextTick(onclosed); } - } else if (!readable && (!willEmitClose || isReadable(stream2)) && (writableFinished || isWritable(stream2) === false)) { + } else if (!readable && (!willEmitClose || isReadable(stream)) && (writableFinished || isWritable(stream) === false)) { process2.nextTick(onclosed); - } else if (!writable && (!willEmitClose || isWritable(stream2)) && (readableFinished || isReadable(stream2) === false)) { + } else if (!writable && (!willEmitClose || isWritable(stream)) && (readableFinished || isReadable(stream) === false)) { process2.nextTick(onclosed); - } else if (rState && stream2.req && stream2.aborted) { + } else if (rState && stream.req && stream.aborted) { process2.nextTick(onclosed); } const cleanup = () => { callback = nop; - stream2.removeListener("aborted", onclose); - stream2.removeListener("complete", onfinish); - stream2.removeListener("abort", onclose); - stream2.removeListener("request", onrequest); - if (stream2.req) stream2.req.removeListener("finish", onfinish); - stream2.removeListener("end", onlegacyfinish); - stream2.removeListener("close", onlegacyfinish); - stream2.removeListener("finish", onfinish); - stream2.removeListener("end", onend); - stream2.removeListener("error", onerror); - stream2.removeListener("close", onclose); + stream.removeListener("aborted", onclose); + stream.removeListener("complete", onfinish); + stream.removeListener("abort", onclose); + stream.removeListener("request", onrequest); + if (stream.req) stream.req.removeListener("finish", onfinish); + stream.removeListener("end", onlegacyfinish); + stream.removeListener("close", onlegacyfinish); + stream.removeListener("finish", onfinish); + stream.removeListener("end", onend); + stream.removeListener("error", onerror); + stream.removeListener("close", onclose); }; if (options.signal && !closed) { const abort = () => { const endCallback = callback; cleanup(); endCallback.call( - stream2, + stream, new AbortError(void 0, { cause: options.signal.reason }) @@ -111433,20 +111433,20 @@ var require_end_of_stream = __commonJS({ const originalCallback = callback; callback = once((...args) => { disposable[SymbolDispose](); - originalCallback.apply(stream2, args); + originalCallback.apply(stream, args); }); } } return cleanup; } - function eosWeb(stream2, options, callback) { + function eosWeb(stream, options, callback) { let isAborted = false; let abort = nop; if (options.signal) { abort = () => { isAborted = true; callback.call( - stream2, + stream, new AbortError(void 0, { cause: options.signal.reason }) @@ -111460,19 +111460,19 @@ var require_end_of_stream = __commonJS({ const originalCallback = callback; callback = once((...args) => { disposable[SymbolDispose](); - originalCallback.apply(stream2, args); + originalCallback.apply(stream, args); }); } } const resolverFn = (...args) => { if (!isAborted) { - process2.nextTick(() => callback.apply(stream2, args)); + process2.nextTick(() => callback.apply(stream, args)); } }; - PromisePrototypeThen(stream2[kIsClosedPromise].promise, resolverFn, resolverFn); + PromisePrototypeThen(stream[kIsClosedPromise].promise, resolverFn, resolverFn); return nop; } - function finished(stream2, opts) { + function finished(stream, opts) { var _opts; let autoCleanup = false; if (opts === null) { @@ -111483,7 +111483,7 @@ var require_end_of_stream = __commonJS({ autoCleanup = opts.cleanup; } return new Promise2((resolve8, reject) => { - const cleanup = eos(stream2, opts, (err) => { + const cleanup = eos(stream, opts, (err) => { if (autoCleanup) { cleanup(); } @@ -111641,14 +111641,14 @@ var require_destroy2 = __commonJS({ w.finished = w.writable === false; } } - function errorOrDestroy(stream2, err, sync) { - const r = stream2._readableState; - const w = stream2._writableState; + function errorOrDestroy(stream, err, sync) { + const r = stream._readableState; + const w = stream._writableState; if (w !== null && w !== void 0 && w.destroyed || r !== null && r !== void 0 && r.destroyed) { return this; } if (r !== null && r !== void 0 && r.autoDestroy || w !== null && w !== void 0 && w.autoDestroy) - stream2.destroy(err); + stream.destroy(err); else if (err) { err.stack; if (w && !w.errored) { @@ -111658,40 +111658,40 @@ var require_destroy2 = __commonJS({ r.errored = err; } if (sync) { - process2.nextTick(emitErrorNT, stream2, err); + process2.nextTick(emitErrorNT, stream, err); } else { - emitErrorNT(stream2, err); + emitErrorNT(stream, err); } } } - function construct(stream2, cb) { - if (typeof stream2._construct !== "function") { + function construct(stream, cb) { + if (typeof stream._construct !== "function") { return; } - const r = stream2._readableState; - const w = stream2._writableState; + const r = stream._readableState; + const w = stream._writableState; if (r) { r.constructed = false; } if (w) { w.constructed = false; } - stream2.once(kConstruct, cb); - if (stream2.listenerCount(kConstruct) > 1) { + stream.once(kConstruct, cb); + if (stream.listenerCount(kConstruct) > 1) { return; } - process2.nextTick(constructNT, stream2); + process2.nextTick(constructNT, stream); } - function constructNT(stream2) { + function constructNT(stream) { let called = false; function onConstruct(err) { if (called) { - errorOrDestroy(stream2, err !== null && err !== void 0 ? err : new ERR_MULTIPLE_CALLBACK()); + errorOrDestroy(stream, err !== null && err !== void 0 ? err : new ERR_MULTIPLE_CALLBACK()); return; } called = true; - const r = stream2._readableState; - const w = stream2._writableState; + const r = stream._readableState; + const w = stream._writableState; const s = w || r; if (r) { r.constructed = true; @@ -111700,59 +111700,59 @@ var require_destroy2 = __commonJS({ w.constructed = true; } if (s.destroyed) { - stream2.emit(kDestroy, err); + stream.emit(kDestroy, err); } else if (err) { - errorOrDestroy(stream2, err, true); + errorOrDestroy(stream, err, true); } else { - process2.nextTick(emitConstructNT, stream2); + process2.nextTick(emitConstructNT, stream); } } try { - stream2._construct((err) => { + stream._construct((err) => { process2.nextTick(onConstruct, err); }); } catch (err) { process2.nextTick(onConstruct, err); } } - function emitConstructNT(stream2) { - stream2.emit(kConstruct); + function emitConstructNT(stream) { + stream.emit(kConstruct); } - function isRequest(stream2) { - return (stream2 === null || stream2 === void 0 ? void 0 : stream2.setHeader) && typeof stream2.abort === "function"; + function isRequest(stream) { + return (stream === null || stream === void 0 ? void 0 : stream.setHeader) && typeof stream.abort === "function"; } - function emitCloseLegacy(stream2) { - stream2.emit("close"); + function emitCloseLegacy(stream) { + stream.emit("close"); } - function emitErrorCloseLegacy(stream2, err) { - stream2.emit("error", err); - process2.nextTick(emitCloseLegacy, stream2); + function emitErrorCloseLegacy(stream, err) { + stream.emit("error", err); + process2.nextTick(emitCloseLegacy, stream); } - function destroyer(stream2, err) { - if (!stream2 || isDestroyed(stream2)) { + function destroyer(stream, err) { + if (!stream || isDestroyed(stream)) { return; } - if (!err && !isFinished(stream2)) { + if (!err && !isFinished(stream)) { err = new AbortError(); } - if (isServerRequest(stream2)) { - stream2.socket = null; - stream2.destroy(err); - } else if (isRequest(stream2)) { - stream2.abort(); - } else if (isRequest(stream2.req)) { - stream2.req.abort(); - } else if (typeof stream2.destroy === "function") { - stream2.destroy(err); - } else if (typeof stream2.close === "function") { - stream2.close(); + if (isServerRequest(stream)) { + stream.socket = null; + stream.destroy(err); + } else if (isRequest(stream)) { + stream.abort(); + } else if (isRequest(stream.req)) { + stream.req.abort(); + } else if (typeof stream.destroy === "function") { + stream.destroy(err); + } else if (typeof stream.close === "function") { + stream.close(); } else if (err) { - process2.nextTick(emitErrorCloseLegacy, stream2, err); + process2.nextTick(emitErrorCloseLegacy, stream, err); } else { - process2.nextTick(emitCloseLegacy, stream2); + process2.nextTick(emitCloseLegacy, stream); } - if (!stream2.destroyed) { - stream2[kIsDestroyed] = true; + if (!stream.destroyed) { + stream[kIsDestroyed] = true; } } module2.exports = { @@ -111858,25 +111858,25 @@ var require_add_abort_signal = __commonJS({ throw new ERR_INVALID_ARG_TYPE2(name, "AbortSignal", signal); } }; - module2.exports.addAbortSignal = function addAbortSignal(signal, stream2) { + module2.exports.addAbortSignal = function addAbortSignal(signal, stream) { validateAbortSignal(signal, "signal"); - if (!isNodeStream(stream2) && !isWebStream(stream2)) { - throw new ERR_INVALID_ARG_TYPE2("stream", ["ReadableStream", "WritableStream", "Stream"], stream2); + if (!isNodeStream(stream) && !isWebStream(stream)) { + throw new ERR_INVALID_ARG_TYPE2("stream", ["ReadableStream", "WritableStream", "Stream"], stream); } - return module2.exports.addAbortSignalNoValidate(signal, stream2); + return module2.exports.addAbortSignalNoValidate(signal, stream); }; - module2.exports.addAbortSignalNoValidate = function(signal, stream2) { + module2.exports.addAbortSignalNoValidate = function(signal, stream) { if (typeof signal !== "object" || !("aborted" in signal)) { - return stream2; + return stream; } - const onAbort = isNodeStream(stream2) ? () => { - stream2.destroy( + const onAbort = isNodeStream(stream) ? () => { + stream.destroy( new AbortError(void 0, { cause: signal.reason }) ); } : () => { - stream2[kControllerErrorFunction]( + stream[kControllerErrorFunction]( new AbortError(void 0, { cause: signal.reason }) @@ -111887,9 +111887,9 @@ var require_add_abort_signal = __commonJS({ } else { addAbortListener = addAbortListener || require_util21().addAbortListener; const disposable = addAbortListener(signal, onAbort); - eos(stream2, disposable[SymbolDispose]); + eos(stream, disposable[SymbolDispose]); } - return stream2; + return stream; }; } }); @@ -112099,10 +112099,10 @@ var require_from = __commonJS({ var { PromisePrototypeThen, SymbolAsyncIterator, SymbolIterator } = require_primordials(); var { Buffer: Buffer2 } = require("buffer"); var { ERR_INVALID_ARG_TYPE: ERR_INVALID_ARG_TYPE2, ERR_STREAM_NULL_VALUES } = require_errors5().codes; - function from(Readable2, iterable, opts) { + function from(Readable, iterable, opts) { let iterator2; if (typeof iterable === "string" || iterable instanceof Buffer2) { - return new Readable2({ + return new Readable({ objectMode: true, ...opts, read() { @@ -112121,7 +112121,7 @@ var require_from = __commonJS({ } else { throw new ERR_INVALID_ARG_TYPE2("iterable", ["Iterable"], iterable); } - const readable = new Readable2({ + const readable = new Readable({ objectMode: true, highWaterMark: 1, // TODO(ronag): What options should be allowed? @@ -112204,8 +112204,8 @@ var require_readable4 = __commonJS({ SymbolAsyncIterator, Symbol: Symbol2 } = require_primordials(); - module2.exports = Readable2; - Readable2.ReadableState = ReadableState; + module2.exports = Readable; + Readable.ReadableState = ReadableState; var { EventEmitter: EE } = require("events"); var { Stream, prependListener } = require_legacy(); var { Buffer: Buffer2 } = require("buffer"); @@ -112232,8 +112232,8 @@ var require_readable4 = __commonJS({ var kPaused = Symbol2("kPaused"); var { StringDecoder } = require("string_decoder"); var from = require_from(); - ObjectSetPrototypeOf(Readable2.prototype, Stream.prototype); - ObjectSetPrototypeOf(Readable2, Stream); + ObjectSetPrototypeOf(Readable.prototype, Stream.prototype); + ObjectSetPrototypeOf(Readable, Stream); var nop = () => { }; var { errorOrDestroy } = destroyImpl; @@ -112305,8 +112305,8 @@ var require_readable4 = __commonJS({ readingMore: makeBitMapDescriptor(kReadingMore), dataEmitted: makeBitMapDescriptor(kDataEmitted) }); - function ReadableState(options, stream2, isDuplex) { - if (typeof isDuplex !== "boolean") isDuplex = stream2 instanceof require_duplex(); + function ReadableState(options, stream, isDuplex) { + if (typeof isDuplex !== "boolean") isDuplex = stream instanceof require_duplex(); this.state = kEmitClose | kAutoDestroy | kConstructed | kSync; if (options && options.objectMode) this.state |= kObjectMode; if (isDuplex && options && options.readableObjectMode) this.state |= kObjectMode; @@ -112328,8 +112328,8 @@ var require_readable4 = __commonJS({ this.encoding = options.encoding; } } - function Readable2(options) { - if (!(this instanceof Readable2)) return new Readable2(options); + function Readable(options) { + if (!(this instanceof Readable)) return new Readable(options); const isDuplex = this instanceof require_duplex(); this._readableState = new ReadableState(options, this, isDuplex); if (options) { @@ -112345,15 +112345,15 @@ var require_readable4 = __commonJS({ } }); } - Readable2.prototype.destroy = destroyImpl.destroy; - Readable2.prototype._undestroy = destroyImpl.undestroy; - Readable2.prototype._destroy = function(err, cb) { + Readable.prototype.destroy = destroyImpl.destroy; + Readable.prototype._undestroy = destroyImpl.undestroy; + Readable.prototype._destroy = function(err, cb) { cb(err); }; - Readable2.prototype[EE.captureRejectionSymbol] = function(err) { + Readable.prototype[EE.captureRejectionSymbol] = function(err) { this.destroy(err); }; - Readable2.prototype[SymbolAsyncDispose] = function() { + Readable.prototype[SymbolAsyncDispose] = function() { let error3; if (!this.destroyed) { error3 = this.readableEnded ? null : new AbortError(); @@ -112361,15 +112361,15 @@ var require_readable4 = __commonJS({ } return new Promise2((resolve8, reject) => eos(this, (err) => err && err !== error3 ? reject(err) : resolve8(null))); }; - Readable2.prototype.push = function(chunk, encoding) { + Readable.prototype.push = function(chunk, encoding) { return readableAddChunk(this, chunk, encoding, false); }; - Readable2.prototype.unshift = function(chunk, encoding) { + Readable.prototype.unshift = function(chunk, encoding) { return readableAddChunk(this, chunk, encoding, true); }; - function readableAddChunk(stream2, chunk, encoding, addToFront) { + function readableAddChunk(stream, chunk, encoding, addToFront) { debug5("readableAddChunk", chunk); - const state = stream2._readableState; + const state = stream._readableState; let err; if ((state.state & kObjectMode) === 0) { if (typeof chunk === "string") { @@ -112392,57 +112392,57 @@ var require_readable4 = __commonJS({ } } if (err) { - errorOrDestroy(stream2, err); + errorOrDestroy(stream, err); } else if (chunk === null) { state.state &= ~kReading; - onEofChunk(stream2, state); + onEofChunk(stream, state); } else if ((state.state & kObjectMode) !== 0 || chunk && chunk.length > 0) { if (addToFront) { - if ((state.state & kEndEmitted) !== 0) errorOrDestroy(stream2, new ERR_STREAM_UNSHIFT_AFTER_END_EVENT()); + if ((state.state & kEndEmitted) !== 0) errorOrDestroy(stream, new ERR_STREAM_UNSHIFT_AFTER_END_EVENT()); else if (state.destroyed || state.errored) return false; - else addChunk(stream2, state, chunk, true); + else addChunk(stream, state, chunk, true); } else if (state.ended) { - errorOrDestroy(stream2, new ERR_STREAM_PUSH_AFTER_EOF()); + errorOrDestroy(stream, new ERR_STREAM_PUSH_AFTER_EOF()); } else if (state.destroyed || state.errored) { return false; } else { state.state &= ~kReading; if (state.decoder && !encoding) { chunk = state.decoder.write(chunk); - if (state.objectMode || chunk.length !== 0) addChunk(stream2, state, chunk, false); - else maybeReadMore(stream2, state); + if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false); + else maybeReadMore(stream, state); } else { - addChunk(stream2, state, chunk, false); + addChunk(stream, state, chunk, false); } } } else if (!addToFront) { state.state &= ~kReading; - maybeReadMore(stream2, state); + maybeReadMore(stream, state); } return !state.ended && (state.length < state.highWaterMark || state.length === 0); } - function addChunk(stream2, state, chunk, addToFront) { - if (state.flowing && state.length === 0 && !state.sync && stream2.listenerCount("data") > 0) { + function addChunk(stream, state, chunk, addToFront) { + if (state.flowing && state.length === 0 && !state.sync && stream.listenerCount("data") > 0) { if ((state.state & kMultiAwaitDrain) !== 0) { state.awaitDrainWriters.clear(); } else { state.awaitDrainWriters = null; } state.dataEmitted = true; - stream2.emit("data", chunk); + stream.emit("data", chunk); } else { state.length += state.objectMode ? 1 : chunk.length; if (addToFront) state.buffer.unshift(chunk); else state.buffer.push(chunk); - if ((state.state & kNeedReadable) !== 0) emitReadable(stream2); + if ((state.state & kNeedReadable) !== 0) emitReadable(stream); } - maybeReadMore(stream2, state); + maybeReadMore(stream, state); } - Readable2.prototype.isPaused = function() { + Readable.prototype.isPaused = function() { const state = this._readableState; return state[kPaused] === true || state.flowing === false; }; - Readable2.prototype.setEncoding = function(enc) { + Readable.prototype.setEncoding = function(enc) { const decoder = new StringDecoder(enc); this._readableState.decoder = decoder; this._readableState.encoding = this._readableState.decoder.encoding; @@ -112481,7 +112481,7 @@ var require_readable4 = __commonJS({ if (n <= state.length) return n; return state.ended ? state.length : 0; } - Readable2.prototype.read = function(n) { + Readable.prototype.read = function(n) { debug5("read", n); if (n === void 0) { n = NaN; @@ -112548,7 +112548,7 @@ var require_readable4 = __commonJS({ } return ret; }; - function onEofChunk(stream2, state) { + function onEofChunk(stream, state) { debug5("onEofChunk"); if (state.ended) return; if (state.decoder) { @@ -112560,53 +112560,53 @@ var require_readable4 = __commonJS({ } state.ended = true; if (state.sync) { - emitReadable(stream2); + emitReadable(stream); } else { state.needReadable = false; state.emittedReadable = true; - emitReadable_(stream2); + emitReadable_(stream); } } - function emitReadable(stream2) { - const state = stream2._readableState; + function emitReadable(stream) { + const state = stream._readableState; debug5("emitReadable", state.needReadable, state.emittedReadable); state.needReadable = false; if (!state.emittedReadable) { debug5("emitReadable", state.flowing); state.emittedReadable = true; - process2.nextTick(emitReadable_, stream2); + process2.nextTick(emitReadable_, stream); } } - function emitReadable_(stream2) { - const state = stream2._readableState; + function emitReadable_(stream) { + const state = stream._readableState; debug5("emitReadable_", state.destroyed, state.length, state.ended); if (!state.destroyed && !state.errored && (state.length || state.ended)) { - stream2.emit("readable"); + stream.emit("readable"); state.emittedReadable = false; } state.needReadable = !state.flowing && !state.ended && state.length <= state.highWaterMark; - flow(stream2); + flow(stream); } - function maybeReadMore(stream2, state) { + function maybeReadMore(stream, state) { if (!state.readingMore && state.constructed) { state.readingMore = true; - process2.nextTick(maybeReadMore_, stream2, state); + process2.nextTick(maybeReadMore_, stream, state); } } - function maybeReadMore_(stream2, state) { + function maybeReadMore_(stream, state) { while (!state.reading && !state.ended && (state.length < state.highWaterMark || state.flowing && state.length === 0)) { const len = state.length; debug5("maybeReadMore read 0"); - stream2.read(0); + stream.read(0); if (len === state.length) break; } state.readingMore = false; } - Readable2.prototype._read = function(n) { + Readable.prototype._read = function(n) { throw new ERR_METHOD_NOT_IMPLEMENTED("_read()"); }; - Readable2.prototype.pipe = function(dest, pipeOpts) { + Readable.prototype.pipe = function(dest, pipeOpts) { const src = this; const state = this._readableState; if (state.pipes.length === 1) { @@ -112731,7 +112731,7 @@ var require_readable4 = __commonJS({ } }; } - Readable2.prototype.unpipe = function(dest) { + Readable.prototype.unpipe = function(dest) { const state = this._readableState; const unpipeInfo = { hasUnpiped: false @@ -112754,7 +112754,7 @@ var require_readable4 = __commonJS({ dest.emit("unpipe", this, unpipeInfo); return this; }; - Readable2.prototype.on = function(ev, fn) { + Readable.prototype.on = function(ev, fn) { const res = Stream.prototype.on.call(this, ev, fn); const state = this._readableState; if (ev === "data") { @@ -112775,16 +112775,16 @@ var require_readable4 = __commonJS({ } return res; }; - Readable2.prototype.addListener = Readable2.prototype.on; - Readable2.prototype.removeListener = function(ev, fn) { + Readable.prototype.addListener = Readable.prototype.on; + Readable.prototype.removeListener = function(ev, fn) { const res = Stream.prototype.removeListener.call(this, ev, fn); if (ev === "readable") { process2.nextTick(updateReadableListening, this); } return res; }; - Readable2.prototype.off = Readable2.prototype.removeListener; - Readable2.prototype.removeAllListeners = function(ev) { + Readable.prototype.off = Readable.prototype.removeListener; + Readable.prototype.removeAllListeners = function(ev) { const res = Stream.prototype.removeAllListeners.apply(this, arguments); if (ev === "readable" || ev === void 0) { process2.nextTick(updateReadableListening, this); @@ -112806,7 +112806,7 @@ var require_readable4 = __commonJS({ debug5("readable nexttick read 0"); self2.read(0); } - Readable2.prototype.resume = function() { + Readable.prototype.resume = function() { const state = this._readableState; if (!state.flowing) { debug5("resume"); @@ -112816,23 +112816,23 @@ var require_readable4 = __commonJS({ state[kPaused] = false; return this; }; - function resume(stream2, state) { + function resume(stream, state) { if (!state.resumeScheduled) { state.resumeScheduled = true; - process2.nextTick(resume_, stream2, state); + process2.nextTick(resume_, stream, state); } } - function resume_(stream2, state) { + function resume_(stream, state) { debug5("resume", state.reading); if (!state.reading) { - stream2.read(0); + stream.read(0); } state.resumeScheduled = false; - stream2.emit("resume"); - flow(stream2); - if (state.flowing && !state.reading) stream2.read(0); + stream.emit("resume"); + flow(stream); + if (state.flowing && !state.reading) stream.read(0); } - Readable2.prototype.pause = function() { + Readable.prototype.pause = function() { debug5("call pause flowing=%j", this._readableState.flowing); if (this._readableState.flowing !== false) { debug5("pause"); @@ -112842,79 +112842,79 @@ var require_readable4 = __commonJS({ this._readableState[kPaused] = true; return this; }; - function flow(stream2) { - const state = stream2._readableState; + function flow(stream) { + const state = stream._readableState; debug5("flow", state.flowing); - while (state.flowing && stream2.read() !== null) ; + while (state.flowing && stream.read() !== null) ; } - Readable2.prototype.wrap = function(stream2) { + Readable.prototype.wrap = function(stream) { let paused = false; - stream2.on("data", (chunk) => { - if (!this.push(chunk) && stream2.pause) { + stream.on("data", (chunk) => { + if (!this.push(chunk) && stream.pause) { paused = true; - stream2.pause(); + stream.pause(); } }); - stream2.on("end", () => { + stream.on("end", () => { this.push(null); }); - stream2.on("error", (err) => { + stream.on("error", (err) => { errorOrDestroy(this, err); }); - stream2.on("close", () => { + stream.on("close", () => { this.destroy(); }); - stream2.on("destroy", () => { + stream.on("destroy", () => { this.destroy(); }); this._read = () => { - if (paused && stream2.resume) { + if (paused && stream.resume) { paused = false; - stream2.resume(); + stream.resume(); } }; - const streamKeys = ObjectKeys(stream2); + const streamKeys = ObjectKeys(stream); for (let j = 1; j < streamKeys.length; j++) { const i = streamKeys[j]; - if (this[i] === void 0 && typeof stream2[i] === "function") { - this[i] = stream2[i].bind(stream2); + if (this[i] === void 0 && typeof stream[i] === "function") { + this[i] = stream[i].bind(stream); } } return this; }; - Readable2.prototype[SymbolAsyncIterator] = function() { + Readable.prototype[SymbolAsyncIterator] = function() { return streamToAsyncIterator(this); }; - Readable2.prototype.iterator = function(options) { + Readable.prototype.iterator = function(options) { if (options !== void 0) { validateObject(options, "options"); } return streamToAsyncIterator(this, options); }; - function streamToAsyncIterator(stream2, options) { - if (typeof stream2.read !== "function") { - stream2 = Readable2.wrap(stream2, { + function streamToAsyncIterator(stream, options) { + if (typeof stream.read !== "function") { + stream = Readable.wrap(stream, { objectMode: true }); } - const iter = createAsyncIterator(stream2, options); - iter.stream = stream2; + const iter = createAsyncIterator(stream, options); + iter.stream = stream; return iter; } - async function* createAsyncIterator(stream2, options) { + async function* createAsyncIterator(stream, options) { let callback = nop; function next(resolve8) { - if (this === stream2) { + if (this === stream) { callback(); callback = nop; } else { callback = resolve8; } } - stream2.on("readable", next); + stream.on("readable", next); let error3; const cleanup = eos( - stream2, + stream, { writable: false }, @@ -112926,7 +112926,7 @@ var require_readable4 = __commonJS({ ); try { while (true) { - const chunk = stream2.destroyed ? null : stream2.read(); + const chunk = stream.destroyed ? null : stream.read(); if (chunk !== null) { yield chunk; } else if (error3) { @@ -112941,15 +112941,15 @@ var require_readable4 = __commonJS({ error3 = aggregateTwoErrors(error3, err); throw error3; } finally { - if ((error3 || (options === null || options === void 0 ? void 0 : options.destroyOnReturn) !== false) && (error3 === void 0 || stream2._readableState.autoDestroy)) { - destroyImpl.destroyer(stream2, null); + if ((error3 || (options === null || options === void 0 ? void 0 : options.destroyOnReturn) !== false) && (error3 === void 0 || stream._readableState.autoDestroy)) { + destroyImpl.destroyer(stream, null); } else { - stream2.off("readable", next); + stream.off("readable", next); cleanup(); } } } - ObjectDefineProperties(Readable2.prototype, { + ObjectDefineProperties(Readable.prototype, { readable: { __proto__: null, get() { @@ -113076,7 +113076,7 @@ var require_readable4 = __commonJS({ } } }); - Readable2._fromList = fromList; + Readable._fromList = fromList; function fromList(n, state) { if (state.length === 0) return null; let ret; @@ -113091,55 +113091,55 @@ var require_readable4 = __commonJS({ } return ret; } - function endReadable(stream2) { - const state = stream2._readableState; + function endReadable(stream) { + const state = stream._readableState; debug5("endReadable", state.endEmitted); if (!state.endEmitted) { state.ended = true; - process2.nextTick(endReadableNT, state, stream2); + process2.nextTick(endReadableNT, state, stream); } } - function endReadableNT(state, stream2) { + function endReadableNT(state, stream) { debug5("endReadableNT", state.endEmitted, state.length); if (!state.errored && !state.closeEmitted && !state.endEmitted && state.length === 0) { state.endEmitted = true; - stream2.emit("end"); - if (stream2.writable && stream2.allowHalfOpen === false) { - process2.nextTick(endWritableNT, stream2); + stream.emit("end"); + if (stream.writable && stream.allowHalfOpen === false) { + process2.nextTick(endWritableNT, stream); } else if (state.autoDestroy) { - const wState = stream2._writableState; + const wState = stream._writableState; const autoDestroy = !wState || wState.autoDestroy && // We don't expect the writable to ever 'finish' // if writable is explicitly set to false. (wState.finished || wState.writable === false); if (autoDestroy) { - stream2.destroy(); + stream.destroy(); } } } } - function endWritableNT(stream2) { - const writable = stream2.writable && !stream2.writableEnded && !stream2.destroyed; + function endWritableNT(stream) { + const writable = stream.writable && !stream.writableEnded && !stream.destroyed; if (writable) { - stream2.end(); + stream.end(); } } - Readable2.from = function(iterable, opts) { - return from(Readable2, iterable, opts); + Readable.from = function(iterable, opts) { + return from(Readable, iterable, opts); }; var webStreamsAdapters; function lazyWebStreams() { if (webStreamsAdapters === void 0) webStreamsAdapters = {}; return webStreamsAdapters; } - Readable2.fromWeb = function(readableStream, options) { + Readable.fromWeb = function(readableStream, options) { return lazyWebStreams().newStreamReadableFromReadableStream(readableStream, options); }; - Readable2.toWeb = function(streamReadable, options) { + Readable.toWeb = function(streamReadable, options) { return lazyWebStreams().newReadableStreamFromStreamReadable(streamReadable, options); }; - Readable2.wrap = function(src, options) { + Readable.wrap = function(src, options) { var _ref, _src$readableObjectMo; - return new Readable2({ + return new Readable({ objectMode: (_ref = (_src$readableObjectMo = src.readableObjectMode) !== null && _src$readableObjectMo !== void 0 ? _src$readableObjectMo : src.objectMode) !== null && _ref !== void 0 ? _ref : true, ...options, destroy(err, callback) { @@ -113191,8 +113191,8 @@ var require_writable = __commonJS({ function nop() { } var kOnFinished = Symbol2("kOnFinished"); - function WritableState(options, stream2, isDuplex) { - if (typeof isDuplex !== "boolean") isDuplex = stream2 instanceof require_duplex(); + function WritableState(options, stream, isDuplex) { + if (typeof isDuplex !== "boolean") isDuplex = stream instanceof require_duplex(); this.objectMode = !!(options && options.objectMode); if (isDuplex) this.objectMode = this.objectMode || !!(options && options.writableObjectMode); this.highWaterMark = options ? getHighWaterMark(this, options, "writableHighWaterMark", isDuplex) : getDefaultHighWaterMark(false); @@ -113210,7 +113210,7 @@ var require_writable = __commonJS({ this.corked = 0; this.sync = true; this.bufferProcessing = false; - this.onwrite = onwrite.bind(void 0, stream2); + this.onwrite = onwrite.bind(void 0, stream); this.writecb = null; this.writelen = 0; this.afterWriteTickInfo = null; @@ -113273,8 +113273,8 @@ var require_writable = __commonJS({ Writable.prototype.pipe = function() { errorOrDestroy(this, new ERR_STREAM_CANNOT_PIPE()); }; - function _write(stream2, chunk, encoding, cb) { - const state = stream2._writableState; + function _write(stream, chunk, encoding, cb) { + const state = stream._writableState; if (typeof encoding === "function") { cb = encoding; encoding = state.defaultEncoding; @@ -113308,11 +113308,11 @@ var require_writable = __commonJS({ } if (err) { process2.nextTick(cb, err); - errorOrDestroy(stream2, err, true); + errorOrDestroy(stream, err, true); return err; } state.pendingcb++; - return writeOrBuffer(stream2, state, chunk, encoding, cb); + return writeOrBuffer(stream, state, chunk, encoding, cb); } Writable.prototype.write = function(chunk, encoding, cb) { return _write(this, chunk, encoding, cb) === true; @@ -113333,7 +113333,7 @@ var require_writable = __commonJS({ this._writableState.defaultEncoding = encoding; return this; }; - function writeOrBuffer(stream2, state, chunk, encoding, callback) { + function writeOrBuffer(stream, state, chunk, encoding, callback) { const len = state.objectMode ? 1 : chunk.length; state.length += len; const ret = state.length < state.highWaterMark; @@ -113355,33 +113355,33 @@ var require_writable = __commonJS({ state.writecb = callback; state.writing = true; state.sync = true; - stream2._write(chunk, encoding, state.onwrite); + stream._write(chunk, encoding, state.onwrite); state.sync = false; } return ret && !state.errored && !state.destroyed; } - function doWrite(stream2, state, writev, len, chunk, encoding, cb) { + function doWrite(stream, state, writev, len, chunk, encoding, cb) { state.writelen = len; state.writecb = cb; state.writing = true; state.sync = true; if (state.destroyed) state.onwrite(new ERR_STREAM_DESTROYED("write")); - else if (writev) stream2._writev(chunk, state.onwrite); - else stream2._write(chunk, encoding, state.onwrite); + else if (writev) stream._writev(chunk, state.onwrite); + else stream._write(chunk, encoding, state.onwrite); state.sync = false; } - function onwriteError(stream2, state, er, cb) { + function onwriteError(stream, state, er, cb) { --state.pendingcb; cb(er); errorBuffer(state); - errorOrDestroy(stream2, er); + errorOrDestroy(stream, er); } - function onwrite(stream2, er) { - const state = stream2._writableState; + function onwrite(stream, er) { + const state = stream._writableState; const sync = state.sync; const cb = state.writecb; if (typeof cb !== "function") { - errorOrDestroy(stream2, new ERR_MULTIPLE_CALLBACK()); + errorOrDestroy(stream, new ERR_MULTIPLE_CALLBACK()); return; } state.writing = false; @@ -113393,17 +113393,17 @@ var require_writable = __commonJS({ if (!state.errored) { state.errored = er; } - if (stream2._readableState && !stream2._readableState.errored) { - stream2._readableState.errored = er; + if (stream._readableState && !stream._readableState.errored) { + stream._readableState.errored = er; } if (sync) { - process2.nextTick(onwriteError, stream2, state, er, cb); + process2.nextTick(onwriteError, stream, state, er, cb); } else { - onwriteError(stream2, state, er, cb); + onwriteError(stream, state, er, cb); } } else { if (state.buffered.length > state.bufferedIndex) { - clearBuffer(stream2, state); + clearBuffer(stream, state); } if (sync) { if (state.afterWriteTickInfo !== null && state.afterWriteTickInfo.cb === cb) { @@ -113412,25 +113412,25 @@ var require_writable = __commonJS({ state.afterWriteTickInfo = { count: 1, cb, - stream: stream2, + stream, state }; process2.nextTick(afterWriteTick, state.afterWriteTickInfo); } } else { - afterWrite(stream2, state, 1, cb); + afterWrite(stream, state, 1, cb); } } } - function afterWriteTick({ stream: stream2, state, count, cb }) { + function afterWriteTick({ stream, state, count, cb }) { state.afterWriteTickInfo = null; - return afterWrite(stream2, state, count, cb); + return afterWrite(stream, state, count, cb); } - function afterWrite(stream2, state, count, cb) { - const needDrain = !state.ending && !stream2.destroyed && state.length === 0 && state.needDrain; + function afterWrite(stream, state, count, cb) { + const needDrain = !state.ending && !stream.destroyed && state.length === 0 && state.needDrain; if (needDrain) { state.needDrain = false; - stream2.emit("drain"); + stream.emit("drain"); } while (count-- > 0) { state.pendingcb--; @@ -113439,7 +113439,7 @@ var require_writable = __commonJS({ if (state.destroyed) { errorBuffer(state); } - finishMaybe(stream2, state); + finishMaybe(stream, state); } function errorBuffer(state) { if (state.writing) { @@ -113463,7 +113463,7 @@ var require_writable = __commonJS({ } resetBuffer(state); } - function clearBuffer(stream2, state) { + function clearBuffer(stream, state) { if (state.corked || state.bufferProcessing || state.destroyed || !state.constructed) { return; } @@ -113474,7 +113474,7 @@ var require_writable = __commonJS({ } let i = bufferedIndex; state.bufferProcessing = true; - if (bufferedLength > 1 && stream2._writev) { + if (bufferedLength > 1 && stream._writev) { state.pendingcb -= bufferedLength - 1; const callback = state.allNoop ? nop : (err) => { for (let n = i; n < buffered.length; ++n) { @@ -113483,14 +113483,14 @@ var require_writable = __commonJS({ }; const chunks = state.allNoop && i === 0 ? buffered : ArrayPrototypeSlice(buffered, i); chunks.allBuffers = state.allBuffers; - doWrite(stream2, state, true, state.length, chunks, "", callback); + doWrite(stream, state, true, state.length, chunks, "", callback); resetBuffer(state); } else { do { const { chunk, encoding, callback } = buffered[i]; buffered[i++] = null; const len = objectMode ? 1 : chunk.length; - doWrite(stream2, state, false, len, chunk, encoding, callback); + doWrite(stream, state, false, len, chunk, encoding, callback); } while (i < buffered.length && !state.writing); if (i === buffered.length) { resetBuffer(state); @@ -113562,11 +113562,11 @@ var require_writable = __commonJS({ function needFinish(state) { return state.ending && !state.destroyed && state.constructed && state.length === 0 && !state.errored && state.buffered.length === 0 && !state.finished && !state.writing && !state.errorEmitted && !state.closeEmitted; } - function callFinal(stream2, state) { + function callFinal(stream, state) { let called = false; function onFinish(err) { if (called) { - errorOrDestroy(stream2, err !== null && err !== void 0 ? err : ERR_MULTIPLE_CALLBACK()); + errorOrDestroy(stream, err !== null && err !== void 0 ? err : ERR_MULTIPLE_CALLBACK()); return; } called = true; @@ -113576,73 +113576,73 @@ var require_writable = __commonJS({ for (let i = 0; i < onfinishCallbacks.length; i++) { onfinishCallbacks[i](err); } - errorOrDestroy(stream2, err, state.sync); + errorOrDestroy(stream, err, state.sync); } else if (needFinish(state)) { state.prefinished = true; - stream2.emit("prefinish"); + stream.emit("prefinish"); state.pendingcb++; - process2.nextTick(finish, stream2, state); + process2.nextTick(finish, stream, state); } } state.sync = true; state.pendingcb++; try { - stream2._final(onFinish); + stream._final(onFinish); } catch (err) { onFinish(err); } state.sync = false; } - function prefinish(stream2, state) { + function prefinish(stream, state) { if (!state.prefinished && !state.finalCalled) { - if (typeof stream2._final === "function" && !state.destroyed) { + if (typeof stream._final === "function" && !state.destroyed) { state.finalCalled = true; - callFinal(stream2, state); + callFinal(stream, state); } else { state.prefinished = true; - stream2.emit("prefinish"); + stream.emit("prefinish"); } } } - function finishMaybe(stream2, state, sync) { + function finishMaybe(stream, state, sync) { if (needFinish(state)) { - prefinish(stream2, state); + prefinish(stream, state); if (state.pendingcb === 0) { if (sync) { state.pendingcb++; process2.nextTick( - (stream3, state2) => { + (stream2, state2) => { if (needFinish(state2)) { - finish(stream3, state2); + finish(stream2, state2); } else { state2.pendingcb--; } }, - stream2, + stream, state ); } else if (needFinish(state)) { state.pendingcb++; - finish(stream2, state); + finish(stream, state); } } } } - function finish(stream2, state) { + function finish(stream, state) { state.pendingcb--; state.finished = true; const onfinishCallbacks = state[kOnFinished].splice(0); for (let i = 0; i < onfinishCallbacks.length; i++) { onfinishCallbacks[i](); } - stream2.emit("finish"); + stream.emit("finish"); if (state.autoDestroy) { - const rState = stream2._readableState; + const rState = stream._readableState; const autoDestroy = !rState || rState.autoDestroy && // We don't expect the readable to ever 'end' // if readable is explicitly set to false. (rState.endEmitted || rState.readable === false); if (autoDestroy) { - stream2.destroy(); + stream.destroy(); } } } @@ -113794,7 +113794,7 @@ var require_duplexify = __commonJS({ } = require_errors5(); var { destroyer } = require_destroy2(); var Duplex = require_duplex(); - var Readable2 = require_readable4(); + var Readable = require_readable4(); var Writable = require_writable(); var { createDeferredPromise } = require_util21(); var from = require_from(); @@ -113844,7 +113844,7 @@ var require_duplexify = __commonJS({ } if (isReadableStream(body)) { return _duplexify({ - readable: Readable2.fromWeb(body) + readable: Readable.fromWeb(body) }); } if (isWritableStream(body)) { @@ -114008,7 +114008,7 @@ var require_duplexify = __commonJS({ }; } function _duplexify(pair) { - const r = pair.readable && typeof pair.readable.read !== "function" ? Readable2.wrap(pair.readable) : pair.readable; + const r = pair.readable && typeof pair.readable.read !== "function" ? Readable.wrap(pair.readable) : pair.readable; const w = pair.writable; let readable = !!isReadable(r); let writable = !!isWritable(w); @@ -114129,10 +114129,10 @@ var require_duplex = __commonJS({ ObjectSetPrototypeOf } = require_primordials(); module2.exports = Duplex; - var Readable2 = require_readable4(); + var Readable = require_readable4(); var Writable = require_writable(); - ObjectSetPrototypeOf(Duplex.prototype, Readable2.prototype); - ObjectSetPrototypeOf(Duplex, Readable2); + ObjectSetPrototypeOf(Duplex.prototype, Readable.prototype); + ObjectSetPrototypeOf(Duplex, Readable); { const keys = ObjectKeys(Writable.prototype); for (let i = 0; i < keys.length; i++) { @@ -114142,7 +114142,7 @@ var require_duplex = __commonJS({ } function Duplex(options) { if (!(this instanceof Duplex)) return new Duplex(options); - Readable2.call(this, options); + Readable.call(this, options); Writable.call(this, options); if (options) { this.allowHalfOpen = options.allowHalfOpen !== false; @@ -114389,15 +114389,15 @@ var require_pipeline4 = __commonJS({ } = require_utils8(); var AbortController2 = globalThis.AbortController || require_abort_controller().AbortController; var PassThrough; - var Readable2; + var Readable; var addAbortListener; - function destroyer(stream2, reading, writing) { + function destroyer(stream, reading, writing) { let finished = false; - stream2.on("close", () => { + stream.on("close", () => { finished = true; }); const cleanup = eos( - stream2, + stream, { readable: reading, writable: writing @@ -114410,7 +114410,7 @@ var require_pipeline4 = __commonJS({ destroy: (err) => { if (finished) return; finished = true; - destroyImpl.destroyer(stream2, err || new ERR_STREAM_DESTROYED("pipe")); + destroyImpl.destroyer(stream, err || new ERR_STREAM_DESTROYED("pipe")); }, cleanup }; @@ -114428,10 +114428,10 @@ var require_pipeline4 = __commonJS({ throw new ERR_INVALID_ARG_TYPE2("val", ["Readable", "Iterable", "AsyncIterable"], val); } async function* fromReadable(val) { - if (!Readable2) { - Readable2 = require_readable4(); + if (!Readable) { + Readable = require_readable4(); } - yield* Readable2.prototype[SymbolAsyncIterator].call(val); + yield* Readable.prototype[SymbolAsyncIterator].call(val); } async function pumpToNode(iterable, writable, finish, { end }) { let error3; @@ -114566,12 +114566,12 @@ var require_pipeline4 = __commonJS({ } let ret; for (let i = 0; i < streams.length; i++) { - const stream2 = streams[i]; + const stream = streams[i]; const reading = i < streams.length - 1; const writing = i > 0; const end = reading || (opts === null || opts === void 0 ? void 0 : opts.end) !== false; const isLastStream = i === streams.length - 1; - if (isNodeStream(stream2)) { + if (isNodeStream(stream)) { let onError2 = function(err) { if (err && err.name !== "AbortError" && err.code !== "ERR_STREAM_PREMATURE_CLOSE") { finish(err); @@ -114579,40 +114579,40 @@ var require_pipeline4 = __commonJS({ }; var onError = onError2; if (end) { - const { destroy, cleanup } = destroyer(stream2, reading, writing); + const { destroy, cleanup } = destroyer(stream, reading, writing); destroys.push(destroy); - if (isReadable(stream2) && isLastStream) { + if (isReadable(stream) && isLastStream) { lastStreamCleanup.push(cleanup); } } - stream2.on("error", onError2); - if (isReadable(stream2) && isLastStream) { + stream.on("error", onError2); + if (isReadable(stream) && isLastStream) { lastStreamCleanup.push(() => { - stream2.removeListener("error", onError2); + stream.removeListener("error", onError2); }); } } if (i === 0) { - if (typeof stream2 === "function") { - ret = stream2({ + if (typeof stream === "function") { + ret = stream({ signal }); if (!isIterable(ret)) { throw new ERR_INVALID_RETURN_VALUE("Iterable, AsyncIterable or Stream", "source", ret); } - } else if (isIterable(stream2) || isReadableNodeStream(stream2) || isTransformStream(stream2)) { - ret = stream2; + } else if (isIterable(stream) || isReadableNodeStream(stream) || isTransformStream(stream)) { + ret = stream; } else { - ret = Duplex.from(stream2); + ret = Duplex.from(stream); } - } else if (typeof stream2 === "function") { + } else if (typeof stream === "function") { if (isTransformStream(ret)) { var _ret; ret = makeAsyncIterable((_ret = ret) === null || _ret === void 0 ? void 0 : _ret.readable); } else { ret = makeAsyncIterable(ret); } - ret = stream2(ret, { + ret = stream(ret, { signal }); if (reading) { @@ -114668,24 +114668,24 @@ var require_pipeline4 = __commonJS({ lastStreamCleanup.push(cleanup); } } - } else if (isNodeStream(stream2)) { + } else if (isNodeStream(stream)) { if (isReadableNodeStream(ret)) { finishCount += 2; - const cleanup = pipe(ret, stream2, finish, { + const cleanup = pipe(ret, stream, finish, { end }); - if (isReadable(stream2) && isLastStream) { + if (isReadable(stream) && isLastStream) { lastStreamCleanup.push(cleanup); } } else if (isTransformStream(ret) || isReadableStream(ret)) { const toRead = ret.readable || ret; finishCount++; - pumpToNode(toRead, stream2, finish, { + pumpToNode(toRead, stream, finish, { end }); } else if (isIterable(ret)) { finishCount++; - pumpToNode(ret, stream2, finish, { + pumpToNode(ret, stream, finish, { end }); } else { @@ -114695,21 +114695,21 @@ var require_pipeline4 = __commonJS({ ret ); } - ret = stream2; - } else if (isWebStream(stream2)) { + ret = stream; + } else if (isWebStream(stream)) { if (isReadableNodeStream(ret)) { finishCount++; - pumpToWeb(makeAsyncIterable(ret), stream2, finish, { + pumpToWeb(makeAsyncIterable(ret), stream, finish, { end }); } else if (isReadableStream(ret) || isIterable(ret)) { finishCount++; - pumpToWeb(ret, stream2, finish, { + pumpToWeb(ret, stream, finish, { end }); } else if (isTransformStream(ret)) { finishCount++; - pumpToWeb(ret.readable, stream2, finish, { + pumpToWeb(ret.readable, stream, finish, { end }); } else { @@ -114719,9 +114719,9 @@ var require_pipeline4 = __commonJS({ ret ); } - ret = stream2; + ret = stream; } else { - ret = Duplex.from(stream2); + ret = Duplex.from(stream); } } if (signal !== null && signal !== void 0 && signal.aborted || outerSignal !== null && outerSignal !== void 0 && outerSignal.aborted) { @@ -115008,17 +115008,17 @@ var require_operators = __commonJS({ } = require_primordials(); var kEmpty = Symbol2("kEmpty"); var kEof = Symbol2("kEof"); - function compose(stream2, options) { + function compose(stream, options) { if (options != null) { validateObject(options, "options"); } if ((options === null || options === void 0 ? void 0 : options.signal) != null) { validateAbortSignal(options.signal, "options.signal"); } - if (isNodeStream(stream2) && !isWritable(stream2)) { - throw new ERR_INVALID_ARG_VALUE("stream", stream2, "must be writable"); + if (isNodeStream(stream) && !isWritable(stream)) { + throw new ERR_INVALID_ARG_VALUE("stream", stream, "must be writable"); } - const composedStream = staticCompose(this, stream2); + const composedStream = staticCompose(this, stream); if (options !== null && options !== void 0 && options.signal) { addAbortSignalNoValidate(options.signal, composedStream); } @@ -115049,7 +115049,7 @@ var require_operators = __commonJS({ const signal = require_util21().AbortSignalAny( [options === null || options === void 0 ? void 0 : options.signal].filter(Boolean2) ); - const stream2 = this; + const stream = this; const queue = []; const signalOpt = { signal @@ -115074,7 +115074,7 @@ var require_operators = __commonJS({ } async function pump() { try { - for await (let val of stream2) { + for await (let val of stream) { if (done) { return; } @@ -117366,11 +117366,11 @@ var require_commonjs20 = __commonJS({ return (f) => f.length === len && f !== "." && f !== ".."; }; var defaultPlatform = typeof process === "object" && process ? typeof process.env === "object" && process.env && process.env.__MINIMATCH_TESTING_PLATFORM__ || process.platform : "posix"; - var path17 = { + var path14 = { win32: { sep: "\\" }, posix: { sep: "/" } }; - exports2.sep = defaultPlatform === "win32" ? path17.win32.sep : path17.posix.sep; + exports2.sep = defaultPlatform === "win32" ? path14.win32.sep : path14.posix.sep; exports2.minimatch.sep = exports2.sep; exports2.GLOBSTAR = /* @__PURE__ */ Symbol("globstar **"); exports2.minimatch.GLOBSTAR = exports2.GLOBSTAR; @@ -120648,12 +120648,12 @@ var require_commonjs23 = __commonJS({ /** * Get the Path object referenced by the string path, resolved from this Path */ - resolve(path17) { - if (!path17) { + resolve(path14) { + if (!path14) { return this; } - const rootPath = this.getRootString(path17); - const dir = path17.substring(rootPath.length); + const rootPath = this.getRootString(path14); + const dir = path14.substring(rootPath.length); const dirParts = dir.split(this.splitSep); const result = rootPath ? this.getRoot(rootPath).#resolveParts(dirParts) : this.#resolveParts(dirParts); return result; @@ -121406,8 +121406,8 @@ var require_commonjs23 = __commonJS({ /** * @internal */ - getRootString(path17) { - return node_path_1.win32.parse(path17).root; + getRootString(path14) { + return node_path_1.win32.parse(path14).root; } /** * @internal @@ -121454,8 +121454,8 @@ var require_commonjs23 = __commonJS({ /** * @internal */ - getRootString(path17) { - return path17.startsWith("/") ? "/" : ""; + getRootString(path14) { + return path14.startsWith("/") ? "/" : ""; } /** * @internal @@ -121505,8 +121505,8 @@ var require_commonjs23 = __commonJS({ * * @internal */ - constructor(cwd = process.cwd(), pathImpl, sep5, { nocase, childrenCacheSize = 16 * 1024, fs: fs18 = defaultFS } = {}) { - this.#fs = fsFromOption(fs18); + constructor(cwd = process.cwd(), pathImpl, sep5, { nocase, childrenCacheSize = 16 * 1024, fs: fs15 = defaultFS } = {}) { + this.#fs = fsFromOption(fs15); if (cwd instanceof URL || cwd.startsWith("file://")) { cwd = (0, node_url_1.fileURLToPath)(cwd); } @@ -121545,11 +121545,11 @@ var require_commonjs23 = __commonJS({ /** * Get the depth of a provided path, string, or the cwd */ - depth(path17 = this.cwd) { - if (typeof path17 === "string") { - path17 = this.cwd.resolve(path17); + depth(path14 = this.cwd) { + if (typeof path14 === "string") { + path14 = this.cwd.resolve(path14); } - return path17.depth(); + return path14.depth(); } /** * Return the cache of child entries. Exposed so subclasses can create @@ -122036,9 +122036,9 @@ var require_commonjs23 = __commonJS({ process2(); return results; } - chdir(path17 = this.cwd) { + chdir(path14 = this.cwd) { const oldCwd = this.cwd; - this.cwd = typeof path17 === "string" ? this.cwd.resolve(path17) : path17; + this.cwd = typeof path14 === "string" ? this.cwd.resolve(path14) : path14; this.cwd[setAsCwd](oldCwd); } }; @@ -122065,8 +122065,8 @@ var require_commonjs23 = __commonJS({ /** * @internal */ - newRoot(fs18) { - return new PathWin32(this.rootPath, IFDIR, void 0, this.roots, this.nocase, this.childrenCache(), { fs: fs18 }); + newRoot(fs15) { + return new PathWin32(this.rootPath, IFDIR, void 0, this.roots, this.nocase, this.childrenCache(), { fs: fs15 }); } /** * Return true if the provided path string is an absolute path @@ -122095,8 +122095,8 @@ var require_commonjs23 = __commonJS({ /** * @internal */ - newRoot(fs18) { - return new PathPosix(this.rootPath, IFDIR, void 0, this.roots, this.nocase, this.childrenCache(), { fs: fs18 }); + newRoot(fs15) { + return new PathPosix(this.rootPath, IFDIR, void 0, this.roots, this.nocase, this.childrenCache(), { fs: fs15 }); } /** * Return true if the provided path string is an absolute path @@ -122426,8 +122426,8 @@ var require_processor = __commonJS({ } // match, absolute, ifdir entries() { - return [...this.store.entries()].map(([path17, n]) => [ - path17, + return [...this.store.entries()].map(([path14, n]) => [ + path14, !!(n & 2), !!(n & 1) ]); @@ -122645,9 +122645,9 @@ var require_walker = __commonJS({ signal; maxDepth; includeChildMatches; - constructor(patterns, path17, opts) { + constructor(patterns, path14, opts) { this.patterns = patterns; - this.path = path17; + this.path = path14; this.opts = opts; this.#sep = !opts.posix && opts.platform === "win32" ? "\\" : "/"; this.includeChildMatches = opts.includeChildMatches !== false; @@ -122666,11 +122666,11 @@ var require_walker = __commonJS({ }); } } - #ignored(path17) { - return this.seen.has(path17) || !!this.#ignore?.ignored?.(path17); + #ignored(path14) { + return this.seen.has(path14) || !!this.#ignore?.ignored?.(path14); } - #childrenIgnored(path17) { - return !!this.#ignore?.childrenIgnored?.(path17); + #childrenIgnored(path14) { + return !!this.#ignore?.childrenIgnored?.(path14); } // backpressure mechanism pause() { @@ -122886,8 +122886,8 @@ var require_walker = __commonJS({ exports2.GlobUtil = GlobUtil; var GlobWalker = class extends GlobUtil { matches = /* @__PURE__ */ new Set(); - constructor(patterns, path17, opts) { - super(patterns, path17, opts); + constructor(patterns, path14, opts) { + super(patterns, path14, opts); } matchEmit(e) { this.matches.add(e); @@ -122925,8 +122925,8 @@ var require_walker = __commonJS({ exports2.GlobWalker = GlobWalker; var GlobStream = class extends GlobUtil { results; - constructor(patterns, path17, opts) { - super(patterns, path17, opts); + constructor(patterns, path14, opts) { + super(patterns, path14, opts); this.results = new minipass_1.Minipass({ signal: this.signal, objectMode: true @@ -123281,8 +123281,8 @@ var require_commonjs24 = __commonJS({ // node_modules/archiver-utils/file.js var require_file4 = __commonJS({ "node_modules/archiver-utils/file.js"(exports2, module2) { - var fs18 = require_graceful_fs(); - var path17 = require("path"); + var fs15 = require_graceful_fs(); + var path14 = require("path"); var flatten = require_flatten(); var difference = require_difference(); var union = require_union(); @@ -123307,8 +123307,8 @@ var require_file4 = __commonJS({ return result; }; file.exists = function() { - var filepath = path17.join.apply(path17, arguments); - return fs18.existsSync(filepath); + var filepath = path14.join.apply(path14, arguments); + return fs15.existsSync(filepath); }; file.expand = function(...args) { var options = isPlainObject3(args[0]) ? args.shift() : {}; @@ -123321,12 +123321,12 @@ var require_file4 = __commonJS({ }); if (options.filter) { matches = matches.filter(function(filepath) { - filepath = path17.join(options.cwd || "", filepath); + filepath = path14.join(options.cwd || "", filepath); try { if (typeof options.filter === "function") { return options.filter(filepath); } else { - return fs18.statSync(filepath)[options.filter](); + return fs15.statSync(filepath)[options.filter](); } } catch (e) { return false; @@ -123338,7 +123338,7 @@ var require_file4 = __commonJS({ file.expandMapping = function(patterns, destBase, options) { options = Object.assign({ rename: function(destBase2, destPath) { - return path17.join(destBase2 || "", destPath); + return path14.join(destBase2 || "", destPath); } }, options); var files = []; @@ -123346,14 +123346,14 @@ var require_file4 = __commonJS({ file.expand(options, patterns).forEach(function(src) { var destPath = src; if (options.flatten) { - destPath = path17.basename(destPath); + destPath = path14.basename(destPath); } if (options.ext) { destPath = destPath.replace(/(\.[^\/]*)?$/, options.ext); } var dest = options.rename(destBase, destPath, options); if (options.cwd) { - src = path17.join(options.cwd, src); + src = path14.join(options.cwd, src); } dest = dest.replace(pathSeparatorRe, "/"); src = src.replace(pathSeparatorRe, "/"); @@ -123434,8 +123434,8 @@ var require_file4 = __commonJS({ // node_modules/archiver-utils/index.js var require_archiver_utils = __commonJS({ "node_modules/archiver-utils/index.js"(exports2, module2) { - var fs18 = require_graceful_fs(); - var path17 = require("path"); + var fs15 = require_graceful_fs(); + var path14 = require("path"); var isStream = require_is_stream(); var lazystream = require_lazystream(); var normalizePath = require_normalize_path(); @@ -123483,7 +123483,7 @@ var require_archiver_utils = __commonJS({ }; utils.lazyReadStream = function(filepath) { return new lazystream.Readable(function() { - return fs18.createReadStream(filepath); + return fs15.createReadStream(filepath); }); }; utils.normalizeInputSource = function(source) { @@ -123511,7 +123511,7 @@ var require_archiver_utils = __commonJS({ callback = base; base = dirpath; } - fs18.readdir(dirpath, function(err, list) { + fs15.readdir(dirpath, function(err, list) { var i = 0; var file; var filepath; @@ -123523,11 +123523,11 @@ var require_archiver_utils = __commonJS({ if (!file) { return callback(null, results); } - filepath = path17.join(dirpath, file); - fs18.stat(filepath, function(err2, stats) { + filepath = path14.join(dirpath, file); + fs15.stat(filepath, function(err2, stats) { results.push({ path: filepath, - relative: path17.relative(base, filepath).replace(/\\/g, "/"), + relative: path14.relative(base, filepath).replace(/\\/g, "/"), stats }); if (stats && stats.isDirectory()) { @@ -123586,10 +123586,10 @@ var require_error3 = __commonJS({ // node_modules/archiver/lib/core.js var require_core2 = __commonJS({ "node_modules/archiver/lib/core.js"(exports2, module2) { - var fs18 = require("fs"); + var fs15 = require("fs"); var glob2 = require_readdir_glob(); var async = require_async(); - var path17 = require("path"); + var path14 = require("path"); var util = require_archiver_utils(); var inherits = require("util").inherits; var ArchiverError = require_error3(); @@ -123650,7 +123650,7 @@ var require_core2 = __commonJS({ data.sourcePath = filepath; task.data = data; this._entriesCount++; - if (data.stats && data.stats instanceof fs18.Stats) { + if (data.stats && data.stats instanceof fs15.Stats) { task = this._updateQueueTaskWithStats(task, data.stats); if (task) { if (data.stats.size) { @@ -123821,7 +123821,7 @@ var require_core2 = __commonJS({ callback(); return; } - fs18.lstat(task.filepath, function(err, stats) { + fs15.lstat(task.filepath, function(err, stats) { if (this._state.aborted) { setImmediate(callback); return; @@ -123864,10 +123864,10 @@ var require_core2 = __commonJS({ task.data.sourceType = "buffer"; task.source = Buffer.concat([]); } else if (stats.isSymbolicLink() && this._moduleSupports("symlink")) { - var linkPath = fs18.readlinkSync(task.filepath); - var dirName = path17.dirname(task.filepath); + var linkPath = fs15.readlinkSync(task.filepath); + var dirName = path14.dirname(task.filepath); task.data.type = "symlink"; - task.data.linkname = path17.relative(dirName, path17.resolve(dirName, linkPath)); + task.data.linkname = path14.relative(dirName, path14.resolve(dirName, linkPath)); task.data.sourceType = "buffer"; task.source = Buffer.concat([]); } else { @@ -124575,11 +124575,11 @@ var require_zip_archive_entry = __commonJS({ var require_is_stream2 = __commonJS({ "node_modules/compress-commons/node_modules/is-stream/index.js"(exports2, module2) { "use strict"; - var isStream = (stream2) => stream2 !== null && typeof stream2 === "object" && typeof stream2.pipe === "function"; - isStream.writable = (stream2) => isStream(stream2) && stream2.writable !== false && typeof stream2._write === "function" && typeof stream2._writableState === "object"; - isStream.readable = (stream2) => isStream(stream2) && stream2.readable !== false && typeof stream2._read === "function" && typeof stream2._readableState === "object"; - isStream.duplex = (stream2) => isStream.writable(stream2) && isStream.readable(stream2); - isStream.transform = (stream2) => isStream.duplex(stream2) && typeof stream2._transform === "function"; + var isStream = (stream) => stream !== null && typeof stream === "object" && typeof stream.pipe === "function"; + isStream.writable = (stream) => isStream(stream) && stream.writable !== false && typeof stream._write === "function" && typeof stream._writableState === "object"; + isStream.readable = (stream) => isStream(stream) && stream.readable !== false && typeof stream._read === "function" && typeof stream._readableState === "object"; + isStream.duplex = (stream) => isStream.writable(stream) && isStream.readable(stream); + isStream.transform = (stream) => isStream.duplex(stream) && typeof stream._transform === "function"; module2.exports = isStream; } }); @@ -125846,8 +125846,8 @@ var require_streamx = __commonJS({ var WRITE_UPDATE_SYNC_STATUS = WRITE_UPDATING | OPEN_STATUS | WRITE_NEXT_TICK | WRITE_PRIMARY; var asyncIterator = Symbol.asyncIterator || /* @__PURE__ */ Symbol("asyncIterator"); var WritableState = class { - constructor(stream2, { highWaterMark = 16384, map: map2 = null, mapWritable, byteLength, byteLengthWritable } = {}) { - this.stream = stream2; + constructor(stream, { highWaterMark = 16384, map: map2 = null, mapWritable, byteLength, byteLengthWritable } = {}) { + this.stream = stream; this.queue = new FIFO(); this.highWaterMark = highWaterMark; this.buffered = 0; @@ -125886,44 +125886,44 @@ var require_streamx = __commonJS({ } autoBatch(data, cb) { const buffer = []; - const stream2 = this.stream; + const stream = this.stream; buffer.push(data); - while ((stream2._duplexState & WRITE_STATUS) === WRITE_QUEUED_AND_ACTIVE) { - buffer.push(stream2._writableState.shift()); + while ((stream._duplexState & WRITE_STATUS) === WRITE_QUEUED_AND_ACTIVE) { + buffer.push(stream._writableState.shift()); } - if ((stream2._duplexState & OPEN_STATUS) !== 0) return cb(null); - stream2._writev(buffer, cb); + if ((stream._duplexState & OPEN_STATUS) !== 0) return cb(null); + stream._writev(buffer, cb); } update() { - const stream2 = this.stream; - stream2._duplexState |= WRITE_UPDATING; + const stream = this.stream; + stream._duplexState |= WRITE_UPDATING; do { - while ((stream2._duplexState & WRITE_STATUS) === WRITE_QUEUED) { + while ((stream._duplexState & WRITE_STATUS) === WRITE_QUEUED) { const data = this.shift(); - stream2._duplexState |= WRITE_ACTIVE_AND_WRITING; - stream2._write(data, this.afterWrite); + stream._duplexState |= WRITE_ACTIVE_AND_WRITING; + stream._write(data, this.afterWrite); } - if ((stream2._duplexState & WRITE_PRIMARY_AND_ACTIVE) === 0) this.updateNonPrimary(); + if ((stream._duplexState & WRITE_PRIMARY_AND_ACTIVE) === 0) this.updateNonPrimary(); } while (this.continueUpdate() === true); - stream2._duplexState &= WRITE_NOT_UPDATING; + stream._duplexState &= WRITE_NOT_UPDATING; } updateNonPrimary() { - const stream2 = this.stream; - if ((stream2._duplexState & WRITE_FINISHING_STATUS) === WRITE_FINISHING) { - stream2._duplexState = (stream2._duplexState | WRITE_ACTIVE) & WRITE_NOT_FINISHING; - stream2._final(afterFinal.bind(this)); + const stream = this.stream; + if ((stream._duplexState & WRITE_FINISHING_STATUS) === WRITE_FINISHING) { + stream._duplexState = (stream._duplexState | WRITE_ACTIVE) & WRITE_NOT_FINISHING; + stream._final(afterFinal.bind(this)); return; } - if ((stream2._duplexState & DESTROY_STATUS) === DESTROYING) { - if ((stream2._duplexState & ACTIVE_OR_TICKING) === 0) { - stream2._duplexState |= ACTIVE; - stream2._destroy(afterDestroy.bind(this)); + if ((stream._duplexState & DESTROY_STATUS) === DESTROYING) { + if ((stream._duplexState & ACTIVE_OR_TICKING) === 0) { + stream._duplexState |= ACTIVE; + stream._destroy(afterDestroy.bind(this)); } return; } - if ((stream2._duplexState & IS_OPENING) === OPENING) { - stream2._duplexState = (stream2._duplexState | ACTIVE) & NOT_OPENING; - stream2._open(afterOpen.bind(this)); + if ((stream._duplexState & IS_OPENING) === OPENING) { + stream._duplexState = (stream._duplexState | ACTIVE) & NOT_OPENING; + stream._open(afterOpen.bind(this)); } } continueUpdate() { @@ -125942,8 +125942,8 @@ var require_streamx = __commonJS({ } }; var ReadableState = class { - constructor(stream2, { highWaterMark = 16384, map: map2 = null, mapReadable, byteLength, byteLengthReadable } = {}) { - this.stream = stream2; + constructor(stream, { highWaterMark = 16384, map: map2 = null, mapReadable, byteLength, byteLengthReadable } = {}) { + this.stream = stream; this.queue = new FIFO(); this.highWaterMark = highWaterMark === 0 ? 1 : highWaterMark; this.buffered = 0; @@ -125982,22 +125982,22 @@ var require_streamx = __commonJS({ pipeTo.emit("pipe", this.stream); } push(data) { - const stream2 = this.stream; + const stream = this.stream; if (data === null) { this.highWaterMark = 0; - stream2._duplexState = (stream2._duplexState | READ_ENDING) & READ_NON_PRIMARY_AND_PUSHED; + stream._duplexState = (stream._duplexState | READ_ENDING) & READ_NON_PRIMARY_AND_PUSHED; return false; } if (this.map !== null) { data = this.map(data); if (data === null) { - stream2._duplexState &= READ_PUSHED; + stream._duplexState &= READ_PUSHED; return this.buffered < this.highWaterMark; } } this.buffered += this.byteLength(data); this.queue.push(data); - stream2._duplexState = (stream2._duplexState | READ_QUEUED) & READ_PUSHED; + stream._duplexState = (stream._duplexState | READ_QUEUED) & READ_PUSHED; return this.buffered < this.highWaterMark; } shift() { @@ -126017,63 +126017,63 @@ var require_streamx = __commonJS({ this.push(pending[pending.length - 1]); } read() { - const stream2 = this.stream; - if ((stream2._duplexState & READ_STATUS) === READ_QUEUED) { + const stream = this.stream; + if ((stream._duplexState & READ_STATUS) === READ_QUEUED) { const data = this.shift(); - if (this.pipeTo !== null && this.pipeTo.write(data) === false) stream2._duplexState &= READ_PIPE_NOT_DRAINED; - if ((stream2._duplexState & READ_EMIT_DATA) !== 0) stream2.emit("data", data); + if (this.pipeTo !== null && this.pipeTo.write(data) === false) stream._duplexState &= READ_PIPE_NOT_DRAINED; + if ((stream._duplexState & READ_EMIT_DATA) !== 0) stream.emit("data", data); return data; } if (this.readAhead === false) { - stream2._duplexState |= READ_READ_AHEAD; + stream._duplexState |= READ_READ_AHEAD; this.updateNextTick(); } return null; } drain() { - const stream2 = this.stream; - while ((stream2._duplexState & READ_STATUS) === READ_QUEUED && (stream2._duplexState & READ_FLOWING) !== 0) { + const stream = this.stream; + while ((stream._duplexState & READ_STATUS) === READ_QUEUED && (stream._duplexState & READ_FLOWING) !== 0) { const data = this.shift(); - if (this.pipeTo !== null && this.pipeTo.write(data) === false) stream2._duplexState &= READ_PIPE_NOT_DRAINED; - if ((stream2._duplexState & READ_EMIT_DATA) !== 0) stream2.emit("data", data); + if (this.pipeTo !== null && this.pipeTo.write(data) === false) stream._duplexState &= READ_PIPE_NOT_DRAINED; + if ((stream._duplexState & READ_EMIT_DATA) !== 0) stream.emit("data", data); } } update() { - const stream2 = this.stream; - stream2._duplexState |= READ_UPDATING; + const stream = this.stream; + stream._duplexState |= READ_UPDATING; do { this.drain(); - while (this.buffered < this.highWaterMark && (stream2._duplexState & SHOULD_NOT_READ) === READ_READ_AHEAD) { - stream2._duplexState |= READ_ACTIVE_AND_NEEDS_PUSH; - stream2._read(this.afterRead); + while (this.buffered < this.highWaterMark && (stream._duplexState & SHOULD_NOT_READ) === READ_READ_AHEAD) { + stream._duplexState |= READ_ACTIVE_AND_NEEDS_PUSH; + stream._read(this.afterRead); this.drain(); } - if ((stream2._duplexState & READ_READABLE_STATUS) === READ_EMIT_READABLE_AND_QUEUED) { - stream2._duplexState |= READ_EMITTED_READABLE; - stream2.emit("readable"); + if ((stream._duplexState & READ_READABLE_STATUS) === READ_EMIT_READABLE_AND_QUEUED) { + stream._duplexState |= READ_EMITTED_READABLE; + stream.emit("readable"); } - if ((stream2._duplexState & READ_PRIMARY_AND_ACTIVE) === 0) this.updateNonPrimary(); + if ((stream._duplexState & READ_PRIMARY_AND_ACTIVE) === 0) this.updateNonPrimary(); } while (this.continueUpdate() === true); - stream2._duplexState &= READ_NOT_UPDATING; + stream._duplexState &= READ_NOT_UPDATING; } updateNonPrimary() { - const stream2 = this.stream; - if ((stream2._duplexState & READ_ENDING_STATUS) === READ_ENDING) { - stream2._duplexState = (stream2._duplexState | READ_DONE) & READ_NOT_ENDING; - stream2.emit("end"); - if ((stream2._duplexState & AUTO_DESTROY) === DONE) stream2._duplexState |= DESTROYING; + const stream = this.stream; + if ((stream._duplexState & READ_ENDING_STATUS) === READ_ENDING) { + stream._duplexState = (stream._duplexState | READ_DONE) & READ_NOT_ENDING; + stream.emit("end"); + if ((stream._duplexState & AUTO_DESTROY) === DONE) stream._duplexState |= DESTROYING; if (this.pipeTo !== null) this.pipeTo.end(); } - if ((stream2._duplexState & DESTROY_STATUS) === DESTROYING) { - if ((stream2._duplexState & ACTIVE_OR_TICKING) === 0) { - stream2._duplexState |= ACTIVE; - stream2._destroy(afterDestroy.bind(this)); + if ((stream._duplexState & DESTROY_STATUS) === DESTROYING) { + if ((stream._duplexState & ACTIVE_OR_TICKING) === 0) { + stream._duplexState |= ACTIVE; + stream._destroy(afterDestroy.bind(this)); } return; } - if ((stream2._duplexState & IS_OPENING) === OPENING) { - stream2._duplexState = (stream2._duplexState | ACTIVE) & NOT_OPENING; - stream2._open(afterOpen.bind(this)); + if ((stream._duplexState & IS_OPENING) === OPENING) { + stream._duplexState = (stream._duplexState | ACTIVE) & NOT_OPENING; + stream._open(afterOpen.bind(this)); } } continueUpdate() { @@ -126092,9 +126092,9 @@ var require_streamx = __commonJS({ } }; var TransformState = class { - constructor(stream2) { + constructor(stream) { this.data = null; - this.afterTransform = afterTransform.bind(stream2); + this.afterTransform = afterTransform.bind(stream); this.afterFinal = null; } }; @@ -126109,9 +126109,9 @@ var require_streamx = __commonJS({ finished() { this.pipeToFinished = true; } - done(stream2, err) { + done(stream, err) { if (err) this.error = err; - if (stream2 === this.to) { + if (stream === this.to) { this.to = null; if (this.from !== null) { if ((this.from._duplexState & READ_DONE) === 0 || !this.pipeToFinished) { @@ -126120,10 +126120,10 @@ var require_streamx = __commonJS({ return; } } - if (stream2 === this.from) { + if (stream === this.from) { this.from = null; if (this.to !== null) { - if ((stream2._duplexState & READ_DONE) === 0) { + if ((stream._duplexState & READ_DONE) === 0) { this.to.destroy(this.error || new Error("Readable stream closed before ending")); } return; @@ -126138,42 +126138,42 @@ var require_streamx = __commonJS({ this.updateCallback(); } function afterFinal(err) { - const stream2 = this.stream; - if (err) stream2.destroy(err); - if ((stream2._duplexState & DESTROY_STATUS) === 0) { - stream2._duplexState |= WRITE_DONE; - stream2.emit("finish"); + const stream = this.stream; + if (err) stream.destroy(err); + if ((stream._duplexState & DESTROY_STATUS) === 0) { + stream._duplexState |= WRITE_DONE; + stream.emit("finish"); } - if ((stream2._duplexState & AUTO_DESTROY) === DONE) { - stream2._duplexState |= DESTROYING; + if ((stream._duplexState & AUTO_DESTROY) === DONE) { + stream._duplexState |= DESTROYING; } - stream2._duplexState &= WRITE_NOT_ACTIVE; - if ((stream2._duplexState & WRITE_UPDATING) === 0) this.update(); + stream._duplexState &= WRITE_NOT_ACTIVE; + if ((stream._duplexState & WRITE_UPDATING) === 0) this.update(); else this.updateNextTick(); } function afterDestroy(err) { - const stream2 = this.stream; + const stream = this.stream; if (!err && this.error !== STREAM_DESTROYED) err = this.error; - if (err) stream2.emit("error", err); - stream2._duplexState |= DESTROYED; - stream2.emit("close"); - const rs = stream2._readableState; - const ws = stream2._writableState; - if (rs !== null && rs.pipeline !== null) rs.pipeline.done(stream2, err); + if (err) stream.emit("error", err); + stream._duplexState |= DESTROYED; + stream.emit("close"); + const rs = stream._readableState; + const ws = stream._writableState; + if (rs !== null && rs.pipeline !== null) rs.pipeline.done(stream, err); if (ws !== null) { while (ws.drains !== null && ws.drains.length > 0) ws.drains.shift().resolve(false); - if (ws.pipeline !== null) ws.pipeline.done(stream2, err); + if (ws.pipeline !== null) ws.pipeline.done(stream, err); } } function afterWrite(err) { - const stream2 = this.stream; - if (err) stream2.destroy(err); - stream2._duplexState &= WRITE_NOT_ACTIVE; + const stream = this.stream; + if (err) stream.destroy(err); + stream._duplexState &= WRITE_NOT_ACTIVE; if (this.drains !== null) tickDrains(this.drains); - if ((stream2._duplexState & WRITE_DRAIN_STATUS) === WRITE_UNDRAINED) { - stream2._duplexState &= WRITE_DRAINED; - if ((stream2._duplexState & WRITE_EMIT_DRAIN) === WRITE_EMIT_DRAIN) { - stream2.emit("drain"); + if ((stream._duplexState & WRITE_DRAIN_STATUS) === WRITE_UNDRAINED) { + stream._duplexState &= WRITE_DRAINED; + if ((stream._duplexState & WRITE_EMIT_DRAIN) === WRITE_EMIT_DRAIN) { + stream.emit("drain"); } } this.updateCallback(); @@ -126205,19 +126205,19 @@ var require_streamx = __commonJS({ } } function afterOpen(err) { - const stream2 = this.stream; - if (err) stream2.destroy(err); - if ((stream2._duplexState & DESTROYING) === 0) { - if ((stream2._duplexState & READ_PRIMARY_STATUS) === 0) stream2._duplexState |= READ_PRIMARY; - if ((stream2._duplexState & WRITE_PRIMARY_STATUS) === 0) stream2._duplexState |= WRITE_PRIMARY; - stream2.emit("open"); + const stream = this.stream; + if (err) stream.destroy(err); + if ((stream._duplexState & DESTROYING) === 0) { + if ((stream._duplexState & READ_PRIMARY_STATUS) === 0) stream._duplexState |= READ_PRIMARY; + if ((stream._duplexState & WRITE_PRIMARY_STATUS) === 0) stream._duplexState |= WRITE_PRIMARY; + stream.emit("open"); } - stream2._duplexState &= NOT_ACTIVE; - if (stream2._writableState !== null) { - stream2._writableState.updateCallback(); + stream._duplexState &= NOT_ACTIVE; + if (stream._writableState !== null) { + stream._writableState.updateCallback(); } - if (stream2._readableState !== null) { - stream2._readableState.updateCallback(); + if (stream._readableState !== null) { + stream._readableState.updateCallback(); } } function afterTransform(err, data) { @@ -126298,7 +126298,7 @@ var require_streamx = __commonJS({ } } }; - var Readable2 = class _Readable extends Stream { + var Readable = class _Readable extends Stream { constructor(opts) { super(opts); this._duplexState |= OPENING | WRITE_DONE | READ_READ_AHEAD; @@ -126390,7 +126390,7 @@ var require_streamx = __commonJS({ return (rs._duplexState & READ_RESUMED) === 0; } [asyncIterator]() { - const stream2 = this; + const stream = this; let error3 = null; let promiseResolve = null; let promiseReject = null; @@ -126407,9 +126407,9 @@ var require_streamx = __commonJS({ return new Promise(function(resolve8, reject) { promiseResolve = resolve8; promiseReject = reject; - const data = stream2.read(); + const data = stream.read(); if (data !== null) ondata(data); - else if ((stream2._duplexState & DESTROYED) !== 0) ondata(null); + else if ((stream._duplexState & DESTROYED) !== 0) ondata(null); }); }, return() { @@ -126420,7 +126420,7 @@ var require_streamx = __commonJS({ } }; function onreadable() { - if (promiseResolve !== null) ondata(stream2.read()); + if (promiseResolve !== null) ondata(stream.read()); } function onclose() { if (promiseResolve !== null) ondata(null); @@ -126428,15 +126428,15 @@ var require_streamx = __commonJS({ function ondata(data) { if (promiseReject === null) return; if (error3) promiseReject(error3); - else if (data === null && (stream2._duplexState & READ_DONE) === 0) promiseReject(STREAM_DESTROYED); + else if (data === null && (stream._duplexState & READ_DONE) === 0) promiseReject(STREAM_DESTROYED); else promiseResolve({ value: data, done: data === null }); promiseReject = promiseResolve = null; } function destroy(err) { - stream2.destroy(err); + stream.destroy(err); return new Promise((resolve8, reject) => { - if (stream2._duplexState & DESTROYED) return resolve8({ value: void 0, done: true }); - stream2.once("close", function() { + if (stream._duplexState & DESTROYED) return resolve8({ value: void 0, done: true }); + stream.once("close", function() { if (err) reject(err); else resolve8({ value: void 0, done: true }); }); @@ -126496,7 +126496,7 @@ var require_streamx = __commonJS({ return this; } }; - var Duplex = class extends Readable2 { + var Duplex = class extends Readable { // and Writable constructor(opts) { super(opts); @@ -126595,8 +126595,8 @@ var require_streamx = __commonJS({ }); }); } - function pipeline(stream2, ...streams) { - const all = Array.isArray(stream2) ? [...stream2, ...streams] : [stream2, ...streams]; + function pipeline(stream, ...streams) { + const all = Array.isArray(stream) ? [...stream, ...streams] : [stream, ...streams]; const done = all.length && typeof all[all.length - 1] === "function" ? all.pop() : null; if (all.length < 2) throw new Error("Pipeline requires at least 2 streams"); let src = all[0]; @@ -126646,24 +126646,24 @@ var require_streamx = __commonJS({ function echo(s) { return s; } - function isStream(stream2) { - return !!stream2._readableState || !!stream2._writableState; + function isStream(stream) { + return !!stream._readableState || !!stream._writableState; } - function isStreamx(stream2) { - return typeof stream2._duplexState === "number" && isStream(stream2); + function isStreamx(stream) { + return typeof stream._duplexState === "number" && isStream(stream); } - function isEnded(stream2) { - return !!stream2._readableState && stream2._readableState.ended; + function isEnded(stream) { + return !!stream._readableState && stream._readableState.ended; } - function isFinished(stream2) { - return !!stream2._writableState && stream2._writableState.ended; + function isFinished(stream) { + return !!stream._writableState && stream._writableState.ended; } - function getStreamError(stream2, opts = {}) { - const err = stream2._readableState && stream2._readableState.error || stream2._writableState && stream2._writableState.error; + function getStreamError(stream, opts = {}) { + const err = stream._readableState && stream._readableState.error || stream._writableState && stream._writableState.error; return !opts.all && err === STREAM_DESTROYED ? null : err; } - function isReadStreamx(stream2) { - return isStreamx(stream2) && stream2.readable; + function isReadStreamx(stream) { + return isStreamx(stream) && stream.readable; } function isTypedArray(data) { return typeof data === "object" && data !== null && typeof data.byteLength === "number"; @@ -126689,7 +126689,7 @@ var require_streamx = __commonJS({ getStreamError, Stream, Writable, - Readable: Readable2, + Readable, Duplex, Transform, // Export PassThrough for compatibility with Node.js core's stream module @@ -126962,7 +126962,7 @@ var require_headers3 = __commonJS({ // node_modules/tar-stream/extract.js var require_extract = __commonJS({ "node_modules/tar-stream/extract.js"(exports2, module2) { - var { Writable, Readable: Readable2, getStreamError } = require_streamx(); + var { Writable, Readable, getStreamError } = require_streamx(); var FIFO = require_fast_fifo(); var b4a = require_b4a(); var headers = require_headers3(); @@ -127009,7 +127009,7 @@ var require_extract = __commonJS({ return buf.subarray(this._offset, this._offset += size); } }; - var Source = class extends Readable2 { + var Source = class extends Readable { constructor(self2, header, offset) { super(); this.header = header; @@ -127251,14 +127251,14 @@ var require_extract = __commonJS({ promiseResolve = promiseReject = null; } } - function onentry(header, stream2, callback) { + function onentry(header, stream, callback) { entryCallback = callback; - stream2.on("error", noop3); + stream.on("error", noop3); if (promiseResolve) { - promiseResolve({ value: stream2, done: false }); + promiseResolve({ value: stream, done: false }); promiseResolve = promiseReject = null; } else { - entryStream = stream2; + entryStream = stream; } } function onclose() { @@ -127316,7 +127316,7 @@ var require_constants19 = __commonJS({ // node_modules/tar-stream/pack.js var require_pack = __commonJS({ "node_modules/tar-stream/pack.js"(exports2, module2) { - var { Readable: Readable2, Writable, getStreamError } = require_streamx(); + var { Readable, Writable, getStreamError } = require_streamx(); var b4a = require_b4a(); var constants = require_constants19(); var headers = require_headers3(); @@ -127409,7 +127409,7 @@ var require_pack = __commonJS({ cb(); } }; - var Pack = class extends Readable2 { + var Pack = class extends Readable { constructor(opts) { super(opts); this._drain = noop3; @@ -127454,8 +127454,8 @@ var require_pack = __commonJS({ this.push(END_OF_TAR); this.push(null); } - _done(stream2) { - if (stream2 !== this._stream) return; + _done(stream) { + if (stream !== this._stream) return; this._stream = null; if (this._finalizing) this.finalize(); if (this._pending.length) this._pending.shift()._continueOpen(); @@ -127506,9 +127506,9 @@ var require_pack = __commonJS({ const err = getStreamError(this); if (this._stream) this._stream.destroy(err); while (this._pending.length) { - const stream2 = this._pending.shift(); - stream2.destroy(err); - stream2._continueOpen(); + const stream = this._pending.shift(); + stream.destroy(err); + stream._continueOpen(); } this._doDrain(); } @@ -128098,13 +128098,13 @@ var require_zip2 = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.createZipUploadStream = exports2.ZipUploadStream = exports2.DEFAULT_COMPRESSION_LEVEL = void 0; - var stream2 = __importStar2(require("stream")); + var stream = __importStar2(require("stream")); var promises_1 = require("fs/promises"); var archiver2 = __importStar2(require_archiver()); var core17 = __importStar2(require_core()); var config_1 = require_config2(); exports2.DEFAULT_COMPRESSION_LEVEL = 6; - var ZipUploadStream = class extends stream2.Transform { + var ZipUploadStream = class extends stream.Transform { constructor(bufferSize) { super({ highWaterMark: bufferSize @@ -128317,8 +128317,8 @@ var require_context2 = __commonJS({ if ((0, fs_1.existsSync)(process.env.GITHUB_EVENT_PATH)) { this.payload = JSON.parse((0, fs_1.readFileSync)(process.env.GITHUB_EVENT_PATH, { encoding: "utf8" })); } else { - const path17 = process.env.GITHUB_EVENT_PATH; - process.stdout.write(`GITHUB_EVENT_PATH ${path17} does not exist${os_1.EOL}`); + const path14 = process.env.GITHUB_EVENT_PATH; + process.stdout.write(`GITHUB_EVENT_PATH ${path14} does not exist${os_1.EOL}`); } } this.eventName = process.env.GITHUB_EVENT_NAME; @@ -128845,7 +128845,7 @@ var require_util24 = __commonJS({ var assert = require("assert"); var { kDestroyed, kBodyUsed } = require_symbols11(); var { IncomingMessage } = require("http"); - var stream2 = require("stream"); + var stream = require("stream"); var net = require("net"); var { InvalidArgumentError } = require_errors6(); var { Blob: Blob2 } = require("buffer"); @@ -128903,14 +128903,14 @@ var require_util24 = __commonJS({ } const port = url2.port != null ? url2.port : url2.protocol === "https:" ? 443 : 80; let origin = url2.origin != null ? url2.origin : `${url2.protocol}//${url2.hostname}:${port}`; - let path17 = url2.path != null ? url2.path : `${url2.pathname || ""}${url2.search || ""}`; + let path14 = url2.path != null ? url2.path : `${url2.pathname || ""}${url2.search || ""}`; if (origin.endsWith("/")) { origin = origin.substring(0, origin.length - 1); } - if (path17 && !path17.startsWith("/")) { - path17 = `/${path17}`; + if (path14 && !path14.startsWith("/")) { + path14 = `/${path14}`; } - url2 = new URL(origin + path17); + url2 = new URL(origin + path14); } return url2; } @@ -128964,29 +128964,29 @@ var require_util24 = __commonJS({ } return null; } - function isDestroyed(stream3) { - return !stream3 || !!(stream3.destroyed || stream3[kDestroyed]); + function isDestroyed(stream2) { + return !stream2 || !!(stream2.destroyed || stream2[kDestroyed]); } - function isReadableAborted(stream3) { - const state = stream3 && stream3._readableState; - return isDestroyed(stream3) && state && !state.endEmitted; + function isReadableAborted(stream2) { + const state = stream2 && stream2._readableState; + return isDestroyed(stream2) && state && !state.endEmitted; } - function destroy(stream3, err) { - if (stream3 == null || !isStream(stream3) || isDestroyed(stream3)) { + function destroy(stream2, err) { + if (stream2 == null || !isStream(stream2) || isDestroyed(stream2)) { return; } - if (typeof stream3.destroy === "function") { - if (Object.getPrototypeOf(stream3).constructor === IncomingMessage) { - stream3.socket = null; + if (typeof stream2.destroy === "function") { + if (Object.getPrototypeOf(stream2).constructor === IncomingMessage) { + stream2.socket = null; } - stream3.destroy(err); + stream2.destroy(err); } else if (err) { - process.nextTick((stream4, err2) => { - stream4.emit("error", err2); - }, stream3, err); + process.nextTick((stream3, err2) => { + stream3.emit("error", err2); + }, stream2, err); } - if (stream3.destroyed !== true) { - stream3[kDestroyed] = true; + if (stream2.destroyed !== true) { + stream2[kDestroyed] = true; } } var KEEPALIVE_TIMEOUT_EXPR = /timeout=(\d+)/; @@ -129075,15 +129075,15 @@ var require_util24 = __commonJS({ } } function isDisturbed(body) { - return !!(body && (stream2.isDisturbed ? stream2.isDisturbed(body) || body[kBodyUsed] : body[kBodyUsed] || body.readableDidRead || body._readableState && body._readableState.dataEmitted || isReadableAborted(body))); + return !!(body && (stream.isDisturbed ? stream.isDisturbed(body) || body[kBodyUsed] : body[kBodyUsed] || body.readableDidRead || body._readableState && body._readableState.dataEmitted || isReadableAborted(body))); } function isErrored(body) { - return !!(body && (stream2.isErrored ? stream2.isErrored(body) : /state: 'errored'/.test( + return !!(body && (stream.isErrored ? stream.isErrored(body) : /state: 'errored'/.test( nodeUtil.inspect(body) ))); } function isReadable(body) { - return !!(body && (stream2.isReadable ? stream2.isReadable(body) : /state: 'readable'/.test( + return !!(body && (stream.isReadable ? stream.isReadable(body) : /state: 'readable'/.test( nodeUtil.inspect(body) ))); } @@ -130524,20 +130524,20 @@ var require_parseParams = __commonJS({ var require_basename = __commonJS({ "node_modules/@fastify/busboy/lib/utils/basename.js"(exports2, module2) { "use strict"; - module2.exports = function basename2(path17) { - if (typeof path17 !== "string") { + module2.exports = function basename2(path14) { + if (typeof path14 !== "string") { return ""; } - for (var i = path17.length - 1; i >= 0; --i) { - switch (path17.charCodeAt(i)) { + for (var i = path14.length - 1; i >= 0; --i) { + switch (path14.charCodeAt(i)) { case 47: // '/' case 92: - path17 = path17.slice(i + 1); - return path17 === ".." || path17 === "." ? "" : path17; + path14 = path14.slice(i + 1); + return path14 === ".." || path14 === "." ? "" : path14; } } - return path17 === ".." || path17 === "." ? "" : path17; + return path14 === ".." || path14 === "." ? "" : path14; }; } }); @@ -130546,7 +130546,7 @@ var require_basename = __commonJS({ var require_multipart2 = __commonJS({ "node_modules/@fastify/busboy/lib/types/multipart.js"(exports2, module2) { "use strict"; - var { Readable: Readable2 } = require("node:stream"); + var { Readable } = require("node:stream"); var { inherits } = require("node:util"); var Dicer = require_Dicer(); var parseParams = require_parseParams(); @@ -130811,11 +130811,11 @@ var require_multipart2 = __commonJS({ part.resume(); } function FileStream(opts) { - Readable2.call(this, opts); + Readable.call(this, opts); this.bytesRead = 0; this.truncated = false; } - inherits(FileStream, Readable2); + inherits(FileStream, Readable); FileStream.prototype._read = function(n) { }; module2.exports = Multipart; @@ -131536,7 +131536,7 @@ var require_util25 = __commonJS({ "use strict"; var { redirectStatusSet, referrerPolicySet: referrerPolicyTokens, badPortsSet } = require_constants21(); var { getGlobalOrigin } = require_global5(); - var { performance: performance3 } = require("perf_hooks"); + var { performance: performance2 } = require("perf_hooks"); var { isBlobLike, toUSVString, ReadableStreamFrom } = require_util24(); var assert = require("assert"); var { isUint8Array } = require("util/types"); @@ -131699,7 +131699,7 @@ var require_util25 = __commonJS({ } } function coarsenedSharedCurrentTime(crossOriginIsolatedCapability) { - return performance3.now(); + return performance2.now(); } function createOpaqueTimingInfo(timingInfo) { return { @@ -132035,11 +132035,11 @@ var require_util25 = __commonJS({ } } var ReadableStream2 = globalThis.ReadableStream; - function isReadableStreamLike(stream2) { + function isReadableStreamLike(stream) { if (!ReadableStream2) { ReadableStream2 = require("stream/web").ReadableStream; } - return stream2 instanceof ReadableStream2 || stream2[Symbol.toStringTag] === "ReadableStream" && typeof stream2.tee === "function"; + return stream instanceof ReadableStream2 || stream[Symbol.toStringTag] === "ReadableStream" && typeof stream.tee === "function"; } var MAXIMUM_ARGUMENT_LENGTH = 65535; function isomorphicDecode(input) { @@ -133196,13 +133196,13 @@ var require_body3 = __commonJS({ if (!ReadableStream2) { ReadableStream2 = require("stream/web").ReadableStream; } - let stream2 = null; + let stream = null; if (object instanceof ReadableStream2) { - stream2 = object; + stream = object; } else if (isBlobLike(object)) { - stream2 = object.stream(); + stream = object.stream(); } else { - stream2 = new ReadableStream2({ + stream = new ReadableStream2({ async pull(controller) { controller.enqueue( typeof source === "string" ? textEncoder.encode(source) : source @@ -133214,7 +133214,7 @@ var require_body3 = __commonJS({ type: void 0 }); } - assert(isReadableStreamLike(stream2)); + assert(isReadableStreamLike(stream)); let action = null; let source = null; let length = null; @@ -133292,14 +133292,14 @@ Content-Type: ${value.type || "application/octet-stream"}\r "Response body object should not be disturbed or locked" ); } - stream2 = object instanceof ReadableStream2 ? object : ReadableStreamFrom(object); + stream = object instanceof ReadableStream2 ? object : ReadableStreamFrom(object); } if (typeof source === "string" || util.isBuffer(source)) { length = Buffer.byteLength(source); } if (action != null) { let iterator2; - stream2 = new ReadableStream2({ + stream = new ReadableStream2({ async start() { iterator2 = action(object)[Symbol.asyncIterator](); }, @@ -133310,7 +133310,7 @@ Content-Type: ${value.type || "application/octet-stream"}\r controller.close(); }); } else { - if (!isErrored(stream2)) { + if (!isErrored(stream)) { controller.enqueue(new Uint8Array(value)); } } @@ -133322,7 +133322,7 @@ Content-Type: ${value.type || "application/octet-stream"}\r type: void 0 }); } - const body = { stream: stream2, source, length }; + const body = { stream, source, length }; return [body, type2]; } function safelyExtractBody(object, keepalive = false) { @@ -133351,15 +133351,15 @@ Content-Type: ${value.type || "application/octet-stream"}\r if (isUint8Array(body)) { yield body; } else { - const stream2 = body.stream; - if (util.isDisturbed(stream2)) { + const stream = body.stream; + if (util.isDisturbed(stream)) { throw new TypeError("The body has already been consumed."); } - if (stream2.locked) { + if (stream.locked) { throw new TypeError("The stream is locked."); } - stream2[kBodyUsed] = true; - yield* stream2; + stream[kBodyUsed] = true; + yield* stream; } } } @@ -133567,7 +133567,7 @@ var require_request5 = __commonJS({ } var Request = class _Request { constructor(origin, { - path: path17, + path: path14, method, body, headers, @@ -133581,11 +133581,11 @@ var require_request5 = __commonJS({ throwOnError, expectContinue }, handler2) { - if (typeof path17 !== "string") { + if (typeof path14 !== "string") { throw new InvalidArgumentError("path must be a string"); - } else if (path17[0] !== "/" && !(path17.startsWith("http://") || path17.startsWith("https://")) && method !== "CONNECT") { + } else if (path14[0] !== "/" && !(path14.startsWith("http://") || path14.startsWith("https://")) && method !== "CONNECT") { throw new InvalidArgumentError("path must be an absolute URL or start with a slash"); - } else if (invalidPathRegex.exec(path17) !== null) { + } else if (invalidPathRegex.exec(path14) !== null) { throw new InvalidArgumentError("invalid request path"); } if (typeof method !== "string") { @@ -133648,7 +133648,7 @@ var require_request5 = __commonJS({ this.completed = false; this.aborted = false; this.upgrade = upgrade || null; - this.path = query ? util.buildURL(path17, query) : path17; + this.path = query ? util.buildURL(path14, query) : path14; this.origin = origin; this.idempotent = idempotent == null ? method === "HEAD" || method === "GET" : idempotent; this.blocking = blocking == null ? false : blocking; @@ -134656,9 +134656,9 @@ var require_RedirectHandler = __commonJS({ return this.handler.onHeaders(statusCode, headers, resume, statusText); } const { origin, pathname, search } = util.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin))); - const path17 = search ? `${pathname}${search}` : pathname; + const path14 = search ? `${pathname}${search}` : pathname; this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin); - this.opts.path = path17; + this.opts.path = path14; this.opts.origin = origin; this.opts.maxRedirections = 0; this.opts.query = null; @@ -135898,7 +135898,7 @@ var require_client3 = __commonJS({ writeH2(client, client[kHTTP2Session], request2); return; } - const { body, method, path: path17, host, upgrade, headers, blocking, reset } = request2; + const { body, method, path: path14, host, upgrade, headers, blocking, reset } = request2; const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH"; if (body && typeof body.read === "function") { body.read(0); @@ -135948,7 +135948,7 @@ var require_client3 = __commonJS({ if (blocking) { socket[kBlocking] = true; } - let header = `${method} ${path17} HTTP/1.1\r + let header = `${method} ${path14} HTTP/1.1\r `; if (typeof host === "string") { header += `host: ${host}\r @@ -136011,7 +136011,7 @@ upgrade: ${upgrade}\r return true; } function writeH2(client, session, request2) { - const { body, method, path: path17, host, upgrade, expectContinue, signal, headers: reqHeaders } = request2; + const { body, method, path: path14, host, upgrade, expectContinue, signal, headers: reqHeaders } = request2; let headers; if (typeof reqHeaders === "string") headers = Request[kHTTP2CopyHeaders](reqHeaders.trim()); else headers = reqHeaders; @@ -136032,29 +136032,29 @@ upgrade: ${upgrade}\r if (request2.aborted) { return false; } - let stream2; + let stream; const h2State = client[kHTTP2SessionState]; headers[HTTP2_HEADER_AUTHORITY] = host || client[kHost]; headers[HTTP2_HEADER_METHOD] = method; if (method === "CONNECT") { session.ref(); - stream2 = session.request(headers, { endStream: false, signal }); - if (stream2.id && !stream2.pending) { - request2.onUpgrade(null, null, stream2); + stream = session.request(headers, { endStream: false, signal }); + if (stream.id && !stream.pending) { + request2.onUpgrade(null, null, stream); ++h2State.openStreams; } else { - stream2.once("ready", () => { - request2.onUpgrade(null, null, stream2); + stream.once("ready", () => { + request2.onUpgrade(null, null, stream); ++h2State.openStreams; }); } - stream2.once("close", () => { + stream.once("close", () => { h2State.openStreams -= 1; if (h2State.openStreams === 0) session.unref(); }); return true; } - headers[HTTP2_HEADER_PATH] = path17; + headers[HTTP2_HEADER_PATH] = path14; headers[HTTP2_HEADER_SCHEME] = "https"; const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH"; if (body && typeof body.read === "function") { @@ -136082,48 +136082,48 @@ upgrade: ${upgrade}\r const shouldEndStream = method === "GET" || method === "HEAD"; if (expectContinue) { headers[HTTP2_HEADER_EXPECT] = "100-continue"; - stream2 = session.request(headers, { endStream: shouldEndStream, signal }); - stream2.once("continue", writeBodyH2); + stream = session.request(headers, { endStream: shouldEndStream, signal }); + stream.once("continue", writeBodyH2); } else { - stream2 = session.request(headers, { + stream = session.request(headers, { endStream: shouldEndStream, signal }); writeBodyH2(); } ++h2State.openStreams; - stream2.once("response", (headers2) => { + stream.once("response", (headers2) => { const { [HTTP2_HEADER_STATUS]: statusCode, ...realHeaders } = headers2; - if (request2.onHeaders(Number(statusCode), realHeaders, stream2.resume.bind(stream2), "") === false) { - stream2.pause(); + if (request2.onHeaders(Number(statusCode), realHeaders, stream.resume.bind(stream), "") === false) { + stream.pause(); } }); - stream2.once("end", () => { + stream.once("end", () => { request2.onComplete([]); }); - stream2.on("data", (chunk) => { + stream.on("data", (chunk) => { if (request2.onData(chunk) === false) { - stream2.pause(); + stream.pause(); } }); - stream2.once("close", () => { + stream.once("close", () => { h2State.openStreams -= 1; if (h2State.openStreams === 0) { session.unref(); } }); - stream2.once("error", function(err) { + stream.once("error", function(err) { if (client[kHTTP2Session] && !client[kHTTP2Session].destroyed && !this.closed && !this.destroyed) { h2State.streams -= 1; - util.destroy(stream2, err); + util.destroy(stream, err); } }); - stream2.once("frameError", (type2, code) => { + stream.once("frameError", (type2, code) => { const err = new InformationalError(`HTTP/2: "frameError" received - type ${type2}, code ${code}`); errorRequest2(client, request2, err); if (client[kHTTP2Session] && !client[kHTTP2Session].destroyed && !this.closed && !this.destroyed) { h2State.streams -= 1; - util.destroy(stream2, err); + util.destroy(stream, err); } }); return true; @@ -136132,10 +136132,10 @@ upgrade: ${upgrade}\r request2.onRequestSent(); } else if (util.isBuffer(body)) { assert(contentLength === body.byteLength, "buffer body must have content length"); - stream2.cork(); - stream2.write(body); - stream2.uncork(); - stream2.end(); + stream.cork(); + stream.write(body); + stream.uncork(); + stream.end(); request2.onBodySent(body); request2.onRequestSent(); } else if (util.isBlobLike(body)) { @@ -136144,7 +136144,7 @@ upgrade: ${upgrade}\r client, request: request2, contentLength, - h2stream: stream2, + h2stream: stream, expectsPayload, body: body.stream(), socket: client[kSocket], @@ -136157,7 +136157,7 @@ upgrade: ${upgrade}\r request: request2, contentLength, expectsPayload, - h2stream: stream2, + h2stream: stream, header: "", socket: client[kSocket] }); @@ -136170,7 +136170,7 @@ upgrade: ${upgrade}\r contentLength, expectsPayload, socket: client[kSocket], - h2stream: stream2, + h2stream: stream, header: "" }); } else if (util.isIterable(body)) { @@ -136181,7 +136181,7 @@ upgrade: ${upgrade}\r contentLength, expectsPayload, header: "", - h2stream: stream2, + h2stream: stream, socket: client[kSocket] }); } else { @@ -137111,7 +137111,7 @@ var require_readable5 = __commonJS({ "node_modules/undici/lib/api/readable.js"(exports2, module2) { "use strict"; var assert = require("assert"); - var { Readable: Readable2 } = require("stream"); + var { Readable } = require("stream"); var { RequestAbortedError, NotSupportedError, InvalidArgumentError } = require_errors6(); var util = require_util24(); var { ReadableStreamFrom, toUSVString } = require_util24(); @@ -137123,7 +137123,7 @@ var require_readable5 = __commonJS({ var kContentType = /* @__PURE__ */ Symbol("kContentType"); var noop3 = () => { }; - module2.exports = class BodyReadable extends Readable2 { + module2.exports = class BodyReadable extends Readable { constructor({ resume, abort, @@ -137266,28 +137266,28 @@ var require_readable5 = __commonJS({ function isUnusable(self2) { return util.isDisturbed(self2) || isLocked(self2); } - async function consume(stream2, type2) { - if (isUnusable(stream2)) { + async function consume(stream, type2) { + if (isUnusable(stream)) { throw new TypeError("unusable"); } - assert(!stream2[kConsume]); + assert(!stream[kConsume]); return new Promise((resolve8, reject) => { - stream2[kConsume] = { + stream[kConsume] = { type: type2, - stream: stream2, + stream, resolve: resolve8, reject, length: 0, body: [] }; - stream2.on("error", function(err) { + stream.on("error", function(err) { consumeFinish(this[kConsume], err); }).on("close", function() { if (this[kConsume].body !== null) { consumeFinish(this[kConsume], new RequestAbortedError()); } }); - process.nextTick(consumeStart, stream2[kConsume]); + process.nextTick(consumeStart, stream[kConsume]); }); } function consumeStart(consume2) { @@ -137310,7 +137310,7 @@ var require_readable5 = __commonJS({ } } function consumeEnd(consume2) { - const { type: type2, body, resolve: resolve8, stream: stream2, length } = consume2; + const { type: type2, body, resolve: resolve8, stream, length } = consume2; try { if (type2 === "text") { resolve8(toUSVString(Buffer.concat(body))); @@ -137328,11 +137328,11 @@ var require_readable5 = __commonJS({ if (!Blob2) { Blob2 = require("buffer").Blob; } - resolve8(new Blob2(body, { type: stream2[kContentType] })); + resolve8(new Blob2(body, { type: stream[kContentType] })); } consumeFinish(consume2); } catch (err) { - stream2.destroy(err); + stream.destroy(err); } } function consumePush(consume2, chunk) { @@ -137454,7 +137454,7 @@ var require_abort_signal3 = __commonJS({ var require_api_request3 = __commonJS({ "node_modules/undici/lib/api/api-request.js"(exports2, module2) { "use strict"; - var Readable2 = require_readable5(); + var Readable = require_readable5(); var { InvalidArgumentError, RequestAbortedError @@ -137528,7 +137528,7 @@ var require_api_request3 = __commonJS({ } const parsedHeaders = responseHeaders === "raw" ? util.parseHeaders(rawHeaders) : headers; const contentType = parsedHeaders["content-type"]; - const body = new Readable2({ resume, abort, contentType, highWaterMark }); + const body = new Readable({ resume, abort, contentType, highWaterMark }); this.callback = null; this.res = body; if (callback !== null) { @@ -137756,10 +137756,10 @@ var require_api_stream3 = __commonJS({ } } }; - function stream2(opts, factory, callback) { + function stream(opts, factory, callback) { if (callback === void 0) { return new Promise((resolve8, reject) => { - stream2.call(this, opts, factory, (err, data) => { + stream.call(this, opts, factory, (err, data) => { return err ? reject(err) : resolve8(data); }); }); @@ -137774,7 +137774,7 @@ var require_api_stream3 = __commonJS({ queueMicrotask(() => callback(err, { opaque })); } } - module2.exports = stream2; + module2.exports = stream; } }); @@ -137783,7 +137783,7 @@ var require_api_pipeline3 = __commonJS({ "node_modules/undici/lib/api/api-pipeline.js"(exports2, module2) { "use strict"; var { - Readable: Readable2, + Readable, Duplex, PassThrough } = require("stream"); @@ -137797,7 +137797,7 @@ var require_api_pipeline3 = __commonJS({ var { addSignal, removeSignal } = require_abort_signal3(); var assert = require("assert"); var kResume = /* @__PURE__ */ Symbol("resume"); - var PipelineRequest = class extends Readable2 { + var PipelineRequest = class extends Readable { constructor() { super({ autoDestroy: true }); this[kResume] = null; @@ -137814,7 +137814,7 @@ var require_api_pipeline3 = __commonJS({ callback(err); } }; - var PipelineResponse = class extends Readable2 { + var PipelineResponse = class extends Readable { constructor(resume) { super({ autoDestroy: true }); this[kResume] = resume; @@ -138294,20 +138294,20 @@ var require_mock_utils3 = __commonJS({ } return true; } - function safeUrl(path17) { - if (typeof path17 !== "string") { - return path17; + function safeUrl(path14) { + if (typeof path14 !== "string") { + return path14; } - const pathSegments = path17.split("?"); + const pathSegments = path14.split("?"); if (pathSegments.length !== 2) { - return path17; + return path14; } const qp = new URLSearchParams(pathSegments.pop()); qp.sort(); return [...pathSegments, qp.toString()].join("?"); } - function matchKey(mockDispatch2, { path: path17, method, body, headers }) { - const pathMatch = matchValue(mockDispatch2.path, path17); + function matchKey(mockDispatch2, { path: path14, method, body, headers }) { + const pathMatch = matchValue(mockDispatch2.path, path14); const methodMatch = matchValue(mockDispatch2.method, method); const bodyMatch = typeof mockDispatch2.body !== "undefined" ? matchValue(mockDispatch2.body, body) : true; const headersMatch = matchHeaders(mockDispatch2, headers); @@ -138325,7 +138325,7 @@ var require_mock_utils3 = __commonJS({ function getMockDispatch(mockDispatches, key) { const basePath = key.query ? buildURL(key.path, key.query) : key.path; const resolvedPath = typeof basePath === "string" ? safeUrl(basePath) : basePath; - let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path: path17 }) => matchValue(safeUrl(path17), resolvedPath)); + let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path: path14 }) => matchValue(safeUrl(path14), resolvedPath)); if (matchedMockDispatches.length === 0) { throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`); } @@ -138362,9 +138362,9 @@ var require_mock_utils3 = __commonJS({ } } function buildKey(opts) { - const { path: path17, method, body, headers, query } = opts; + const { path: path14, method, body, headers, query } = opts; return { - path: path17, + path: path14, method, body, headers, @@ -138813,10 +138813,10 @@ var require_pending_interceptors_formatter3 = __commonJS({ } format(pendingInterceptors) { const withPrettyHeaders = pendingInterceptors.map( - ({ method, path: path17, data: { statusCode }, persist, times, timesInvoked, origin }) => ({ + ({ method, path: path14, data: { statusCode }, persist, times, timesInvoked, origin }) => ({ Method: method, Origin: origin, - Path: path17, + Path: path14, "Status code": statusCode, Persistent: persist ? "\u2705" : "\u274C", Invocations: timesInvoked, @@ -140917,7 +140917,7 @@ var require_fetch3 = __commonJS({ } = require_constants21(); var { kHeadersList } = require_symbols11(); var EE = require("events"); - var { Readable: Readable2, pipeline } = require("stream"); + var { Readable, pipeline } = require("stream"); var { addAbortListener, isErrored, isReadable, nodeMajor, nodeMinor } = require_util24(); var { dataURLProcessor, serializeAMimeType } = require_dataURL(); var { TransformStream: TransformStream2 } = require("stream/web"); @@ -141676,7 +141676,7 @@ var require_fetch3 = __commonJS({ if (!ReadableStream2) { ReadableStream2 = require("stream/web").ReadableStream; } - const stream2 = new ReadableStream2( + const stream = new ReadableStream2( { async start(controller) { fetchParams.controller.controller = controller; @@ -141695,7 +141695,7 @@ var require_fetch3 = __commonJS({ } } ); - response.body = { stream: stream2 }; + response.body = { stream }; fetchParams.controller.on("terminated", onAborted); fetchParams.controller.resume = async () => { while (true) { @@ -141726,7 +141726,7 @@ var require_fetch3 = __commonJS({ return; } fetchParams.controller.controller.enqueue(new Uint8Array(bytes)); - if (isErrored(stream2)) { + if (isErrored(stream)) { fetchParams.controller.terminate(); return; } @@ -141738,13 +141738,13 @@ var require_fetch3 = __commonJS({ function onAborted(reason) { if (isAborted(fetchParams)) { response.aborted = true; - if (isReadable(stream2)) { + if (isReadable(stream)) { fetchParams.controller.controller.error( fetchParams.controller.serializedAbortReason ); } } else { - if (isReadable(stream2)) { + if (isReadable(stream)) { fetchParams.controller.controller.error(new TypeError("terminated", { cause: isErrorLike(reason) ? reason : void 0 })); @@ -141808,7 +141808,7 @@ var require_fetch3 = __commonJS({ headers[kHeadersList].append(key, val); } } - this.body = new Readable2({ read: resume }); + this.body = new Readable({ read: resume }); const decoders = []; const willFollow = request2.redirect === "follow" && location && redirectStatusSet.has(status); if (request2.method !== "HEAD" && request2.method !== "CONNECT" && !nullBodyStatus.includes(status) && !willFollow) { @@ -142295,8 +142295,8 @@ var require_util27 = __commonJS({ fr[kState] = "loading"; fr[kResult] = null; fr[kError] = null; - const stream2 = blob.stream(); - const reader = stream2.getReader(); + const stream = blob.stream(); + const reader = stream.getReader(); const bytes = []; let chunkPromise = reader.read(); let isFirstChunk = true; @@ -142980,8 +142980,8 @@ var require_cache6 = __commonJS({ const clonedResponse = cloneResponse(innerResponse); const bodyReadPromise = createDeferredPromise(); if (innerResponse.body != null) { - const stream2 = innerResponse.body.stream; - const reader = stream2.getReader(); + const stream = innerResponse.body.stream; + const reader = stream.getReader(); readAllBytes(reader).then(bodyReadPromise.resolve, bodyReadPromise.reject); } else { bodyReadPromise.resolve(void 0); @@ -143436,8 +143436,8 @@ var require_util29 = __commonJS({ } } } - function validateCookiePath(path17) { - for (const char of path17) { + function validateCookiePath(path14) { + for (const char of path14) { const code = char.charCodeAt(0); if (code < 33 || char === ";") { throw new Error("Invalid cookie path"); @@ -145117,11 +145117,11 @@ var require_undici3 = __commonJS({ if (typeof opts.path !== "string") { throw new InvalidArgumentError("invalid opts.path"); } - let path17 = opts.path; + let path14 = opts.path; if (!opts.path.startsWith("/")) { - path17 = `/${path17}`; + path14 = `/${path14}`; } - url2 = new URL(util.parseOrigin(url2).origin + path17); + url2 = new URL(util.parseOrigin(url2).origin + path14); } else { if (!opts) { opts = typeof url2 === "object" ? url2 : {}; @@ -145439,9 +145439,9 @@ var require_lib4 = __commonJS({ return this.request("HEAD", requestUrl, null, additionalHeaders || {}); }); } - sendStream(verb, requestUrl, stream2, additionalHeaders) { + sendStream(verb, requestUrl, stream, additionalHeaders) { return __awaiter2(this, void 0, void 0, function* () { - return this.request(verb, requestUrl, stream2, additionalHeaders); + return this.request(verb, requestUrl, stream, additionalHeaders); }); } /** @@ -149971,7 +149971,7 @@ var require_traverse = __commonJS({ })(this.value); }; function walk(root, cb, immutable) { - var path17 = []; + var path14 = []; var parents = []; var alive = true; return (function walker(node_) { @@ -149980,11 +149980,11 @@ var require_traverse = __commonJS({ var state = { node, node_, - path: [].concat(path17), + path: [].concat(path14), parent: parents.slice(-1)[0], - key: path17.slice(-1)[0], - isRoot: path17.length === 0, - level: path17.length, + key: path14.slice(-1)[0], + isRoot: path14.length === 0, + level: path14.length, circular: null, update: function(x) { if (!state.isRoot) { @@ -150039,7 +150039,7 @@ var require_traverse = __commonJS({ parents.push(state); var keys = Object.keys(state.node); keys.forEach(function(key, i2) { - path17.push(key); + path14.push(key); if (modifiers.pre) modifiers.pre.call(state, state.node[key], key); var child = walker(state.node[key]); if (immutable && Object.hasOwnProperty.call(state.node, key)) { @@ -150048,7 +150048,7 @@ var require_traverse = __commonJS({ child.isLast = i2 == keys.length - 1; child.isFirst = i2 == 0; if (modifiers.post) modifiers.post.call(state, child); - path17.pop(); + path14.pop(); }); parents.pop(); } @@ -150625,23 +150625,23 @@ var require_binary = __commonJS({ return self2; } ; - var stream2 = Chainsaw.light(builder); - stream2.writable = true; + var stream = Chainsaw.light(builder); + stream.writable = true; var buffers = Buffers(); - stream2.write = function(buf) { + stream.write = function(buf) { buffers.push(buf); dispatch(); }; var vars = Vars(); var done = false, caughtEnd = false; - stream2.end = function() { + stream.end = function() { caughtEnd = true; }; - stream2.pipe = Stream.prototype.pipe; + stream.pipe = Stream.prototype.pipe; Object.getOwnPropertyNames(EventEmitter.prototype).forEach(function(name) { - stream2[name] = EventEmitter.prototype[name]; + stream[name] = EventEmitter.prototype[name]; }); - return stream2; + return stream; }; exports2.parse = function parse2(buffer) { var self2 = words(function(bytes, cb) { @@ -150857,20 +150857,20 @@ var require_matcher_stream = __commonJS({ var require_entry = __commonJS({ "node_modules/unzip-stream/lib/entry.js"(exports2, module2) { "use strict"; - var stream2 = require("stream"); + var stream = require("stream"); var inherits = require("util").inherits; function Entry() { if (!(this instanceof Entry)) { return new Entry(); } - stream2.PassThrough.call(this); + stream.PassThrough.call(this); this.path = null; this.type = null; this.isDirectory = false; } - inherits(Entry, stream2.PassThrough); + inherits(Entry, stream.PassThrough); Entry.prototype.autodrain = function() { - return this.pipe(new stream2.Transform({ transform: function(d, e, cb) { + return this.pipe(new stream.Transform({ transform: function(d, e, cb) { cb(); } })); }; @@ -150883,7 +150883,7 @@ var require_unzip_stream = __commonJS({ "node_modules/unzip-stream/lib/unzip-stream.js"(exports2, module2) { "use strict"; var binary2 = require_binary(); - var stream2 = require("stream"); + var stream = require("stream"); var util = require("util"); var zlib3 = require("zlib"); var MatcherStream = require_matcher_stream(); @@ -150917,7 +150917,7 @@ var require_unzip_stream = __commonJS({ if (!(this instanceof UnzipStream)) { return new UnzipStream(options); } - stream2.Transform.call(this); + stream.Transform.call(this); this.options = options || {}; this.data = new Buffer(""); this.state = states.STREAM_START; @@ -150925,7 +150925,7 @@ var require_unzip_stream = __commonJS({ this.parsedEntity = null; this.outStreamInfo = {}; } - util.inherits(UnzipStream, stream2.Transform); + util.inherits(UnzipStream, stream.Transform); UnzipStream.prototype.processDataChunk = function(chunk) { var requiredLength; switch (this.state) { @@ -151069,11 +151069,11 @@ var require_unzip_stream = __commonJS({ return requiredLength; case states.CENTRAL_DIRECTORY_FILE_HEADER_SUFFIX: var isUtf8 = (this.parsedEntity.flags & 2048) !== 0; - var path17 = this._decodeString(chunk.slice(0, this.parsedEntity.fileNameLength), isUtf8); + var path14 = this._decodeString(chunk.slice(0, this.parsedEntity.fileNameLength), isUtf8); var extraDataBuffer = chunk.slice(this.parsedEntity.fileNameLength, this.parsedEntity.fileNameLength + this.parsedEntity.extraFieldLength); var extra = this._readExtraFields(extraDataBuffer); if (extra && extra.parsed && extra.parsed.path && !isUtf8) { - path17 = extra.parsed.path; + path14 = extra.parsed.path; } this.parsedEntity.extra = extra.parsed; var isUnix = (this.parsedEntity.versionMadeBy & 65280) >> 8 === 3; @@ -151085,7 +151085,7 @@ var require_unzip_stream = __commonJS({ } if (this.options.debug) { const debugObj = Object.assign({}, this.parsedEntity, { - path: path17, + path: path14, flags: "0x" + this.parsedEntity.flags.toString(16), unixAttrs: unixAttrs && "0" + unixAttrs.toString(8), isSymlink, @@ -151179,7 +151179,7 @@ var require_unzip_stream = __commonJS({ }); this.outStreamInfo.stream = matcherStream; } else { - this.outStreamInfo.stream = new stream2.PassThrough(); + this.outStreamInfo.stream = new stream.PassThrough(); } var isEncrypted = vars.flags & 1 || vars.flags & 64; if (isEncrypted || !isVersionSupported) { @@ -151522,8 +151522,8 @@ var require_parser_stream = __commonJS({ // node_modules/mkdirp/index.js var require_mkdirp = __commonJS({ "node_modules/mkdirp/index.js"(exports2, module2) { - var path17 = require("path"); - var fs18 = require("fs"); + var path14 = require("path"); + var fs15 = require("fs"); var _0777 = parseInt("0777", 8); module2.exports = mkdirP.mkdirp = mkdirP.mkdirP = mkdirP; function mkdirP(p, opts, f, made) { @@ -151534,7 +151534,7 @@ var require_mkdirp = __commonJS({ opts = { mode: opts }; } var mode = opts.mode; - var xfs = opts.fs || fs18; + var xfs = opts.fs || fs15; if (mode === void 0) { mode = _0777; } @@ -151542,7 +151542,7 @@ var require_mkdirp = __commonJS({ var cb = f || /* istanbul ignore next */ function() { }; - p = path17.resolve(p); + p = path14.resolve(p); xfs.mkdir(p, mode, function(er) { if (!er) { made = made || p; @@ -151550,8 +151550,8 @@ var require_mkdirp = __commonJS({ } switch (er.code) { case "ENOENT": - if (path17.dirname(p) === p) return cb(er); - mkdirP(path17.dirname(p), opts, function(er2, made2) { + if (path14.dirname(p) === p) return cb(er); + mkdirP(path14.dirname(p), opts, function(er2, made2) { if (er2) cb(er2, made2); else mkdirP(p, opts, cb, made2); }); @@ -151573,19 +151573,19 @@ var require_mkdirp = __commonJS({ opts = { mode: opts }; } var mode = opts.mode; - var xfs = opts.fs || fs18; + var xfs = opts.fs || fs15; if (mode === void 0) { mode = _0777; } if (!made) made = null; - p = path17.resolve(p); + p = path14.resolve(p); try { xfs.mkdirSync(p, mode); made = made || p; } catch (err0) { switch (err0.code) { case "ENOENT": - made = sync(path17.dirname(p), opts, made); + made = sync(path14.dirname(p), opts, made); sync(p, opts, made); break; // In the case of any other error, just see if there's a dir @@ -151610,8 +151610,8 @@ var require_mkdirp = __commonJS({ // node_modules/unzip-stream/lib/extract.js var require_extract2 = __commonJS({ "node_modules/unzip-stream/lib/extract.js"(exports2, module2) { - var fs18 = require("fs"); - var path17 = require("path"); + var fs15 = require("fs"); + var path14 = require("path"); var util = require("util"); var mkdirp = require_mkdirp(); var Transform = require("stream").Transform; @@ -151653,11 +151653,11 @@ var require_extract2 = __commonJS({ }; Extract.prototype._processEntry = function(entry) { var self2 = this; - var destPath = path17.join(this.opts.path, entry.path); - var directory = entry.isDirectory ? destPath : path17.dirname(destPath); + var destPath = path14.join(this.opts.path, entry.path); + var directory = entry.isDirectory ? destPath : path14.dirname(destPath); this.unfinishedEntries++; var writeFileFn = function() { - var pipedStream = fs18.createWriteStream(destPath); + var pipedStream = fs15.createWriteStream(destPath); pipedStream.on("close", function() { self2.unfinishedEntries--; self2._notifyAwaiter(); @@ -151765,7 +151765,7 @@ var require_download_artifact = __commonJS({ exports2.downloadArtifactInternal = exports2.downloadArtifactPublic = exports2.streamExtractExternal = void 0; var promises_1 = __importDefault2(require("fs/promises")); var crypto2 = __importStar2(require("crypto")); - var stream2 = __importStar2(require("stream")); + var stream = __importStar2(require("stream")); var github3 = __importStar2(require_github2()); var core17 = __importStar2(require_core()); var httpClient = __importStar2(require_lib()); @@ -151781,10 +151781,10 @@ var require_download_artifact = __commonJS({ parsed.search = ""; return parsed.toString(); }; - function exists(path17) { + function exists(path14) { return __awaiter2(this, void 0, void 0, function* () { try { - yield promises_1.default.access(path17); + yield promises_1.default.access(path14); return true; } catch (error3) { if (error3.code === "ENOENT") { @@ -151826,7 +151826,7 @@ var require_download_artifact = __commonJS({ }; const timer = setTimeout(timerFn, opts.timeout); const hashStream = crypto2.createHash("sha256").setEncoding("hex"); - const passThrough = new stream2.PassThrough(); + const passThrough = new stream.PassThrough(); response.message.pipe(passThrough); passThrough.pipe(hashStream); const extractStream = passThrough; @@ -152016,12 +152016,12 @@ var require_dist_node11 = __commonJS({ octokit.log.debug("request", options); const start = Date.now(); const requestOptions = octokit.request.endpoint.parse(options); - const path17 = requestOptions.url.replace(options.baseUrl, ""); + const path14 = requestOptions.url.replace(options.baseUrl, ""); return request2(options).then((response) => { - octokit.log.info(`${requestOptions.method} ${path17} - ${response.status} in ${Date.now() - start}ms`); + octokit.log.info(`${requestOptions.method} ${path14} - ${response.status} in ${Date.now() - start}ms`); return response; }).catch((error3) => { - octokit.log.info(`${requestOptions.method} ${path17} - ${error3.status} in ${Date.now() - start}ms`); + octokit.log.info(`${requestOptions.method} ${path14} - ${error3.status} in ${Date.now() - start}ms`); throw error3; }); }); @@ -152768,11 +152768,11 @@ var require_command2 = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.issue = exports2.issueCommand = void 0; - var os4 = __importStar2(require("os")); + var os3 = __importStar2(require("os")); var utils_1 = require_utils12(); function issueCommand(command, properties, message) { const cmd = new Command(command, properties, message); - process.stdout.write(cmd.toString() + os4.EOL); + process.stdout.write(cmd.toString() + os3.EOL); } exports2.issueCommand = issueCommand; function issue(name, message = "") { @@ -152855,18 +152855,18 @@ var require_file_command2 = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.prepareKeyValueMessage = exports2.issueFileCommand = void 0; var crypto2 = __importStar2(require("crypto")); - var fs18 = __importStar2(require("fs")); - var os4 = __importStar2(require("os")); + var fs15 = __importStar2(require("fs")); + var os3 = __importStar2(require("os")); var utils_1 = require_utils12(); function issueFileCommand(command, message) { const filePath = process.env[`GITHUB_${command}`]; if (!filePath) { throw new Error(`Unable to find environment variable for file command ${command}`); } - if (!fs18.existsSync(filePath)) { + if (!fs15.existsSync(filePath)) { throw new Error(`Missing file at path: ${filePath}`); } - fs18.appendFileSync(filePath, `${(0, utils_1.toCommandValue)(message)}${os4.EOL}`, { + fs15.appendFileSync(filePath, `${(0, utils_1.toCommandValue)(message)}${os3.EOL}`, { encoding: "utf8" }); } @@ -152880,7 +152880,7 @@ var require_file_command2 = __commonJS({ if (convertedValue.includes(delimiter)) { throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`); } - return `${key}<<${delimiter}${os4.EOL}${convertedValue}${os4.EOL}${delimiter}`; + return `${key}<<${delimiter}${os3.EOL}${convertedValue}${os3.EOL}${delimiter}`; } exports2.prepareKeyValueMessage = prepareKeyValueMessage; } @@ -153211,9 +153211,9 @@ var require_lib5 = __commonJS({ return this.request("HEAD", requestUrl, null, additionalHeaders || {}); }); } - sendStream(verb, requestUrl, stream2, additionalHeaders) { + sendStream(verb, requestUrl, stream, additionalHeaders) { return __awaiter2(this, void 0, void 0, function* () { - return this.request(verb, requestUrl, stream2, additionalHeaders); + return this.request(verb, requestUrl, stream, additionalHeaders); }); } /** @@ -154116,7 +154116,7 @@ var require_path_utils2 = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.toPlatformPath = exports2.toWin32Path = exports2.toPosixPath = void 0; - var path17 = __importStar2(require("path")); + var path14 = __importStar2(require("path")); function toPosixPath(pth) { return pth.replace(/[\\]/g, "/"); } @@ -154126,7 +154126,7 @@ var require_path_utils2 = __commonJS({ } exports2.toWin32Path = toWin32Path; function toPlatformPath(pth) { - return pth.replace(/[/\\]/g, path17.sep); + return pth.replace(/[/\\]/g, path14.sep); } exports2.toPlatformPath = toPlatformPath; } @@ -154189,12 +154189,12 @@ var require_io_util2 = __commonJS({ var _a; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getCmdPath = exports2.tryGetExecutablePath = exports2.isRooted = exports2.isDirectory = exports2.exists = exports2.READONLY = exports2.UV_FS_O_EXLOCK = exports2.IS_WINDOWS = exports2.unlink = exports2.symlink = exports2.stat = exports2.rmdir = exports2.rm = exports2.rename = exports2.readlink = exports2.readdir = exports2.open = exports2.mkdir = exports2.lstat = exports2.copyFile = exports2.chmod = void 0; - var fs18 = __importStar2(require("fs")); - var path17 = __importStar2(require("path")); - _a = fs18.promises, exports2.chmod = _a.chmod, exports2.copyFile = _a.copyFile, exports2.lstat = _a.lstat, exports2.mkdir = _a.mkdir, exports2.open = _a.open, exports2.readdir = _a.readdir, exports2.readlink = _a.readlink, exports2.rename = _a.rename, exports2.rm = _a.rm, exports2.rmdir = _a.rmdir, exports2.stat = _a.stat, exports2.symlink = _a.symlink, exports2.unlink = _a.unlink; + var fs15 = __importStar2(require("fs")); + var path14 = __importStar2(require("path")); + _a = fs15.promises, exports2.chmod = _a.chmod, exports2.copyFile = _a.copyFile, exports2.lstat = _a.lstat, exports2.mkdir = _a.mkdir, exports2.open = _a.open, exports2.readdir = _a.readdir, exports2.readlink = _a.readlink, exports2.rename = _a.rename, exports2.rm = _a.rm, exports2.rmdir = _a.rmdir, exports2.stat = _a.stat, exports2.symlink = _a.symlink, exports2.unlink = _a.unlink; exports2.IS_WINDOWS = process.platform === "win32"; exports2.UV_FS_O_EXLOCK = 268435456; - exports2.READONLY = fs18.constants.O_RDONLY; + exports2.READONLY = fs15.constants.O_RDONLY; function exists(fsPath) { return __awaiter2(this, void 0, void 0, function* () { try { @@ -154239,7 +154239,7 @@ var require_io_util2 = __commonJS({ } if (stats && stats.isFile()) { if (exports2.IS_WINDOWS) { - const upperExt = path17.extname(filePath).toUpperCase(); + const upperExt = path14.extname(filePath).toUpperCase(); if (extensions.some((validExt) => validExt.toUpperCase() === upperExt)) { return filePath; } @@ -154263,11 +154263,11 @@ var require_io_util2 = __commonJS({ if (stats && stats.isFile()) { if (exports2.IS_WINDOWS) { try { - const directory = path17.dirname(filePath); - const upperName = path17.basename(filePath).toUpperCase(); + const directory = path14.dirname(filePath); + const upperName = path14.basename(filePath).toUpperCase(); for (const actualName of yield exports2.readdir(directory)) { if (upperName === actualName.toUpperCase()) { - filePath = path17.join(directory, actualName); + filePath = path14.join(directory, actualName); break; } } @@ -154362,7 +154362,7 @@ var require_io2 = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.findInPath = exports2.which = exports2.mkdirP = exports2.rmRF = exports2.mv = exports2.cp = void 0; var assert_1 = require("assert"); - var path17 = __importStar2(require("path")); + var path14 = __importStar2(require("path")); var ioUtil = __importStar2(require_io_util2()); function cp(source, dest, options = {}) { return __awaiter2(this, void 0, void 0, function* () { @@ -154371,7 +154371,7 @@ var require_io2 = __commonJS({ if (destStat && destStat.isFile() && !force) { return; } - const newDest = destStat && destStat.isDirectory() && copySourceDirectory ? path17.join(dest, path17.basename(source)) : dest; + const newDest = destStat && destStat.isDirectory() && copySourceDirectory ? path14.join(dest, path14.basename(source)) : dest; if (!(yield ioUtil.exists(source))) { throw new Error(`no such file or directory: ${source}`); } @@ -154383,7 +154383,7 @@ var require_io2 = __commonJS({ yield cpDirRecursive(source, newDest, 0, force); } } else { - if (path17.relative(source, newDest) === "") { + if (path14.relative(source, newDest) === "") { throw new Error(`'${newDest}' and '${source}' are the same file`); } yield copyFile2(source, newDest, force); @@ -154396,7 +154396,7 @@ var require_io2 = __commonJS({ if (yield ioUtil.exists(dest)) { let destExists = true; if (yield ioUtil.isDirectory(dest)) { - dest = path17.join(dest, path17.basename(source)); + dest = path14.join(dest, path14.basename(source)); destExists = yield ioUtil.exists(dest); } if (destExists) { @@ -154407,7 +154407,7 @@ var require_io2 = __commonJS({ } } } - yield mkdirP(path17.dirname(dest)); + yield mkdirP(path14.dirname(dest)); yield ioUtil.rename(source, dest); }); } @@ -154470,7 +154470,7 @@ var require_io2 = __commonJS({ } const extensions = []; if (ioUtil.IS_WINDOWS && process.env["PATHEXT"]) { - for (const extension of process.env["PATHEXT"].split(path17.delimiter)) { + for (const extension of process.env["PATHEXT"].split(path14.delimiter)) { if (extension) { extensions.push(extension); } @@ -154483,12 +154483,12 @@ var require_io2 = __commonJS({ } return []; } - if (tool.includes(path17.sep)) { + if (tool.includes(path14.sep)) { return []; } const directories = []; if (process.env.PATH) { - for (const p of process.env.PATH.split(path17.delimiter)) { + for (const p of process.env.PATH.split(path14.delimiter)) { if (p) { directories.push(p); } @@ -154496,7 +154496,7 @@ var require_io2 = __commonJS({ } const matches = []; for (const directory of directories) { - const filePath = yield ioUtil.tryGetExecutablePath(path17.join(directory, tool), extensions); + const filePath = yield ioUtil.tryGetExecutablePath(path14.join(directory, tool), extensions); if (filePath) { matches.push(filePath); } @@ -154609,10 +154609,10 @@ var require_toolrunner2 = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.argStringToArray = exports2.ToolRunner = void 0; - var os4 = __importStar2(require("os")); + var os3 = __importStar2(require("os")); var events = __importStar2(require("events")); var child = __importStar2(require("child_process")); - var path17 = __importStar2(require("path")); + var path14 = __importStar2(require("path")); var io7 = __importStar2(require_io2()); var ioUtil = __importStar2(require_io_util2()); var timers_1 = require("timers"); @@ -154664,12 +154664,12 @@ var require_toolrunner2 = __commonJS({ _processLineBuffer(data, strBuffer, onLine) { try { let s = strBuffer + data.toString(); - let n = s.indexOf(os4.EOL); + let n = s.indexOf(os3.EOL); while (n > -1) { const line = s.substring(0, n); onLine(line); - s = s.substring(n + os4.EOL.length); - n = s.indexOf(os4.EOL); + s = s.substring(n + os3.EOL.length); + n = s.indexOf(os3.EOL); } return s; } catch (err) { @@ -154827,7 +154827,7 @@ var require_toolrunner2 = __commonJS({ exec() { return __awaiter2(this, void 0, void 0, function* () { if (!ioUtil.isRooted(this.toolPath) && (this.toolPath.includes("/") || IS_WINDOWS && this.toolPath.includes("\\"))) { - this.toolPath = path17.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath); + this.toolPath = path14.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath); } this.toolPath = yield io7.which(this.toolPath, true); return new Promise((resolve8, reject) => __awaiter2(this, void 0, void 0, function* () { @@ -154838,7 +154838,7 @@ var require_toolrunner2 = __commonJS({ } const optionsNonNull = this._cloneExecOptions(this.options); if (!optionsNonNull.silent && optionsNonNull.outStream) { - optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os4.EOL); + optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os3.EOL); } const state = new ExecState(optionsNonNull, this.toolPath); state.on("debug", (message) => { @@ -155326,8 +155326,8 @@ var require_core3 = __commonJS({ var command_1 = require_command2(); var file_command_1 = require_file_command2(); var utils_1 = require_utils12(); - var os4 = __importStar2(require("os")); - var path17 = __importStar2(require("path")); + var os3 = __importStar2(require("os")); + var path14 = __importStar2(require("path")); var oidc_utils_1 = require_oidc_utils2(); var ExitCode; (function(ExitCode2) { @@ -155355,7 +155355,7 @@ var require_core3 = __commonJS({ } else { (0, command_1.issueCommand)("add-path", {}, inputPath); } - process.env["PATH"] = `${inputPath}${path17.delimiter}${process.env["PATH"]}`; + process.env["PATH"] = `${inputPath}${path14.delimiter}${process.env["PATH"]}`; } exports2.addPath = addPath; function getInput2(name, options) { @@ -155394,7 +155394,7 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``); if (filePath) { return (0, file_command_1.issueFileCommand)("OUTPUT", (0, file_command_1.prepareKeyValueMessage)(name, value)); } - process.stdout.write(os4.EOL); + process.stdout.write(os3.EOL); (0, command_1.issueCommand)("set-output", { name }, (0, utils_1.toCommandValue)(value)); } exports2.setOutput = setOutput; @@ -155428,7 +155428,7 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``); } exports2.notice = notice; function info7(message) { - process.stdout.write(message + os4.EOL); + process.stdout.write(message + os3.EOL); } exports2.info = info7; function startGroup4(name) { @@ -155531,13 +155531,13 @@ These characters are not allowed in the artifact name due to limitations with ce (0, core_1.info)(`Artifact name is valid!`); } exports2.checkArtifactName = checkArtifactName; - function checkArtifactFilePath(path17) { - if (!path17) { - throw new Error(`Artifact path: ${path17}, is incorrectly provided`); + function checkArtifactFilePath(path14) { + if (!path14) { + throw new Error(`Artifact path: ${path14}, is incorrectly provided`); } for (const [invalidCharacterKey, errorMessageForCharacter] of invalidArtifactFilePathCharacters) { - if (path17.includes(invalidCharacterKey)) { - throw new Error(`Artifact path is not valid: ${path17}. Contains the following character: ${errorMessageForCharacter} + if (path14.includes(invalidCharacterKey)) { + throw new Error(`Artifact path is not valid: ${path14}. Contains the following character: ${errorMessageForCharacter} Invalid characters include: ${Array.from(invalidArtifactFilePathCharacters.values()).toString()} @@ -155583,25 +155583,25 @@ var require_upload_specification = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getUploadSpecification = void 0; - var fs18 = __importStar2(require("fs")); + var fs15 = __importStar2(require("fs")); var core_1 = require_core3(); var path_1 = require("path"); var path_and_artifact_name_validation_1 = require_path_and_artifact_name_validation2(); function getUploadSpecification(artifactName, rootDirectory, artifactFiles) { const specifications = []; - if (!fs18.existsSync(rootDirectory)) { + if (!fs15.existsSync(rootDirectory)) { throw new Error(`Provided rootDirectory ${rootDirectory} does not exist`); } - if (!fs18.statSync(rootDirectory).isDirectory()) { + if (!fs15.statSync(rootDirectory).isDirectory()) { throw new Error(`Provided rootDirectory ${rootDirectory} is not a valid directory`); } rootDirectory = (0, path_1.normalize)(rootDirectory); rootDirectory = (0, path_1.resolve)(rootDirectory); for (let file of artifactFiles) { - if (!fs18.existsSync(file)) { + if (!fs15.existsSync(file)) { throw new Error(`File ${file} does not exist`); } - if (!fs18.statSync(file).isDirectory()) { + if (!fs15.statSync(file).isDirectory()) { file = (0, path_1.normalize)(file); file = (0, path_1.resolve)(file); if (!file.startsWith(rootDirectory)) { @@ -155626,29 +155626,29 @@ var require_upload_specification = __commonJS({ // node_modules/tmp/lib/tmp.js var require_tmp = __commonJS({ "node_modules/tmp/lib/tmp.js"(exports2, module2) { - var fs18 = require("fs"); - var os4 = require("os"); - var path17 = require("path"); + var fs15 = require("fs"); + var os3 = require("os"); + var path14 = require("path"); var crypto2 = require("crypto"); - var _c = { fs: fs18.constants, os: os4.constants }; + var _c = { fs: fs15.constants, os: os3.constants }; var RANDOM_CHARS = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; var TEMPLATE_PATTERN = /XXXXXX/; var DEFAULT_TRIES = 3; var CREATE_FLAGS = (_c.O_CREAT || _c.fs.O_CREAT) | (_c.O_EXCL || _c.fs.O_EXCL) | (_c.O_RDWR || _c.fs.O_RDWR); - var IS_WIN32 = os4.platform() === "win32"; + var IS_WIN32 = os3.platform() === "win32"; var EBADF = _c.EBADF || _c.os.errno.EBADF; var ENOENT = _c.ENOENT || _c.os.errno.ENOENT; var DIR_MODE = 448; var FILE_MODE = 384; var EXIT = "exit"; var _removeObjects = []; - var FN_RMDIR_SYNC = fs18.rmdirSync.bind(fs18); + var FN_RMDIR_SYNC = fs15.rmdirSync.bind(fs15); var _gracefulCleanup = false; function rimraf(dirPath, callback) { - return fs18.rm(dirPath, { recursive: true }, callback); + return fs15.rm(dirPath, { recursive: true }, callback); } function FN_RIMRAF_SYNC(dirPath) { - return fs18.rmSync(dirPath, { recursive: true }); + return fs15.rmSync(dirPath, { recursive: true }); } function tmpName(options, callback) { const args = _parseArguments(options, callback), opts = args[0], cb = args[1]; @@ -155658,7 +155658,7 @@ var require_tmp = __commonJS({ (function _getUniqueName() { try { const name = _generateTmpName(sanitizedOptions); - fs18.stat(name, function(err2) { + fs15.stat(name, function(err2) { if (!err2) { if (tries-- > 0) return _getUniqueName(); return cb(new Error("Could not get a unique tmp filename, max tries reached " + name)); @@ -155678,7 +155678,7 @@ var require_tmp = __commonJS({ do { const name = _generateTmpName(sanitizedOptions); try { - fs18.statSync(name); + fs15.statSync(name); } catch (e) { return name; } @@ -155689,10 +155689,10 @@ var require_tmp = __commonJS({ const args = _parseArguments(options, callback), opts = args[0], cb = args[1]; tmpName(opts, function _tmpNameCreated(err, name) { if (err) return cb(err); - fs18.open(name, CREATE_FLAGS, opts.mode || FILE_MODE, function _fileCreated(err2, fd) { + fs15.open(name, CREATE_FLAGS, opts.mode || FILE_MODE, function _fileCreated(err2, fd) { if (err2) return cb(err2); if (opts.discardDescriptor) { - return fs18.close(fd, function _discardCallback(possibleErr) { + return fs15.close(fd, function _discardCallback(possibleErr) { return cb(possibleErr, name, void 0, _prepareTmpFileRemoveCallback(name, -1, opts, false)); }); } else { @@ -155706,9 +155706,9 @@ var require_tmp = __commonJS({ const args = _parseArguments(options), opts = args[0]; const discardOrDetachDescriptor = opts.discardDescriptor || opts.detachDescriptor; const name = tmpNameSync(opts); - let fd = fs18.openSync(name, CREATE_FLAGS, opts.mode || FILE_MODE); + let fd = fs15.openSync(name, CREATE_FLAGS, opts.mode || FILE_MODE); if (opts.discardDescriptor) { - fs18.closeSync(fd); + fs15.closeSync(fd); fd = void 0; } return { @@ -155721,7 +155721,7 @@ var require_tmp = __commonJS({ const args = _parseArguments(options, callback), opts = args[0], cb = args[1]; tmpName(opts, function _tmpNameCreated(err, name) { if (err) return cb(err); - fs18.mkdir(name, opts.mode || DIR_MODE, function _dirCreated(err2) { + fs15.mkdir(name, opts.mode || DIR_MODE, function _dirCreated(err2) { if (err2) return cb(err2); cb(null, name, _prepareTmpDirRemoveCallback(name, opts, false)); }); @@ -155730,7 +155730,7 @@ var require_tmp = __commonJS({ function dirSync(options) { const args = _parseArguments(options), opts = args[0]; const name = tmpNameSync(opts); - fs18.mkdirSync(name, opts.mode || DIR_MODE); + fs15.mkdirSync(name, opts.mode || DIR_MODE); return { name, removeCallback: _prepareTmpDirRemoveCallback(name, opts, true) @@ -155744,20 +155744,20 @@ var require_tmp = __commonJS({ next(); }; if (0 <= fdPath[0]) - fs18.close(fdPath[0], function() { - fs18.unlink(fdPath[1], _handler); + fs15.close(fdPath[0], function() { + fs15.unlink(fdPath[1], _handler); }); - else fs18.unlink(fdPath[1], _handler); + else fs15.unlink(fdPath[1], _handler); } function _removeFileSync(fdPath) { let rethrownException = null; try { - if (0 <= fdPath[0]) fs18.closeSync(fdPath[0]); + if (0 <= fdPath[0]) fs15.closeSync(fdPath[0]); } catch (e) { if (!_isEBADF(e) && !_isENOENT(e)) throw e; } finally { try { - fs18.unlinkSync(fdPath[1]); + fs15.unlinkSync(fdPath[1]); } catch (e) { if (!_isENOENT(e)) rethrownException = e; } @@ -155773,7 +155773,7 @@ var require_tmp = __commonJS({ return sync ? removeCallbackSync : removeCallback; } function _prepareTmpDirRemoveCallback(name, opts, sync) { - const removeFunction = opts.unsafeCleanup ? rimraf : fs18.rmdir.bind(fs18); + const removeFunction = opts.unsafeCleanup ? rimraf : fs15.rmdir.bind(fs15); const removeFunctionSync = opts.unsafeCleanup ? FN_RIMRAF_SYNC : FN_RMDIR_SYNC; const removeCallbackSync = _prepareRemoveCallback(removeFunctionSync, name, sync); const removeCallback = _prepareRemoveCallback(removeFunction, name, sync, removeCallbackSync); @@ -155835,35 +155835,35 @@ var require_tmp = __commonJS({ return [actualOptions, callback]; } function _resolvePath(name, tmpDir, cb) { - const pathToResolve = path17.isAbsolute(name) ? name : path17.join(tmpDir, name); - fs18.stat(pathToResolve, function(err) { + const pathToResolve = path14.isAbsolute(name) ? name : path14.join(tmpDir, name); + fs15.stat(pathToResolve, function(err) { if (err) { - fs18.realpath(path17.dirname(pathToResolve), function(err2, parentDir) { + fs15.realpath(path14.dirname(pathToResolve), function(err2, parentDir) { if (err2) return cb(err2); - cb(null, path17.join(parentDir, path17.basename(pathToResolve))); + cb(null, path14.join(parentDir, path14.basename(pathToResolve))); }); } else { - fs18.realpath(path17, cb); + fs15.realpath(path14, cb); } }); } function _resolvePathSync(name, tmpDir) { - const pathToResolve = path17.isAbsolute(name) ? name : path17.join(tmpDir, name); + const pathToResolve = path14.isAbsolute(name) ? name : path14.join(tmpDir, name); try { - fs18.statSync(pathToResolve); - return fs18.realpathSync(pathToResolve); + fs15.statSync(pathToResolve); + return fs15.realpathSync(pathToResolve); } catch (_err) { - const parentDir = fs18.realpathSync(path17.dirname(pathToResolve)); - return path17.join(parentDir, path17.basename(pathToResolve)); + const parentDir = fs15.realpathSync(path14.dirname(pathToResolve)); + return path14.join(parentDir, path14.basename(pathToResolve)); } } function _generateTmpName(opts) { const tmpDir = opts.tmpdir; if (!_isUndefined(opts.name)) { - return path17.join(tmpDir, opts.dir, opts.name); + return path14.join(tmpDir, opts.dir, opts.name); } if (!_isUndefined(opts.template)) { - return path17.join(tmpDir, opts.dir, opts.template).replace(TEMPLATE_PATTERN, _randomChars(6)); + return path14.join(tmpDir, opts.dir, opts.template).replace(TEMPLATE_PATTERN, _randomChars(6)); } const name = [ opts.prefix ? opts.prefix : "tmp", @@ -155873,13 +155873,13 @@ var require_tmp = __commonJS({ _randomChars(12), opts.postfix ? "-" + opts.postfix : "" ].join(""); - return path17.join(tmpDir, opts.dir, name); + return path14.join(tmpDir, opts.dir, name); } function _assertOptionsBase(options) { if (!_isUndefined(options.name)) { const name = options.name; - if (path17.isAbsolute(name)) throw new Error(`name option must not contain an absolute path, found "${name}".`); - const basename2 = path17.basename(name); + if (path14.isAbsolute(name)) throw new Error(`name option must not contain an absolute path, found "${name}".`); + const basename2 = path14.basename(name); if (basename2 === ".." || basename2 === "." || basename2 !== name) throw new Error(`name option must not contain a path, found "${name}".`); } @@ -155901,7 +155901,7 @@ var require_tmp = __commonJS({ if (_isUndefined(name)) return cb(null); _resolvePath(name, tmpDir, function(err, resolvedPath) { if (err) return cb(err); - const relativePath = path17.relative(tmpDir, resolvedPath); + const relativePath = path14.relative(tmpDir, resolvedPath); if (!resolvedPath.startsWith(tmpDir)) { return cb(new Error(`${option} option must be relative to "${tmpDir}", found "${relativePath}".`)); } @@ -155911,7 +155911,7 @@ var require_tmp = __commonJS({ function _getRelativePathSync(option, name, tmpDir) { if (_isUndefined(name)) return; const resolvedPath = _resolvePathSync(name, tmpDir); - const relativePath = path17.relative(tmpDir, resolvedPath); + const relativePath = path14.relative(tmpDir, resolvedPath); if (!resolvedPath.startsWith(tmpDir)) { throw new Error(`${option} option must be relative to "${tmpDir}", found "${relativePath}".`); } @@ -155958,10 +155958,10 @@ var require_tmp = __commonJS({ _gracefulCleanup = true; } function _getTmpDir(options, cb) { - return fs18.realpath(options && options.tmpdir || os4.tmpdir(), cb); + return fs15.realpath(options && options.tmpdir || os3.tmpdir(), cb); } function _getTmpDirSync(options) { - return fs18.realpathSync(options && options.tmpdir || os4.tmpdir()); + return fs15.realpathSync(options && options.tmpdir || os3.tmpdir()); } process.addListener(EXIT, _garbageCollector); Object.defineProperty(module2.exports, "tmpdir", { @@ -155991,14 +155991,14 @@ var require_tmp_promise = __commonJS({ var fileWithOptions = promisify( (options, cb) => tmp.file( options, - (err, path17, fd, cleanup) => err ? cb(err) : cb(void 0, { path: path17, fd, cleanup: promisify(cleanup) }) + (err, path14, fd, cleanup) => err ? cb(err) : cb(void 0, { path: path14, fd, cleanup: promisify(cleanup) }) ) ); module2.exports.file = async (options) => fileWithOptions(options); module2.exports.withFile = async function withFile(fn, options) { - const { path: path17, fd, cleanup } = await module2.exports.file(options); + const { path: path14, fd, cleanup } = await module2.exports.file(options); try { - return await fn({ path: path17, fd }); + return await fn({ path: path14, fd }); } finally { await cleanup(); } @@ -156007,14 +156007,14 @@ var require_tmp_promise = __commonJS({ var dirWithOptions = promisify( (options, cb) => tmp.dir( options, - (err, path17, cleanup) => err ? cb(err) : cb(void 0, { path: path17, cleanup: promisify(cleanup) }) + (err, path14, cleanup) => err ? cb(err) : cb(void 0, { path: path14, cleanup: promisify(cleanup) }) ) ); module2.exports.dir = async (options) => dirWithOptions(options); module2.exports.withDir = async function withDir(fn, options) { - const { path: path17, cleanup } = await module2.exports.dir(options); + const { path: path14, cleanup } = await module2.exports.dir(options); try { - return await fn({ path: path17 }); + return await fn({ path: path14 }); } finally { await cleanup(); } @@ -156637,12 +156637,12 @@ Header Information: ${JSON.stringify(response.message.headers, void 0, 2)} }); } exports2.sleep = sleep; - function digestForStream(stream2) { + function digestForStream(stream) { return __awaiter2(this, void 0, void 0, function* () { return new Promise((resolve8, reject) => { const crc64 = new crc64_1.default(); const md5 = crypto_1.default.createHash("md5"); - stream2.on("data", (data) => { + stream.on("data", (data) => { crc64.update(data); md5.update(data); }).on("end", () => resolve8({ @@ -156815,10 +156815,10 @@ var require_upload_gzip = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.createGZipFileInBuffer = exports2.createGZipFileOnDisk = void 0; - var fs18 = __importStar2(require("fs")); + var fs15 = __importStar2(require("fs")); var zlib3 = __importStar2(require("zlib")); var util_1 = require("util"); - var stat = (0, util_1.promisify)(fs18.stat); + var stat = (0, util_1.promisify)(fs15.stat); var gzipExemptFileExtensions = [ ".gz", ".gzip", @@ -156851,9 +156851,9 @@ var require_upload_gzip = __commonJS({ } } return new Promise((resolve8, reject) => { - const inputStream = fs18.createReadStream(originalFilePath); + const inputStream = fs15.createReadStream(originalFilePath); const gzip = zlib3.createGzip(); - const outputStream = fs18.createWriteStream(tempFilePath); + const outputStream = fs15.createWriteStream(tempFilePath); inputStream.pipe(gzip).pipe(outputStream); outputStream.on("finish", () => __awaiter2(this, void 0, void 0, function* () { const size = (yield stat(tempFilePath)).size; @@ -156871,7 +156871,7 @@ var require_upload_gzip = __commonJS({ return __awaiter2(this, void 0, void 0, function* () { return new Promise((resolve8) => __awaiter2(this, void 0, void 0, function* () { var _a, e_1, _b, _c; - const inputStream = fs18.createReadStream(originalFilePath); + const inputStream = fs15.createReadStream(originalFilePath); const gzip = zlib3.createGzip(); inputStream.pipe(gzip); const chunks = []; @@ -157080,10 +157080,10 @@ var require_upload_http_client = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.UploadHttpClient = void 0; - var fs18 = __importStar2(require("fs")); + var fs15 = __importStar2(require("fs")); var core17 = __importStar2(require_core3()); var tmp = __importStar2(require_tmp_promise()); - var stream2 = __importStar2(require("stream")); + var stream = __importStar2(require("stream")); var utils_1 = require_utils13(); var config_variables_1 = require_config_variables(); var util_1 = require("util"); @@ -157094,7 +157094,7 @@ var require_upload_http_client = __commonJS({ var http_manager_1 = require_http_manager(); var upload_gzip_1 = require_upload_gzip(); var requestUtils_1 = require_requestUtils2(); - var stat = (0, util_1.promisify)(fs18.stat); + var stat = (0, util_1.promisify)(fs15.stat); var UploadHttpClient = class { constructor() { this.uploadHttpManager = new http_manager_1.HttpManager((0, config_variables_1.getUploadFileConcurrency)(), "@actions/artifact-upload"); @@ -157231,13 +157231,13 @@ var require_upload_http_client = __commonJS({ let openUploadStream; if (totalFileSize < buffer.byteLength) { core17.debug(`The gzip file created for ${parameters.file} did not help with reducing the size of the file. The original file will be uploaded as-is`); - openUploadStream = () => fs18.createReadStream(parameters.file); + openUploadStream = () => fs15.createReadStream(parameters.file); isGzip = false; uploadFileSize = totalFileSize; } else { core17.debug(`A gzip file created for ${parameters.file} helped with reducing the size of the original file. The file will be uploaded using gzip.`); openUploadStream = () => { - const passThrough = new stream2.PassThrough(); + const passThrough = new stream.PassThrough(); passThrough.end(buffer); return passThrough; }; @@ -157277,7 +157277,7 @@ var require_upload_http_client = __commonJS({ failedChunkSizes += chunkSize; continue; } - const result = yield this.uploadChunk(httpClientIndex, parameters.resourceUrl, () => fs18.createReadStream(uploadFilePath, { + const result = yield this.uploadChunk(httpClientIndex, parameters.resourceUrl, () => fs15.createReadStream(uploadFilePath, { start: startChunkIndex, end: endChunkIndex, autoClose: false @@ -157472,7 +157472,7 @@ var require_download_http_client = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.DownloadHttpClient = void 0; - var fs18 = __importStar2(require("fs")); + var fs15 = __importStar2(require("fs")); var core17 = __importStar2(require_core3()); var zlib3 = __importStar2(require("zlib")); var utils_1 = require_utils13(); @@ -157563,7 +157563,7 @@ var require_download_http_client = __commonJS({ return __awaiter2(this, void 0, void 0, function* () { let retryCount = 0; const retryLimit = (0, config_variables_1.getRetryLimit)(); - let destinationStream = fs18.createWriteStream(downloadPath); + let destinationStream = fs15.createWriteStream(downloadPath); const headers = (0, utils_1.getDownloadHeaders)("application/json", true, true); const makeDownloadRequest = () => __awaiter2(this, void 0, void 0, function* () { const client = this.downloadHttpManager.getClient(httpClientIndex); @@ -157605,7 +157605,7 @@ var require_download_http_client = __commonJS({ } }); yield (0, utils_1.rmFile)(fileDownloadPath); - destinationStream = fs18.createWriteStream(fileDownloadPath); + destinationStream = fs15.createWriteStream(fileDownloadPath); }); while (retryCount <= retryLimit) { let response; @@ -157722,21 +157722,21 @@ var require_download_specification = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getDownloadSpecification = void 0; - var path17 = __importStar2(require("path")); + var path14 = __importStar2(require("path")); function getDownloadSpecification(artifactName, artifactEntries, downloadPath, includeRootDirectory) { const directories = /* @__PURE__ */ new Set(); const specifications = { - rootDownloadLocation: includeRootDirectory ? path17.join(downloadPath, artifactName) : downloadPath, + rootDownloadLocation: includeRootDirectory ? path14.join(downloadPath, artifactName) : downloadPath, directoryStructure: [], emptyFilesToCreate: [], filesToDownload: [] }; for (const entry of artifactEntries) { if (entry.path.startsWith(`${artifactName}/`) || entry.path.startsWith(`${artifactName}\\`)) { - const normalizedPathEntry = path17.normalize(entry.path); - const filePath = path17.join(downloadPath, includeRootDirectory ? normalizedPathEntry : normalizedPathEntry.replace(artifactName, "")); + const normalizedPathEntry = path14.normalize(entry.path); + const filePath = path14.join(downloadPath, includeRootDirectory ? normalizedPathEntry : normalizedPathEntry.replace(artifactName, "")); if (entry.itemType === "file") { - directories.add(path17.dirname(filePath)); + directories.add(path14.dirname(filePath)); if (entry.fileLength === 0) { specifications.emptyFilesToCreate.push(filePath); } else { @@ -157878,7 +157878,7 @@ Note: The size of downloaded zips can differ significantly from the reported siz return uploadResponse; }); } - downloadArtifact(name, path17, options) { + downloadArtifact(name, path14, options) { return __awaiter2(this, void 0, void 0, function* () { const downloadHttpClient = new download_http_client_1.DownloadHttpClient(); const artifacts = yield downloadHttpClient.listArtifacts(); @@ -157892,12 +157892,12 @@ Note: The size of downloaded zips can differ significantly from the reported siz throw new Error(`Unable to find an artifact with the name: ${name}`); } const items = yield downloadHttpClient.getContainerItems(artifactToDownload.name, artifactToDownload.fileContainerResourceUrl); - if (!path17) { - path17 = (0, config_variables_1.getWorkSpaceDirectory)(); + if (!path14) { + path14 = (0, config_variables_1.getWorkSpaceDirectory)(); } - path17 = (0, path_1.normalize)(path17); - path17 = (0, path_1.resolve)(path17); - const downloadSpecification = (0, download_specification_1.getDownloadSpecification)(name, items.value, path17, (options === null || options === void 0 ? void 0 : options.createArtifactFolder) || false); + path14 = (0, path_1.normalize)(path14); + path14 = (0, path_1.resolve)(path14); + const downloadSpecification = (0, download_specification_1.getDownloadSpecification)(name, items.value, path14, (options === null || options === void 0 ? void 0 : options.createArtifactFolder) || false); if (downloadSpecification.filesToDownload.length === 0) { core17.info(`No downloadable files were found for the artifact: ${artifactToDownload.name}`); } else { @@ -157912,7 +157912,7 @@ Note: The size of downloaded zips can differ significantly from the reported siz }; }); } - downloadAllArtifacts(path17) { + downloadAllArtifacts(path14) { return __awaiter2(this, void 0, void 0, function* () { const downloadHttpClient = new download_http_client_1.DownloadHttpClient(); const response = []; @@ -157921,18 +157921,18 @@ Note: The size of downloaded zips can differ significantly from the reported siz core17.info("Unable to find any artifacts for the associated workflow"); return response; } - if (!path17) { - path17 = (0, config_variables_1.getWorkSpaceDirectory)(); + if (!path14) { + path14 = (0, config_variables_1.getWorkSpaceDirectory)(); } - path17 = (0, path_1.normalize)(path17); - path17 = (0, path_1.resolve)(path17); + path14 = (0, path_1.normalize)(path14); + path14 = (0, path_1.resolve)(path14); let downloadedArtifacts = 0; while (downloadedArtifacts < artifacts.count) { const currentArtifactToDownload = artifacts.value[downloadedArtifacts]; downloadedArtifacts += 1; core17.info(`starting download of artifact ${currentArtifactToDownload.name} : ${downloadedArtifacts}/${artifacts.count}`); const items = yield downloadHttpClient.getContainerItems(currentArtifactToDownload.name, currentArtifactToDownload.fileContainerResourceUrl); - const downloadSpecification = (0, download_specification_1.getDownloadSpecification)(currentArtifactToDownload.name, items.value, path17, true); + const downloadSpecification = (0, download_specification_1.getDownloadSpecification)(currentArtifactToDownload.name, items.value, path14, true); if (downloadSpecification.filesToDownload.length === 0) { core17.info(`No downloadable files were found for any artifact ${currentArtifactToDownload.name}`); } else { @@ -160889,21 +160889,21 @@ async function getFolderSize(itemPath, options) { getFolderSize.loose = async (itemPath, options) => await core(itemPath, options); getFolderSize.strict = async (itemPath, options) => await core(itemPath, options, { strict: true }); async function core(rootItemPath, options = {}, returnType = {}) { - const fs18 = options.fs || await import("node:fs/promises"); + const fs15 = options.fs || await import("node:fs/promises"); let folderSize = 0n; const foundInos = /* @__PURE__ */ new Set(); const errors = []; await processItem(rootItemPath); async function processItem(itemPath) { if (options.ignore?.test(itemPath)) return; - const stats = returnType.strict ? await fs18.lstat(itemPath, { bigint: true }) : await fs18.lstat(itemPath, { bigint: true }).catch((error3) => errors.push(error3)); + const stats = returnType.strict ? await fs15.lstat(itemPath, { bigint: true }) : await fs15.lstat(itemPath, { bigint: true }).catch((error3) => errors.push(error3)); if (typeof stats !== "object") return; if (!foundInos.has(stats.ino)) { foundInos.add(stats.ino); folderSize += stats.size; } if (stats.isDirectory()) { - const directoryItems = returnType.strict ? await fs18.readdir(itemPath) : await fs18.readdir(itemPath).catch((error3) => errors.push(error3)); + const directoryItems = returnType.strict ? await fs15.readdir(itemPath) : await fs15.readdir(itemPath).catch((error3) => errors.push(error3)); if (typeof directoryItems !== "object") return; await Promise.all( directoryItems.map( @@ -163531,7 +163531,6 @@ var minimumVersion = "3.14"; // src/util.ts var BASE_DATABASE_OIDS_FILE_NAME = "base-database-oids.json"; -var BROKEN_VERSIONS = ["0.0.0-20211207"]; var GITHUB_DOTCOM_URL = "https://github.com"; var MINIMUM_CGROUP_MEMORY_LIMIT_BYTES = 1024 * 1024; function getExtraOptionsEnvParam() { @@ -163712,9 +163711,6 @@ async function delay(milliseconds, opts) { } }); } -function isGoodVersion(versionSpec) { - return !BROKEN_VERSIONS.includes(versionSpec); -} function isInTestMode() { return process.env["CODEQL_ACTION_TEST_MODE" /* TEST_MODE */] === "true"; } @@ -163802,27 +163798,6 @@ function satisfiesGHESVersion(ghesVersion, range, defaultIfInvalid) { function cloneObject(obj) { return JSON.parse(JSON.stringify(obj)); } -async function cleanUpPath(file, name, logger) { - logger.debug(`Cleaning up ${name}.`); - try { - await fs.promises.rm(file, { - force: true, - recursive: true - }); - } catch (e) { - logger.warning(`Failed to clean up ${name}: ${e}.`); - } -} -async function isBinaryAccessible(binary2, logger) { - try { - await io.which(binary2, true); - logger.debug(`Found ${binary2}.`); - return true; - } catch (e) { - logger.debug(`Could not find ${binary2}: ${e}`); - return false; - } -} async function asyncSome(array, predicate) { const results = await Promise.all(array.map(predicate)); return results.some((result) => result); @@ -163851,15 +163826,6 @@ function getActionVersion() { function getWorkflowEventName() { return getRequiredEnvParam("GITHUB_EVENT_NAME"); } -function isRunningLocalAction() { - const relativeScriptPath = getRelativeScriptPath(); - return relativeScriptPath.startsWith("..") || path2.isAbsolute(relativeScriptPath); -} -function getRelativeScriptPath() { - const runnerTemp = getRequiredEnvParam("RUNNER_TEMP"); - const actionsDirectory = path2.join(path2.dirname(runnerTemp), "_actions"); - return path2.relative(actionsDirectory, __filename); -} function getWorkflowEvent() { const eventJsonFile = getRequiredEnvParam("GITHUB_EVENT_PATH"); try { @@ -164179,14 +164145,6 @@ function getApiDetails() { function getApiClient() { return createApiClientWithDetails(getApiDetails()); } -function getAuthorizationHeaderFor(logger, apiDetails, url2) { - if (url2.startsWith(`${apiDetails.url}/`) || apiDetails.apiURL && url2.startsWith(`${apiDetails.apiURL}/`)) { - logger.debug(`Providing an authorization token.`); - return `token ${apiDetails.auth}`; - } - logger.debug(`Not using an authorization token.`); - return void 0; -} var cachedGitHubVersion = void 0; async function getGitHubVersionFromApi(apiClient, apiDetails) { if (parseGitHubUrl(apiDetails.url) === GITHUB_DOTCOM_URL) { @@ -164310,8 +164268,8 @@ function wrapApiConfigurationError(e) { var core6 = __toESM(require_core()); // src/codeql.ts -var fs10 = __toESM(require("fs")); -var path10 = __toESM(require("path")); +var fs7 = __toESM(require("fs")); +var path7 = __toESM(require("path")); var core10 = __toESM(require_core()); var toolrunner3 = __toESM(require_toolrunner()); @@ -164533,7 +164491,7 @@ function getCliConfigCategoryIfExists(cliError) { } function isUnsupportedPlatform() { return !SUPPORTED_PLATFORMS.some( - ([platform, arch2]) => platform === process.platform && arch2 === process.arch + ([platform, arch]) => platform === process.platform && arch === process.arch ); } function getUnsupportedPlatformError(cliError) { @@ -164559,7 +164517,7 @@ function wrapCliConfigurationError(cliError) { // src/config-utils.ts var fs6 = __toESM(require("fs")); -var path7 = __toESM(require("path")); +var path6 = __toESM(require("path")); // src/analyses.ts var AnalysisKind = /* @__PURE__ */ ((AnalysisKind2) => { @@ -164625,10 +164583,6 @@ var PACK_IDENTIFIER_PATTERN = (function() { return new RegExp(`^${component}/${component}$`); })(); -// src/diagnostics.ts -var import_fs = require("fs"); -var import_path = __toESM(require("path")); - // src/logging.ts var core7 = __toESM(require_core()); function getActionsLogger() { @@ -164650,82 +164604,14 @@ function withGroup(groupName, f) { core7.endGroup(); } } -function formatDuration(durationMs) { - if (durationMs < 1e3) { - return `${durationMs}ms`; - } - if (durationMs < 60 * 1e3) { - return `${(durationMs / 1e3).toFixed(1)}s`; - } - const minutes = Math.floor(durationMs / (60 * 1e3)); - const seconds = Math.floor(durationMs % (60 * 1e3) / 1e3); - return `${minutes}m${seconds}s`; -} - -// src/diagnostics.ts -var unwrittenDiagnostics = []; -var unwrittenDefaultLanguageDiagnostics = []; -function makeDiagnostic(id, name, data = void 0) { - return { - ...data, - timestamp: data?.timestamp ?? (/* @__PURE__ */ new Date()).toISOString(), - source: { ...data?.source, id, name } - }; -} -function addDiagnostic(config, language, diagnostic) { - const logger = getActionsLogger(); - const databasePath = language ? getCodeQLDatabasePath(config, language) : config.dbLocation; - if ((0, import_fs.existsSync)(databasePath)) { - writeDiagnostic(config, language, diagnostic); - } else { - logger.debug( - `Writing a diagnostic for ${language}, but the database at ${databasePath} does not exist yet.` - ); - unwrittenDiagnostics.push({ diagnostic, language }); - } -} -function addNoLanguageDiagnostic(config, diagnostic) { - if (config !== void 0) { - addDiagnostic( - config, - // Arbitrarily choose the first language. We could also choose all languages, but that - // increases the risk of misinterpreting the data. - config.languages[0], - diagnostic - ); - } else { - unwrittenDefaultLanguageDiagnostics.push(diagnostic); - } -} -function writeDiagnostic(config, language, diagnostic) { - const logger = getActionsLogger(); - const databasePath = language ? getCodeQLDatabasePath(config, language) : config.dbLocation; - const diagnosticsPath = import_path.default.resolve( - databasePath, - "diagnostic", - "codeql-action" - ); - try { - (0, import_fs.mkdirSync)(diagnosticsPath, { recursive: true }); - const jsonPath = import_path.default.resolve( - diagnosticsPath, - // Remove colons from the timestamp as these are not allowed in Windows filenames. - `codeql-action-${diagnostic.timestamp.replaceAll(":", "")}.json` - ); - (0, import_fs.writeFileSync)(jsonPath, JSON.stringify(diagnostic)); - } catch (err) { - logger.warning(`Unable to write diagnostic message to database: ${err}`); - logger.debug(JSON.stringify(diagnostic)); - } -} // src/diff-informed-analysis-utils.ts var fs5 = __toESM(require("fs")); -var path6 = __toESM(require("path")); +var path5 = __toESM(require("path")); // src/feature-flags.ts var fs4 = __toESM(require("fs")); -var path5 = __toESM(require("path")); +var path4 = __toESM(require("path")); var semver5 = __toESM(require_semver2()); // src/defaults.json @@ -164734,7 +164620,7 @@ var cliVersion = "2.24.2"; // src/overlay-database-utils.ts var fs3 = __toESM(require("fs")); -var path4 = __toESM(require("path")); +var path3 = __toESM(require("path")); var actionsCache = __toESM(require_cache5()); // src/git-utils.ts @@ -164862,8 +164748,8 @@ var getFileOidsUnderPath = async function(basePath) { const match = line.match(regex); if (match) { const oid = match[1]; - const path17 = decodeGitFilePath(match[2]); - fileOidMap[path17] = oid; + const path14 = decodeGitFilePath(match[2]); + fileOidMap[path14] = oid; } else { throw new Error(`Unexpected "git ls-files" output: ${line}`); } @@ -164969,7 +164855,7 @@ async function writeOverlayChangesFile(config, sourceRoot, logger) { `Found ${changedFiles.length} changed file(s) under ${sourceRoot}.` ); const changedFilesJson = JSON.stringify({ changes: changedFiles }); - const overlayChangesFile = path4.join( + const overlayChangesFile = path3.join( getTemporaryDirectory(), "overlay-changes.json" ); @@ -165007,7 +164893,6 @@ function isSafeArtifactUpload(codeQlVersion) { // src/feature-flags.ts var DEFAULT_VERSION_FEATURE_FLAG_PREFIX = "default_codeql_version_"; var DEFAULT_VERSION_FEATURE_FLAG_SUFFIX = "_enabled"; -var CODEQL_VERSION_ZSTD_BUNDLE = "2.19.0"; var featureConfig = { ["allow_toolcache_input" /* AllowToolcacheInput */]: { defaultValue: false, @@ -165345,7 +165230,7 @@ var Features = class extends OfflineFeatures { super(logger); this.gitHubFeatureFlags = new GitHubFeatureFlags( repositoryNwo, - path5.join(tempDir, FEATURE_FLAGS_FILE_NAME), + path4.join(tempDir, FEATURE_FLAGS_FILE_NAME), logger ); } @@ -165562,7 +165447,7 @@ function initFeatures(gitHubVersion, repositoryNwo, tempDir, logger) { // src/diff-informed-analysis-utils.ts function getDiffRangesJsonFilePath() { - return path6.join(getTemporaryDirectory(), "pr-diff-range.json"); + return path5.join(getTemporaryDirectory(), "pr-diff-range.json"); } function readDiffRangesJsonFile(logger) { const jsonFilePath = getDiffRangesJsonFilePath(); @@ -165610,7 +165495,7 @@ var OVERLAY_ANALYSIS_CODE_SCANNING_FEATURES = { swift: "overlay_analysis_code_scanning_swift" /* OverlayAnalysisCodeScanningSwift */ }; function getPathToParsedConfigFile(tempDir) { - return path7.join(tempDir, "config"); + return path6.join(tempDir, "config"); } async function getConfig(tempDir, logger) { const configFile = getPathToParsedConfigFile(tempDir); @@ -165656,949 +165541,23 @@ function isCodeScanningEnabled(config) { } // src/setup-codeql.ts -var fs9 = __toESM(require("fs")); -var path9 = __toESM(require("path")); var toolcache3 = __toESM(require_tool_cache()); var import_fast_deep_equal = __toESM(require_fast_deep_equal()); var semver8 = __toESM(require_semver2()); -// node_modules/uuid/dist-node/stringify.js -var byteToHex = []; -for (let i = 0; i < 256; ++i) { - byteToHex.push((i + 256).toString(16).slice(1)); -} -function unsafeStringify(arr, offset = 0) { - return (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(); -} - -// node_modules/uuid/dist-node/rng.js -var import_node_crypto = require("node:crypto"); -var rnds8Pool = new Uint8Array(256); -var poolPtr = rnds8Pool.length; -function rng() { - if (poolPtr > rnds8Pool.length - 16) { - (0, import_node_crypto.randomFillSync)(rnds8Pool); - poolPtr = 0; - } - return rnds8Pool.slice(poolPtr, poolPtr += 16); -} - -// node_modules/uuid/dist-node/native.js -var import_node_crypto2 = require("node:crypto"); -var native_default = { randomUUID: import_node_crypto2.randomUUID }; - -// node_modules/uuid/dist-node/v4.js -function _v4(options, buf, offset) { - options = options || {}; - const rnds = options.random ?? options.rng?.() ?? rng(); - if (rnds.length < 16) { - throw new Error("Random bytes length must be >= 16"); - } - rnds[6] = rnds[6] & 15 | 64; - rnds[8] = rnds[8] & 63 | 128; - if (buf) { - offset = offset || 0; - if (offset < 0 || offset + 16 > buf.length) { - throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`); - } - for (let i = 0; i < 16; ++i) { - buf[offset + i] = rnds[i]; - } - return buf; - } - return unsafeStringify(rnds); -} -function v4(options, buf, offset) { - if (native_default.randomUUID && !buf && !options) { - return native_default.randomUUID(); - } - return _v4(options, buf, offset); -} -var v4_default = v4; - // src/tar.ts -var import_child_process = require("child_process"); -var fs7 = __toESM(require("fs")); -var stream = __toESM(require("stream")); var import_toolrunner = __toESM(require_toolrunner()); var io4 = __toESM(require_io()); var toolcache = __toESM(require_tool_cache()); var semver6 = __toESM(require_semver2()); -var MIN_REQUIRED_BSD_TAR_VERSION = "3.4.3"; -var MIN_REQUIRED_GNU_TAR_VERSION = "1.31"; -async function getTarVersion() { - const tar = await io4.which("tar", true); - let stdout = ""; - const exitCode = await new import_toolrunner.ToolRunner(tar, ["--version"], { - listeners: { - stdout: (data) => { - stdout += data.toString(); - } - } - }).exec(); - if (exitCode !== 0) { - throw new Error("Failed to call tar --version"); - } - if (stdout.includes("GNU tar")) { - const match = stdout.match(/tar \(GNU tar\) ([0-9.]+)/); - if (!match?.[1]) { - throw new Error("Failed to parse output of tar --version."); - } - return { type: "gnu", version: match[1] }; - } else if (stdout.includes("bsdtar")) { - const match = stdout.match(/bsdtar ([0-9.]+)/); - if (!match?.[1]) { - throw new Error("Failed to parse output of tar --version."); - } - return { type: "bsd", version: match[1] }; - } else { - throw new Error("Unknown tar version"); - } -} -async function isZstdAvailable(logger) { - const foundZstdBinary = await isBinaryAccessible("zstd", logger); - try { - const tarVersion = await getTarVersion(); - const { type: type2, version } = tarVersion; - logger.info(`Found ${type2} tar version ${version}.`); - switch (type2) { - case "gnu": - return { - available: foundZstdBinary && // GNU tar only uses major and minor version numbers - semver6.gte( - semver6.coerce(version), - semver6.coerce(MIN_REQUIRED_GNU_TAR_VERSION) - ), - foundZstdBinary, - version: tarVersion - }; - case "bsd": - return { - available: foundZstdBinary && // Do a loose comparison since these version numbers don't contain - // a patch version number. - semver6.gte(version, MIN_REQUIRED_BSD_TAR_VERSION), - foundZstdBinary, - version: tarVersion - }; - default: - assertNever(type2); - } - } catch (e) { - logger.warning( - `Failed to determine tar version, therefore will assume zstd is not available. The underlying error was: ${e}` - ); - return { available: false, foundZstdBinary }; - } -} -async function extract(tarPath, dest, compressionMethod, tarVersion, logger) { - fs7.mkdirSync(dest, { recursive: true }); - switch (compressionMethod) { - case "gzip": - return await toolcache.extractTar(tarPath, dest); - case "zstd": { - if (!tarVersion) { - throw new Error( - "Could not determine tar version, which is required to extract a Zstandard archive." - ); - } - await extractTarZst(tarPath, dest, tarVersion, logger); - return dest; - } - } -} -async function extractTarZst(tar, dest, tarVersion, logger) { - logger.debug( - `Extracting to ${dest}.${tar instanceof stream.Readable ? ` Input stream has high water mark ${tar.readableHighWaterMark}.` : ""}` - ); - try { - const args = ["-x", "--zstd", "--ignore-zeros"]; - if (tarVersion.type === "gnu") { - args.push("--warning=no-unknown-keyword"); - args.push("--overwrite"); - } - args.push("-f", tar instanceof stream.Readable ? "-" : tar, "-C", dest); - process.stdout.write(`[command]tar ${args.join(" ")} -`); - await new Promise((resolve8, reject) => { - const tarProcess = (0, import_child_process.spawn)("tar", args, { stdio: "pipe" }); - let stdout = ""; - tarProcess.stdout?.on("data", (data) => { - stdout += data.toString(); - process.stdout.write(data); - }); - let stderr = ""; - tarProcess.stderr?.on("data", (data) => { - stderr += data.toString(); - process.stdout.write(data); - }); - tarProcess.on("error", (err) => { - reject(new Error(`Error while extracting tar: ${err}`)); - }); - if (tar instanceof stream.Readable) { - tar.pipe(tarProcess.stdin).on("error", (err) => { - reject( - new Error(`Error while downloading and extracting tar: ${err}`) - ); - }); - } - tarProcess.on("exit", (code) => { - if (code !== 0) { - reject( - new CommandInvocationError( - "tar", - args, - code ?? void 0, - stdout, - stderr - ) - ); - } - resolve8(); - }); - }); - } catch (e) { - await cleanUpPath(dest, "extraction destination directory", logger); - throw e; - } -} -var KNOWN_EXTENSIONS = { - "tar.gz": "gzip", - "tar.zst": "zstd" -}; -function inferCompressionMethod(tarPath) { - for (const [ext, method] of Object.entries(KNOWN_EXTENSIONS)) { - if (tarPath.endsWith(`.${ext}`)) { - return method; - } - } - return void 0; -} // src/tools-download.ts -var fs8 = __toESM(require("fs")); -var os = __toESM(require("os")); -var path8 = __toESM(require("path")); -var import_perf_hooks = require("perf_hooks"); var core9 = __toESM(require_core()); var import_http_client = __toESM(require_lib()); var toolcache2 = __toESM(require_tool_cache()); var import_follow_redirects = __toESM(require_follow_redirects()); var semver7 = __toESM(require_semver2()); var STREAMING_HIGH_WATERMARK_BYTES = 4 * 1024 * 1024; -var TOOLCACHE_TOOL_NAME = "CodeQL"; -function makeDownloadFirstToolsDownloadDurations(downloadDurationMs, extractionDurationMs) { - return { - combinedDurationMs: downloadDurationMs + extractionDurationMs, - downloadDurationMs, - extractionDurationMs, - streamExtraction: false - }; -} -function makeStreamedToolsDownloadDurations(combinedDurationMs) { - return { - combinedDurationMs, - downloadDurationMs: void 0, - extractionDurationMs: void 0, - streamExtraction: true - }; -} -async function downloadAndExtract(codeqlURL, compressionMethod, dest, authorization, headers, tarVersion, logger) { - logger.info( - `Downloading CodeQL tools from ${codeqlURL} . This may take a while.` - ); - try { - if (compressionMethod === "zstd" && process.platform === "linux") { - logger.info(`Streaming the extraction of the CodeQL bundle.`); - const toolsInstallStart = import_perf_hooks.performance.now(); - await downloadAndExtractZstdWithStreaming( - codeqlURL, - dest, - authorization, - headers, - tarVersion, - logger - ); - const combinedDurationMs = Math.round( - import_perf_hooks.performance.now() - toolsInstallStart - ); - logger.info( - `Finished downloading and extracting CodeQL bundle to ${dest} (${formatDuration( - combinedDurationMs - )}).` - ); - return { - compressionMethod, - toolsUrl: sanitizeUrlForStatusReport(codeqlURL), - ...makeStreamedToolsDownloadDurations(combinedDurationMs) - }; - } - } catch (e) { - core9.warning( - `Failed to download and extract CodeQL bundle using streaming with error: ${getErrorMessage(e)}` - ); - core9.warning(`Falling back to downloading the bundle before extracting.`); - await cleanUpPath(dest, "CodeQL bundle", logger); - } - const toolsDownloadStart = import_perf_hooks.performance.now(); - const archivedBundlePath = await toolcache2.downloadTool( - codeqlURL, - void 0, - authorization, - headers - ); - const downloadDurationMs = Math.round(import_perf_hooks.performance.now() - toolsDownloadStart); - logger.info( - `Finished downloading CodeQL bundle to ${archivedBundlePath} (${formatDuration( - downloadDurationMs - )}).` - ); - let extractionDurationMs; - try { - logger.info("Extracting CodeQL bundle."); - const extractionStart = import_perf_hooks.performance.now(); - await extract( - archivedBundlePath, - dest, - compressionMethod, - tarVersion, - logger - ); - extractionDurationMs = Math.round(import_perf_hooks.performance.now() - extractionStart); - logger.info( - `Finished extracting CodeQL bundle to ${dest} (${formatDuration( - extractionDurationMs - )}).` - ); - } finally { - await cleanUpPath(archivedBundlePath, "CodeQL bundle archive", logger); - } - return { - compressionMethod, - toolsUrl: sanitizeUrlForStatusReport(codeqlURL), - ...makeDownloadFirstToolsDownloadDurations( - downloadDurationMs, - extractionDurationMs - ) - }; -} -async function downloadAndExtractZstdWithStreaming(codeqlURL, dest, authorization, headers, tarVersion, logger) { - fs8.mkdirSync(dest, { recursive: true }); - const agent = new import_http_client.HttpClient().getAgent(codeqlURL); - headers = Object.assign( - { "User-Agent": "CodeQL Action" }, - authorization ? { authorization } : {}, - headers - ); - const response = await new Promise( - (resolve8) => import_follow_redirects.https.get( - codeqlURL, - { - headers, - // Increase the high water mark to improve performance. - highWaterMark: STREAMING_HIGH_WATERMARK_BYTES, - // Use the agent to respect proxy settings. - agent - }, - (r) => resolve8(r) - ) - ); - if (response.statusCode !== 200) { - throw new Error( - `Failed to download CodeQL bundle from ${codeqlURL}. HTTP status code: ${response.statusCode}.` - ); - } - await extractTarZst(response, dest, tarVersion, logger); -} -function getToolcacheDirectory(version) { - return path8.join( - getRequiredEnvParam("RUNNER_TOOL_CACHE"), - TOOLCACHE_TOOL_NAME, - semver7.clean(version) || version, - os.arch() || "" - ); -} -function writeToolcacheMarkerFile(extractedPath, logger) { - const markerFilePath = `${extractedPath}.complete`; - fs8.writeFileSync(markerFilePath, ""); - logger.info(`Created toolcache marker file ${markerFilePath}`); -} -function sanitizeUrlForStatusReport(url2) { - return ["github/codeql-action", "dsp-testing/codeql-cli-nightlies"].some( - (repo) => url2.startsWith(`https://github.com/${repo}/releases/download/`) - ) ? url2 : "sanitized-value"; -} - -// src/setup-codeql.ts -var CODEQL_DEFAULT_ACTION_REPOSITORY = "github/codeql-action"; -var CODEQL_NIGHTLIES_REPOSITORY_OWNER = "dsp-testing"; -var CODEQL_NIGHTLIES_REPOSITORY_NAME = "codeql-cli-nightlies"; -var CODEQL_BUNDLE_VERSION_ALIAS = ["linked", "latest"]; -var CODEQL_NIGHTLY_TOOLS_INPUTS = ["nightly", "nightly-latest"]; -var CODEQL_TOOLCACHE_INPUT = "toolcache"; -function getCodeQLBundleExtension(compressionMethod) { - switch (compressionMethod) { - case "gzip": - return ".tar.gz"; - case "zstd": - return ".tar.zst"; - default: - assertNever(compressionMethod); - } -} -function getCodeQLBundleName(compressionMethod) { - const extension = getCodeQLBundleExtension(compressionMethod); - 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${extension}`; - } - return `codeql-bundle-${platform}${extension}`; -} -function getCodeQLActionRepository(logger) { - if (isRunningLocalAction()) { - logger.info( - "The CodeQL Action is checked out locally. Using the default CodeQL Action repository." - ); - return CODEQL_DEFAULT_ACTION_REPOSITORY; - } - return getRequiredEnvParam("GITHUB_ACTION_REPOSITORY"); -} -async function getCodeQLBundleDownloadURL(tagName, apiDetails, compressionMethod, logger) { - const codeQLActionRepository = getCodeQLActionRepository(logger); - const potentialDownloadSources = [ - // This GitHub instance, and this Action. - [apiDetails.url, codeQLActionRepository], - // This GitHub instance, and the canonical Action. - [apiDetails.url, CODEQL_DEFAULT_ACTION_REPOSITORY], - // GitHub.com, and the canonical Action. - [GITHUB_DOTCOM_URL, CODEQL_DEFAULT_ACTION_REPOSITORY] - ]; - const uniqueDownloadSources = potentialDownloadSources.filter( - (source, index, self2) => { - return !self2.slice(0, index).some((other) => (0, import_fast_deep_equal.default)(source, other)); - } - ); - const codeQLBundleName = getCodeQLBundleName(compressionMethod); - for (const downloadSource of uniqueDownloadSources) { - const [apiURL, repository] = downloadSource; - if (apiURL === GITHUB_DOTCOM_URL && repository === CODEQL_DEFAULT_ACTION_REPOSITORY) { - break; - } - const [repositoryOwner, repositoryName] = repository.split("/"); - try { - const release2 = await getApiClient().rest.repos.getReleaseByTag({ - owner: repositoryOwner, - repo: repositoryName, - tag: tagName - }); - for (const asset of release2.data.assets) { - if (asset.name === codeQLBundleName) { - logger.info( - `Found CodeQL bundle ${codeQLBundleName} in ${repository} on ${apiURL} with URL ${asset.url}.` - ); - return asset.url; - } - } - } catch (e) { - logger.info( - `Looked for CodeQL bundle ${codeQLBundleName} in ${repository} on ${apiURL} but got error ${e}.` - ); - } - } - return `https://github.com/${CODEQL_DEFAULT_ACTION_REPOSITORY}/releases/download/${tagName}/${codeQLBundleName}`; -} -function tryGetBundleVersionFromTagName(tagName, logger) { - const match = tagName.match(/^codeql-bundle-(.*)$/); - if (match === null || match.length < 2) { - logger.debug(`Could not determine bundle version from tag ${tagName}.`); - return void 0; - } - return match[1]; -} -function tryGetTagNameFromUrl(url2, logger) { - const matches = [...url2.matchAll(/\/(codeql-bundle-[^/]*)\//g)]; - if (matches.length === 0) { - logger.debug(`Could not determine tag name for URL ${url2}.`); - return void 0; - } - const match = matches[matches.length - 1]; - if (match?.length !== 2) { - logger.debug( - `Could not determine tag name for URL ${url2}. Matched ${JSON.stringify( - match - )}.` - ); - return void 0; - } - return match[1]; -} -function convertToSemVer(version, logger) { - if (!semver8.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 = semver8.clean(version); - if (!s) { - throw new Error(`Bundle version ${version} is not in SemVer format.`); - } - return s; -} -async function findOverridingToolsInCache(humanReadableVersion, logger) { - const candidates = toolcache3.findAllVersions("CodeQL").filter(isGoodVersion).map((version) => ({ - folder: toolcache3.find("CodeQL", version), - version - })).filter(({ folder }) => fs9.existsSync(path9.join(folder, "pinned-version"))); - if (candidates.length === 1) { - const candidate = candidates[0]; - logger.debug( - `CodeQL tools version ${candidate.version} in toolcache overriding version ${humanReadableVersion}.` - ); - return { - codeqlFolder: candidate.folder, - sourceType: "toolcache", - toolsVersion: candidate.version - }; - } else if (candidates.length === 0) { - logger.debug( - "Did not find any candidate pinned versions of the CodeQL tools in the toolcache." - ); - } else { - logger.debug( - "Could not use CodeQL tools from the toolcache since more than one candidate pinned version was found in the toolcache." - ); - } - return void 0; -} -async function getCodeQLSource(toolsInput, defaultCliVersion, apiDetails, variant, tarSupportsZstd, features, logger) { - if (toolsInput && !isReservedToolsValue(toolsInput) && !toolsInput.startsWith("http")) { - logger.info(`Using CodeQL CLI from local path ${toolsInput}`); - const compressionMethod2 = inferCompressionMethod(toolsInput); - if (compressionMethod2 === void 0) { - throw new ConfigurationError( - `Could not infer compression method from path ${toolsInput}. Please specify a path ending in '.tar.gz' or '.tar.zst'.` - ); - } - return { - codeqlTarPath: toolsInput, - compressionMethod: compressionMethod2, - sourceType: "local", - toolsVersion: "local" - }; - } - let cliVersion2; - let tagName; - let url2; - const canForceNightlyWithFF = isDynamicWorkflow() || isInTestMode(); - const forceNightlyValueFF = await features.getValue("force_nightly" /* ForceNightly */); - const forceNightly = forceNightlyValueFF && canForceNightlyWithFF; - const nightlyRequestedByToolsInput = toolsInput !== void 0 && CODEQL_NIGHTLY_TOOLS_INPUTS.includes(toolsInput); - if (forceNightly || nightlyRequestedByToolsInput) { - if (forceNightly) { - logger.info( - `Using the latest CodeQL CLI nightly, as forced by the ${"force_nightly" /* ForceNightly */} feature flag.` - ); - addNoLanguageDiagnostic( - void 0, - makeDiagnostic( - "codeql-action/forced-nightly-cli", - "A nightly release of CodeQL was used", - { - markdownMessage: "GitHub configured this analysis to use a nightly release of CodeQL to allow you to preview changes from an upcoming release.\n\nNightly releases do not undergo the same validation as regular releases and may lead to analysis instability.\n\nIf use of a nightly CodeQL release for this analysis is unexpected, please contact GitHub support.", - visibility: { - cliSummaryTable: true, - statusPage: true, - telemetry: true - }, - severity: "note" - } - ) - ); - } else { - logger.info( - `Using the latest CodeQL CLI nightly, as requested by 'tools: ${toolsInput}'.` - ); - } - toolsInput = await getNightlyToolsUrl(logger); - } - const forceShippedTools = toolsInput && CODEQL_BUNDLE_VERSION_ALIAS.includes(toolsInput); - if (forceShippedTools) { - cliVersion2 = cliVersion; - tagName = bundleVersion; - logger.info( - `'tools: ${toolsInput}' was requested, so using CodeQL version ${cliVersion2}, the version shipped with the Action.` - ); - if (toolsInput === "latest") { - logger.warning( - "`tools: latest` has been renamed to `tools: linked`, but the old name is still supported. No action is required." - ); - } - } else if (toolsInput !== void 0 && toolsInput === CODEQL_TOOLCACHE_INPUT) { - let latestToolcacheVersion; - const allowToolcacheValueFF = await features.getValue( - "allow_toolcache_input" /* AllowToolcacheInput */ - ); - const allowToolcacheValue = allowToolcacheValueFF && (isDynamicWorkflow() || isInTestMode()); - if (allowToolcacheValue) { - logger.info( - `Attempting to use the latest CodeQL CLI version in the toolcache, as requested by 'tools: ${toolsInput}'.` - ); - latestToolcacheVersion = getLatestToolcacheVersion(logger); - if (latestToolcacheVersion) { - cliVersion2 = latestToolcacheVersion; - } - } - if (latestToolcacheVersion === void 0) { - if (allowToolcacheValue) { - logger.info( - `Found no CodeQL CLI in the toolcache, ignoring 'tools: ${toolsInput}'...` - ); - } else { - if (allowToolcacheValueFF) { - logger.warning( - `Ignoring 'tools: ${toolsInput}' because the workflow was not triggered dynamically.` - ); - } else { - logger.info( - `Ignoring 'tools: ${toolsInput}' because the feature is not enabled.` - ); - } - } - cliVersion2 = defaultCliVersion.cliVersion; - tagName = defaultCliVersion.tagName; - } - } else if (toolsInput !== void 0) { - tagName = tryGetTagNameFromUrl(toolsInput, logger); - url2 = toolsInput; - if (tagName) { - const bundleVersion3 = tryGetBundleVersionFromTagName(tagName, logger); - if (bundleVersion3 && semver8.valid(bundleVersion3)) { - cliVersion2 = convertToSemVer(bundleVersion3, logger); - } - } - } else { - cliVersion2 = defaultCliVersion.cliVersion; - tagName = defaultCliVersion.tagName; - } - const bundleVersion2 = tagName && tryGetBundleVersionFromTagName(tagName, logger); - const humanReadableVersion = cliVersion2 ?? (bundleVersion2 && convertToSemVer(bundleVersion2, logger)) ?? tagName ?? url2 ?? "unknown"; - logger.debug( - `Attempting to obtain CodeQL tools. CLI version: ${cliVersion2 ?? "unknown"}, bundle tag name: ${tagName ?? "unknown"}, URL: ${url2 ?? "unspecified"}.` - ); - let codeqlFolder; - if (cliVersion2) { - codeqlFolder = toolcache3.find("CodeQL", cliVersion2); - if (!codeqlFolder) { - logger.debug( - `Didn't find a version of the CodeQL tools in the toolcache with a version number exactly matching ${cliVersion2}.` - ); - const allVersions = toolcache3.findAllVersions("CodeQL"); - logger.debug( - `Found the following versions of the CodeQL tools in the toolcache: ${JSON.stringify( - allVersions - )}.` - ); - const candidateVersions = allVersions.filter( - (version) => version.startsWith(`${cliVersion2}-`) - ); - if (candidateVersions.length === 1) { - logger.debug( - `Exactly one version of the CodeQL tools starting with ${cliVersion2} found in the toolcache, using that.` - ); - codeqlFolder = toolcache3.find("CodeQL", candidateVersions[0]); - } else if (candidateVersions.length === 0) { - logger.debug( - `Didn't find any versions of the CodeQL tools starting with ${cliVersion2} in the toolcache. Trying next fallback method.` - ); - } else { - logger.warning( - `Found ${candidateVersions.length} versions of the CodeQL tools starting with ${cliVersion2} in the toolcache, but at most one was expected.` - ); - logger.debug("Trying next fallback method."); - } - } - } - if (!codeqlFolder && tagName) { - const fallbackVersion = await tryGetFallbackToolcacheVersion( - cliVersion2, - tagName, - logger - ); - if (fallbackVersion) { - codeqlFolder = toolcache3.find("CodeQL", fallbackVersion); - } else { - logger.debug( - `Could not determine a fallback toolcache version number for CodeQL tools version ${humanReadableVersion}.` - ); - } - } - if (codeqlFolder) { - logger.info( - `Found CodeQL tools version ${humanReadableVersion} in the toolcache.` - ); - } else { - logger.info( - `Did not find CodeQL tools version ${humanReadableVersion} in the toolcache.` - ); - } - if (codeqlFolder) { - if (cliVersion2) { - logger.info( - `Using CodeQL CLI version ${cliVersion2} from toolcache at ${codeqlFolder}` - ); - } else { - logger.info(`Using CodeQL CLI from toolcache at ${codeqlFolder}`); - } - return { - codeqlFolder, - sourceType: "toolcache", - toolsVersion: cliVersion2 ?? humanReadableVersion - }; - } - if (variant === "GitHub Enterprise Server" /* GHES */ && !forceShippedTools && !toolsInput) { - const result = await findOverridingToolsInCache( - humanReadableVersion, - logger - ); - if (result !== void 0) { - return result; - } - } - let compressionMethod; - if (!url2) { - compressionMethod = cliVersion2 !== void 0 && await useZstdBundle(cliVersion2, tarSupportsZstd) ? "zstd" : "gzip"; - url2 = await getCodeQLBundleDownloadURL( - tagName, - apiDetails, - compressionMethod, - logger - ); - } else { - const method = inferCompressionMethod(url2); - if (method === void 0) { - throw new ConfigurationError( - `Could not infer compression method from URL ${url2}. Please specify a URL ending in '.tar.gz' or '.tar.zst'.` - ); - } - compressionMethod = method; - } - if (cliVersion2) { - logger.info(`Using CodeQL CLI version ${cliVersion2} sourced from ${url2} .`); - } else { - logger.info(`Using CodeQL CLI sourced from ${url2} .`); - } - return { - bundleVersion: tagName && tryGetBundleVersionFromTagName(tagName, logger), - cliVersion: cliVersion2, - codeqlURL: url2, - compressionMethod, - sourceType: "download", - toolsVersion: cliVersion2 ?? humanReadableVersion - }; -} -async function tryGetFallbackToolcacheVersion(cliVersion2, tagName, logger) { - const bundleVersion2 = tryGetBundleVersionFromTagName(tagName, logger); - if (!bundleVersion2) { - return void 0; - } - const fallbackVersion = convertToSemVer(bundleVersion2, logger); - logger.debug( - `Computed a fallback toolcache version number of ${fallbackVersion} for CodeQL version ${cliVersion2 ?? tagName}.` - ); - return fallbackVersion; -} -var downloadCodeQL = async function(codeqlURL, compressionMethod, maybeBundleVersion, maybeCliVersion, apiDetails, tarVersion, tempDir, logger) { - const parsedCodeQLURL = new URL(codeqlURL); - const searchParams = new URLSearchParams(parsedCodeQLURL.search); - const headers = { - accept: "application/octet-stream" - }; - let authorization = void 0; - if (searchParams.has("token")) { - logger.debug("CodeQL tools URL contains an authorization token."); - } else { - authorization = getAuthorizationHeaderFor( - logger, - apiDetails, - codeqlURL - ); - } - const toolcacheInfo = getToolcacheDestinationInfo( - maybeBundleVersion, - maybeCliVersion, - logger - ); - const extractedBundlePath = toolcacheInfo?.path ?? getTempExtractionDir(tempDir); - const statusReport = await downloadAndExtract( - codeqlURL, - compressionMethod, - extractedBundlePath, - authorization, - { "User-Agent": "CodeQL Action", ...headers }, - tarVersion, - logger - ); - if (!toolcacheInfo) { - logger.debug( - `Could not cache CodeQL tools because we could not determine the bundle version from the URL ${codeqlURL}.` - ); - return { - codeqlFolder: extractedBundlePath, - statusReport, - toolsVersion: maybeCliVersion ?? "unknown" - }; - } - writeToolcacheMarkerFile(toolcacheInfo.path, logger); - return { - codeqlFolder: extractedBundlePath, - statusReport, - toolsVersion: maybeCliVersion ?? toolcacheInfo.version - }; -}; -function getToolcacheDestinationInfo(maybeBundleVersion, maybeCliVersion, logger) { - if (maybeBundleVersion) { - const version = getCanonicalToolcacheVersion( - maybeCliVersion, - maybeBundleVersion, - logger - ); - return { - path: getToolcacheDirectory(version), - version - }; - } - return void 0; -} -function getCanonicalToolcacheVersion(cliVersion2, bundleVersion2, logger) { - if (!cliVersion2?.match(/^[0-9]+\.[0-9]+\.[0-9]+$/)) { - return convertToSemVer(bundleVersion2, logger); - } - return cliVersion2; -} -async function setupCodeQLBundle(toolsInput, apiDetails, tempDir, variant, defaultCliVersion, features, logger) { - if (!await isBinaryAccessible("tar", logger)) { - throw new ConfigurationError( - "Could not find tar in PATH, so unable to extract CodeQL bundle." - ); - } - const zstdAvailability = await isZstdAvailable(logger); - const source = await getCodeQLSource( - toolsInput, - defaultCliVersion, - apiDetails, - variant, - zstdAvailability.available, - features, - logger - ); - let codeqlFolder; - let toolsVersion = source.toolsVersion; - let toolsDownloadStatusReport; - let toolsSource; - switch (source.sourceType) { - case "local": { - codeqlFolder = await extract( - source.codeqlTarPath, - getTempExtractionDir(tempDir), - source.compressionMethod, - zstdAvailability.version, - logger - ); - toolsSource = "LOCAL" /* Local */; - break; - } - case "toolcache": - codeqlFolder = source.codeqlFolder; - logger.debug(`CodeQL found in cache ${codeqlFolder}`); - toolsSource = "TOOLCACHE" /* Toolcache */; - break; - case "download": { - const result = await downloadCodeQL( - source.codeqlURL, - source.compressionMethod, - source.bundleVersion, - source.cliVersion, - apiDetails, - zstdAvailability.version, - tempDir, - logger - ); - toolsVersion = result.toolsVersion; - codeqlFolder = result.codeqlFolder; - toolsDownloadStatusReport = result.statusReport; - toolsSource = "DOWNLOAD" /* Download */; - break; - } - default: - assertNever(source); - } - return { - codeqlFolder, - toolsDownloadStatusReport, - toolsSource, - toolsVersion, - zstdAvailability - }; -} -async function useZstdBundle(cliVersion2, tarSupportsZstd) { - return ( - // In testing, gzip performs better than zstd on Windows. - process.platform !== "win32" && tarSupportsZstd && semver8.gte(cliVersion2, CODEQL_VERSION_ZSTD_BUNDLE) - ); -} -function getTempExtractionDir(tempDir) { - return path9.join(tempDir, v4_default()); -} -async function getNightlyToolsUrl(logger) { - const zstdAvailability = await isZstdAvailable(logger); - const compressionMethod = await useZstdBundle( - CODEQL_VERSION_ZSTD_BUNDLE, - zstdAvailability.available - ) ? "zstd" : "gzip"; - try { - const release2 = await getApiClient().rest.repos.listReleases({ - owner: CODEQL_NIGHTLIES_REPOSITORY_OWNER, - repo: CODEQL_NIGHTLIES_REPOSITORY_NAME, - per_page: 1, - page: 1, - prerelease: true - }); - const latestRelease = release2.data[0]; - if (!latestRelease) { - throw new Error("Could not find the latest nightly release."); - } - return `https://github.com/${CODEQL_NIGHTLIES_REPOSITORY_OWNER}/${CODEQL_NIGHTLIES_REPOSITORY_NAME}/releases/download/${latestRelease.tag_name}/${getCodeQLBundleName(compressionMethod)}`; - } catch (e) { - throw new Error( - `Failed to retrieve the latest nightly release: ${wrapError(e)}` - ); - } -} -function getLatestToolcacheVersion(logger) { - const allVersions = toolcache3.findAllVersions("CodeQL").sort((a, b) => semver8.compare(b, a)); - logger.debug( - `Found the following versions of the CodeQL tools in the toolcache: ${JSON.stringify( - allVersions - )}.` - ); - if (allVersions.length > 0) { - const latestToolcacheVersion = allVersions[0]; - logger.info( - `CLI version ${latestToolcacheVersion} is the latest version in the toolcache.` - ); - return latestToolcacheVersion; - } - return void 0; -} -function isReservedToolsValue(tools) { - return CODEQL_BUNDLE_VERSION_ALIAS.includes(tools) || CODEQL_NIGHTLY_TOOLS_INPUTS.includes(tools) || tools === CODEQL_TOOLCACHE_INPUT; -} // src/tracer-config.ts async function shouldEnableIndirectTracing(codeql, config) { @@ -166619,54 +165578,6 @@ var GHES_VERSION_MOST_RECENTLY_DEPRECATED = "3.13"; var GHES_MOST_RECENT_DEPRECATION_DATE = "2025-06-19"; var EXTRACTION_DEBUG_MODE_VERBOSITY = "progress++"; var CODEQL_VERSION_CACHE_CLEANUP = "2.17.1"; -async function setupCodeQL(toolsInput, apiDetails, tempDir, variant, defaultCliVersion, features, logger, checkVersion) { - try { - const { - codeqlFolder, - toolsDownloadStatusReport, - toolsSource, - toolsVersion, - zstdAvailability - } = await setupCodeQLBundle( - toolsInput, - apiDetails, - tempDir, - variant, - defaultCliVersion, - features, - logger - ); - logger.debug( - `Bundle download status report: ${JSON.stringify( - toolsDownloadStatusReport - )}` - ); - let codeqlCmd = path10.join(codeqlFolder, "codeql", "codeql"); - if (process.platform === "win32") { - codeqlCmd += ".exe"; - } else if (process.platform !== "linux" && process.platform !== "darwin") { - throw new ConfigurationError( - `Unsupported platform: ${process.platform}` - ); - } - cachedCodeQL = await getCodeQLForCmd(codeqlCmd, checkVersion); - return { - codeql: cachedCodeQL, - toolsDownloadStatusReport, - toolsSource, - toolsVersion, - zstdAvailability - }; - } catch (rawError) { - const e = wrapApiConfigurationError(rawError); - const ErrorClass = e instanceof ConfigurationError || e instanceof Error && e.message.includes("ENOSPC") ? ConfigurationError : Error; - throw new ErrorClass( - `Unable to download and extract CodeQL CLI: ${getErrorMessage(e)}${e instanceof Error && e.stack ? ` - -Details: ${e.stack}` : ""}` - ); - } -} async function getCodeQL(cmd) { if (cachedCodeQL === void 0) { cachedCodeQL = await getCodeQLForCmd(cmd, true); @@ -166703,12 +165614,12 @@ async function getCodeQLForCmd(cmd, checkVersion) { }, async isTracedLanguage(language) { const extractorPath = await this.resolveExtractor(language); - const tracingConfigPath = path10.join( + const tracingConfigPath = path7.join( extractorPath, "tools", "tracing-config.lua" ); - return fs10.existsSync(tracingConfigPath); + return fs7.existsSync(tracingConfigPath); }, async isScannedLanguage(language) { return !await this.isTracedLanguage(language); @@ -166785,7 +165696,7 @@ async function getCodeQLForCmd(cmd, checkVersion) { }, async runAutobuild(config, language) { applyAutobuildAzurePipelinesTimeoutFix(); - const autobuildCmd = path10.join( + const autobuildCmd = path7.join( await this.resolveExtractor(language), "tools", process.platform === "win32" ? "autobuild.cmd" : "autobuild.sh" @@ -167184,7 +166095,7 @@ async function writeCodeScanningConfigFile(config, logger) { logger.startGroup("Augmented user configuration file contents"); logger.info(dump(augmentedConfig)); logger.endGroup(); - fs10.writeFileSync(codeScanningConfigFile, dump(augmentedConfig)); + fs7.writeFileSync(codeScanningConfigFile, dump(augmentedConfig)); return codeScanningConfigFile; } var TRAP_CACHE_SIZE_MB = 1024; @@ -167207,7 +166118,7 @@ async function getTrapCachingExtractorConfigArgsForLang(config, language) { ]; } function getGeneratedCodeScanningConfigPath(config) { - return path10.resolve(config.tempDir, "user-config.yaml"); + return path7.resolve(config.tempDir, "user-config.yaml"); } function getExtractionVerbosityArguments(enableDebugLogging) { return enableDebugLogging ? [`--verbosity=${EXTRACTION_DEBUG_MODE_VERBOSITY}`] : []; @@ -167228,16 +166139,16 @@ async function getJobRunUuidSarifOptions(codeql) { } // src/debug-artifacts.ts -var fs13 = __toESM(require("fs")); -var path13 = __toESM(require("path")); +var fs10 = __toESM(require("fs")); +var path10 = __toESM(require("path")); var artifact = __toESM(require_artifact2()); var artifactLegacy = __toESM(require_artifact_client2()); var core12 = __toESM(require_core()); var import_archiver = __toESM(require_archiver()); // src/analyze.ts -var fs11 = __toESM(require("fs")); -var path11 = __toESM(require("path")); +var fs8 = __toESM(require("fs")); +var path8 = __toESM(require("path")); var io5 = __toESM(require_io()); // src/autobuild.ts @@ -167268,7 +166179,7 @@ function dbIsFinalized(config, language, logger) { const dbPath = getCodeQLDatabasePath(config, language); try { const dbInfo = load( - fs11.readFileSync(path11.resolve(dbPath, "codeql-database.yml"), "utf8") + fs8.readFileSync(path8.resolve(dbPath, "codeql-database.yml"), "utf8") ); return !("inProgress" in dbInfo); } catch { @@ -167280,9 +166191,9 @@ function dbIsFinalized(config, language, logger) { } // src/artifact-scanner.ts -var fs12 = __toESM(require("fs")); -var os2 = __toESM(require("os")); -var path12 = __toESM(require("path")); +var fs9 = __toESM(require("fs")); +var os = __toESM(require("os")); +var path9 = __toESM(require("path")); var exec = __toESM(require_exec()); var GITHUB_PAT_CLASSIC_PATTERN = { type: "Personal Access Token (Classic)" /* PersonalAccessClassic */, @@ -167319,7 +166230,7 @@ var GITHUB_TOKEN_PATTERNS = [ function scanFileForTokens(filePath, relativePath, logger) { const findings = []; try { - const content = fs12.readFileSync(filePath, "utf8"); + const content = fs9.readFileSync(filePath, "utf8"); for (const { type: type2, pattern } of GITHUB_TOKEN_PATTERNS) { const matches = content.match(pattern); if (matches) { @@ -167349,10 +166260,10 @@ async function scanArchiveFile(archivePath, relativeArchivePath, extractDir, log findings: [] }; try { - const tempExtractDir = fs12.mkdtempSync( - path12.join(extractDir, `extract-${depth}-`) + const tempExtractDir = fs9.mkdtempSync( + path9.join(extractDir, `extract-${depth}-`) ); - const fileName = path12.basename(archivePath).toLowerCase(); + const fileName = path9.basename(archivePath).toLowerCase(); if (fileName.endsWith(".tar.gz") || fileName.endsWith(".tgz")) { logger.debug(`Extracting tar.gz file: ${archivePath}`); await exec.exec("tar", ["-xzf", archivePath, "-C", tempExtractDir], { @@ -167369,21 +166280,21 @@ async function scanArchiveFile(archivePath, relativeArchivePath, extractDir, log ); } else if (fileName.endsWith(".zst")) { logger.debug(`Extracting zst file: ${archivePath}`); - const outputFile = path12.join( + const outputFile = path9.join( tempExtractDir, - path12.basename(archivePath, ".zst") + path9.basename(archivePath, ".zst") ); await exec.exec("zstd", ["-d", archivePath, "-o", outputFile], { silent: true }); } else if (fileName.endsWith(".gz")) { logger.debug(`Extracting gz file: ${archivePath}`); - const outputFile = path12.join( + const outputFile = path9.join( tempExtractDir, - path12.basename(archivePath, ".gz") + path9.basename(archivePath, ".gz") ); await exec.exec("gunzip", ["-c", archivePath], { - outStream: fs12.createWriteStream(outputFile), + outStream: fs9.createWriteStream(outputFile), silent: true }); } else if (fileName.endsWith(".zip")) { @@ -167404,7 +166315,7 @@ async function scanArchiveFile(archivePath, relativeArchivePath, extractDir, log ); result.scannedFiles += scanResult.scannedFiles; result.findings.push(...scanResult.findings); - fs12.rmSync(tempExtractDir, { recursive: true, force: true }); + fs9.rmSync(tempExtractDir, { recursive: true, force: true }); } catch (e) { logger.debug( `Could not extract or scan archive file ${archivePath}: ${getErrorMessage(e)}` @@ -167417,7 +166328,7 @@ async function scanFile(fullPath, relativePath, extractDir, logger, depth = 0) { scannedFiles: 1, findings: [] }; - const fileName = path12.basename(fullPath).toLowerCase(); + const fileName = path9.basename(fullPath).toLowerCase(); const isArchive = fileName.endsWith(".zip") || fileName.endsWith(".tar.gz") || fileName.endsWith(".tgz") || fileName.endsWith(".tar.zst") || fileName.endsWith(".zst") || fileName.endsWith(".gz"); if (isArchive) { const archiveResult = await scanArchiveFile( @@ -167439,10 +166350,10 @@ async function scanDirectory(dirPath, baseRelativePath, logger, depth = 0) { scannedFiles: 0, findings: [] }; - const entries = fs12.readdirSync(dirPath, { withFileTypes: true }); + const entries = fs9.readdirSync(dirPath, { withFileTypes: true }); for (const entry of entries) { - const fullPath = path12.join(dirPath, entry.name); - const relativePath = path12.join(baseRelativePath, entry.name); + const fullPath = path9.join(dirPath, entry.name); + const relativePath = path9.join(baseRelativePath, entry.name); if (entry.isDirectory()) { const subResult = await scanDirectory( fullPath, @@ -167456,7 +166367,7 @@ async function scanDirectory(dirPath, baseRelativePath, logger, depth = 0) { const fileResult = await scanFile( fullPath, relativePath, - path12.dirname(fullPath), + path9.dirname(fullPath), logger, depth ); @@ -167474,11 +166385,11 @@ async function scanArtifactsForTokens(filesToScan, logger) { scannedFiles: 0, findings: [] }; - const tempScanDir = fs12.mkdtempSync(path12.join(os2.tmpdir(), "artifact-scan-")); + const tempScanDir = fs9.mkdtempSync(path9.join(os.tmpdir(), "artifact-scan-")); try { for (const filePath of filesToScan) { - const stats = fs12.statSync(filePath); - const fileName = path12.basename(filePath); + const stats = fs9.statSync(filePath); + const fileName = path9.basename(filePath); if (stats.isDirectory()) { const dirResult = await scanDirectory(filePath, fileName, logger); result.scannedFiles += dirResult.scannedFiles; @@ -167515,7 +166426,7 @@ async function scanArtifactsForTokens(filesToScan, logger) { } } finally { try { - fs12.rmSync(tempScanDir, { recursive: true, force: true }); + fs9.rmSync(tempScanDir, { recursive: true, force: true }); } catch (e) { logger.debug( `Could not clean up temporary scan directory: ${getErrorMessage(e)}` @@ -167531,17 +166442,17 @@ function sanitizeArtifactName(name) { function tryPrepareSarifDebugArtifact(config, language, logger) { try { const analyzeActionOutputDir = process.env["CODEQL_ACTION_SARIF_RESULTS_OUTPUT_DIR" /* SARIF_RESULTS_OUTPUT_DIR */]; - if (analyzeActionOutputDir !== void 0 && fs13.existsSync(analyzeActionOutputDir) && fs13.lstatSync(analyzeActionOutputDir).isDirectory()) { - const sarifFile = path13.resolve( + if (analyzeActionOutputDir !== void 0 && fs10.existsSync(analyzeActionOutputDir) && fs10.lstatSync(analyzeActionOutputDir).isDirectory()) { + const sarifFile = path10.resolve( analyzeActionOutputDir, `${language}.sarif` ); - if (fs13.existsSync(sarifFile)) { - const sarifInDbLocation = path13.resolve( + if (fs10.existsSync(sarifFile)) { + const sarifInDbLocation = path10.resolve( config.dbLocation, `${language}.sarif` ); - fs13.copyFileSync(sarifFile, sarifInDbLocation); + fs10.copyFileSync(sarifFile, sarifInDbLocation); return sarifInDbLocation; } } @@ -167592,13 +166503,13 @@ async function tryUploadAllAvailableDebugArtifacts(codeql, config, logger, codeQ } logger.info("Preparing database logs debug artifact..."); const databaseDirectory = getCodeQLDatabasePath(config, language); - const logsDirectory = path13.resolve(databaseDirectory, "log"); + const logsDirectory = path10.resolve(databaseDirectory, "log"); if (doesDirectoryExist(logsDirectory)) { filesToUpload.push(...listFolder(logsDirectory)); logger.info("Database logs debug artifact ready for upload."); } logger.info("Preparing database cluster logs debug artifact..."); - const multiLanguageTracingLogsDirectory = path13.resolve( + const multiLanguageTracingLogsDirectory = path10.resolve( config.dbLocation, "log" ); @@ -167685,8 +166596,8 @@ async function uploadArtifacts(logger, toUpload, rootDir, artifactName, ghVarian try { await artifactUploader.uploadArtifact( sanitizeArtifactName(`${artifactName}${suffix}`), - toUpload.map((file) => path13.normalize(file)), - path13.normalize(rootDir), + toUpload.map((file) => path10.normalize(file)), + path10.normalize(rootDir), { // ensure we don't keep the debug artifacts around for too long since they can be large. retentionDays: 7 @@ -167713,17 +166624,17 @@ async function getArtifactUploaderClient(logger, ghVariant) { } async function createPartialDatabaseBundle(config, language) { const databasePath = getCodeQLDatabasePath(config, language); - const databaseBundlePath = path13.resolve( + const databaseBundlePath = path10.resolve( config.dbLocation, `${config.debugDatabaseName}-${language}-partial.zip` ); core12.info( `${config.debugDatabaseName}-${language} is not finalized. Uploading partial database bundle at ${databaseBundlePath}...` ); - if (fs13.existsSync(databaseBundlePath)) { - await fs13.promises.rm(databaseBundlePath, { force: true }); + if (fs10.existsSync(databaseBundlePath)) { + await fs10.promises.rm(databaseBundlePath, { force: true }); } - const output = fs13.createWriteStream(databaseBundlePath); + const output = fs10.createWriteStream(databaseBundlePath); const zip = (0, import_archiver.default)("zip"); zip.on("error", (err) => { throw err; @@ -167749,20 +166660,20 @@ async function createDatabaseBundleCli(codeql, config, language) { } // src/init-action-post-helper.ts -var fs17 = __toESM(require("fs")); +var fs14 = __toESM(require("fs")); var github2 = __toESM(require_github()); // src/upload-lib.ts -var fs15 = __toESM(require("fs")); -var path15 = __toESM(require("path")); +var fs12 = __toESM(require("fs")); +var path12 = __toESM(require("path")); var url = __toESM(require("url")); var import_zlib = __toESM(require("zlib")); var core13 = __toESM(require_core()); var jsonschema2 = __toESM(require_lib2()); // src/fingerprints.ts -var fs14 = __toESM(require("fs")); -var import_path2 = __toESM(require("path")); +var fs11 = __toESM(require("fs")); +var import_path = __toESM(require("path")); // node_modules/long/index.js var wasm = null; @@ -168749,7 +167660,7 @@ async function hash(callback, filepath) { } updateHash(current); }; - const readStream = fs14.createReadStream(filepath, "utf8"); + const readStream = fs11.createReadStream(filepath, "utf8"); for await (const data of readStream) { for (let i = 0; i < data.length; ++i) { processCharacter(data.charCodeAt(i)); @@ -168821,14 +167732,14 @@ function resolveUriToFile(location, artifacts, sourceRoot, logger) { ); return void 0; } - if (!import_path2.default.isAbsolute(uri)) { + if (!import_path.default.isAbsolute(uri)) { uri = srcRootPrefix + uri; } - if (!fs14.existsSync(uri)) { + if (!fs11.existsSync(uri)) { logger.debug(`Unable to compute fingerprint for non-existent file: ${uri}`); return void 0; } - if (fs14.statSync(uri).isDirectory()) { + if (fs11.statSync(uri).isDirectory()) { logger.debug(`Unable to compute fingerprint for directory: ${uri}`); return void 0; } @@ -168885,34 +167796,6 @@ async function addFingerprints(sarif, sourceRoot, logger) { // src/init.ts var toolrunner4 = __toESM(require_toolrunner()); var io6 = __toESM(require_io()); -async function initCodeQL(toolsInput, apiDetails, tempDir, variant, defaultCliVersion, features, logger) { - logger.startGroup("Setup CodeQL tools"); - const { - codeql, - toolsDownloadStatusReport, - toolsSource, - toolsVersion, - zstdAvailability - } = await setupCodeQL( - toolsInput, - apiDetails, - tempDir, - variant, - defaultCliVersion, - features, - logger, - true - ); - await codeql.printVersion(); - logger.endGroup(); - return { - codeql, - toolsDownloadStatusReport, - toolsSource, - toolsVersion, - zstdAvailability - }; -} // src/upload-lib.ts var GENERIC_403_MSG = "The repo on which this action is running has not opted-in to CodeQL code scanning."; @@ -168926,7 +167809,7 @@ function combineSarifFiles(sarifFiles, logger) { for (const sarifFile of sarifFiles) { logger.debug(`Loading SARIF file: ${sarifFile}`); const sarifObject = JSON.parse( - fs15.readFileSync(sarifFile, "utf8") + fs12.readFileSync(sarifFile, "utf8") ); if (combinedSarif.version === null) { combinedSarif.version = sarifObject.version; @@ -168995,35 +167878,10 @@ async function shouldDisableCombineSarifFiles(sarifObjects, githubVersion) { } return true; } -async function minimalInitCodeQL(logger, gitHubVersion, features) { - logger.info( - "Initializing CodeQL since the 'init' Action was not called before this step." - ); - const apiDetails = { - auth: getRequiredInput("token"), - externalRepoAuth: getOptionalInput("external-repository-token"), - url: getRequiredEnvParam("GITHUB_SERVER_URL"), - apiURL: getRequiredEnvParam("GITHUB_API_URL") - }; - const codeQLDefaultVersionInfo = await features.getDefaultCliVersion( - gitHubVersion.type - ); - const initCodeQLResult = await initCodeQL( - void 0, - // There is no tools input on the upload action - apiDetails, - getTemporaryDirectory(), - gitHubVersion.type, - codeQLDefaultVersionInfo, - features, - logger - ); - return initCodeQLResult.codeql; -} -async function combineSarifFilesUsingCLI(sarifFiles, gitHubVersion, features, logger) { +async function combineSarifFilesUsingCLI(sarifFiles, gitHubVersion, _features, logger, getCodeQL2, tempDir) { logger.info("Combining SARIF files using the CodeQL CLI"); const sarifObjects = sarifFiles.map((sarifFile) => { - return JSON.parse(fs15.readFileSync(sarifFile, "utf8")); + return JSON.parse(fs12.readFileSync(sarifFile, "utf8")); }); const deprecationWarningMessage = gitHubVersion.type === "GitHub Enterprise Server" /* GHES */ ? "and will be removed in GitHub Enterprise Server 3.18" : "and will be removed in July 2025"; const deprecationMoreInformationMessage = "For more information, see https://github.blog/changelog/2024-05-06-code-scanning-will-stop-combining-runs-from-a-single-upload"; @@ -169043,23 +167901,15 @@ async function combineSarifFilesUsingCLI(sarifFiles, gitHubVersion, features, lo } return combineSarifFiles(sarifFiles, logger); } - let codeQL; - let tempDir = getTemporaryDirectory(); - const config = await getConfig(tempDir, logger); - if (config !== void 0) { - codeQL = await getCodeQL(config.codeQLCmd); - tempDir = config.tempDir; - } else { - codeQL = await minimalInitCodeQL(logger, gitHubVersion, features); - } - const baseTempDir = path15.resolve(tempDir, "combined-sarif"); - fs15.mkdirSync(baseTempDir, { recursive: true }); - const outputDirectory = fs15.mkdtempSync(path15.resolve(baseTempDir, "output-")); - const outputFile = path15.resolve(outputDirectory, "combined-sarif.sarif"); + const codeQL = await getCodeQL2(); + const baseTempDir = path12.resolve(tempDir, "combined-sarif"); + fs12.mkdirSync(baseTempDir, { recursive: true }); + const outputDirectory = fs12.mkdtempSync(path12.resolve(baseTempDir, "output-")); + const outputFile = path12.resolve(outputDirectory, "combined-sarif.sarif"); await codeQL.mergeResults(sarifFiles, outputFile, { mergeRunsFromEqualCategory: true }); - return JSON.parse(fs15.readFileSync(outputFile, "utf8")); + return JSON.parse(fs12.readFileSync(outputFile, "utf8")); } function populateRunAutomationDetails(sarif, category, analysis_key, environment) { const automationID = getAutomationID2(category, analysis_key, environment); @@ -169088,7 +167938,7 @@ function getAutomationID2(category, analysis_key, environment) { async function uploadPayload(payload, repositoryNwo, logger, analysis) { logger.info("Uploading results"); if (shouldSkipSarifUpload()) { - const payloadSaveFile = path15.join( + const payloadSaveFile = path12.join( getTemporaryDirectory(), `payload-${analysis.kind}.json` ); @@ -169096,7 +167946,7 @@ async function uploadPayload(payload, repositoryNwo, logger, analysis) { `SARIF upload disabled by an environment variable. Saving to ${payloadSaveFile}` ); logger.info(`Payload: ${JSON.stringify(payload, null, 2)}`); - fs15.writeFileSync(payloadSaveFile, JSON.stringify(payload, null, 2)); + fs12.writeFileSync(payloadSaveFile, JSON.stringify(payload, null, 2)); return "dummy-sarif-id"; } const client = getApiClient(); @@ -169130,12 +167980,12 @@ async function uploadPayload(payload, repositoryNwo, logger, analysis) { function findSarifFilesInDir(sarifPath, isSarif) { const sarifFiles = []; const walkSarifFiles = (dir) => { - const entries = fs15.readdirSync(dir, { withFileTypes: true }); + const entries = fs12.readdirSync(dir, { withFileTypes: true }); for (const entry of entries) { if (entry.isFile() && isSarif(entry.name)) { - sarifFiles.push(path15.resolve(dir, entry.name)); + sarifFiles.push(path12.resolve(dir, entry.name)); } else if (entry.isDirectory()) { - walkSarifFiles(path15.resolve(dir, entry.name)); + walkSarifFiles(path12.resolve(dir, entry.name)); } } }; @@ -169143,11 +167993,11 @@ function findSarifFilesInDir(sarifPath, isSarif) { return sarifFiles; } function getSarifFilePaths(sarifPath, isSarif) { - if (!fs15.existsSync(sarifPath)) { + if (!fs12.existsSync(sarifPath)) { throw new ConfigurationError(`Path does not exist: ${sarifPath}`); } let sarifFiles; - if (fs15.lstatSync(sarifPath).isDirectory()) { + if (fs12.lstatSync(sarifPath).isDirectory()) { sarifFiles = findSarifFilesInDir(sarifPath, isSarif); if (sarifFiles.length === 0) { throw new ConfigurationError( @@ -169177,7 +168027,7 @@ function countResultsInSarif(sarif) { } function readSarifFile(sarifFilePath) { try { - return JSON.parse(fs15.readFileSync(sarifFilePath, "utf8")); + return JSON.parse(fs12.readFileSync(sarifFilePath, "utf8")); } catch (e) { throw new InvalidSarifUploadError( `Invalid SARIF. JSON syntax error: ${getErrorMessage(e)}` @@ -169246,7 +168096,7 @@ function buildPayload(commitOid, ref, analysisKey, analysisName, zippedSarif, wo payloadObj.base_sha = mergeBaseCommitOid; } else if (process.env.GITHUB_EVENT_PATH) { const githubEvent = JSON.parse( - fs15.readFileSync(process.env.GITHUB_EVENT_PATH, "utf8") + fs12.readFileSync(process.env.GITHUB_EVENT_PATH, "utf8") ); payloadObj.base_ref = `refs/heads/${githubEvent.pull_request.base.ref}`; payloadObj.base_sha = githubEvent.pull_request.base.sha; @@ -169254,7 +168104,7 @@ function buildPayload(commitOid, ref, analysisKey, analysisName, zippedSarif, wo } return payloadObj; } -async function postProcessSarifFiles(logger, features, checkoutPath, sarifPaths, category, analysis) { +async function postProcessSarifFiles(logger, features, getCodeQL2, tempPath, checkoutPath, sarifPaths, category, analysis) { logger.info(`Post-processing sarif files: ${JSON.stringify(sarifPaths)}`); const gitHubVersion = await getGitHubVersion(); let sarif; @@ -169268,7 +168118,9 @@ async function postProcessSarifFiles(logger, features, checkoutPath, sarifPaths, sarifPaths, gitHubVersion, features, - logger + logger, + getCodeQL2, + tempPath ); } else { const sarifPath = sarifPaths[0]; @@ -169288,12 +168140,14 @@ async function postProcessSarifFiles(logger, features, checkoutPath, sarifPaths, ); return { sarif, analysisKey, environment }; } -async function uploadFiles(inputSarifPath, checkoutPath, category, features, logger, uploadTarget) { +async function uploadFiles(tempDir, codeql, inputSarifPath, checkoutPath, category, features, logger, uploadTarget) { const sarifPaths = getSarifFilePaths( inputSarifPath, uploadTarget.sarifPredicate ); return uploadSpecifiedFiles( + tempDir, + codeql, sarifPaths, checkoutPath, category, @@ -169302,10 +168156,12 @@ async function uploadFiles(inputSarifPath, checkoutPath, category, features, log uploadTarget ); } -async function uploadSpecifiedFiles(sarifPaths, checkoutPath, category, features, logger, uploadTarget) { +async function uploadSpecifiedFiles(tempDir, codeql, sarifPaths, checkoutPath, category, features, logger, uploadTarget) { const processingResults = await postProcessSarifFiles( logger, features, + async () => codeql, + tempDir, checkoutPath, sarifPaths, category, @@ -169507,7 +168363,7 @@ function filterAlertsByDiffRange(logger, sarif) { if (!locationUri || locationStartLine === void 0) { return false; } - const locationPath = path15.join(checkoutPath, locationUri).replaceAll(path15.sep, "/"); + const locationPath = path12.join(checkoutPath, locationUri).replaceAll(path12.sep, "/"); return diffRanges.some( (range) => range.path === locationPath && (range.startLine <= locationStartLine && range.endLine >= locationStartLine || range.startLine === 0 && range.endLine === 0) ); @@ -169519,8 +168375,8 @@ function filterAlertsByDiffRange(logger, sarif) { } // src/workflow.ts -var fs16 = __toESM(require("fs")); -var path16 = __toESM(require("path")); +var fs13 = __toESM(require("fs")); +var path13 = __toESM(require("path")); var import_zlib2 = __toESM(require("zlib")); var core14 = __toESM(require_core()); function toCodedErrors(errors) { @@ -169548,15 +168404,15 @@ async function getWorkflow(logger) { ); } const workflowPath = await getWorkflowAbsolutePath(logger); - return load(fs16.readFileSync(workflowPath, "utf-8")); + return load(fs13.readFileSync(workflowPath, "utf-8")); } async function getWorkflowAbsolutePath(logger) { const relativePath = await getWorkflowRelativePath(); - const absolutePath = path16.join( + const absolutePath = path13.join( getRequiredEnvParam("GITHUB_WORKSPACE"), relativePath ); - if (fs16.existsSync(absolutePath)) { + if (fs13.existsSync(absolutePath)) { logger.debug( `Derived the following absolute path for the currently executing workflow: ${absolutePath}.` ); @@ -169683,6 +168539,8 @@ async function maybeUploadFailedSarif(config, repositoryNwo, features, logger) { } logger.info(`Uploading failed SARIF file ${sarifFile}`); const uploadResult = await uploadFiles( + config.tempDir, + codeql, sarifFile, checkoutPath, category, @@ -169765,7 +168623,7 @@ async function run(uploadAllAvailableDebugArtifacts, printDebugLogs2, codeql, co } if (isSelfHostedRunner()) { try { - fs17.rmSync(config.dbLocation, { + fs14.rmSync(config.dbLocation, { recursive: true, force: true, maxRetries: 3 @@ -169846,7 +168704,7 @@ async function removeUploadedSarif(uploadFailedSarifResult, logger) { } // src/status-report.ts -var os3 = __toESM(require("os")); +var os2 = __toESM(require("os")); var core15 = __toESM(require_core()); function isFirstPartyAnalysis(actionName) { if (actionName !== "upload-sarif" /* UploadSarif */) { @@ -169973,7 +168831,7 @@ async function createStatusReportBase(actionName, status, actionStartedAt, confi statusReport.runner_arch = process.env["RUNNER_ARCH"]; } if (!(runnerOs === "Linux" && isSelfHostedRunner())) { - statusReport.runner_os_release = os3.release(); + statusReport.runner_os_release = os2.release(); } if (codeQlCliVersion !== void 0) { statusReport.codeql_version = codeQlCliVersion.version; diff --git a/lib/upload-lib.js b/lib/upload-lib.js index 984ecc571..5d88713a2 100644 --- a/lib/upload-lib.js +++ b/lib/upload-lib.js @@ -204,7 +204,7 @@ var require_file_command = __commonJS({ exports2.issueFileCommand = issueFileCommand; exports2.prepareKeyValueMessage = prepareKeyValueMessage; var crypto2 = __importStar2(require("crypto")); - var fs12 = __importStar2(require("fs")); + var fs11 = __importStar2(require("fs")); var os2 = __importStar2(require("os")); var utils_1 = require_utils(); function issueFileCommand(command, message) { @@ -212,10 +212,10 @@ var require_file_command = __commonJS({ if (!filePath) { throw new Error(`Unable to find environment variable for file command ${command}`); } - if (!fs12.existsSync(filePath)) { + if (!fs11.existsSync(filePath)) { throw new Error(`Missing file at path: ${filePath}`); } - fs12.appendFileSync(filePath, `${(0, utils_1.toCommandValue)(message)}${os2.EOL}`, { + fs11.appendFileSync(filePath, `${(0, utils_1.toCommandValue)(message)}${os2.EOL}`, { encoding: "utf8" }); } @@ -1337,14 +1337,14 @@ var require_util = __commonJS({ } const port = url2.port != null ? url2.port : url2.protocol === "https:" ? 443 : 80; let origin = url2.origin != null ? url2.origin : `${url2.protocol || ""}//${url2.hostname || ""}:${port}`; - let path12 = url2.path != null ? url2.path : `${url2.pathname || ""}${url2.search || ""}`; + let path11 = url2.path != null ? url2.path : `${url2.pathname || ""}${url2.search || ""}`; if (origin[origin.length - 1] === "/") { origin = origin.slice(0, origin.length - 1); } - if (path12 && path12[0] !== "/") { - path12 = `/${path12}`; + if (path11 && path11[0] !== "/") { + path11 = `/${path11}`; } - return new URL(`${origin}${path12}`); + return new URL(`${origin}${path11}`); } if (!isHttpOrHttpsPrefixed(url2.origin || url2.protocol)) { throw new InvalidArgumentError("Invalid URL protocol: the URL must start with `http:` or `https:`."); @@ -1795,39 +1795,39 @@ var require_diagnostics = __commonJS({ }); diagnosticsChannel.channel("undici:client:sendHeaders").subscribe((evt) => { const { - request: { method, path: path12, origin } + request: { method, path: path11, origin } } = evt; - debuglog("sending request to %s %s/%s", method, origin, path12); + debuglog("sending request to %s %s/%s", method, origin, path11); }); diagnosticsChannel.channel("undici:request:headers").subscribe((evt) => { const { - request: { method, path: path12, origin }, + request: { method, path: path11, origin }, response: { statusCode } } = evt; debuglog( "received response to %s %s/%s - HTTP %d", method, origin, - path12, + path11, statusCode ); }); diagnosticsChannel.channel("undici:request:trailers").subscribe((evt) => { const { - request: { method, path: path12, origin } + request: { method, path: path11, origin } } = evt; - debuglog("trailers received from %s %s/%s", method, origin, path12); + debuglog("trailers received from %s %s/%s", method, origin, path11); }); diagnosticsChannel.channel("undici:request:error").subscribe((evt) => { const { - request: { method, path: path12, origin }, + request: { method, path: path11, origin }, error: error3 } = evt; debuglog( "request to %s %s/%s errored - %s", method, origin, - path12, + path11, error3.message ); }); @@ -1876,9 +1876,9 @@ var require_diagnostics = __commonJS({ }); diagnosticsChannel.channel("undici:client:sendHeaders").subscribe((evt) => { const { - request: { method, path: path12, origin } + request: { method, path: path11, origin } } = evt; - debuglog("sending request to %s %s/%s", method, origin, path12); + debuglog("sending request to %s %s/%s", method, origin, path11); }); } diagnosticsChannel.channel("undici:websocket:open").subscribe((evt) => { @@ -1941,7 +1941,7 @@ var require_request = __commonJS({ var kHandler = /* @__PURE__ */ Symbol("handler"); var Request = class { constructor(origin, { - path: path12, + path: path11, method, body, headers, @@ -1956,11 +1956,11 @@ var require_request = __commonJS({ expectContinue, servername }, handler2) { - if (typeof path12 !== "string") { + if (typeof path11 !== "string") { throw new InvalidArgumentError("path must be a string"); - } else if (path12[0] !== "/" && !(path12.startsWith("http://") || path12.startsWith("https://")) && method !== "CONNECT") { + } else if (path11[0] !== "/" && !(path11.startsWith("http://") || path11.startsWith("https://")) && method !== "CONNECT") { throw new InvalidArgumentError("path must be an absolute URL or start with a slash"); - } else if (invalidPathRegex.test(path12)) { + } else if (invalidPathRegex.test(path11)) { throw new InvalidArgumentError("invalid request path"); } if (typeof method !== "string") { @@ -2023,7 +2023,7 @@ var require_request = __commonJS({ this.completed = false; this.aborted = false; this.upgrade = upgrade || null; - this.path = query ? buildURL(path12, query) : path12; + this.path = query ? buildURL(path11, query) : path11; this.origin = origin; this.idempotent = idempotent == null ? method === "HEAD" || method === "GET" : idempotent; this.blocking = blocking == null ? false : blocking; @@ -2335,9 +2335,9 @@ var require_dispatcher_base = __commonJS({ } close(callback) { if (callback === void 0) { - return new Promise((resolve6, reject) => { + return new Promise((resolve5, reject) => { this.close((err, data) => { - return err ? reject(err) : resolve6(data); + return err ? reject(err) : resolve5(data); }); }); } @@ -2375,12 +2375,12 @@ var require_dispatcher_base = __commonJS({ err = null; } if (callback === void 0) { - return new Promise((resolve6, reject) => { + return new Promise((resolve5, reject) => { this.destroy(err, (err2, data) => { return err2 ? ( /* istanbul ignore next: should never error */ reject(err2) - ) : resolve6(data); + ) : resolve5(data); }); }); } @@ -4647,8 +4647,8 @@ var require_util2 = __commonJS({ function createDeferredPromise() { let res; let rej; - const promise = new Promise((resolve6, reject) => { - res = resolve6; + const promise = new Promise((resolve5, reject) => { + res = resolve5; rej = reject; }); return { promise, resolve: res, reject: rej }; @@ -6536,7 +6536,7 @@ var require_client_h1 = __commonJS({ return method !== "GET" && method !== "HEAD" && method !== "OPTIONS" && method !== "TRACE" && method !== "CONNECT"; } function writeH1(client, request2) { - const { method, path: path12, host, upgrade, blocking, reset } = request2; + const { method, path: path11, host, upgrade, blocking, reset } = request2; let { body, headers, contentLength } = request2; const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH" || method === "QUERY" || method === "PROPFIND" || method === "PROPPATCH"; if (util.isFormDataLike(body)) { @@ -6602,7 +6602,7 @@ var require_client_h1 = __commonJS({ if (blocking) { socket[kBlocking] = true; } - let header = `${method} ${path12} HTTP/1.1\r + let header = `${method} ${path11} HTTP/1.1\r `; if (typeof host === "string") { header += `host: ${host}\r @@ -6789,12 +6789,12 @@ upgrade: ${upgrade}\r cb(); } } - const waitForDrain = () => new Promise((resolve6, reject) => { + const waitForDrain = () => new Promise((resolve5, reject) => { assert(callback === null); if (socket[kError]) { reject(socket[kError]); } else { - callback = resolve6; + callback = resolve5; } }); socket.on("close", onDrain).on("drain", onDrain); @@ -7128,7 +7128,7 @@ var require_client_h2 = __commonJS({ } function writeH2(client, request2) { const session = client[kHTTP2Session]; - const { method, path: path12, host, upgrade, expectContinue, signal, headers: reqHeaders } = request2; + const { method, path: path11, host, upgrade, expectContinue, signal, headers: reqHeaders } = request2; let { body } = request2; if (upgrade) { util.errorRequest(client, request2, new Error("Upgrade not supported for H2")); @@ -7195,7 +7195,7 @@ var require_client_h2 = __commonJS({ }); return true; } - headers[HTTP2_HEADER_PATH] = path12; + headers[HTTP2_HEADER_PATH] = path11; headers[HTTP2_HEADER_SCHEME] = "https"; const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH"; if (body && typeof body.read === "function") { @@ -7431,12 +7431,12 @@ var require_client_h2 = __commonJS({ cb(); } } - const waitForDrain = () => new Promise((resolve6, reject) => { + const waitForDrain = () => new Promise((resolve5, reject) => { assert(callback === null); if (socket[kError]) { reject(socket[kError]); } else { - callback = resolve6; + callback = resolve5; } }); h2stream.on("close", onDrain).on("drain", onDrain); @@ -7548,9 +7548,9 @@ var require_redirect_handler = __commonJS({ return this.handler.onHeaders(statusCode, headers, resume, statusText); } const { origin, pathname, search } = util.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin))); - const path12 = search ? `${pathname}${search}` : pathname; + const path11 = search ? `${pathname}${search}` : pathname; this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin); - this.opts.path = path12; + this.opts.path = path11; this.opts.origin = origin; this.opts.maxRedirections = 0; this.opts.query = null; @@ -7913,16 +7913,16 @@ var require_client = __commonJS({ return this[kNeedDrain] < 2; } async [kClose]() { - return new Promise((resolve6) => { + return new Promise((resolve5) => { if (this[kSize]) { - this[kClosedResolve] = resolve6; + this[kClosedResolve] = resolve5; } else { - resolve6(null); + resolve5(null); } }); } async [kDestroy](err) { - return new Promise((resolve6) => { + return new Promise((resolve5) => { const requests = this[kQueue].splice(this[kPendingIdx]); for (let i = 0; i < requests.length; i++) { const request2 = requests[i]; @@ -7933,7 +7933,7 @@ var require_client = __commonJS({ this[kClosedResolve](); this[kClosedResolve] = null; } - resolve6(null); + resolve5(null); }; if (this[kHTTPContext]) { this[kHTTPContext].destroy(err, callback); @@ -7984,7 +7984,7 @@ var require_client = __commonJS({ }); } try { - const socket = await new Promise((resolve6, reject) => { + const socket = await new Promise((resolve5, reject) => { client[kConnector]({ host, hostname, @@ -7996,7 +7996,7 @@ var require_client = __commonJS({ if (err) { reject(err); } else { - resolve6(socket2); + resolve5(socket2); } }); }); @@ -8332,8 +8332,8 @@ var require_pool_base = __commonJS({ if (this[kQueue].isEmpty()) { await Promise.all(this[kClients].map((c) => c.close())); } else { - await new Promise((resolve6) => { - this[kClosedResolve] = resolve6; + await new Promise((resolve5) => { + this[kClosedResolve] = resolve5; }); } } @@ -8784,10 +8784,10 @@ var require_proxy_agent = __commonJS({ }; const { origin, - path: path12 = "/", + path: path11 = "/", headers = {} } = opts; - opts.path = origin + path12; + opts.path = origin + path11; if (!("host" in headers) && !("Host" in headers)) { const { host } = new URL2(origin); headers.host = host; @@ -9548,7 +9548,7 @@ var require_readable = __commonJS({ if (this._readableState.closeEmitted) { return null; } - return await new Promise((resolve6, reject) => { + return await new Promise((resolve5, reject) => { if (this[kContentLength] > limit) { this.destroy(new AbortError()); } @@ -9561,7 +9561,7 @@ var require_readable = __commonJS({ if (signal?.aborted) { reject(signal.reason ?? new AbortError()); } else { - resolve6(null); + resolve5(null); } }).on("error", noop3).on("data", function(chunk) { limit -= chunk.length; @@ -9580,7 +9580,7 @@ var require_readable = __commonJS({ } async function consume(stream2, type2) { assert(!stream2[kConsume]); - return new Promise((resolve6, reject) => { + return new Promise((resolve5, reject) => { if (isUnusable(stream2)) { const rState = stream2._readableState; if (rState.destroyed && rState.closeEmitted === false) { @@ -9597,7 +9597,7 @@ var require_readable = __commonJS({ stream2[kConsume] = { type: type2, stream: stream2, - resolve: resolve6, + resolve: resolve5, reject, length: 0, body: [] @@ -9667,18 +9667,18 @@ var require_readable = __commonJS({ return buffer; } function consumeEnd(consume2) { - const { type: type2, body, resolve: resolve6, stream: stream2, length } = consume2; + const { type: type2, body, resolve: resolve5, stream: stream2, length } = consume2; try { if (type2 === "text") { - resolve6(chunksDecode(body, length)); + resolve5(chunksDecode(body, length)); } else if (type2 === "json") { - resolve6(JSON.parse(chunksDecode(body, length))); + resolve5(JSON.parse(chunksDecode(body, length))); } else if (type2 === "arrayBuffer") { - resolve6(chunksConcat(body, length).buffer); + resolve5(chunksConcat(body, length).buffer); } else if (type2 === "blob") { - resolve6(new Blob(body, { type: stream2[kContentType] })); + resolve5(new Blob(body, { type: stream2[kContentType] })); } else if (type2 === "bytes") { - resolve6(chunksConcat(body, length)); + resolve5(chunksConcat(body, length)); } consumeFinish(consume2); } catch (err) { @@ -9935,9 +9935,9 @@ var require_api_request = __commonJS({ }; function request2(opts, callback) { if (callback === void 0) { - return new Promise((resolve6, reject) => { + return new Promise((resolve5, reject) => { request2.call(this, opts, (err, data) => { - return err ? reject(err) : resolve6(data); + return err ? reject(err) : resolve5(data); }); }); } @@ -10160,9 +10160,9 @@ var require_api_stream = __commonJS({ }; function stream2(opts, factory, callback) { if (callback === void 0) { - return new Promise((resolve6, reject) => { + return new Promise((resolve5, reject) => { stream2.call(this, opts, factory, (err, data) => { - return err ? reject(err) : resolve6(data); + return err ? reject(err) : resolve5(data); }); }); } @@ -10447,9 +10447,9 @@ var require_api_upgrade = __commonJS({ }; function upgrade(opts, callback) { if (callback === void 0) { - return new Promise((resolve6, reject) => { + return new Promise((resolve5, reject) => { upgrade.call(this, opts, (err, data) => { - return err ? reject(err) : resolve6(data); + return err ? reject(err) : resolve5(data); }); }); } @@ -10541,9 +10541,9 @@ var require_api_connect = __commonJS({ }; function connect(opts, callback) { if (callback === void 0) { - return new Promise((resolve6, reject) => { + return new Promise((resolve5, reject) => { connect.call(this, opts, (err, data) => { - return err ? reject(err) : resolve6(data); + return err ? reject(err) : resolve5(data); }); }); } @@ -10708,20 +10708,20 @@ var require_mock_utils = __commonJS({ } return true; } - function safeUrl(path12) { - if (typeof path12 !== "string") { - return path12; + function safeUrl(path11) { + if (typeof path11 !== "string") { + return path11; } - const pathSegments = path12.split("?"); + const pathSegments = path11.split("?"); if (pathSegments.length !== 2) { - return path12; + return path11; } const qp = new URLSearchParams(pathSegments.pop()); qp.sort(); return [...pathSegments, qp.toString()].join("?"); } - function matchKey(mockDispatch2, { path: path12, method, body, headers }) { - const pathMatch = matchValue(mockDispatch2.path, path12); + function matchKey(mockDispatch2, { path: path11, method, body, headers }) { + const pathMatch = matchValue(mockDispatch2.path, path11); const methodMatch = matchValue(mockDispatch2.method, method); const bodyMatch = typeof mockDispatch2.body !== "undefined" ? matchValue(mockDispatch2.body, body) : true; const headersMatch = matchHeaders(mockDispatch2, headers); @@ -10743,7 +10743,7 @@ var require_mock_utils = __commonJS({ function getMockDispatch(mockDispatches, key) { const basePath = key.query ? buildURL(key.path, key.query) : key.path; const resolvedPath = typeof basePath === "string" ? safeUrl(basePath) : basePath; - let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path: path12 }) => matchValue(safeUrl(path12), resolvedPath)); + let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path: path11 }) => matchValue(safeUrl(path11), resolvedPath)); if (matchedMockDispatches.length === 0) { throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`); } @@ -10781,9 +10781,9 @@ var require_mock_utils = __commonJS({ } } function buildKey(opts) { - const { path: path12, method, body, headers, query } = opts; + const { path: path11, method, body, headers, query } = opts; return { - path: path12, + path: path11, method, body, headers, @@ -11246,10 +11246,10 @@ var require_pending_interceptors_formatter = __commonJS({ } format(pendingInterceptors) { const withPrettyHeaders = pendingInterceptors.map( - ({ method, path: path12, data: { statusCode }, persist, times, timesInvoked, origin }) => ({ + ({ method, path: path11, data: { statusCode }, persist, times, timesInvoked, origin }) => ({ Method: method, Origin: origin, - Path: path12, + Path: path11, "Status code": statusCode, Persistent: persist ? PERSISTENT : NOT_PERSISTENT, Invocations: timesInvoked, @@ -14405,7 +14405,7 @@ var require_fetch = __commonJS({ function dispatch({ body }) { const url2 = requestCurrentURL(request2); const agent = fetchParams.controller.dispatcher; - return new Promise((resolve6, reject) => agent.dispatch( + return new Promise((resolve5, reject) => agent.dispatch( { path: url2.pathname + url2.search, origin: url2.origin, @@ -14481,7 +14481,7 @@ var require_fetch = __commonJS({ } } const onError = this.onError.bind(this); - resolve6({ + resolve5({ status, statusText, headersList, @@ -14527,7 +14527,7 @@ var require_fetch = __commonJS({ for (let i = 0; i < rawHeaders.length; i += 2) { headersList.append(bufferToLowerCasedHeaderName(rawHeaders[i]), rawHeaders[i + 1].toString("latin1"), true); } - resolve6({ + resolve5({ status, statusText: STATUS_CODES[status], headersList, @@ -16130,9 +16130,9 @@ var require_util6 = __commonJS({ } } } - function validateCookiePath(path12) { - for (let i = 0; i < path12.length; ++i) { - const code = path12.charCodeAt(i); + function validateCookiePath(path11) { + for (let i = 0; i < path11.length; ++i) { + const code = path11.charCodeAt(i); if (code < 32 || // exclude CTLs (0-31) code === 127 || // DEL code === 59) { @@ -18120,8 +18120,8 @@ var require_util8 = __commonJS({ return true; } function delay2(ms) { - return new Promise((resolve6) => { - setTimeout(resolve6, ms).unref(); + return new Promise((resolve5) => { + setTimeout(resolve5, ms).unref(); }); } module2.exports = { @@ -18726,11 +18726,11 @@ var require_undici = __commonJS({ if (typeof opts.path !== "string") { throw new InvalidArgumentError("invalid opts.path"); } - let path12 = opts.path; + let path11 = opts.path; if (!opts.path.startsWith("/")) { - path12 = `/${path12}`; + path11 = `/${path11}`; } - url2 = new URL(util.parseOrigin(url2).origin + path12); + url2 = new URL(util.parseOrigin(url2).origin + path11); } else { if (!opts) { opts = typeof url2 === "object" ? url2 : {}; @@ -18844,11 +18844,11 @@ var require_lib = __commonJS({ })(); var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { - return value instanceof P ? value : new P(function(resolve6) { - resolve6(value); + return value instanceof P ? value : new P(function(resolve5) { + resolve5(value); }); } - return new (P || (P = Promise))(function(resolve6, reject) { + return new (P || (P = Promise))(function(resolve5, reject) { function fulfilled(value) { try { step(generator.next(value)); @@ -18864,7 +18864,7 @@ var require_lib = __commonJS({ } } function step(result) { - result.done ? resolve6(result.value) : adopt(result.value).then(fulfilled, rejected); + result.done ? resolve5(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); @@ -18951,26 +18951,26 @@ var require_lib = __commonJS({ } readBody() { return __awaiter2(this, void 0, void 0, function* () { - return new Promise((resolve6) => __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve5) => __awaiter2(this, void 0, void 0, function* () { let output = Buffer.alloc(0); this.message.on("data", (chunk) => { output = Buffer.concat([output, chunk]); }); this.message.on("end", () => { - resolve6(output.toString()); + resolve5(output.toString()); }); })); }); } readBodyBuffer() { return __awaiter2(this, void 0, void 0, function* () { - return new Promise((resolve6) => __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve5) => __awaiter2(this, void 0, void 0, function* () { const chunks = []; this.message.on("data", (chunk) => { chunks.push(chunk); }); this.message.on("end", () => { - resolve6(Buffer.concat(chunks)); + resolve5(Buffer.concat(chunks)); }); })); }); @@ -19178,14 +19178,14 @@ var require_lib = __commonJS({ */ requestRaw(info6, data) { return __awaiter2(this, void 0, void 0, function* () { - return new Promise((resolve6, reject) => { + return new Promise((resolve5, reject) => { function callbackForResult(err, res) { if (err) { reject(err); } else if (!res) { reject(new Error("Unknown error")); } else { - resolve6(res); + resolve5(res); } } this.requestRawWithCallback(info6, data, callbackForResult); @@ -19429,12 +19429,12 @@ var require_lib = __commonJS({ return __awaiter2(this, void 0, void 0, function* () { retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); - return new Promise((resolve6) => setTimeout(() => resolve6(), ms)); + return new Promise((resolve5) => setTimeout(() => resolve5(), ms)); }); } _processResponse(res, options) { return __awaiter2(this, void 0, void 0, function* () { - return new Promise((resolve6, reject) => __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve5, reject) => __awaiter2(this, void 0, void 0, function* () { const statusCode = res.message.statusCode || 0; const response = { statusCode, @@ -19442,7 +19442,7 @@ var require_lib = __commonJS({ headers: {} }; if (statusCode === HttpCodes.NotFound) { - resolve6(response); + resolve5(response); } function dateTimeDeserializer(key, value) { if (typeof value === "string") { @@ -19481,7 +19481,7 @@ var require_lib = __commonJS({ err.result = response.result; reject(err); } else { - resolve6(response); + resolve5(response); } })); }); @@ -19498,11 +19498,11 @@ var require_auth = __commonJS({ "use strict"; var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { - return value instanceof P ? value : new P(function(resolve6) { - resolve6(value); + return value instanceof P ? value : new P(function(resolve5) { + resolve5(value); }); } - return new (P || (P = Promise))(function(resolve6, reject) { + return new (P || (P = Promise))(function(resolve5, reject) { function fulfilled(value) { try { step(generator.next(value)); @@ -19518,7 +19518,7 @@ var require_auth = __commonJS({ } } function step(result) { - result.done ? resolve6(result.value) : adopt(result.value).then(fulfilled, rejected); + result.done ? resolve5(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); @@ -19602,11 +19602,11 @@ var require_oidc_utils = __commonJS({ "use strict"; var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { - return value instanceof P ? value : new P(function(resolve6) { - resolve6(value); + return value instanceof P ? value : new P(function(resolve5) { + resolve5(value); }); } - return new (P || (P = Promise))(function(resolve6, reject) { + return new (P || (P = Promise))(function(resolve5, reject) { function fulfilled(value) { try { step(generator.next(value)); @@ -19622,7 +19622,7 @@ var require_oidc_utils = __commonJS({ } } function step(result) { - result.done ? resolve6(result.value) : adopt(result.value).then(fulfilled, rejected); + result.done ? resolve5(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); @@ -19700,11 +19700,11 @@ var require_summary = __commonJS({ "use strict"; var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { - return value instanceof P ? value : new P(function(resolve6) { - resolve6(value); + return value instanceof P ? value : new P(function(resolve5) { + resolve5(value); }); } - return new (P || (P = Promise))(function(resolve6, reject) { + return new (P || (P = Promise))(function(resolve5, reject) { function fulfilled(value) { try { step(generator.next(value)); @@ -19720,7 +19720,7 @@ var require_summary = __commonJS({ } } function step(result) { - result.done ? resolve6(result.value) : adopt(result.value).then(fulfilled, rejected); + result.done ? resolve5(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); @@ -20033,7 +20033,7 @@ var require_path_utils = __commonJS({ exports2.toPosixPath = toPosixPath; exports2.toWin32Path = toWin32Path; exports2.toPlatformPath = toPlatformPath; - var path12 = __importStar2(require("path")); + var path11 = __importStar2(require("path")); function toPosixPath(pth) { return pth.replace(/[\\]/g, "/"); } @@ -20041,7 +20041,7 @@ var require_path_utils = __commonJS({ return pth.replace(/[/]/g, "\\"); } function toPlatformPath(pth) { - return pth.replace(/[/\\]/g, path12.sep); + return pth.replace(/[/\\]/g, path11.sep); } } }); @@ -20089,11 +20089,11 @@ var require_io_util = __commonJS({ })(); var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { - return value instanceof P ? value : new P(function(resolve6) { - resolve6(value); + return value instanceof P ? value : new P(function(resolve5) { + resolve5(value); }); } - return new (P || (P = Promise))(function(resolve6, reject) { + return new (P || (P = Promise))(function(resolve5, reject) { function fulfilled(value) { try { step(generator.next(value)); @@ -20109,7 +20109,7 @@ var require_io_util = __commonJS({ } } function step(result) { - result.done ? resolve6(result.value) : adopt(result.value).then(fulfilled, rejected); + result.done ? resolve5(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); @@ -20123,13 +20123,13 @@ var require_io_util = __commonJS({ exports2.isRooted = isRooted; exports2.tryGetExecutablePath = tryGetExecutablePath; exports2.getCmdPath = getCmdPath; - var fs12 = __importStar2(require("fs")); - var path12 = __importStar2(require("path")); - _a = fs12.promises, exports2.chmod = _a.chmod, exports2.copyFile = _a.copyFile, exports2.lstat = _a.lstat, exports2.mkdir = _a.mkdir, exports2.open = _a.open, exports2.readdir = _a.readdir, exports2.rename = _a.rename, exports2.rm = _a.rm, exports2.rmdir = _a.rmdir, exports2.stat = _a.stat, exports2.symlink = _a.symlink, exports2.unlink = _a.unlink; + var fs11 = __importStar2(require("fs")); + var path11 = __importStar2(require("path")); + _a = fs11.promises, exports2.chmod = _a.chmod, exports2.copyFile = _a.copyFile, exports2.lstat = _a.lstat, exports2.mkdir = _a.mkdir, exports2.open = _a.open, exports2.readdir = _a.readdir, exports2.rename = _a.rename, exports2.rm = _a.rm, exports2.rmdir = _a.rmdir, exports2.stat = _a.stat, exports2.symlink = _a.symlink, exports2.unlink = _a.unlink; exports2.IS_WINDOWS = process.platform === "win32"; function readlink(fsPath) { return __awaiter2(this, void 0, void 0, function* () { - const result = yield fs12.promises.readlink(fsPath); + const result = yield fs11.promises.readlink(fsPath); if (exports2.IS_WINDOWS && !result.endsWith("\\")) { return `${result}\\`; } @@ -20137,7 +20137,7 @@ var require_io_util = __commonJS({ }); } exports2.UV_FS_O_EXLOCK = 268435456; - exports2.READONLY = fs12.constants.O_RDONLY; + exports2.READONLY = fs11.constants.O_RDONLY; function exists(fsPath) { return __awaiter2(this, void 0, void 0, function* () { try { @@ -20179,7 +20179,7 @@ var require_io_util = __commonJS({ } if (stats && stats.isFile()) { if (exports2.IS_WINDOWS) { - const upperExt = path12.extname(filePath).toUpperCase(); + const upperExt = path11.extname(filePath).toUpperCase(); if (extensions.some((validExt) => validExt.toUpperCase() === upperExt)) { return filePath; } @@ -20203,11 +20203,11 @@ var require_io_util = __commonJS({ if (stats && stats.isFile()) { if (exports2.IS_WINDOWS) { try { - const directory = path12.dirname(filePath); - const upperName = path12.basename(filePath).toUpperCase(); + const directory = path11.dirname(filePath); + const upperName = path11.basename(filePath).toUpperCase(); for (const actualName of yield (0, exports2.readdir)(directory)) { if (upperName === actualName.toUpperCase()) { - filePath = path12.join(directory, actualName); + filePath = path11.join(directory, actualName); break; } } @@ -20286,11 +20286,11 @@ var require_io = __commonJS({ })(); var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { - return value instanceof P ? value : new P(function(resolve6) { - resolve6(value); + return value instanceof P ? value : new P(function(resolve5) { + resolve5(value); }); } - return new (P || (P = Promise))(function(resolve6, reject) { + return new (P || (P = Promise))(function(resolve5, reject) { function fulfilled(value) { try { step(generator.next(value)); @@ -20306,7 +20306,7 @@ var require_io = __commonJS({ } } function step(result) { - result.done ? resolve6(result.value) : adopt(result.value).then(fulfilled, rejected); + result.done ? resolve5(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); @@ -20319,7 +20319,7 @@ var require_io = __commonJS({ exports2.which = which6; exports2.findInPath = findInPath; var assert_1 = require("assert"); - var path12 = __importStar2(require("path")); + var path11 = __importStar2(require("path")); var ioUtil = __importStar2(require_io_util()); function cp(source_1, dest_1) { return __awaiter2(this, arguments, void 0, function* (source, dest, options = {}) { @@ -20328,7 +20328,7 @@ var require_io = __commonJS({ if (destStat && destStat.isFile() && !force) { return; } - const newDest = destStat && destStat.isDirectory() && copySourceDirectory ? path12.join(dest, path12.basename(source)) : dest; + const newDest = destStat && destStat.isDirectory() && copySourceDirectory ? path11.join(dest, path11.basename(source)) : dest; if (!(yield ioUtil.exists(source))) { throw new Error(`no such file or directory: ${source}`); } @@ -20340,7 +20340,7 @@ var require_io = __commonJS({ yield cpDirRecursive(source, newDest, 0, force); } } else { - if (path12.relative(source, newDest) === "") { + if (path11.relative(source, newDest) === "") { throw new Error(`'${newDest}' and '${source}' are the same file`); } yield copyFile(source, newDest, force); @@ -20352,7 +20352,7 @@ var require_io = __commonJS({ if (yield ioUtil.exists(dest)) { let destExists = true; if (yield ioUtil.isDirectory(dest)) { - dest = path12.join(dest, path12.basename(source)); + dest = path11.join(dest, path11.basename(source)); destExists = yield ioUtil.exists(dest); } if (destExists) { @@ -20363,7 +20363,7 @@ var require_io = __commonJS({ } } } - yield mkdirP(path12.dirname(dest)); + yield mkdirP(path11.dirname(dest)); yield ioUtil.rename(source, dest); }); } @@ -20422,7 +20422,7 @@ var require_io = __commonJS({ } const extensions = []; if (ioUtil.IS_WINDOWS && process.env["PATHEXT"]) { - for (const extension of process.env["PATHEXT"].split(path12.delimiter)) { + for (const extension of process.env["PATHEXT"].split(path11.delimiter)) { if (extension) { extensions.push(extension); } @@ -20435,12 +20435,12 @@ var require_io = __commonJS({ } return []; } - if (tool.includes(path12.sep)) { + if (tool.includes(path11.sep)) { return []; } const directories = []; if (process.env.PATH) { - for (const p of process.env.PATH.split(path12.delimiter)) { + for (const p of process.env.PATH.split(path11.delimiter)) { if (p) { directories.push(p); } @@ -20448,7 +20448,7 @@ var require_io = __commonJS({ } const matches = []; for (const directory of directories) { - const filePath = yield ioUtil.tryGetExecutablePath(path12.join(directory, tool), extensions); + const filePath = yield ioUtil.tryGetExecutablePath(path11.join(directory, tool), extensions); if (filePath) { matches.push(filePath); } @@ -20547,11 +20547,11 @@ var require_toolrunner = __commonJS({ })(); var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { - return value instanceof P ? value : new P(function(resolve6) { - resolve6(value); + return value instanceof P ? value : new P(function(resolve5) { + resolve5(value); }); } - return new (P || (P = Promise))(function(resolve6, reject) { + return new (P || (P = Promise))(function(resolve5, reject) { function fulfilled(value) { try { step(generator.next(value)); @@ -20567,7 +20567,7 @@ var require_toolrunner = __commonJS({ } } function step(result) { - result.done ? resolve6(result.value) : adopt(result.value).then(fulfilled, rejected); + result.done ? resolve5(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); @@ -20578,7 +20578,7 @@ var require_toolrunner = __commonJS({ var os2 = __importStar2(require("os")); var events = __importStar2(require("events")); var child = __importStar2(require("child_process")); - var path12 = __importStar2(require("path")); + var path11 = __importStar2(require("path")); var io6 = __importStar2(require_io()); var ioUtil = __importStar2(require_io_util()); var timers_1 = require("timers"); @@ -20793,10 +20793,10 @@ var require_toolrunner = __commonJS({ exec() { return __awaiter2(this, void 0, void 0, function* () { if (!ioUtil.isRooted(this.toolPath) && (this.toolPath.includes("/") || IS_WINDOWS && this.toolPath.includes("\\"))) { - this.toolPath = path12.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath); + this.toolPath = path11.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath); } this.toolPath = yield io6.which(this.toolPath, true); - return new Promise((resolve6, reject) => __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve5, reject) => __awaiter2(this, void 0, void 0, function* () { this._debug(`exec tool: ${this.toolPath}`); this._debug("arguments:"); for (const arg of this.args) { @@ -20879,7 +20879,7 @@ var require_toolrunner = __commonJS({ if (error3) { reject(error3); } else { - resolve6(exitCode); + resolve5(exitCode); } }); if (this.options.input) { @@ -21045,11 +21045,11 @@ var require_exec = __commonJS({ })(); var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { - return value instanceof P ? value : new P(function(resolve6) { - resolve6(value); + return value instanceof P ? value : new P(function(resolve5) { + resolve5(value); }); } - return new (P || (P = Promise))(function(resolve6, reject) { + return new (P || (P = Promise))(function(resolve5, reject) { function fulfilled(value) { try { step(generator.next(value)); @@ -21065,7 +21065,7 @@ var require_exec = __commonJS({ } } function step(result) { - result.done ? resolve6(result.value) : adopt(result.value).then(fulfilled, rejected); + result.done ? resolve5(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); @@ -21165,11 +21165,11 @@ var require_platform = __commonJS({ })(); var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { - return value instanceof P ? value : new P(function(resolve6) { - resolve6(value); + return value instanceof P ? value : new P(function(resolve5) { + resolve5(value); }); } - return new (P || (P = Promise))(function(resolve6, reject) { + return new (P || (P = Promise))(function(resolve5, reject) { function fulfilled(value) { try { step(generator.next(value)); @@ -21185,7 +21185,7 @@ var require_platform = __commonJS({ } } function step(result) { - result.done ? resolve6(result.value) : adopt(result.value).then(fulfilled, rejected); + result.done ? resolve5(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); @@ -21294,11 +21294,11 @@ var require_core = __commonJS({ })(); var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { - return value instanceof P ? value : new P(function(resolve6) { - resolve6(value); + return value instanceof P ? value : new P(function(resolve5) { + resolve5(value); }); } - return new (P || (P = Promise))(function(resolve6, reject) { + return new (P || (P = Promise))(function(resolve5, reject) { function fulfilled(value) { try { step(generator.next(value)); @@ -21314,7 +21314,7 @@ var require_core = __commonJS({ } } function step(result) { - result.done ? resolve6(result.value) : adopt(result.value).then(fulfilled, rejected); + result.done ? resolve5(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); @@ -21346,7 +21346,7 @@ var require_core = __commonJS({ var file_command_1 = require_file_command(); var utils_1 = require_utils(); var os2 = __importStar2(require("os")); - var path12 = __importStar2(require("path")); + var path11 = __importStar2(require("path")); var oidc_utils_1 = require_oidc_utils(); var ExitCode; (function(ExitCode2) { @@ -21372,7 +21372,7 @@ var require_core = __commonJS({ } else { (0, command_1.issueCommand)("add-path", {}, inputPath); } - process.env["PATH"] = `${inputPath}${path12.delimiter}${process.env["PATH"]}`; + process.env["PATH"] = `${inputPath}${path11.delimiter}${process.env["PATH"]}`; } function getInput2(name, options) { const val = process.env[`INPUT_${name.replace(/ /g, "_").toUpperCase()}`] || ""; @@ -21495,14 +21495,14 @@ var require_helpers = __commonJS({ "node_modules/jsonschema/lib/helpers.js"(exports2, module2) { "use strict"; var uri = require("url"); - var ValidationError = exports2.ValidationError = function ValidationError2(message, instance, schema2, path12, name, argument) { - if (Array.isArray(path12)) { - this.path = path12; - this.property = path12.reduce(function(sum, item) { + var ValidationError = exports2.ValidationError = function ValidationError2(message, instance, schema2, path11, name, argument) { + if (Array.isArray(path11)) { + this.path = path11; + this.property = path11.reduce(function(sum, item) { return sum + makeSuffix(item); }, "instance"); - } else if (path12 !== void 0) { - this.property = path12; + } else if (path11 !== void 0) { + this.property = path11; } if (message) { this.message = message; @@ -21593,28 +21593,28 @@ var require_helpers = __commonJS({ name: { value: "SchemaError", enumerable: false } } ); - var SchemaContext = exports2.SchemaContext = function SchemaContext2(schema2, options, path12, base, schemas) { + var SchemaContext = exports2.SchemaContext = function SchemaContext2(schema2, options, path11, base, schemas) { this.schema = schema2; this.options = options; - if (Array.isArray(path12)) { - this.path = path12; - this.propertyPath = path12.reduce(function(sum, item) { + if (Array.isArray(path11)) { + this.path = path11; + this.propertyPath = path11.reduce(function(sum, item) { return sum + makeSuffix(item); }, "instance"); } else { - this.propertyPath = path12; + this.propertyPath = path11; } this.base = base; this.schemas = schemas; }; - SchemaContext.prototype.resolve = function resolve6(target) { + SchemaContext.prototype.resolve = function resolve5(target) { return uri.resolve(this.base, target); }; SchemaContext.prototype.makeChild = function makeChild(schema2, propertyName) { - var path12 = propertyName === void 0 ? this.path : this.path.concat([propertyName]); + var path11 = propertyName === void 0 ? this.path : this.path.concat([propertyName]); var id = schema2.$id || schema2.id; var base = uri.resolve(this.base, id || ""); - var ctx = new SchemaContext(schema2, this.options, path12, base, Object.create(this.schemas)); + var ctx = new SchemaContext(schema2, this.options, path11, base, Object.create(this.schemas)); if (id && !ctx.schemas[base]) { ctx.schemas[base] = schema2; } @@ -22705,7 +22705,7 @@ var require_validator = __commonJS({ } return schema2; }; - Validator3.prototype.resolve = function resolve6(schema2, switchSchema, ctx) { + Validator3.prototype.resolve = function resolve5(schema2, switchSchema, ctx) { switchSchema = ctx.resolve(switchSchema); if (ctx.schemas[switchSchema]) { return { subschema: ctx.schemas[switchSchema], switchSchema }; @@ -22806,8 +22806,8 @@ var require_context = __commonJS({ if ((0, fs_1.existsSync)(process.env.GITHUB_EVENT_PATH)) { this.payload = JSON.parse((0, fs_1.readFileSync)(process.env.GITHUB_EVENT_PATH, { encoding: "utf8" })); } else { - const path12 = process.env.GITHUB_EVENT_PATH; - process.stdout.write(`GITHUB_EVENT_PATH ${path12} does not exist${os_1.EOL}`); + const path11 = process.env.GITHUB_EVENT_PATH; + process.stdout.write(`GITHUB_EVENT_PATH ${path11} does not exist${os_1.EOL}`); } } this.eventName = process.env.GITHUB_EVENT_NAME; @@ -23632,14 +23632,14 @@ var require_util9 = __commonJS({ } const port = url2.port != null ? url2.port : url2.protocol === "https:" ? 443 : 80; let origin = url2.origin != null ? url2.origin : `${url2.protocol || ""}//${url2.hostname || ""}:${port}`; - let path12 = url2.path != null ? url2.path : `${url2.pathname || ""}${url2.search || ""}`; + let path11 = url2.path != null ? url2.path : `${url2.pathname || ""}${url2.search || ""}`; if (origin[origin.length - 1] === "/") { origin = origin.slice(0, origin.length - 1); } - if (path12 && path12[0] !== "/") { - path12 = `/${path12}`; + if (path11 && path11[0] !== "/") { + path11 = `/${path11}`; } - return new URL(`${origin}${path12}`); + return new URL(`${origin}${path11}`); } if (!isHttpOrHttpsPrefixed(url2.origin || url2.protocol)) { throw new InvalidArgumentError("Invalid URL protocol: the URL must start with `http:` or `https:`."); @@ -24090,39 +24090,39 @@ var require_diagnostics2 = __commonJS({ }); diagnosticsChannel.channel("undici:client:sendHeaders").subscribe((evt) => { const { - request: { method, path: path12, origin } + request: { method, path: path11, origin } } = evt; - debuglog("sending request to %s %s/%s", method, origin, path12); + debuglog("sending request to %s %s/%s", method, origin, path11); }); diagnosticsChannel.channel("undici:request:headers").subscribe((evt) => { const { - request: { method, path: path12, origin }, + request: { method, path: path11, origin }, response: { statusCode } } = evt; debuglog( "received response to %s %s/%s - HTTP %d", method, origin, - path12, + path11, statusCode ); }); diagnosticsChannel.channel("undici:request:trailers").subscribe((evt) => { const { - request: { method, path: path12, origin } + request: { method, path: path11, origin } } = evt; - debuglog("trailers received from %s %s/%s", method, origin, path12); + debuglog("trailers received from %s %s/%s", method, origin, path11); }); diagnosticsChannel.channel("undici:request:error").subscribe((evt) => { const { - request: { method, path: path12, origin }, + request: { method, path: path11, origin }, error: error3 } = evt; debuglog( "request to %s %s/%s errored - %s", method, origin, - path12, + path11, error3.message ); }); @@ -24171,9 +24171,9 @@ var require_diagnostics2 = __commonJS({ }); diagnosticsChannel.channel("undici:client:sendHeaders").subscribe((evt) => { const { - request: { method, path: path12, origin } + request: { method, path: path11, origin } } = evt; - debuglog("sending request to %s %s/%s", method, origin, path12); + debuglog("sending request to %s %s/%s", method, origin, path11); }); } diagnosticsChannel.channel("undici:websocket:open").subscribe((evt) => { @@ -24236,7 +24236,7 @@ var require_request3 = __commonJS({ var kHandler = /* @__PURE__ */ Symbol("handler"); var Request = class { constructor(origin, { - path: path12, + path: path11, method, body, headers, @@ -24251,11 +24251,11 @@ var require_request3 = __commonJS({ expectContinue, servername }, handler2) { - if (typeof path12 !== "string") { + if (typeof path11 !== "string") { throw new InvalidArgumentError("path must be a string"); - } else if (path12[0] !== "/" && !(path12.startsWith("http://") || path12.startsWith("https://")) && method !== "CONNECT") { + } else if (path11[0] !== "/" && !(path11.startsWith("http://") || path11.startsWith("https://")) && method !== "CONNECT") { throw new InvalidArgumentError("path must be an absolute URL or start with a slash"); - } else if (invalidPathRegex.test(path12)) { + } else if (invalidPathRegex.test(path11)) { throw new InvalidArgumentError("invalid request path"); } if (typeof method !== "string") { @@ -24318,7 +24318,7 @@ var require_request3 = __commonJS({ this.completed = false; this.aborted = false; this.upgrade = upgrade || null; - this.path = query ? buildURL(path12, query) : path12; + this.path = query ? buildURL(path11, query) : path11; this.origin = origin; this.idempotent = idempotent == null ? method === "HEAD" || method === "GET" : idempotent; this.blocking = blocking == null ? false : blocking; @@ -24630,9 +24630,9 @@ var require_dispatcher_base2 = __commonJS({ } close(callback) { if (callback === void 0) { - return new Promise((resolve6, reject) => { + return new Promise((resolve5, reject) => { this.close((err, data) => { - return err ? reject(err) : resolve6(data); + return err ? reject(err) : resolve5(data); }); }); } @@ -24670,12 +24670,12 @@ var require_dispatcher_base2 = __commonJS({ err = null; } if (callback === void 0) { - return new Promise((resolve6, reject) => { + return new Promise((resolve5, reject) => { this.destroy(err, (err2, data) => { return err2 ? ( /* istanbul ignore next: should never error */ reject(err2) - ) : resolve6(data); + ) : resolve5(data); }); }); } @@ -26942,8 +26942,8 @@ var require_util10 = __commonJS({ function createDeferredPromise() { let res; let rej; - const promise = new Promise((resolve6, reject) => { - res = resolve6; + const promise = new Promise((resolve5, reject) => { + res = resolve5; rej = reject; }); return { promise, resolve: res, reject: rej }; @@ -28831,7 +28831,7 @@ var require_client_h12 = __commonJS({ return method !== "GET" && method !== "HEAD" && method !== "OPTIONS" && method !== "TRACE" && method !== "CONNECT"; } function writeH1(client, request2) { - const { method, path: path12, host, upgrade, blocking, reset } = request2; + const { method, path: path11, host, upgrade, blocking, reset } = request2; let { body, headers, contentLength } = request2; const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH" || method === "QUERY" || method === "PROPFIND" || method === "PROPPATCH"; if (util.isFormDataLike(body)) { @@ -28897,7 +28897,7 @@ var require_client_h12 = __commonJS({ if (blocking) { socket[kBlocking] = true; } - let header = `${method} ${path12} HTTP/1.1\r + let header = `${method} ${path11} HTTP/1.1\r `; if (typeof host === "string") { header += `host: ${host}\r @@ -29084,12 +29084,12 @@ upgrade: ${upgrade}\r cb(); } } - const waitForDrain = () => new Promise((resolve6, reject) => { + const waitForDrain = () => new Promise((resolve5, reject) => { assert(callback === null); if (socket[kError]) { reject(socket[kError]); } else { - callback = resolve6; + callback = resolve5; } }); socket.on("close", onDrain).on("drain", onDrain); @@ -29423,7 +29423,7 @@ var require_client_h22 = __commonJS({ } function writeH2(client, request2) { const session = client[kHTTP2Session]; - const { method, path: path12, host, upgrade, expectContinue, signal, headers: reqHeaders } = request2; + const { method, path: path11, host, upgrade, expectContinue, signal, headers: reqHeaders } = request2; let { body } = request2; if (upgrade) { util.errorRequest(client, request2, new Error("Upgrade not supported for H2")); @@ -29490,7 +29490,7 @@ var require_client_h22 = __commonJS({ }); return true; } - headers[HTTP2_HEADER_PATH] = path12; + headers[HTTP2_HEADER_PATH] = path11; headers[HTTP2_HEADER_SCHEME] = "https"; const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH"; if (body && typeof body.read === "function") { @@ -29726,12 +29726,12 @@ var require_client_h22 = __commonJS({ cb(); } } - const waitForDrain = () => new Promise((resolve6, reject) => { + const waitForDrain = () => new Promise((resolve5, reject) => { assert(callback === null); if (socket[kError]) { reject(socket[kError]); } else { - callback = resolve6; + callback = resolve5; } }); h2stream.on("close", onDrain).on("drain", onDrain); @@ -29843,9 +29843,9 @@ var require_redirect_handler2 = __commonJS({ return this.handler.onHeaders(statusCode, headers, resume, statusText); } const { origin, pathname, search } = util.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin))); - const path12 = search ? `${pathname}${search}` : pathname; + const path11 = search ? `${pathname}${search}` : pathname; this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin); - this.opts.path = path12; + this.opts.path = path11; this.opts.origin = origin; this.opts.maxRedirections = 0; this.opts.query = null; @@ -30208,16 +30208,16 @@ var require_client2 = __commonJS({ return this[kNeedDrain] < 2; } async [kClose]() { - return new Promise((resolve6) => { + return new Promise((resolve5) => { if (this[kSize]) { - this[kClosedResolve] = resolve6; + this[kClosedResolve] = resolve5; } else { - resolve6(null); + resolve5(null); } }); } async [kDestroy](err) { - return new Promise((resolve6) => { + return new Promise((resolve5) => { const requests = this[kQueue].splice(this[kPendingIdx]); for (let i = 0; i < requests.length; i++) { const request2 = requests[i]; @@ -30228,7 +30228,7 @@ var require_client2 = __commonJS({ this[kClosedResolve](); this[kClosedResolve] = null; } - resolve6(null); + resolve5(null); }; if (this[kHTTPContext]) { this[kHTTPContext].destroy(err, callback); @@ -30279,7 +30279,7 @@ var require_client2 = __commonJS({ }); } try { - const socket = await new Promise((resolve6, reject) => { + const socket = await new Promise((resolve5, reject) => { client[kConnector]({ host, hostname, @@ -30291,7 +30291,7 @@ var require_client2 = __commonJS({ if (err) { reject(err); } else { - resolve6(socket2); + resolve5(socket2); } }); }); @@ -30627,8 +30627,8 @@ var require_pool_base2 = __commonJS({ if (this[kQueue].isEmpty()) { await Promise.all(this[kClients].map((c) => c.close())); } else { - await new Promise((resolve6) => { - this[kClosedResolve] = resolve6; + await new Promise((resolve5) => { + this[kClosedResolve] = resolve5; }); } } @@ -31079,10 +31079,10 @@ var require_proxy_agent2 = __commonJS({ }; const { origin, - path: path12 = "/", + path: path11 = "/", headers = {} } = opts; - opts.path = origin + path12; + opts.path = origin + path11; if (!("host" in headers) && !("Host" in headers)) { const { host } = new URL2(origin); headers.host = host; @@ -31843,7 +31843,7 @@ var require_readable2 = __commonJS({ if (this._readableState.closeEmitted) { return null; } - return await new Promise((resolve6, reject) => { + return await new Promise((resolve5, reject) => { if (this[kContentLength] > limit) { this.destroy(new AbortError()); } @@ -31856,7 +31856,7 @@ var require_readable2 = __commonJS({ if (signal?.aborted) { reject(signal.reason ?? new AbortError()); } else { - resolve6(null); + resolve5(null); } }).on("error", noop3).on("data", function(chunk) { limit -= chunk.length; @@ -31875,7 +31875,7 @@ var require_readable2 = __commonJS({ } async function consume(stream2, type2) { assert(!stream2[kConsume]); - return new Promise((resolve6, reject) => { + return new Promise((resolve5, reject) => { if (isUnusable(stream2)) { const rState = stream2._readableState; if (rState.destroyed && rState.closeEmitted === false) { @@ -31892,7 +31892,7 @@ var require_readable2 = __commonJS({ stream2[kConsume] = { type: type2, stream: stream2, - resolve: resolve6, + resolve: resolve5, reject, length: 0, body: [] @@ -31962,18 +31962,18 @@ var require_readable2 = __commonJS({ return buffer; } function consumeEnd(consume2) { - const { type: type2, body, resolve: resolve6, stream: stream2, length } = consume2; + const { type: type2, body, resolve: resolve5, stream: stream2, length } = consume2; try { if (type2 === "text") { - resolve6(chunksDecode(body, length)); + resolve5(chunksDecode(body, length)); } else if (type2 === "json") { - resolve6(JSON.parse(chunksDecode(body, length))); + resolve5(JSON.parse(chunksDecode(body, length))); } else if (type2 === "arrayBuffer") { - resolve6(chunksConcat(body, length).buffer); + resolve5(chunksConcat(body, length).buffer); } else if (type2 === "blob") { - resolve6(new Blob(body, { type: stream2[kContentType] })); + resolve5(new Blob(body, { type: stream2[kContentType] })); } else if (type2 === "bytes") { - resolve6(chunksConcat(body, length)); + resolve5(chunksConcat(body, length)); } consumeFinish(consume2); } catch (err) { @@ -32230,9 +32230,9 @@ var require_api_request2 = __commonJS({ }; function request2(opts, callback) { if (callback === void 0) { - return new Promise((resolve6, reject) => { + return new Promise((resolve5, reject) => { request2.call(this, opts, (err, data) => { - return err ? reject(err) : resolve6(data); + return err ? reject(err) : resolve5(data); }); }); } @@ -32455,9 +32455,9 @@ var require_api_stream2 = __commonJS({ }; function stream2(opts, factory, callback) { if (callback === void 0) { - return new Promise((resolve6, reject) => { + return new Promise((resolve5, reject) => { stream2.call(this, opts, factory, (err, data) => { - return err ? reject(err) : resolve6(data); + return err ? reject(err) : resolve5(data); }); }); } @@ -32742,9 +32742,9 @@ var require_api_upgrade2 = __commonJS({ }; function upgrade(opts, callback) { if (callback === void 0) { - return new Promise((resolve6, reject) => { + return new Promise((resolve5, reject) => { upgrade.call(this, opts, (err, data) => { - return err ? reject(err) : resolve6(data); + return err ? reject(err) : resolve5(data); }); }); } @@ -32836,9 +32836,9 @@ var require_api_connect2 = __commonJS({ }; function connect(opts, callback) { if (callback === void 0) { - return new Promise((resolve6, reject) => { + return new Promise((resolve5, reject) => { connect.call(this, opts, (err, data) => { - return err ? reject(err) : resolve6(data); + return err ? reject(err) : resolve5(data); }); }); } @@ -33003,20 +33003,20 @@ var require_mock_utils2 = __commonJS({ } return true; } - function safeUrl(path12) { - if (typeof path12 !== "string") { - return path12; + function safeUrl(path11) { + if (typeof path11 !== "string") { + return path11; } - const pathSegments = path12.split("?"); + const pathSegments = path11.split("?"); if (pathSegments.length !== 2) { - return path12; + return path11; } const qp = new URLSearchParams(pathSegments.pop()); qp.sort(); return [...pathSegments, qp.toString()].join("?"); } - function matchKey(mockDispatch2, { path: path12, method, body, headers }) { - const pathMatch = matchValue(mockDispatch2.path, path12); + function matchKey(mockDispatch2, { path: path11, method, body, headers }) { + const pathMatch = matchValue(mockDispatch2.path, path11); const methodMatch = matchValue(mockDispatch2.method, method); const bodyMatch = typeof mockDispatch2.body !== "undefined" ? matchValue(mockDispatch2.body, body) : true; const headersMatch = matchHeaders(mockDispatch2, headers); @@ -33038,7 +33038,7 @@ var require_mock_utils2 = __commonJS({ function getMockDispatch(mockDispatches, key) { const basePath = key.query ? buildURL(key.path, key.query) : key.path; const resolvedPath = typeof basePath === "string" ? safeUrl(basePath) : basePath; - let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path: path12 }) => matchValue(safeUrl(path12), resolvedPath)); + let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path: path11 }) => matchValue(safeUrl(path11), resolvedPath)); if (matchedMockDispatches.length === 0) { throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`); } @@ -33076,9 +33076,9 @@ var require_mock_utils2 = __commonJS({ } } function buildKey(opts) { - const { path: path12, method, body, headers, query } = opts; + const { path: path11, method, body, headers, query } = opts; return { - path: path12, + path: path11, method, body, headers, @@ -33541,10 +33541,10 @@ var require_pending_interceptors_formatter2 = __commonJS({ } format(pendingInterceptors) { const withPrettyHeaders = pendingInterceptors.map( - ({ method, path: path12, data: { statusCode }, persist, times, timesInvoked, origin }) => ({ + ({ method, path: path11, data: { statusCode }, persist, times, timesInvoked, origin }) => ({ Method: method, Origin: origin, - Path: path12, + Path: path11, "Status code": statusCode, Persistent: persist ? PERSISTENT : NOT_PERSISTENT, Invocations: timesInvoked, @@ -36700,7 +36700,7 @@ var require_fetch2 = __commonJS({ function dispatch({ body }) { const url2 = requestCurrentURL(request2); const agent = fetchParams.controller.dispatcher; - return new Promise((resolve6, reject) => agent.dispatch( + return new Promise((resolve5, reject) => agent.dispatch( { path: url2.pathname + url2.search, origin: url2.origin, @@ -36776,7 +36776,7 @@ var require_fetch2 = __commonJS({ } } const onError = this.onError.bind(this); - resolve6({ + resolve5({ status, statusText, headersList, @@ -36822,7 +36822,7 @@ var require_fetch2 = __commonJS({ for (let i = 0; i < rawHeaders.length; i += 2) { headersList.append(bufferToLowerCasedHeaderName(rawHeaders[i]), rawHeaders[i + 1].toString("latin1"), true); } - resolve6({ + resolve5({ status, statusText: STATUS_CODES[status], headersList, @@ -38425,9 +38425,9 @@ var require_util14 = __commonJS({ } } } - function validateCookiePath(path12) { - for (let i = 0; i < path12.length; ++i) { - const code = path12.charCodeAt(i); + function validateCookiePath(path11) { + for (let i = 0; i < path11.length; ++i) { + const code = path11.charCodeAt(i); if (code < 32 || // exclude CTLs (0-31) code === 127 || // DEL code === 59) { @@ -40415,8 +40415,8 @@ var require_util16 = __commonJS({ return true; } function delay2(ms) { - return new Promise((resolve6) => { - setTimeout(resolve6, ms).unref(); + return new Promise((resolve5) => { + setTimeout(resolve5, ms).unref(); }); } module2.exports = { @@ -41021,11 +41021,11 @@ var require_undici2 = __commonJS({ if (typeof opts.path !== "string") { throw new InvalidArgumentError("invalid opts.path"); } - let path12 = opts.path; + let path11 = opts.path; if (!opts.path.startsWith("/")) { - path12 = `/${path12}`; + path11 = `/${path11}`; } - url2 = new URL(util.parseOrigin(url2).origin + path12); + url2 = new URL(util.parseOrigin(url2).origin + path11); } else { if (!opts) { opts = typeof url2 === "object" ? url2 : {}; @@ -41139,11 +41139,11 @@ var require_utils4 = __commonJS({ })(); var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { - return value instanceof P ? value : new P(function(resolve6) { - resolve6(value); + return value instanceof P ? value : new P(function(resolve5) { + resolve5(value); }); } - return new (P || (P = Promise))(function(resolve6, reject) { + return new (P || (P = Promise))(function(resolve5, reject) { function fulfilled(value) { try { step(generator.next(value)); @@ -41159,7 +41159,7 @@ var require_utils4 = __commonJS({ } } function step(result) { - result.done ? resolve6(result.value) : adopt(result.value).then(fulfilled, rejected); + result.done ? resolve5(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); @@ -47840,8 +47840,8 @@ var require_light = __commonJS({ return this.Promise.resolve(); } yieldLoop(t = 0) { - return new this.Promise(function(resolve6, reject) { - return setTimeout(resolve6, t); + return new this.Promise(function(resolve5, reject) { + return setTimeout(resolve5, t); }); } computePenalty() { @@ -48052,15 +48052,15 @@ var require_light = __commonJS({ return this._queue.length === 0; } async _tryToRun() { - var args, cb, error3, reject, resolve6, returned, task; + var args, cb, error3, reject, resolve5, returned, task; if (this._running < 1 && this._queue.length > 0) { this._running++; - ({ task, args, resolve: resolve6, reject } = this._queue.shift()); + ({ task, args, resolve: resolve5, reject } = this._queue.shift()); cb = await (async function() { try { returned = await task(...args); return function() { - return resolve6(returned); + return resolve5(returned); }; } catch (error1) { error3 = error1; @@ -48075,13 +48075,13 @@ var require_light = __commonJS({ } } schedule(task, ...args) { - var promise, reject, resolve6; - resolve6 = reject = null; + var promise, reject, resolve5; + resolve5 = reject = null; promise = new this.Promise(function(_resolve, _reject) { - resolve6 = _resolve; + resolve5 = _resolve; return reject = _reject; }); - this._queue.push({ task, args, resolve: resolve6, reject }); + this._queue.push({ task, args, resolve: resolve5, reject }); this._tryToRun(); return promise; } @@ -48482,14 +48482,14 @@ var require_light = __commonJS({ counts = this._states.counts; return counts[0] + counts[1] + counts[2] + counts[3] === at; }; - return new this.Promise((resolve6, reject) => { + return new this.Promise((resolve5, reject) => { if (finished()) { - return resolve6(); + return resolve5(); } else { return this.on("done", () => { if (finished()) { this.removeAllListeners("done"); - return resolve6(); + return resolve5(); } }); } @@ -48582,9 +48582,9 @@ var require_light = __commonJS({ options = parser$5.load(options, this.jobDefaults); } task = (...args2) => { - return new this.Promise(function(resolve6, reject) { + return new this.Promise(function(resolve5, reject) { return fn(...args2, function(...args3) { - return (args3[0] != null ? reject : resolve6)(args3); + return (args3[0] != null ? reject : resolve5)(args3); }); }); }; @@ -48830,21 +48830,21 @@ var require_internal_path_helper = __commonJS({ return mod && mod.__esModule ? mod : { "default": mod }; }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.dirname = dirname3; + exports2.dirname = dirname2; exports2.ensureAbsoluteRoot = ensureAbsoluteRoot; exports2.hasAbsoluteRoot = hasAbsoluteRoot; exports2.hasRoot = hasRoot; exports2.normalizeSeparators = normalizeSeparators; exports2.safeTrimTrailingSeparator = safeTrimTrailingSeparator; - var path12 = __importStar2(require("path")); + var path11 = __importStar2(require("path")); var assert_1 = __importDefault2(require("assert")); var IS_WINDOWS = process.platform === "win32"; - function dirname3(p) { + function dirname2(p) { p = safeTrimTrailingSeparator(p); if (IS_WINDOWS && /^\\\\[^\\]+(\\[^\\]+)?$/.test(p)) { return p; } - let result = path12.dirname(p); + let result = path11.dirname(p); if (IS_WINDOWS && /^\\\\[^\\]+\\[^\\]+\\$/.test(result)) { result = safeTrimTrailingSeparator(result); } @@ -48881,7 +48881,7 @@ var require_internal_path_helper = __commonJS({ (0, assert_1.default)(hasAbsoluteRoot(root), `ensureAbsoluteRoot parameter 'root' must have an absolute root`); if (root.endsWith("/") || IS_WINDOWS && root.endsWith("\\")) { } else { - root += path12.sep; + root += path11.sep; } return root + itemPath; } @@ -48915,10 +48915,10 @@ var require_internal_path_helper = __commonJS({ return ""; } p = normalizeSeparators(p); - if (!p.endsWith(path12.sep)) { + if (!p.endsWith(path11.sep)) { return p; } - if (p === path12.sep) { + if (p === path11.sep) { return p; } if (IS_WINDOWS && /^[A-Z]:\\$/i.test(p)) { @@ -49263,7 +49263,7 @@ var require_minimatch = __commonJS({ "node_modules/minimatch/minimatch.js"(exports2, module2) { module2.exports = minimatch; minimatch.Minimatch = Minimatch; - var path12 = (function() { + var path11 = (function() { try { return require("path"); } catch (e) { @@ -49271,7 +49271,7 @@ var require_minimatch = __commonJS({ })() || { sep: "/" }; - minimatch.sep = path12.sep; + minimatch.sep = path11.sep; var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {}; var expand2 = require_brace_expansion(); var plTypes = { @@ -49360,8 +49360,8 @@ var require_minimatch = __commonJS({ assertValidPattern(pattern); if (!options) options = {}; pattern = pattern.trim(); - if (!options.allowWindowsEscape && path12.sep !== "/") { - pattern = pattern.split(path12.sep).join("/"); + if (!options.allowWindowsEscape && path11.sep !== "/") { + pattern = pattern.split(path11.sep).join("/"); } this.options = options; this.set = []; @@ -49730,8 +49730,8 @@ var require_minimatch = __commonJS({ if (this.empty) return f === ""; if (f === "/" && partial) return true; var options = this.options; - if (path12.sep !== "/") { - f = f.split(path12.sep).join("/"); + if (path11.sep !== "/") { + f = f.split(path11.sep).join("/"); } f = f.split(slashSplit); this.debug(this.pattern, "split", f); @@ -49877,7 +49877,7 @@ var require_internal_path = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.Path = void 0; - var path12 = __importStar2(require("path")); + var path11 = __importStar2(require("path")); var pathHelper = __importStar2(require_internal_path_helper()); var assert_1 = __importDefault2(require("assert")); var IS_WINDOWS = process.platform === "win32"; @@ -49892,12 +49892,12 @@ var require_internal_path = __commonJS({ (0, assert_1.default)(itemPath, `Parameter 'itemPath' must not be empty`); itemPath = pathHelper.safeTrimTrailingSeparator(itemPath); if (!pathHelper.hasRoot(itemPath)) { - this.segments = itemPath.split(path12.sep); + this.segments = itemPath.split(path11.sep); } else { let remaining = itemPath; let dir = pathHelper.dirname(remaining); while (dir !== remaining) { - const basename = path12.basename(remaining); + const basename = path11.basename(remaining); this.segments.unshift(basename); remaining = dir; dir = pathHelper.dirname(remaining); @@ -49915,7 +49915,7 @@ var require_internal_path = __commonJS({ (0, assert_1.default)(segment === pathHelper.dirname(segment), `Parameter 'itemPath' root segment contains information for multiple segments`); this.segments.push(segment); } else { - (0, assert_1.default)(!segment.includes(path12.sep), `Parameter 'itemPath' contains unexpected path separators`); + (0, assert_1.default)(!segment.includes(path11.sep), `Parameter 'itemPath' contains unexpected path separators`); this.segments.push(segment); } } @@ -49926,12 +49926,12 @@ var require_internal_path = __commonJS({ */ toString() { let result = this.segments[0]; - let skipSlash = result.endsWith(path12.sep) || IS_WINDOWS && /^[A-Z]:$/i.test(result); + let skipSlash = result.endsWith(path11.sep) || IS_WINDOWS && /^[A-Z]:$/i.test(result); for (let i = 1; i < this.segments.length; i++) { if (skipSlash) { skipSlash = false; } else { - result += path12.sep; + result += path11.sep; } result += this.segments[i]; } @@ -49989,7 +49989,7 @@ var require_internal_pattern = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.Pattern = void 0; var os2 = __importStar2(require("os")); - var path12 = __importStar2(require("path")); + var path11 = __importStar2(require("path")); var pathHelper = __importStar2(require_internal_path_helper()); var assert_1 = __importDefault2(require("assert")); var minimatch_1 = require_minimatch(); @@ -50018,7 +50018,7 @@ var require_internal_pattern = __commonJS({ } pattern = _Pattern.fixupPattern(pattern, homedir); this.segments = new internal_path_1.Path(pattern).segments; - this.trailingSeparator = pathHelper.normalizeSeparators(pattern).endsWith(path12.sep); + this.trailingSeparator = pathHelper.normalizeSeparators(pattern).endsWith(path11.sep); pattern = pathHelper.safeTrimTrailingSeparator(pattern); let foundGlob = false; const searchSegments = this.segments.map((x) => _Pattern.getLiteral(x)).filter((x) => !foundGlob && !(foundGlob = x === "")); @@ -50042,8 +50042,8 @@ var require_internal_pattern = __commonJS({ match(itemPath) { if (this.segments[this.segments.length - 1] === "**") { itemPath = pathHelper.normalizeSeparators(itemPath); - if (!itemPath.endsWith(path12.sep) && this.isImplicitPattern === false) { - itemPath = `${itemPath}${path12.sep}`; + if (!itemPath.endsWith(path11.sep) && this.isImplicitPattern === false) { + itemPath = `${itemPath}${path11.sep}`; } } else { itemPath = pathHelper.safeTrimTrailingSeparator(itemPath); @@ -50078,9 +50078,9 @@ var require_internal_pattern = __commonJS({ (0, assert_1.default)(literalSegments.every((x, i) => (x !== "." || i === 0) && x !== ".."), `Invalid pattern '${pattern}'. Relative pathing '.' and '..' is not allowed.`); (0, assert_1.default)(!pathHelper.hasRoot(pattern) || literalSegments[0], `Invalid pattern '${pattern}'. Root segment must not contain globs.`); pattern = pathHelper.normalizeSeparators(pattern); - if (pattern === "." || pattern.startsWith(`.${path12.sep}`)) { + if (pattern === "." || pattern.startsWith(`.${path11.sep}`)) { pattern = _Pattern.globEscape(process.cwd()) + pattern.substr(1); - } else if (pattern === "~" || pattern.startsWith(`~${path12.sep}`)) { + } else if (pattern === "~" || pattern.startsWith(`~${path11.sep}`)) { homedir = homedir || os2.homedir(); (0, assert_1.default)(homedir, "Unable to determine HOME directory"); (0, assert_1.default)(pathHelper.hasAbsoluteRoot(homedir), `Expected HOME directory to be a rooted path. Actual '${homedir}'`); @@ -50164,8 +50164,8 @@ var require_internal_search_state = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.SearchState = void 0; var SearchState = class { - constructor(path12, level) { - this.path = path12; + constructor(path11, level) { + this.path = path11; this.level = level; } }; @@ -50216,11 +50216,11 @@ var require_internal_globber = __commonJS({ })(); var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { - return value instanceof P ? value : new P(function(resolve6) { - resolve6(value); + return value instanceof P ? value : new P(function(resolve5) { + resolve5(value); }); } - return new (P || (P = Promise))(function(resolve6, reject) { + return new (P || (P = Promise))(function(resolve5, reject) { function fulfilled(value) { try { step(generator.next(value)); @@ -50236,7 +50236,7 @@ var require_internal_globber = __commonJS({ } } function step(result) { - result.done ? resolve6(result.value) : adopt(result.value).then(fulfilled, rejected); + result.done ? resolve5(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); @@ -50249,14 +50249,14 @@ var require_internal_globber = __commonJS({ }, i); function verb(n) { i[n] = o[n] && function(v) { - return new Promise(function(resolve6, reject) { - v = o[n](v), settle(resolve6, reject, v.done, v.value); + return new Promise(function(resolve5, reject) { + v = o[n](v), settle(resolve5, reject, v.done, v.value); }); }; } - function settle(resolve6, reject, d, v) { + function settle(resolve5, reject, d, v) { Promise.resolve(v).then(function(v2) { - resolve6({ value: v2, done: d }); + resolve5({ value: v2, done: d }); }, reject); } }; @@ -50307,9 +50307,9 @@ var require_internal_globber = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.DefaultGlobber = void 0; var core12 = __importStar2(require_core()); - var fs12 = __importStar2(require("fs")); + var fs11 = __importStar2(require("fs")); var globOptionsHelper = __importStar2(require_internal_glob_options_helper()); - var path12 = __importStar2(require("path")); + var path11 = __importStar2(require("path")); var patternHelper = __importStar2(require_internal_pattern_helper()); var internal_match_kind_1 = require_internal_match_kind(); var internal_pattern_1 = require_internal_pattern(); @@ -50361,7 +50361,7 @@ var require_internal_globber = __commonJS({ for (const searchPath of patternHelper.getSearchPaths(patterns)) { core12.debug(`Search path '${searchPath}'`); try { - yield __await2(fs12.promises.lstat(searchPath)); + yield __await2(fs11.promises.lstat(searchPath)); } catch (err) { if (err.code === "ENOENT") { continue; @@ -50385,7 +50385,7 @@ var require_internal_globber = __commonJS({ if (!stats) { continue; } - if (options.excludeHiddenFiles && path12.basename(item.path).match(/^\./)) { + if (options.excludeHiddenFiles && path11.basename(item.path).match(/^\./)) { continue; } if (stats.isDirectory()) { @@ -50395,7 +50395,7 @@ var require_internal_globber = __commonJS({ continue; } const childLevel = item.level + 1; - const childItems = (yield __await2(fs12.promises.readdir(item.path))).map((x) => new internal_search_state_1.SearchState(path12.join(item.path, x), childLevel)); + const childItems = (yield __await2(fs11.promises.readdir(item.path))).map((x) => new internal_search_state_1.SearchState(path11.join(item.path, x), childLevel)); stack.push(...childItems.reverse()); } else if (match & internal_match_kind_1.MatchKind.File) { yield yield __await2(item.path); @@ -50430,7 +50430,7 @@ var require_internal_globber = __commonJS({ let stats; if (options.followSymbolicLinks) { try { - stats = yield fs12.promises.stat(item.path); + stats = yield fs11.promises.stat(item.path); } catch (err) { if (err.code === "ENOENT") { if (options.omitBrokenSymbolicLinks) { @@ -50442,10 +50442,10 @@ var require_internal_globber = __commonJS({ throw err; } } else { - stats = yield fs12.promises.lstat(item.path); + stats = yield fs11.promises.lstat(item.path); } if (stats.isDirectory() && options.followSymbolicLinks) { - const realPath = yield fs12.promises.realpath(item.path); + const realPath = yield fs11.promises.realpath(item.path); while (traversalChain.length >= item.level) { traversalChain.pop(); } @@ -50506,11 +50506,11 @@ var require_internal_hash_files = __commonJS({ })(); var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { - return value instanceof P ? value : new P(function(resolve6) { - resolve6(value); + return value instanceof P ? value : new P(function(resolve5) { + resolve5(value); }); } - return new (P || (P = Promise))(function(resolve6, reject) { + return new (P || (P = Promise))(function(resolve5, reject) { function fulfilled(value) { try { step(generator.next(value)); @@ -50526,7 +50526,7 @@ var require_internal_hash_files = __commonJS({ } } function step(result) { - result.done ? resolve6(result.value) : adopt(result.value).then(fulfilled, rejected); + result.done ? resolve5(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); @@ -50539,14 +50539,14 @@ var require_internal_hash_files = __commonJS({ }, i); function verb(n) { i[n] = o[n] && function(v) { - return new Promise(function(resolve6, reject) { - v = o[n](v), settle(resolve6, reject, v.done, v.value); + return new Promise(function(resolve5, reject) { + v = o[n](v), settle(resolve5, reject, v.done, v.value); }); }; } - function settle(resolve6, reject, d, v) { + function settle(resolve5, reject, d, v) { Promise.resolve(v).then(function(v2) { - resolve6({ value: v2, done: d }); + resolve5({ value: v2, done: d }); }, reject); } }; @@ -50554,10 +50554,10 @@ var require_internal_hash_files = __commonJS({ exports2.hashFiles = hashFiles; var crypto2 = __importStar2(require("crypto")); var core12 = __importStar2(require_core()); - var fs12 = __importStar2(require("fs")); + var fs11 = __importStar2(require("fs")); var stream2 = __importStar2(require("stream")); var util = __importStar2(require("util")); - var path12 = __importStar2(require("path")); + var path11 = __importStar2(require("path")); function hashFiles(globber_1, currentWorkspace_1) { return __awaiter2(this, arguments, void 0, function* (globber, currentWorkspace, verbose = false) { var _a, e_1, _b, _c; @@ -50573,17 +50573,17 @@ var require_internal_hash_files = __commonJS({ _e = false; const file = _c; writeDelegate(file); - if (!file.startsWith(`${githubWorkspace}${path12.sep}`)) { + if (!file.startsWith(`${githubWorkspace}${path11.sep}`)) { writeDelegate(`Ignore '${file}' since it is not under GITHUB_WORKSPACE.`); continue; } - if (fs12.statSync(file).isDirectory()) { + if (fs11.statSync(file).isDirectory()) { writeDelegate(`Skip directory '${file}'.`); continue; } const hash2 = crypto2.createHash("sha256"); const pipeline = util.promisify(stream2.pipeline); - yield pipeline(fs12.createReadStream(file), hash2); + yield pipeline(fs11.createReadStream(file), hash2); result.write(hash2.digest()); count++; if (!hasMatch) { @@ -50618,11 +50618,11 @@ var require_glob = __commonJS({ "use strict"; var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { - return value instanceof P ? value : new P(function(resolve6) { - resolve6(value); + return value instanceof P ? value : new P(function(resolve5) { + resolve5(value); }); } - return new (P || (P = Promise))(function(resolve6, reject) { + return new (P || (P = Promise))(function(resolve5, reject) { function fulfilled(value) { try { step(generator.next(value)); @@ -50638,7 +50638,7 @@ var require_glob = __commonJS({ } } function step(result) { - result.done ? resolve6(result.value) : adopt(result.value).then(fulfilled, rejected); + result.done ? resolve5(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); @@ -51898,11 +51898,11 @@ var require_cacheUtils = __commonJS({ })(); var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { - return value instanceof P ? value : new P(function(resolve6) { - resolve6(value); + return value instanceof P ? value : new P(function(resolve5) { + resolve5(value); }); } - return new (P || (P = Promise))(function(resolve6, reject) { + return new (P || (P = Promise))(function(resolve5, reject) { function fulfilled(value) { try { step(generator.next(value)); @@ -51918,7 +51918,7 @@ var require_cacheUtils = __commonJS({ } } function step(result) { - result.done ? resolve6(result.value) : adopt(result.value).then(fulfilled, rejected); + result.done ? resolve5(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); @@ -51931,14 +51931,14 @@ var require_cacheUtils = __commonJS({ }, i); function verb(n) { i[n] = o[n] && function(v) { - return new Promise(function(resolve6, reject) { - v = o[n](v), settle(resolve6, reject, v.done, v.value); + return new Promise(function(resolve5, reject) { + v = o[n](v), settle(resolve5, reject, v.done, v.value); }); }; } - function settle(resolve6, reject, d, v) { + function settle(resolve5, reject, d, v) { Promise.resolve(v).then(function(v2) { - resolve6({ value: v2, done: d }); + resolve5({ value: v2, done: d }); }, reject); } }; @@ -51958,8 +51958,8 @@ var require_cacheUtils = __commonJS({ var glob = __importStar2(require_glob()); var io6 = __importStar2(require_io()); var crypto2 = __importStar2(require("crypto")); - var fs12 = __importStar2(require("fs")); - var path12 = __importStar2(require("path")); + var fs11 = __importStar2(require("fs")); + var path11 = __importStar2(require("path")); var semver9 = __importStar2(require_semver3()); var util = __importStar2(require("util")); var constants_1 = require_constants12(); @@ -51979,15 +51979,15 @@ var require_cacheUtils = __commonJS({ baseLocation = "/home"; } } - tempDirectory = path12.join(baseLocation, "actions", "temp"); + tempDirectory = path11.join(baseLocation, "actions", "temp"); } - const dest = path12.join(tempDirectory, crypto2.randomUUID()); + const dest = path11.join(tempDirectory, crypto2.randomUUID()); yield io6.mkdirP(dest); return dest; }); } function getArchiveFileSizeInBytes(filePath) { - return fs12.statSync(filePath).size; + return fs11.statSync(filePath).size; } function resolvePaths(patterns) { return __awaiter2(this, void 0, void 0, function* () { @@ -52003,7 +52003,7 @@ var require_cacheUtils = __commonJS({ _c = _g.value; _e = false; const file = _c; - const relativeFile = path12.relative(workspace, file).replace(new RegExp(`\\${path12.sep}`, "g"), "/"); + const relativeFile = path11.relative(workspace, file).replace(new RegExp(`\\${path11.sep}`, "g"), "/"); core12.debug(`Matched: ${relativeFile}`); if (relativeFile === "") { paths.push("."); @@ -52025,7 +52025,7 @@ var require_cacheUtils = __commonJS({ } function unlinkFile(filePath) { return __awaiter2(this, void 0, void 0, function* () { - return util.promisify(fs12.unlink)(filePath); + return util.promisify(fs11.unlink)(filePath); }); } function getVersion(app_1) { @@ -52067,7 +52067,7 @@ var require_cacheUtils = __commonJS({ } function getGnuTarPathOnWindows() { return __awaiter2(this, void 0, void 0, function* () { - if (fs12.existsSync(constants_1.GnuTarPathOnWindows)) { + if (fs11.existsSync(constants_1.GnuTarPathOnWindows)) { return constants_1.GnuTarPathOnWindows; } const versionOutput = yield getVersion("tar"); @@ -52220,11 +52220,11 @@ function __metadata(metadataKey, metadataValue) { } function __awaiter(thisArg, _arguments, P, generator) { function adopt(value) { - return value instanceof P ? value : new P(function(resolve6) { - resolve6(value); + return value instanceof P ? value : new P(function(resolve5) { + resolve5(value); }); } - return new (P || (P = Promise))(function(resolve6, reject) { + return new (P || (P = Promise))(function(resolve5, reject) { function fulfilled(value) { try { step(generator.next(value)); @@ -52240,7 +52240,7 @@ function __awaiter(thisArg, _arguments, P, generator) { } } function step(result) { - result.done ? resolve6(result.value) : adopt(result.value).then(fulfilled, rejected); + result.done ? resolve5(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); @@ -52431,14 +52431,14 @@ function __asyncValues(o) { }, i); function verb(n) { i[n] = o[n] && function(v) { - return new Promise(function(resolve6, reject) { - v = o[n](v), settle(resolve6, reject, v.done, v.value); + return new Promise(function(resolve5, reject) { + v = o[n](v), settle(resolve5, reject, v.done, v.value); }); }; } - function settle(resolve6, reject, d, v) { + function settle(resolve5, reject, d, v) { Promise.resolve(v).then(function(v2) { - resolve6({ value: v2, done: d }); + resolve5({ value: v2, done: d }); }, reject); } } @@ -52530,13 +52530,13 @@ function __disposeResources(env) { } return next(); } -function __rewriteRelativeImportExtension(path12, preserveJsx) { - if (typeof path12 === "string" && /^\.\.?\//.test(path12)) { - return path12.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function(m, tsx, d, ext, cm) { +function __rewriteRelativeImportExtension(path11, preserveJsx) { + if (typeof path11 === "string" && /^\.\.?\//.test(path11)) { + return path11.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function(m, tsx, d, ext, cm) { return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : d + ext + "." + cm.toLowerCase() + "js"; }); } - return path12; + return path11; } var extendStatics, __assign, __createBinding, __setModuleDefault, ownKeys, _SuppressedError, tslib_es6_default; var init_tslib_es6 = __esm({ @@ -53610,9 +53610,9 @@ var require_nodeHttpClient = __commonJS({ if (stream2.readable === false) { return Promise.resolve(); } - return new Promise((resolve6) => { + return new Promise((resolve5) => { const handler2 = () => { - resolve6(); + resolve5(); stream2.removeListener("close", handler2); stream2.removeListener("end", handler2); stream2.removeListener("error", handler2); @@ -53767,8 +53767,8 @@ var require_nodeHttpClient = __commonJS({ headers: request2.headers.toJSON({ preserveCase: true }), ...request2.requestOverrides }; - return new Promise((resolve6, reject) => { - const req = isInsecure ? node_http_1.default.request(options, resolve6) : node_https_1.default.request(options, resolve6); + return new Promise((resolve5, reject) => { + const req = isInsecure ? node_http_1.default.request(options, resolve5) : node_https_1.default.request(options, resolve5); req.once("error", (err) => { reject(new restError_js_1.RestError(err.message, { code: err.code ?? restError_js_1.RestError.REQUEST_SEND_ERROR, request: request2 })); }); @@ -53852,7 +53852,7 @@ var require_nodeHttpClient = __commonJS({ return stream2; } function streamToText(stream2) { - return new Promise((resolve6, reject) => { + return new Promise((resolve5, reject) => { const buffer = []; stream2.on("data", (chunk) => { if (Buffer.isBuffer(chunk)) { @@ -53862,7 +53862,7 @@ var require_nodeHttpClient = __commonJS({ } }); stream2.on("end", () => { - resolve6(Buffer.concat(buffer).toString("utf8")); + resolve5(Buffer.concat(buffer).toString("utf8")); }); stream2.on("error", (e) => { if (e && e?.name === "AbortError") { @@ -54140,7 +54140,7 @@ var require_helpers2 = __commonJS({ var AbortError_js_1 = require_AbortError(); var StandardAbortMessage = "The operation was aborted."; function delay2(delayInMs, value, options) { - return new Promise((resolve6, reject) => { + return new Promise((resolve5, reject) => { let timer = void 0; let onAborted = void 0; const rejectOnAbort = () => { @@ -54163,7 +54163,7 @@ var require_helpers2 = __commonJS({ } timer = setTimeout(() => { removeListeners(); - resolve6(value); + resolve5(value); }, delayInMs); if (options?.abortSignal) { options.abortSignal.addEventListener("abort", onAborted); @@ -55326,8 +55326,8 @@ var require_helpers3 = __commonJS({ function req(url2, opts = {}) { const href = typeof url2 === "string" ? url2 : url2.href; const req2 = (href.startsWith("https:") ? https2 : http).request(url2, opts); - const promise = new Promise((resolve6, reject) => { - req2.once("response", resolve6).once("error", reject).end(); + const promise = new Promise((resolve5, reject) => { + req2.once("response", resolve5).once("error", reject).end(); }); req2.then = promise.then.bind(promise); return req2; @@ -55504,7 +55504,7 @@ var require_parse_proxy_response = __commonJS({ var debug_1 = __importDefault2(require_src()); var debug4 = (0, debug_1.default)("https-proxy-agent:parse-proxy-response"); function parseProxyResponse(socket) { - return new Promise((resolve6, reject) => { + return new Promise((resolve5, reject) => { let buffersLength = 0; const buffers = []; function read() { @@ -55570,7 +55570,7 @@ var require_parse_proxy_response = __commonJS({ } debug4("got proxy server response: %o %o", firstLine, headers); cleanup(); - resolve6({ + resolve5({ connect: { statusCode, statusText, @@ -56950,8 +56950,8 @@ var require_getClient = __commonJS({ } const { allowInsecureConnection, httpClient } = clientOptions; const endpointUrl = clientOptions.endpoint ?? endpoint2; - const client = (path12, ...args) => { - const getUrl = (requestOptions) => (0, urlHelpers_js_1.buildRequestUrl)(endpointUrl, path12, args, { allowInsecureConnection, ...requestOptions }); + const client = (path11, ...args) => { + const getUrl = (requestOptions) => (0, urlHelpers_js_1.buildRequestUrl)(endpointUrl, path11, args, { allowInsecureConnection, ...requestOptions }); return { get: (requestOptions = {}) => { return buildOperation("GET", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); @@ -57656,7 +57656,7 @@ var require_createAbortablePromise = __commonJS({ var abort_controller_1 = require_commonjs3(); function createAbortablePromise(buildPromise, options) { const { cleanupBeforeAbort, abortSignal, abortErrorMsg } = options ?? {}; - return new Promise((resolve6, reject) => { + return new Promise((resolve5, reject) => { function rejectOnAbort() { reject(new abort_controller_1.AbortError(abortErrorMsg ?? "The operation was aborted.")); } @@ -57674,7 +57674,7 @@ var require_createAbortablePromise = __commonJS({ try { buildPromise((x) => { removeListeners(); - resolve6(x); + resolve5(x); }, (x) => { removeListeners(); reject(x); @@ -57701,8 +57701,8 @@ var require_delay2 = __commonJS({ function delay2(timeInMs, options) { let token; const { abortSignal, abortErrorMsg } = options ?? {}; - return (0, createAbortablePromise_js_1.createAbortablePromise)((resolve6) => { - token = setTimeout(resolve6, timeInMs); + return (0, createAbortablePromise_js_1.createAbortablePromise)((resolve5) => { + token = setTimeout(resolve5, timeInMs); }, { cleanupBeforeAbort: () => clearTimeout(token), abortSignal, @@ -60822,15 +60822,15 @@ var require_urlHelpers2 = __commonJS({ let isAbsolutePath = false; let requestUrl = replaceAll(baseUri, urlReplacements); if (operationSpec.path) { - let path12 = replaceAll(operationSpec.path, urlReplacements); - if (operationSpec.path === "/{nextLink}" && path12.startsWith("/")) { - path12 = path12.substring(1); + let path11 = replaceAll(operationSpec.path, urlReplacements); + if (operationSpec.path === "/{nextLink}" && path11.startsWith("/")) { + path11 = path11.substring(1); } - if (isAbsoluteUrl(path12)) { - requestUrl = path12; + if (isAbsoluteUrl(path11)) { + requestUrl = path11; isAbsolutePath = true; } else { - requestUrl = appendPath(requestUrl, path12); + requestUrl = appendPath(requestUrl, path11); } } const { queryParams, sequenceParams } = calculateQueryParameters(operationSpec, operationArguments, fallbackObject); @@ -60876,9 +60876,9 @@ var require_urlHelpers2 = __commonJS({ } const searchStart = pathToAppend.indexOf("?"); if (searchStart !== -1) { - const path12 = pathToAppend.substring(0, searchStart); + const path11 = pathToAppend.substring(0, searchStart); const search = pathToAppend.substring(searchStart + 1); - newPath = newPath + path12; + newPath = newPath + path11; if (search) { parsedUrl.search = parsedUrl.search ? `${parsedUrl.search}&${search}` : search; } @@ -63129,10 +63129,10 @@ var require_utils_common = __commonJS({ var constants_js_1 = require_constants15(); function escapeURLPath(url2) { const urlParsed = new URL(url2); - let path12 = urlParsed.pathname; - path12 = path12 || "/"; - path12 = escape(path12); - urlParsed.pathname = path12; + let path11 = urlParsed.pathname; + path11 = path11 || "/"; + path11 = escape(path11); + urlParsed.pathname = path11; return urlParsed.toString(); } function getProxyUriFromDevConnString(connectionString) { @@ -63217,9 +63217,9 @@ var require_utils_common = __commonJS({ } function appendToURLPath(url2, name) { const urlParsed = new URL(url2); - let path12 = urlParsed.pathname; - path12 = path12 ? path12.endsWith("/") ? `${path12}${name}` : `${path12}/${name}` : name; - urlParsed.pathname = path12; + let path11 = urlParsed.pathname; + path11 = path11 ? path11.endsWith("/") ? `${path11}${name}` : `${path11}/${name}` : name; + urlParsed.pathname = path11; return urlParsed.toString(); } function setURLParameter(url2, name, value) { @@ -63334,7 +63334,7 @@ var require_utils_common = __commonJS({ return base64encode(res); } async function delay2(timeInMs, aborter, abortError) { - return new Promise((resolve6, reject) => { + return new Promise((resolve5, reject) => { let timeout; const abortHandler = () => { if (timeout !== void 0) { @@ -63346,7 +63346,7 @@ var require_utils_common = __commonJS({ if (aborter !== void 0) { aborter.removeEventListener("abort", abortHandler); } - resolve6(); + resolve5(); }; timeout = setTimeout(resolveHandler, timeInMs); if (aborter !== void 0) { @@ -64446,9 +64446,9 @@ var require_StorageSharedKeyCredentialPolicy = __commonJS({ * @param request - */ getCanonicalizedResourceString(request2) { - const path12 = (0, utils_common_js_1.getURLPath)(request2.url) || "/"; + const path11 = (0, utils_common_js_1.getURLPath)(request2.url) || "/"; let canonicalizedResourceString = ""; - canonicalizedResourceString += `/${this.factory.accountName}${path12}`; + canonicalizedResourceString += `/${this.factory.accountName}${path11}`; const queries = (0, utils_common_js_1.getURLQueries)(request2.url); const lowercaseQueries = {}; if (queries) { @@ -64887,7 +64887,7 @@ var require_BufferScheduler = __commonJS({ * */ async do() { - return new Promise((resolve6, reject) => { + return new Promise((resolve5, reject) => { this.readable.on("data", (data) => { data = typeof data === "string" ? Buffer.from(data, this.encoding) : data; this.appendUnresolvedData(data); @@ -64915,11 +64915,11 @@ var require_BufferScheduler = __commonJS({ if (this.isStreamEnd && this.executingOutgoingHandlers === 0) { if (this.unresolvedLength > 0 && this.unresolvedLength < this.bufferSize) { const buffer = this.shiftBufferFromUnresolvedDataArray(); - this.outgoingHandler(() => buffer.getReadableStream(), buffer.size, this.offset).then(resolve6).catch(reject); + this.outgoingHandler(() => buffer.getReadableStream(), buffer.size, this.offset).then(resolve5).catch(reject); } else if (this.unresolvedLength >= this.bufferSize) { return; } else { - resolve6(); + resolve5(); } } }); @@ -65187,10 +65187,10 @@ var require_utils_common2 = __commonJS({ var constants_js_1 = require_constants16(); function escapeURLPath(url2) { const urlParsed = new URL(url2); - let path12 = urlParsed.pathname; - path12 = path12 || "/"; - path12 = escape(path12); - urlParsed.pathname = path12; + let path11 = urlParsed.pathname; + path11 = path11 || "/"; + path11 = escape(path11); + urlParsed.pathname = path11; return urlParsed.toString(); } function getProxyUriFromDevConnString(connectionString) { @@ -65275,9 +65275,9 @@ var require_utils_common2 = __commonJS({ } function appendToURLPath(url2, name) { const urlParsed = new URL(url2); - let path12 = urlParsed.pathname; - path12 = path12 ? path12.endsWith("/") ? `${path12}${name}` : `${path12}/${name}` : name; - urlParsed.pathname = path12; + let path11 = urlParsed.pathname; + path11 = path11 ? path11.endsWith("/") ? `${path11}${name}` : `${path11}/${name}` : name; + urlParsed.pathname = path11; return urlParsed.toString(); } function setURLParameter(url2, name, value) { @@ -65392,7 +65392,7 @@ var require_utils_common2 = __commonJS({ return base64encode(res); } async function delay2(timeInMs, aborter, abortError) { - return new Promise((resolve6, reject) => { + return new Promise((resolve5, reject) => { let timeout; const abortHandler = () => { if (timeout !== void 0) { @@ -65404,7 +65404,7 @@ var require_utils_common2 = __commonJS({ if (aborter !== void 0) { aborter.removeEventListener("abort", abortHandler); } - resolve6(); + resolve5(); }; timeout = setTimeout(resolveHandler, timeInMs); if (aborter !== void 0) { @@ -66198,9 +66198,9 @@ var require_StorageSharedKeyCredentialPolicy2 = __commonJS({ * @param request - */ getCanonicalizedResourceString(request2) { - const path12 = (0, utils_common_js_1.getURLPath)(request2.url) || "/"; + const path11 = (0, utils_common_js_1.getURLPath)(request2.url) || "/"; let canonicalizedResourceString = ""; - canonicalizedResourceString += `/${this.factory.accountName}${path12}`; + canonicalizedResourceString += `/${this.factory.accountName}${path11}`; const queries = (0, utils_common_js_1.getURLQueries)(request2.url); const lowercaseQueries = {}; if (queries) { @@ -66830,9 +66830,9 @@ var require_StorageSharedKeyCredentialPolicyV2 = __commonJS({ return canonicalizedHeadersStringToSign; } function getCanonicalizedResourceString(request2) { - const path12 = (0, utils_common_js_1.getURLPath)(request2.url) || "/"; + const path11 = (0, utils_common_js_1.getURLPath)(request2.url) || "/"; let canonicalizedResourceString = ""; - canonicalizedResourceString += `/${options.accountName}${path12}`; + canonicalizedResourceString += `/${options.accountName}${path11}`; const queries = (0, utils_common_js_1.getURLQueries)(request2.url); const lowercaseQueries = {}; if (queries) { @@ -67177,9 +67177,9 @@ var require_StorageSharedKeyCredentialPolicyV22 = __commonJS({ return canonicalizedHeadersStringToSign; } function getCanonicalizedResourceString(request2) { - const path12 = (0, utils_common_js_1.getURLPath)(request2.url) || "/"; + const path11 = (0, utils_common_js_1.getURLPath)(request2.url) || "/"; let canonicalizedResourceString = ""; - canonicalizedResourceString += `/${options.accountName}${path12}`; + canonicalizedResourceString += `/${options.accountName}${path11}`; const queries = (0, utils_common_js_1.getURLQueries)(request2.url); const lowercaseQueries = {}; if (queries) { @@ -83602,7 +83602,7 @@ var require_AvroReadableFromStream = __commonJS({ this._position += chunk.length; return this.toUint8Array(chunk); } else { - return new Promise((resolve6, reject) => { + return new Promise((resolve5, reject) => { const cleanUp = () => { this._readable.removeListener("readable", readableCallback); this._readable.removeListener("error", rejectCallback); @@ -83617,7 +83617,7 @@ var require_AvroReadableFromStream = __commonJS({ if (callbackChunk) { this._position += callbackChunk.length; cleanUp(); - resolve6(this.toUint8Array(callbackChunk)); + resolve5(this.toUint8Array(callbackChunk)); } }; const rejectCallback = () => { @@ -85097,8 +85097,8 @@ var require_poller3 = __commonJS({ this.stopped = true; this.pollProgressCallbacks = []; this.operation = operation; - this.promise = new Promise((resolve6, reject) => { - this.resolve = resolve6; + this.promise = new Promise((resolve5, reject) => { + this.resolve = resolve5; this.reject = reject; }); this.promise.catch(() => { @@ -85351,7 +85351,7 @@ var require_lroEngine = __commonJS({ * The method used by the poller to wait before attempting to update its operation. */ delay() { - return new Promise((resolve6) => setTimeout(() => resolve6(), this.config.intervalInMs)); + return new Promise((resolve5) => setTimeout(() => resolve5(), this.config.intervalInMs)); } }; exports2.LroEngine = LroEngine; @@ -85597,8 +85597,8 @@ var require_Batch = __commonJS({ return Promise.resolve(); } this.parallelExecute(); - return new Promise((resolve6, reject) => { - this.emitter.on("finish", resolve6); + return new Promise((resolve5, reject) => { + this.emitter.on("finish", resolve5); this.emitter.on("error", (error3) => { this.state = BatchStates.Error; reject(error3); @@ -85659,12 +85659,12 @@ var require_utils7 = __commonJS({ async function streamToBuffer(stream2, buffer, offset, end, encoding) { let pos = 0; const count = end - offset; - return new Promise((resolve6, reject) => { + return new Promise((resolve5, reject) => { const timeout = setTimeout(() => reject(new Error(`The operation cannot be completed in timeout.`)), constants_js_1.REQUEST_TIMEOUT); stream2.on("readable", () => { if (pos >= count) { clearTimeout(timeout); - resolve6(); + resolve5(); return; } let chunk = stream2.read(); @@ -85683,7 +85683,7 @@ var require_utils7 = __commonJS({ if (pos < count) { reject(new Error(`Stream drains before getting enough data needed. Data read: ${pos}, data need: ${count}`)); } - resolve6(); + resolve5(); }); stream2.on("error", (msg) => { clearTimeout(timeout); @@ -85694,7 +85694,7 @@ var require_utils7 = __commonJS({ async function streamToBuffer2(stream2, buffer, encoding) { let pos = 0; const bufferSize = buffer.length; - return new Promise((resolve6, reject) => { + return new Promise((resolve5, reject) => { stream2.on("readable", () => { let chunk = stream2.read(); if (!chunk) { @@ -85711,25 +85711,25 @@ var require_utils7 = __commonJS({ pos += chunk.length; }); stream2.on("end", () => { - resolve6(pos); + resolve5(pos); }); stream2.on("error", reject); }); } async function streamToBuffer3(readableStream, encoding) { - return new Promise((resolve6, reject) => { + return new Promise((resolve5, reject) => { const chunks = []; readableStream.on("data", (data) => { chunks.push(typeof data === "string" ? Buffer.from(data, encoding) : data); }); readableStream.on("end", () => { - resolve6(Buffer.concat(chunks)); + resolve5(Buffer.concat(chunks)); }); readableStream.on("error", reject); }); } async function readStreamToLocalFile(rs, file) { - return new Promise((resolve6, reject) => { + return new Promise((resolve5, reject) => { const ws = node_fs_1.default.createWriteStream(file); rs.on("error", (err) => { reject(err); @@ -85737,7 +85737,7 @@ var require_utils7 = __commonJS({ ws.on("error", (err) => { reject(err); }); - ws.on("close", resolve6); + ws.on("close", resolve5); rs.pipe(ws); }); } @@ -86676,7 +86676,7 @@ var require_Clients = __commonJS({ * @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token. */ generateSasUrl(options) { - return new Promise((resolve6) => { + return new Promise((resolve5) => { if (!(this.credential instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential)) { throw new RangeError("Can only generate the SAS when the client is initialized with a shared key credential"); } @@ -86687,7 +86687,7 @@ var require_Clients = __commonJS({ versionId: this._versionId, ...options }, this.credential).toString(); - resolve6((0, utils_common_js_1.appendToURLQuery)(this.url, sas)); + resolve5((0, utils_common_js_1.appendToURLQuery)(this.url, sas)); }); } /** @@ -86726,7 +86726,7 @@ var require_Clients = __commonJS({ * @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token. */ generateUserDelegationSasUrl(options, userDelegationKey) { - return new Promise((resolve6) => { + return new Promise((resolve5) => { const sas = (0, BlobSASSignatureValues_js_1.generateBlobSASQueryParameters)({ containerName: this._containerName, blobName: this._name, @@ -86734,7 +86734,7 @@ var require_Clients = __commonJS({ versionId: this._versionId, ...options }, userDelegationKey, this.accountName).toString(); - resolve6((0, utils_common_js_1.appendToURLQuery)(this.url, sas)); + resolve5((0, utils_common_js_1.appendToURLQuery)(this.url, sas)); }); } /** @@ -88589,14 +88589,14 @@ var require_Mutex = __commonJS({ * @param key - lock key */ static async lock(key) { - return new Promise((resolve6) => { + return new Promise((resolve5) => { if (this.keys[key] === void 0 || this.keys[key] === MutexLockStatus.UNLOCKED) { this.keys[key] = MutexLockStatus.LOCKED; - resolve6(); + resolve5(); } else { this.onUnlockEvent(key, () => { this.keys[key] = MutexLockStatus.LOCKED; - resolve6(); + resolve5(); }); } }); @@ -88607,12 +88607,12 @@ var require_Mutex = __commonJS({ * @param key - */ static async unlock(key) { - return new Promise((resolve6) => { + return new Promise((resolve5) => { if (this.keys[key] === MutexLockStatus.LOCKED) { this.emitUnlockEvent(key); } delete this.keys[key]; - resolve6(); + resolve5(); }); } static keys = {}; @@ -88834,8 +88834,8 @@ var require_BlobBatch = __commonJS({ if (this.operationCount >= constants_js_1.BATCH_MAX_REQUEST) { throw new RangeError(`Cannot exceed ${constants_js_1.BATCH_MAX_REQUEST} sub requests in a single batch`); } - const path12 = (0, utils_common_js_1.getURLPath)(subRequest.url); - if (!path12 || path12 === "") { + const path11 = (0, utils_common_js_1.getURLPath)(subRequest.url); + if (!path11 || path11 === "") { throw new RangeError(`Invalid url for sub request: '${subRequest.url}'`); } } @@ -88913,8 +88913,8 @@ var require_BlobBatchClient = __commonJS({ pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipeline, options); } const storageClientContext = new StorageContextClient_js_1.StorageContextClient(url2, (0, Pipeline_js_1.getCoreClientOptions)(pipeline)); - const path12 = (0, utils_common_js_1.getURLPath)(url2); - if (path12 && path12 !== "/") { + const path11 = (0, utils_common_js_1.getURLPath)(url2); + if (path11 && path11 !== "/") { this.serviceOrContainerContext = storageClientContext.container; } else { this.serviceOrContainerContext = storageClientContext.service; @@ -90215,7 +90215,7 @@ var require_ContainerClient = __commonJS({ * @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token. */ generateSasUrl(options) { - return new Promise((resolve6) => { + return new Promise((resolve5) => { if (!(this.credential instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential)) { throw new RangeError("Can only generate the SAS when the client is initialized with a shared key credential"); } @@ -90223,7 +90223,7 @@ var require_ContainerClient = __commonJS({ containerName: this._containerName, ...options }, this.credential).toString(); - resolve6((0, utils_common_js_1.appendToURLQuery)(this.url, sas)); + resolve5((0, utils_common_js_1.appendToURLQuery)(this.url, sas)); }); } /** @@ -90258,12 +90258,12 @@ var require_ContainerClient = __commonJS({ * @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token. */ generateUserDelegationSasUrl(options, userDelegationKey) { - return new Promise((resolve6) => { + return new Promise((resolve5) => { const sas = (0, BlobSASSignatureValues_js_1.generateBlobSASQueryParameters)({ containerName: this._containerName, ...options }, userDelegationKey, this.accountName).toString(); - resolve6((0, utils_common_js_1.appendToURLQuery)(this.url, sas)); + resolve5((0, utils_common_js_1.appendToURLQuery)(this.url, sas)); }); } /** @@ -91659,11 +91659,11 @@ var require_uploadUtils = __commonJS({ })(); var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { - return value instanceof P ? value : new P(function(resolve6) { - resolve6(value); + return value instanceof P ? value : new P(function(resolve5) { + resolve5(value); }); } - return new (P || (P = Promise))(function(resolve6, reject) { + return new (P || (P = Promise))(function(resolve5, reject) { function fulfilled(value) { try { step(generator.next(value)); @@ -91679,7 +91679,7 @@ var require_uploadUtils = __commonJS({ } } function step(result) { - result.done ? resolve6(result.value) : adopt(result.value).then(fulfilled, rejected); + result.done ? resolve5(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); @@ -91846,11 +91846,11 @@ var require_requestUtils = __commonJS({ })(); var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { - return value instanceof P ? value : new P(function(resolve6) { - resolve6(value); + return value instanceof P ? value : new P(function(resolve5) { + resolve5(value); }); } - return new (P || (P = Promise))(function(resolve6, reject) { + return new (P || (P = Promise))(function(resolve5, reject) { function fulfilled(value) { try { step(generator.next(value)); @@ -91866,7 +91866,7 @@ var require_requestUtils = __commonJS({ } } function step(result) { - result.done ? resolve6(result.value) : adopt(result.value).then(fulfilled, rejected); + result.done ? resolve5(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); @@ -91906,7 +91906,7 @@ var require_requestUtils = __commonJS({ } function sleep(milliseconds) { return __awaiter2(this, void 0, void 0, function* () { - return new Promise((resolve6) => setTimeout(resolve6, milliseconds)); + return new Promise((resolve5) => setTimeout(resolve5, milliseconds)); }); } function retry2(name_1, method_1, getStatusCode_1) { @@ -92167,11 +92167,11 @@ var require_downloadUtils = __commonJS({ })(); var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { - return value instanceof P ? value : new P(function(resolve6) { - resolve6(value); + return value instanceof P ? value : new P(function(resolve5) { + resolve5(value); }); } - return new (P || (P = Promise))(function(resolve6, reject) { + return new (P || (P = Promise))(function(resolve5, reject) { function fulfilled(value) { try { step(generator.next(value)); @@ -92187,7 +92187,7 @@ var require_downloadUtils = __commonJS({ } } function step(result) { - result.done ? resolve6(result.value) : adopt(result.value).then(fulfilled, rejected); + result.done ? resolve5(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); @@ -92201,7 +92201,7 @@ var require_downloadUtils = __commonJS({ var http_client_1 = require_lib(); var storage_blob_1 = require_commonjs15(); var buffer = __importStar2(require("buffer")); - var fs12 = __importStar2(require("fs")); + var fs11 = __importStar2(require("fs")); var stream2 = __importStar2(require("stream")); var util = __importStar2(require("util")); var utils = __importStar2(require_cacheUtils()); @@ -92312,7 +92312,7 @@ var require_downloadUtils = __commonJS({ exports2.DownloadProgress = DownloadProgress; function downloadCacheHttpClient(archiveLocation, archivePath) { return __awaiter2(this, void 0, void 0, function* () { - const writeStream = fs12.createWriteStream(archivePath); + const writeStream = fs11.createWriteStream(archivePath); const httpClient = new http_client_1.HttpClient("actions/cache"); const downloadResponse = yield (0, requestUtils_1.retryHttpClientResponse)("downloadCache", () => __awaiter2(this, void 0, void 0, function* () { return httpClient.get(archiveLocation); @@ -92337,7 +92337,7 @@ var require_downloadUtils = __commonJS({ function downloadCacheHttpClientConcurrent(archiveLocation, archivePath, options) { return __awaiter2(this, void 0, void 0, function* () { var _a; - const archiveDescriptor = yield fs12.promises.open(archivePath, "w"); + const archiveDescriptor = yield fs11.promises.open(archivePath, "w"); const httpClient = new http_client_1.HttpClient("actions/cache", void 0, { socketTimeout: options.timeoutInMs, keepAlive: true @@ -92453,7 +92453,7 @@ var require_downloadUtils = __commonJS({ } else { const maxSegmentSize = Math.min(134217728, buffer.constants.MAX_LENGTH); const downloadProgress = new DownloadProgress(contentLength); - const fd = fs12.openSync(archivePath, "w"); + const fd = fs11.openSync(archivePath, "w"); try { downloadProgress.startDisplayTimer(); const controller = new abort_controller_1.AbortController(); @@ -92471,20 +92471,20 @@ var require_downloadUtils = __commonJS({ controller.abort(); throw new Error("Aborting cache download as the download time exceeded the timeout."); } else if (Buffer.isBuffer(result)) { - fs12.writeFileSync(fd, result); + fs11.writeFileSync(fd, result); } } } finally { downloadProgress.stopDisplayTimer(); - fs12.closeSync(fd); + fs11.closeSync(fd); } } }); } var promiseWithTimeout = (timeoutMs, promise) => __awaiter2(void 0, void 0, void 0, function* () { let timeoutHandle; - const timeoutPromise = new Promise((resolve6) => { - timeoutHandle = setTimeout(() => resolve6("timeout"), timeoutMs); + const timeoutPromise = new Promise((resolve5) => { + timeoutHandle = setTimeout(() => resolve5("timeout"), timeoutMs); }); return Promise.race([promise, timeoutPromise]).then((result) => { clearTimeout(timeoutHandle); @@ -92765,11 +92765,11 @@ var require_cacheHttpClient = __commonJS({ })(); var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { - return value instanceof P ? value : new P(function(resolve6) { - resolve6(value); + return value instanceof P ? value : new P(function(resolve5) { + resolve5(value); }); } - return new (P || (P = Promise))(function(resolve6, reject) { + return new (P || (P = Promise))(function(resolve5, reject) { function fulfilled(value) { try { step(generator.next(value)); @@ -92785,7 +92785,7 @@ var require_cacheHttpClient = __commonJS({ } } function step(result) { - result.done ? resolve6(result.value) : adopt(result.value).then(fulfilled, rejected); + result.done ? resolve5(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); @@ -92798,7 +92798,7 @@ var require_cacheHttpClient = __commonJS({ var core12 = __importStar2(require_core()); var http_client_1 = require_lib(); var auth_1 = require_auth(); - var fs12 = __importStar2(require("fs")); + var fs11 = __importStar2(require("fs")); var url_1 = require("url"); var utils = __importStar2(require_cacheUtils()); var uploadUtils_1 = require_uploadUtils(); @@ -92933,7 +92933,7 @@ Other caches with similar key:`); return __awaiter2(this, void 0, void 0, function* () { const fileSize = utils.getArchiveFileSizeInBytes(archivePath); const resourceUrl = getCacheApiUrl(`caches/${cacheId.toString()}`); - const fd = fs12.openSync(archivePath, "r"); + const fd = fs11.openSync(archivePath, "r"); const uploadOptions = (0, options_1.getUploadOptions)(options); const concurrency = utils.assertDefined("uploadConcurrency", uploadOptions.uploadConcurrency); const maxChunkSize = utils.assertDefined("uploadChunkSize", uploadOptions.uploadChunkSize); @@ -92947,7 +92947,7 @@ Other caches with similar key:`); const start = offset; const end = offset + chunkSize - 1; offset += maxChunkSize; - yield uploadChunk(httpClient, resourceUrl, () => fs12.createReadStream(archivePath, { + yield uploadChunk(httpClient, resourceUrl, () => fs11.createReadStream(archivePath, { fd, start, end, @@ -92958,7 +92958,7 @@ Other caches with similar key:`); } }))); } finally { - fs12.closeSync(fd); + fs11.closeSync(fd); } return; }); @@ -96255,8 +96255,8 @@ var require_deferred = __commonJS({ */ constructor(preventUnhandledRejectionWarning = true) { this._state = DeferredState.PENDING; - this._promise = new Promise((resolve6, reject) => { - this._resolve = resolve6; + this._promise = new Promise((resolve5, reject) => { + this._resolve = resolve5; this._reject = reject; }); if (preventUnhandledRejectionWarning) { @@ -96471,11 +96471,11 @@ var require_unary_call = __commonJS({ "use strict"; var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { - return value instanceof P ? value : new P(function(resolve6) { - resolve6(value); + return value instanceof P ? value : new P(function(resolve5) { + resolve5(value); }); } - return new (P || (P = Promise))(function(resolve6, reject) { + return new (P || (P = Promise))(function(resolve5, reject) { function fulfilled(value) { try { step(generator.next(value)); @@ -96491,7 +96491,7 @@ var require_unary_call = __commonJS({ } } function step(result) { - result.done ? resolve6(result.value) : adopt(result.value).then(fulfilled, rejected); + result.done ? resolve5(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); @@ -96540,11 +96540,11 @@ var require_server_streaming_call = __commonJS({ "use strict"; var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { - return value instanceof P ? value : new P(function(resolve6) { - resolve6(value); + return value instanceof P ? value : new P(function(resolve5) { + resolve5(value); }); } - return new (P || (P = Promise))(function(resolve6, reject) { + return new (P || (P = Promise))(function(resolve5, reject) { function fulfilled(value) { try { step(generator.next(value)); @@ -96560,7 +96560,7 @@ var require_server_streaming_call = __commonJS({ } } function step(result) { - result.done ? resolve6(result.value) : adopt(result.value).then(fulfilled, rejected); + result.done ? resolve5(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); @@ -96610,11 +96610,11 @@ var require_client_streaming_call = __commonJS({ "use strict"; var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { - return value instanceof P ? value : new P(function(resolve6) { - resolve6(value); + return value instanceof P ? value : new P(function(resolve5) { + resolve5(value); }); } - return new (P || (P = Promise))(function(resolve6, reject) { + return new (P || (P = Promise))(function(resolve5, reject) { function fulfilled(value) { try { step(generator.next(value)); @@ -96630,7 +96630,7 @@ var require_client_streaming_call = __commonJS({ } } function step(result) { - result.done ? resolve6(result.value) : adopt(result.value).then(fulfilled, rejected); + result.done ? resolve5(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); @@ -96679,11 +96679,11 @@ var require_duplex_streaming_call = __commonJS({ "use strict"; var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { - return value instanceof P ? value : new P(function(resolve6) { - resolve6(value); + return value instanceof P ? value : new P(function(resolve5) { + resolve5(value); }); } - return new (P || (P = Promise))(function(resolve6, reject) { + return new (P || (P = Promise))(function(resolve5, reject) { function fulfilled(value) { try { step(generator.next(value)); @@ -96699,7 +96699,7 @@ var require_duplex_streaming_call = __commonJS({ } } function step(result) { - result.done ? resolve6(result.value) : adopt(result.value).then(fulfilled, rejected); + result.done ? resolve5(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); @@ -96747,11 +96747,11 @@ var require_test_transport = __commonJS({ "use strict"; var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { - return value instanceof P ? value : new P(function(resolve6) { - resolve6(value); + return value instanceof P ? value : new P(function(resolve5) { + resolve5(value); }); } - return new (P || (P = Promise))(function(resolve6, reject) { + return new (P || (P = Promise))(function(resolve5, reject) { function fulfilled(value) { try { step(generator.next(value)); @@ -96767,7 +96767,7 @@ var require_test_transport = __commonJS({ } } function step(result) { - result.done ? resolve6(result.value) : adopt(result.value).then(fulfilled, rejected); + result.done ? resolve5(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); @@ -96964,11 +96964,11 @@ var require_test_transport = __commonJS({ responseTrailer: "test" }; function delay2(ms, abort) { - return (v) => new Promise((resolve6, reject) => { + return (v) => new Promise((resolve5, reject) => { if (abort === null || abort === void 0 ? void 0 : abort.aborted) { reject(new rpc_error_1.RpcError("user cancel", "CANCELLED")); } else { - const id = setTimeout(() => resolve6(v), ms); + const id = setTimeout(() => resolve5(v), ms); if (abort) { abort.addEventListener("abort", (ev) => { clearTimeout(id); @@ -97966,11 +97966,11 @@ var require_cacheTwirpClient = __commonJS({ "use strict"; var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { - return value instanceof P ? value : new P(function(resolve6) { - resolve6(value); + return value instanceof P ? value : new P(function(resolve5) { + resolve5(value); }); } - return new (P || (P = Promise))(function(resolve6, reject) { + return new (P || (P = Promise))(function(resolve5, reject) { function fulfilled(value) { try { step(generator.next(value)); @@ -97986,7 +97986,7 @@ var require_cacheTwirpClient = __commonJS({ } } function step(result) { - result.done ? resolve6(result.value) : adopt(result.value).then(fulfilled, rejected); + result.done ? resolve5(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); @@ -98126,7 +98126,7 @@ var require_cacheTwirpClient = __commonJS({ } sleep(milliseconds) { return __awaiter2(this, void 0, void 0, function* () { - return new Promise((resolve6) => setTimeout(resolve6, milliseconds)); + return new Promise((resolve5) => setTimeout(resolve5, milliseconds)); }); } getExponentialRetryTimeMilliseconds(attempt) { @@ -98191,11 +98191,11 @@ var require_tar = __commonJS({ })(); var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { - return value instanceof P ? value : new P(function(resolve6) { - resolve6(value); + return value instanceof P ? value : new P(function(resolve5) { + resolve5(value); }); } - return new (P || (P = Promise))(function(resolve6, reject) { + return new (P || (P = Promise))(function(resolve5, reject) { function fulfilled(value) { try { step(generator.next(value)); @@ -98211,7 +98211,7 @@ var require_tar = __commonJS({ } } function step(result) { - result.done ? resolve6(result.value) : adopt(result.value).then(fulfilled, rejected); + result.done ? resolve5(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); @@ -98223,7 +98223,7 @@ var require_tar = __commonJS({ var exec_1 = require_exec(); var io6 = __importStar2(require_io()); var fs_1 = require("fs"); - var path12 = __importStar2(require("path")); + var path11 = __importStar2(require("path")); var utils = __importStar2(require_cacheUtils()); var constants_1 = require_constants12(); var IS_WINDOWS = process.platform === "win32"; @@ -98269,13 +98269,13 @@ var require_tar = __commonJS({ const BSD_TAR_ZSTD = tarPath.type === constants_1.ArchiveToolType.BSD && compressionMethod !== constants_1.CompressionMethod.Gzip && IS_WINDOWS; switch (type2) { case "create": - args.push("--posix", "-cf", BSD_TAR_ZSTD ? tarFile : cacheFileName.replace(new RegExp(`\\${path12.sep}`, "g"), "/"), "--exclude", BSD_TAR_ZSTD ? tarFile : cacheFileName.replace(new RegExp(`\\${path12.sep}`, "g"), "/"), "-P", "-C", workingDirectory.replace(new RegExp(`\\${path12.sep}`, "g"), "/"), "--files-from", constants_1.ManifestFilename); + args.push("--posix", "-cf", BSD_TAR_ZSTD ? tarFile : cacheFileName.replace(new RegExp(`\\${path11.sep}`, "g"), "/"), "--exclude", BSD_TAR_ZSTD ? tarFile : cacheFileName.replace(new RegExp(`\\${path11.sep}`, "g"), "/"), "-P", "-C", workingDirectory.replace(new RegExp(`\\${path11.sep}`, "g"), "/"), "--files-from", constants_1.ManifestFilename); break; case "extract": - args.push("-xf", BSD_TAR_ZSTD ? tarFile : archivePath.replace(new RegExp(`\\${path12.sep}`, "g"), "/"), "-P", "-C", workingDirectory.replace(new RegExp(`\\${path12.sep}`, "g"), "/")); + args.push("-xf", BSD_TAR_ZSTD ? tarFile : archivePath.replace(new RegExp(`\\${path11.sep}`, "g"), "/"), "-P", "-C", workingDirectory.replace(new RegExp(`\\${path11.sep}`, "g"), "/")); break; case "list": - args.push("-tf", BSD_TAR_ZSTD ? tarFile : archivePath.replace(new RegExp(`\\${path12.sep}`, "g"), "/"), "-P"); + args.push("-tf", BSD_TAR_ZSTD ? tarFile : archivePath.replace(new RegExp(`\\${path11.sep}`, "g"), "/"), "-P"); break; } if (tarPath.type === constants_1.ArchiveToolType.GNU) { @@ -98321,7 +98321,7 @@ var require_tar = __commonJS({ return BSD_TAR_ZSTD ? [ "zstd -d --long=30 --force -o", constants_1.TarFilename, - archivePath.replace(new RegExp(`\\${path12.sep}`, "g"), "/") + archivePath.replace(new RegExp(`\\${path11.sep}`, "g"), "/") ] : [ "--use-compress-program", IS_WINDOWS ? '"zstd -d --long=30"' : "unzstd --long=30" @@ -98330,7 +98330,7 @@ var require_tar = __commonJS({ return BSD_TAR_ZSTD ? [ "zstd -d --force -o", constants_1.TarFilename, - archivePath.replace(new RegExp(`\\${path12.sep}`, "g"), "/") + archivePath.replace(new RegExp(`\\${path11.sep}`, "g"), "/") ] : ["--use-compress-program", IS_WINDOWS ? '"zstd -d"' : "unzstd"]; default: return ["-z"]; @@ -98345,7 +98345,7 @@ var require_tar = __commonJS({ case constants_1.CompressionMethod.Zstd: return BSD_TAR_ZSTD ? [ "zstd -T0 --long=30 --force -o", - cacheFileName.replace(new RegExp(`\\${path12.sep}`, "g"), "/"), + cacheFileName.replace(new RegExp(`\\${path11.sep}`, "g"), "/"), constants_1.TarFilename ] : [ "--use-compress-program", @@ -98354,7 +98354,7 @@ var require_tar = __commonJS({ case constants_1.CompressionMethod.ZstdWithoutLong: return BSD_TAR_ZSTD ? [ "zstd -T0 --force -o", - cacheFileName.replace(new RegExp(`\\${path12.sep}`, "g"), "/"), + cacheFileName.replace(new RegExp(`\\${path11.sep}`, "g"), "/"), constants_1.TarFilename ] : ["--use-compress-program", IS_WINDOWS ? '"zstd -T0"' : "zstdmt"]; default: @@ -98392,7 +98392,7 @@ var require_tar = __commonJS({ } function createTar(archiveFolder, sourceDirectories, compressionMethod) { return __awaiter2(this, void 0, void 0, function* () { - (0, fs_1.writeFileSync)(path12.join(archiveFolder, constants_1.ManifestFilename), sourceDirectories.join("\n")); + (0, fs_1.writeFileSync)(path11.join(archiveFolder, constants_1.ManifestFilename), sourceDirectories.join("\n")); const commands = yield getCommands(compressionMethod, "create"); yield execCommands(commands, archiveFolder); }); @@ -98443,11 +98443,11 @@ var require_cache5 = __commonJS({ })(); var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { - return value instanceof P ? value : new P(function(resolve6) { - resolve6(value); + return value instanceof P ? value : new P(function(resolve5) { + resolve5(value); }); } - return new (P || (P = Promise))(function(resolve6, reject) { + return new (P || (P = Promise))(function(resolve5, reject) { function fulfilled(value) { try { step(generator.next(value)); @@ -98463,7 +98463,7 @@ var require_cache5 = __commonJS({ } } function step(result) { - result.done ? resolve6(result.value) : adopt(result.value).then(fulfilled, rejected); + result.done ? resolve5(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); @@ -98474,7 +98474,7 @@ var require_cache5 = __commonJS({ exports2.restoreCache = restoreCache3; exports2.saveCache = saveCache3; var core12 = __importStar2(require_core()); - var path12 = __importStar2(require("path")); + var path11 = __importStar2(require("path")); var utils = __importStar2(require_cacheUtils()); var cacheHttpClient = __importStar2(require_cacheHttpClient()); var cacheTwirpClient = __importStar2(require_cacheTwirpClient()); @@ -98569,7 +98569,7 @@ var require_cache5 = __commonJS({ core12.info("Lookup only - skipping download"); return cacheEntry.cacheKey; } - archivePath = path12.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod)); + archivePath = path11.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod)); core12.debug(`Archive Path: ${archivePath}`); yield cacheHttpClient.downloadCache(cacheEntry.archiveLocation, archivePath, options); if (core12.isDebug()) { @@ -98638,7 +98638,7 @@ var require_cache5 = __commonJS({ core12.info("Lookup only - skipping download"); return response.matchedKey; } - archivePath = path12.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod)); + archivePath = path11.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod)); core12.debug(`Archive path: ${archivePath}`); core12.debug(`Starting download of archive to: ${archivePath}`); yield cacheHttpClient.downloadCache(response.signedDownloadUrl, archivePath, options); @@ -98700,7 +98700,7 @@ var require_cache5 = __commonJS({ throw new Error(`Path Validation Error: Path(s) specified in the action for caching do(es) not exist, hence no cache is being saved.`); } const archiveFolder = yield utils.createTempDirectory(); - const archivePath = path12.join(archiveFolder, utils.getCacheFileName(compressionMethod)); + const archivePath = path11.join(archiveFolder, utils.getCacheFileName(compressionMethod)); core12.debug(`Archive Path: ${archivePath}`); try { yield (0, tar_1.createTar)(archiveFolder, cachePaths, compressionMethod); @@ -98764,7 +98764,7 @@ var require_cache5 = __commonJS({ throw new Error(`Path Validation Error: Path(s) specified in the action for caching do(es) not exist, hence no cache is being saved.`); } const archiveFolder = yield utils.createTempDirectory(); - const archivePath = path12.join(archiveFolder, utils.getCacheFileName(compressionMethod)); + const archivePath = path11.join(archiveFolder, utils.getCacheFileName(compressionMethod)); core12.debug(`Archive Path: ${archivePath}`); try { yield (0, tar_1.createTar)(archiveFolder, cachePaths, compressionMethod); @@ -98881,11 +98881,11 @@ var require_manifest = __commonJS({ })(); var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { - return value instanceof P ? value : new P(function(resolve6) { - resolve6(value); + return value instanceof P ? value : new P(function(resolve5) { + resolve5(value); }); } - return new (P || (P = Promise))(function(resolve6, reject) { + return new (P || (P = Promise))(function(resolve5, reject) { function fulfilled(value) { try { step(generator.next(value)); @@ -98901,7 +98901,7 @@ var require_manifest = __commonJS({ } } function step(result) { - result.done ? resolve6(result.value) : adopt(result.value).then(fulfilled, rejected); + result.done ? resolve5(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); @@ -98914,7 +98914,7 @@ var require_manifest = __commonJS({ var core_1 = require_core(); var os2 = require("os"); var cp = require("child_process"); - var fs12 = require("fs"); + var fs11 = require("fs"); function _findMatch(versionSpec, stable, candidates, archFilter) { return __awaiter2(this, void 0, void 0, function* () { const platFilter = os2.platform(); @@ -98976,10 +98976,10 @@ var require_manifest = __commonJS({ const lsbReleaseFile = "/etc/lsb-release"; const osReleaseFile = "/etc/os-release"; let contents = ""; - if (fs12.existsSync(lsbReleaseFile)) { - contents = fs12.readFileSync(lsbReleaseFile).toString(); - } else if (fs12.existsSync(osReleaseFile)) { - contents = fs12.readFileSync(osReleaseFile).toString(); + if (fs11.existsSync(lsbReleaseFile)) { + contents = fs11.readFileSync(lsbReleaseFile).toString(); + } else if (fs11.existsSync(osReleaseFile)) { + contents = fs11.readFileSync(osReleaseFile).toString(); } return contents; } @@ -99029,11 +99029,11 @@ var require_retry_helper = __commonJS({ })(); var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { - return value instanceof P ? value : new P(function(resolve6) { - resolve6(value); + return value instanceof P ? value : new P(function(resolve5) { + resolve5(value); }); } - return new (P || (P = Promise))(function(resolve6, reject) { + return new (P || (P = Promise))(function(resolve5, reject) { function fulfilled(value) { try { step(generator.next(value)); @@ -99049,7 +99049,7 @@ var require_retry_helper = __commonJS({ } } function step(result) { - result.done ? resolve6(result.value) : adopt(result.value).then(fulfilled, rejected); + result.done ? resolve5(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); @@ -99094,7 +99094,7 @@ var require_retry_helper = __commonJS({ } sleep(seconds) { return __awaiter2(this, void 0, void 0, function* () { - return new Promise((resolve6) => setTimeout(resolve6, seconds * 1e3)); + return new Promise((resolve5) => setTimeout(resolve5, seconds * 1e3)); }); } }; @@ -99145,11 +99145,11 @@ var require_tool_cache = __commonJS({ })(); var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { - return value instanceof P ? value : new P(function(resolve6) { - resolve6(value); + return value instanceof P ? value : new P(function(resolve5) { + resolve5(value); }); } - return new (P || (P = Promise))(function(resolve6, reject) { + return new (P || (P = Promise))(function(resolve5, reject) { function fulfilled(value) { try { step(generator.next(value)); @@ -99165,7 +99165,7 @@ var require_tool_cache = __commonJS({ } } function step(result) { - result.done ? resolve6(result.value) : adopt(result.value).then(fulfilled, rejected); + result.done ? resolve5(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); @@ -99188,10 +99188,10 @@ var require_tool_cache = __commonJS({ var core12 = __importStar2(require_core()); var io6 = __importStar2(require_io()); var crypto2 = __importStar2(require("crypto")); - var fs12 = __importStar2(require("fs")); + var fs11 = __importStar2(require("fs")); var mm = __importStar2(require_manifest()); var os2 = __importStar2(require("os")); - var path12 = __importStar2(require("path")); + var path11 = __importStar2(require("path")); var httpm = __importStar2(require_lib()); var semver9 = __importStar2(require_semver2()); var stream2 = __importStar2(require("stream")); @@ -99212,8 +99212,8 @@ var require_tool_cache = __commonJS({ var userAgent2 = "actions/tool-cache"; function downloadTool2(url2, dest, auth2, headers) { return __awaiter2(this, void 0, void 0, function* () { - dest = dest || path12.join(_getTempDirectory(), crypto2.randomUUID()); - yield io6.mkdirP(path12.dirname(dest)); + dest = dest || path11.join(_getTempDirectory(), crypto2.randomUUID()); + yield io6.mkdirP(path11.dirname(dest)); core12.debug(`Downloading ${url2}`); core12.debug(`Destination ${dest}`); const maxAttempts = 3; @@ -99234,7 +99234,7 @@ var require_tool_cache = __commonJS({ } function downloadToolAttempt(url2, dest, auth2, headers) { return __awaiter2(this, void 0, void 0, function* () { - if (fs12.existsSync(dest)) { + if (fs11.existsSync(dest)) { throw new Error(`Destination file path ${dest} already exists`); } const http = new httpm.HttpClient(userAgent2, [], { @@ -99258,7 +99258,7 @@ var require_tool_cache = __commonJS({ const readStream = responseMessageFactory(); let succeeded = false; try { - yield pipeline(readStream, fs12.createWriteStream(dest)); + yield pipeline(readStream, fs11.createWriteStream(dest)); core12.debug("download complete"); succeeded = true; return dest; @@ -99303,7 +99303,7 @@ var require_tool_cache = __commonJS({ process.chdir(originalCwd); } } else { - const escapedScript = path12.join(__dirname, "..", "scripts", "Invoke-7zdec.ps1").replace(/'/g, "''").replace(/"|\n|\r/g, ""); + const escapedScript = path11.join(__dirname, "..", "scripts", "Invoke-7zdec.ps1").replace(/'/g, "''").replace(/"|\n|\r/g, ""); 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}'`; @@ -99470,12 +99470,12 @@ var require_tool_cache = __commonJS({ arch2 = arch2 || os2.arch(); core12.debug(`Caching tool ${tool} ${version} ${arch2}`); core12.debug(`source dir: ${sourceDir}`); - if (!fs12.statSync(sourceDir).isDirectory()) { + if (!fs11.statSync(sourceDir).isDirectory()) { throw new Error("sourceDir is not a directory"); } const destPath = yield _createToolPath(tool, version, arch2); - for (const itemName of fs12.readdirSync(sourceDir)) { - const s = path12.join(sourceDir, itemName); + for (const itemName of fs11.readdirSync(sourceDir)) { + const s = path11.join(sourceDir, itemName); yield io6.cp(s, destPath, { recursive: true }); } _completeToolPath(tool, version, arch2); @@ -99488,11 +99488,11 @@ var require_tool_cache = __commonJS({ arch2 = arch2 || os2.arch(); core12.debug(`Caching tool ${tool} ${version} ${arch2}`); core12.debug(`source file: ${sourceFile}`); - if (!fs12.statSync(sourceFile).isFile()) { + if (!fs11.statSync(sourceFile).isFile()) { throw new Error("sourceFile is not a file"); } const destFolder = yield _createToolPath(tool, version, arch2); - const destPath = path12.join(destFolder, targetFile); + const destPath = path11.join(destFolder, targetFile); core12.debug(`destination file ${destPath}`); yield io6.cp(sourceFile, destPath); _completeToolPath(tool, version, arch2); @@ -99515,9 +99515,9 @@ var require_tool_cache = __commonJS({ let toolPath = ""; if (versionSpec) { versionSpec = semver9.clean(versionSpec) || ""; - const cachePath = path12.join(_getCacheDirectory(), toolName, versionSpec, arch2); + const cachePath = path11.join(_getCacheDirectory(), toolName, versionSpec, arch2); core12.debug(`checking cache: ${cachePath}`); - if (fs12.existsSync(cachePath) && fs12.existsSync(`${cachePath}.complete`)) { + if (fs11.existsSync(cachePath) && fs11.existsSync(`${cachePath}.complete`)) { core12.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch2}`); toolPath = cachePath; } else { @@ -99529,13 +99529,13 @@ var require_tool_cache = __commonJS({ function findAllVersions2(toolName, arch2) { const versions = []; arch2 = arch2 || os2.arch(); - const toolPath = path12.join(_getCacheDirectory(), toolName); - if (fs12.existsSync(toolPath)) { - const children = fs12.readdirSync(toolPath); + const toolPath = path11.join(_getCacheDirectory(), toolName); + if (fs11.existsSync(toolPath)) { + const children = fs11.readdirSync(toolPath); for (const child of children) { if (isExplicitVersion(child)) { - const fullPath = path12.join(toolPath, child, arch2 || ""); - if (fs12.existsSync(fullPath) && fs12.existsSync(`${fullPath}.complete`)) { + const fullPath = path11.join(toolPath, child, arch2 || ""); + if (fs11.existsSync(fullPath) && fs11.existsSync(`${fullPath}.complete`)) { versions.push(child); } } @@ -99586,7 +99586,7 @@ var require_tool_cache = __commonJS({ function _createExtractFolder(dest) { return __awaiter2(this, void 0, void 0, function* () { if (!dest) { - dest = path12.join(_getTempDirectory(), crypto2.randomUUID()); + dest = path11.join(_getTempDirectory(), crypto2.randomUUID()); } yield io6.mkdirP(dest); return dest; @@ -99594,7 +99594,7 @@ var require_tool_cache = __commonJS({ } function _createToolPath(tool, version, arch2) { return __awaiter2(this, void 0, void 0, function* () { - const folderPath = path12.join(_getCacheDirectory(), tool, semver9.clean(version) || version, arch2 || ""); + const folderPath = path11.join(_getCacheDirectory(), tool, semver9.clean(version) || version, arch2 || ""); core12.debug(`destination ${folderPath}`); const markerPath = `${folderPath}.complete`; yield io6.rmRF(folderPath); @@ -99604,9 +99604,9 @@ var require_tool_cache = __commonJS({ }); } function _completeToolPath(tool, version, arch2) { - const folderPath = path12.join(_getCacheDirectory(), tool, semver9.clean(version) || version, arch2 || ""); + const folderPath = path11.join(_getCacheDirectory(), tool, semver9.clean(version) || version, arch2 || ""); const markerPath = `${folderPath}.complete`; - fs12.writeFileSync(markerPath, ""); + fs11.writeFileSync(markerPath, ""); core12.debug("finished caching tool"); } function isExplicitVersion(versionSpec) { @@ -103131,8 +103131,8 @@ __export(upload_lib_exports, { writePostProcessedFiles: () => writePostProcessedFiles }); module.exports = __toCommonJS(upload_lib_exports); -var fs11 = __toESM(require("fs")); -var path11 = __toESM(require("path")); +var fs10 = __toESM(require("fs")); +var path10 = __toESM(require("path")); var url = __toESM(require("url")); var import_zlib = __toESM(require("zlib")); var core11 = __toESM(require_core()); @@ -103160,21 +103160,21 @@ async function getFolderSize(itemPath, options) { getFolderSize.loose = async (itemPath, options) => await core(itemPath, options); getFolderSize.strict = async (itemPath, options) => await core(itemPath, options, { strict: true }); async function core(rootItemPath, options = {}, returnType = {}) { - const fs12 = options.fs || await import("node:fs/promises"); + const fs11 = options.fs || await import("node:fs/promises"); let folderSize = 0n; const foundInos = /* @__PURE__ */ new Set(); const errors = []; await processItem(rootItemPath); async function processItem(itemPath) { if (options.ignore?.test(itemPath)) return; - const stats = returnType.strict ? await fs12.lstat(itemPath, { bigint: true }) : await fs12.lstat(itemPath, { bigint: true }).catch((error3) => errors.push(error3)); + const stats = returnType.strict ? await fs11.lstat(itemPath, { bigint: true }) : await fs11.lstat(itemPath, { bigint: true }).catch((error3) => errors.push(error3)); if (typeof stats !== "object") return; if (!foundInos.has(stats.ino)) { foundInos.add(stats.ino); folderSize += stats.size; } if (stats.isDirectory()) { - const directoryItems = returnType.strict ? await fs12.readdir(itemPath) : await fs12.readdir(itemPath).catch((error3) => errors.push(error3)); + const directoryItems = returnType.strict ? await fs11.readdir(itemPath) : await fs11.readdir(itemPath).catch((error3) => errors.push(error3)); if (typeof directoryItems !== "object") return; await Promise.all( directoryItems.map( @@ -105921,8 +105921,8 @@ function getBaseDatabaseOidsFilePath(config) { } async function delay(milliseconds, opts) { const { allowProcessExit } = opts || {}; - return new Promise((resolve6) => { - const timer = setTimeout(resolve6, milliseconds); + return new Promise((resolve5) => { + const timer = setTimeout(resolve5, milliseconds); if (allowProcessExit) { timer.unref(); } @@ -106459,6 +106459,1688 @@ function wrapApiConfigurationError(e) { return e; } +// src/diff-informed-analysis-utils.ts +var fs4 = __toESM(require("fs")); +var path4 = __toESM(require("path")); + +// src/feature-flags.ts +var semver4 = __toESM(require_semver2()); + +// src/defaults.json +var bundleVersion = "codeql-bundle-v2.24.2"; +var cliVersion = "2.24.2"; + +// src/overlay-database-utils.ts +var fs3 = __toESM(require("fs")); +var path3 = __toESM(require("path")); +var actionsCache = __toESM(require_cache5()); + +// src/caching-utils.ts +var core6 = __toESM(require_core()); + +// src/git-utils.ts +var core7 = __toESM(require_core()); +var toolrunner2 = __toESM(require_toolrunner()); +var io3 = __toESM(require_io()); +var semver2 = __toESM(require_semver2()); +var runGitCommand = async function(workingDirectory, args, customErrorMessage, options) { + let stdout = ""; + let stderr = ""; + core7.debug(`Running git command: git ${args.join(" ")}`); + try { + await new toolrunner2.ToolRunner(await io3.which("git", true), args, { + silent: true, + listeners: { + stdout: (data) => { + stdout += data.toString(); + }, + stderr: (data) => { + stderr += data.toString(); + } + }, + cwd: workingDirectory, + ...options + }).exec(); + return stdout; + } catch (error3) { + let reason = stderr; + if (stderr.includes("not a git repository")) { + reason = "The checkout path provided to the action does not appear to be a git repository."; + } + core7.info(`git call failed. ${customErrorMessage} Error: ${reason}`); + throw error3; + } +}; +var getCommitOid = async function(checkoutPath, ref = "HEAD") { + try { + const stdout = await runGitCommand( + checkoutPath, + ["rev-parse", ref], + "Continuing with commit SHA from user input or environment." + ); + return stdout.trim(); + } catch { + return getOptionalInput("sha") || getRequiredEnvParam("GITHUB_SHA"); + } +}; +var determineBaseBranchHeadCommitOid = async function(checkoutPathOverride) { + if (getWorkflowEventName() !== "pull_request") { + return void 0; + } + const mergeSha = getRequiredEnvParam("GITHUB_SHA"); + const checkoutPath = checkoutPathOverride ?? getOptionalInput("checkout_path"); + try { + let commitOid = ""; + let baseOid = ""; + let headOid = ""; + const stdout = await runGitCommand( + checkoutPath, + ["show", "-s", "--format=raw", mergeSha], + "Will calculate the base branch SHA on the server." + ); + for (const data of stdout.split("\n")) { + if (data.startsWith("commit ") && commitOid === "") { + commitOid = data.substring(7); + } else if (data.startsWith("parent ")) { + if (baseOid === "") { + baseOid = data.substring(7); + } else if (headOid === "") { + headOid = data.substring(7); + } + } + } + if (commitOid === mergeSha && headOid.length === 40 && baseOid.length === 40) { + return baseOid; + } + return void 0; + } catch { + return void 0; + } +}; +var decodeGitFilePath = function(filePath) { + if (filePath.startsWith('"') && filePath.endsWith('"')) { + filePath = filePath.substring(1, filePath.length - 1); + return filePath.replace( + /\\([abfnrtv\\"]|[0-7]{1,3})/g, + (_match, seq2) => { + switch (seq2[0]) { + case "a": + return "\x07"; + case "b": + return "\b"; + case "f": + return "\f"; + case "n": + return "\n"; + case "r": + return "\r"; + case "t": + return " "; + case "v": + return "\v"; + case "\\": + return "\\"; + case '"': + return '"'; + default: + return String.fromCharCode(parseInt(seq2, 8)); + } + } + ); + } + return filePath; +}; +var getFileOidsUnderPath = async function(basePath) { + const stdout = await runGitCommand( + basePath, + ["ls-files", "--recurse-submodules", "--format=%(objectname)_%(path)"], + "Cannot list Git OIDs of tracked files." + ); + const fileOidMap = {}; + const regex = /^([0-9a-f]{40})_(.+)$/; + for (const line of stdout.split("\n")) { + if (line) { + const match = line.match(regex); + if (match) { + const oid = match[1]; + const path11 = decodeGitFilePath(match[2]); + fileOidMap[path11] = oid; + } else { + throw new Error(`Unexpected "git ls-files" output: ${line}`); + } + } + } + return fileOidMap; +}; +function getRefFromEnv() { + let refEnv; + try { + refEnv = getRequiredEnvParam("GITHUB_REF"); + } catch (e) { + const maybeRef = process.env["CODE_SCANNING_REF"]; + if (maybeRef === void 0 || maybeRef.length === 0) { + throw e; + } + refEnv = maybeRef; + } + return refEnv; +} +async function getRef() { + const refInput = getOptionalInput("ref"); + const shaInput = getOptionalInput("sha"); + const checkoutPath = getOptionalInput("checkout_path") || getOptionalInput("source-root") || getRequiredEnvParam("GITHUB_WORKSPACE"); + const hasRefInput = !!refInput; + const hasShaInput = !!shaInput; + if ((hasRefInput || hasShaInput) && !(hasRefInput && hasShaInput)) { + throw new ConfigurationError( + "Both 'ref' and 'sha' are required if one of them is provided." + ); + } + const ref = refInput || getRefFromEnv(); + const sha = shaInput || getRequiredEnvParam("GITHUB_SHA"); + if (refInput) { + return refInput; + } + const pull_ref_regex = /refs\/pull\/(\d+)\/merge/; + if (!pull_ref_regex.test(ref)) { + return ref; + } + const head = await getCommitOid(checkoutPath, "HEAD"); + const hasChangedRef = sha !== head && await getCommitOid( + checkoutPath, + ref.replace(/^refs\/pull\//, "refs/remotes/pull/") + ) !== head; + if (hasChangedRef) { + const newRef = ref.replace(pull_ref_regex, "refs/pull/$1/head"); + core7.debug( + `No longer on merge commit, rewriting ref from ${ref} to ${newRef}.` + ); + return newRef; + } else { + return ref; + } +} +function removeRefsHeadsPrefix(ref) { + return ref.startsWith("refs/heads/") ? ref.slice("refs/heads/".length) : ref; +} +async function isAnalyzingDefaultBranch() { + if (process.env.CODE_SCANNING_IS_ANALYZING_DEFAULT_BRANCH === "true") { + return true; + } + let currentRef = await getRef(); + currentRef = removeRefsHeadsPrefix(currentRef); + const event = getWorkflowEvent(); + let defaultBranch = event?.repository?.default_branch; + if (getWorkflowEventName() === "schedule") { + defaultBranch = removeRefsHeadsPrefix(getRefFromEnv()); + } + return currentRef === defaultBranch; +} + +// src/logging.ts +var core8 = __toESM(require_core()); +function getActionsLogger() { + return { + debug: core8.debug, + info: core8.info, + warning: core8.warning, + error: core8.error, + isDebug: core8.isDebug, + startGroup: core8.startGroup, + endGroup: core8.endGroup + }; +} +function formatDuration(durationMs) { + if (durationMs < 1e3) { + return `${durationMs}ms`; + } + if (durationMs < 60 * 1e3) { + return `${(durationMs / 1e3).toFixed(1)}s`; + } + const minutes = Math.floor(durationMs / (60 * 1e3)); + const seconds = Math.floor(durationMs % (60 * 1e3) / 1e3); + return `${minutes}m${seconds}s`; +} + +// src/overlay-database-utils.ts +var CODEQL_OVERLAY_MINIMUM_VERSION = "2.23.8"; +var OVERLAY_BASE_DATABASE_MAX_UPLOAD_SIZE_MB = 7500; +var OVERLAY_BASE_DATABASE_MAX_UPLOAD_SIZE_BYTES = OVERLAY_BASE_DATABASE_MAX_UPLOAD_SIZE_MB * 1e6; +async function writeBaseDatabaseOidsFile(config, sourceRoot) { + const gitFileOids = await getFileOidsUnderPath(sourceRoot); + const gitFileOidsJson = JSON.stringify(gitFileOids); + const baseDatabaseOidsFilePath = getBaseDatabaseOidsFilePath(config); + await fs3.promises.writeFile(baseDatabaseOidsFilePath, gitFileOidsJson); +} +async function readBaseDatabaseOidsFile(config, logger) { + const baseDatabaseOidsFilePath = getBaseDatabaseOidsFilePath(config); + try { + const contents = await fs3.promises.readFile( + baseDatabaseOidsFilePath, + "utf-8" + ); + return JSON.parse(contents); + } catch (e) { + logger.error( + `Failed to read overlay-base file OIDs from ${baseDatabaseOidsFilePath}: ${e.message || e}` + ); + throw e; + } +} +async function writeOverlayChangesFile(config, sourceRoot, logger) { + const baseFileOids = await readBaseDatabaseOidsFile(config, logger); + const overlayFileOids = await getFileOidsUnderPath(sourceRoot); + const changedFiles = computeChangedFiles(baseFileOids, overlayFileOids); + logger.info( + `Found ${changedFiles.length} changed file(s) under ${sourceRoot}.` + ); + const changedFilesJson = JSON.stringify({ changes: changedFiles }); + const overlayChangesFile = path3.join( + getTemporaryDirectory(), + "overlay-changes.json" + ); + logger.debug( + `Writing overlay changed files to ${overlayChangesFile}: ${changedFilesJson}` + ); + await fs3.promises.writeFile(overlayChangesFile, changedFilesJson); + return overlayChangesFile; +} +function computeChangedFiles(baseFileOids, overlayFileOids) { + const changes = []; + for (const [file, oid] of Object.entries(overlayFileOids)) { + if (!(file in baseFileOids) || baseFileOids[file] !== oid) { + changes.push(file); + } + } + for (const file of Object.keys(baseFileOids)) { + if (!(file in overlayFileOids)) { + changes.push(file); + } + } + return changes; +} + +// src/tools-features.ts +var semver3 = __toESM(require_semver2()); +function isSupportedToolsFeature(versionInfo, feature) { + return !!versionInfo.features && versionInfo.features[feature]; +} + +// src/feature-flags.ts +var CODEQL_VERSION_ZSTD_BUNDLE = "2.19.0"; +var featureConfig = { + ["allow_toolcache_input" /* AllowToolcacheInput */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_ALLOW_TOOLCACHE_INPUT", + minimumVersion: void 0 + }, + ["cleanup_trap_caches" /* CleanupTrapCaches */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_CLEANUP_TRAP_CACHES", + minimumVersion: void 0 + }, + ["cpp_dependency_installation_enabled" /* CppDependencyInstallation */]: { + defaultValue: false, + envVar: "CODEQL_EXTRACTOR_CPP_AUTOINSTALL_DEPENDENCIES", + legacyApi: true, + minimumVersion: "2.15.0" + }, + ["csharp_cache_bmn" /* CsharpCacheBuildModeNone */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_CSHARP_CACHE_BMN", + minimumVersion: void 0 + }, + ["csharp_new_cache_key" /* CsharpNewCacheKey */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_CSHARP_NEW_CACHE_KEY", + minimumVersion: void 0 + }, + ["diff_informed_queries" /* DiffInformedQueries */]: { + defaultValue: true, + envVar: "CODEQL_ACTION_DIFF_INFORMED_QUERIES", + minimumVersion: "2.21.0" + }, + ["disable_csharp_buildless" /* DisableCsharpBuildless */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_DISABLE_CSHARP_BUILDLESS", + minimumVersion: void 0 + }, + ["disable_java_buildless_enabled" /* DisableJavaBuildlessEnabled */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_DISABLE_JAVA_BUILDLESS", + legacyApi: true, + minimumVersion: void 0 + }, + ["disable_kotlin_analysis_enabled" /* DisableKotlinAnalysisEnabled */]: { + defaultValue: false, + envVar: "CODEQL_DISABLE_KOTLIN_ANALYSIS", + legacyApi: true, + minimumVersion: void 0 + }, + ["export_diagnostics_enabled" /* ExportDiagnosticsEnabled */]: { + defaultValue: true, + envVar: "CODEQL_ACTION_EXPORT_DIAGNOSTICS", + legacyApi: true, + minimumVersion: void 0 + }, + ["force_nightly" /* ForceNightly */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_FORCE_NIGHTLY", + minimumVersion: void 0 + }, + ["ignore_generated_files" /* IgnoreGeneratedFiles */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_IGNORE_GENERATED_FILES", + minimumVersion: void 0 + }, + ["improved_proxy_certificates" /* ImprovedProxyCertificates */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_IMPROVED_PROXY_CERTIFICATES", + minimumVersion: void 0 + }, + ["java_network_debugging" /* JavaNetworkDebugging */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_JAVA_NETWORK_DEBUGGING", + minimumVersion: void 0 + }, + ["overlay_analysis" /* OverlayAnalysis */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS", + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION + }, + ["overlay_analysis_actions" /* OverlayAnalysisActions */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_ACTIONS", + minimumVersion: void 0 + }, + ["overlay_analysis_code_scanning_actions" /* OverlayAnalysisCodeScanningActions */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_ACTIONS", + minimumVersion: void 0 + }, + ["overlay_analysis_code_scanning_cpp" /* OverlayAnalysisCodeScanningCpp */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_CPP", + minimumVersion: void 0 + }, + ["overlay_analysis_code_scanning_csharp" /* OverlayAnalysisCodeScanningCsharp */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_CSHARP", + minimumVersion: void 0 + }, + ["overlay_analysis_code_scanning_go" /* OverlayAnalysisCodeScanningGo */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_GO", + minimumVersion: void 0 + }, + ["overlay_analysis_code_scanning_java" /* OverlayAnalysisCodeScanningJava */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_JAVA", + minimumVersion: void 0 + }, + ["overlay_analysis_code_scanning_javascript" /* OverlayAnalysisCodeScanningJavascript */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_JAVASCRIPT", + minimumVersion: void 0 + }, + ["overlay_analysis_code_scanning_python" /* OverlayAnalysisCodeScanningPython */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_PYTHON", + minimumVersion: void 0 + }, + ["overlay_analysis_code_scanning_ruby" /* OverlayAnalysisCodeScanningRuby */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_RUBY", + minimumVersion: void 0 + }, + ["overlay_analysis_code_scanning_rust" /* OverlayAnalysisCodeScanningRust */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_RUST", + minimumVersion: void 0 + }, + ["overlay_analysis_code_scanning_swift" /* OverlayAnalysisCodeScanningSwift */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_SWIFT", + minimumVersion: void 0 + }, + ["overlay_analysis_cpp" /* OverlayAnalysisCpp */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CPP", + minimumVersion: void 0 + }, + ["overlay_analysis_csharp" /* OverlayAnalysisCsharp */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CSHARP", + minimumVersion: void 0 + }, + ["overlay_analysis_go" /* OverlayAnalysisGo */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_GO", + minimumVersion: void 0 + }, + ["overlay_analysis_java" /* OverlayAnalysisJava */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_JAVA", + minimumVersion: void 0 + }, + ["overlay_analysis_javascript" /* OverlayAnalysisJavascript */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_JAVASCRIPT", + minimumVersion: void 0 + }, + ["overlay_analysis_python" /* OverlayAnalysisPython */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_PYTHON", + minimumVersion: void 0 + }, + ["overlay_analysis_ruby" /* OverlayAnalysisRuby */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_RUBY", + minimumVersion: void 0 + }, + ["overlay_analysis_rust" /* OverlayAnalysisRust */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_RUST", + minimumVersion: void 0 + }, + ["overlay_analysis_skip_resource_checks" /* OverlayAnalysisSkipResourceChecks */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_SKIP_RESOURCE_CHECKS", + minimumVersion: void 0 + }, + ["overlay_analysis_swift" /* OverlayAnalysisSwift */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_SWIFT", + minimumVersion: void 0 + }, + ["python_default_is_to_not_extract_stdlib" /* PythonDefaultIsToNotExtractStdlib */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_DISABLE_PYTHON_STANDARD_LIBRARY_EXTRACTION", + minimumVersion: void 0, + toolsFeature: "pythonDefaultIsToNotExtractStdlib" /* PythonDefaultIsToNotExtractStdlib */ + }, + ["qa_telemetry_enabled" /* QaTelemetryEnabled */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_QA_TELEMETRY", + legacyApi: true, + minimumVersion: void 0 + }, + ["skip_file_coverage_on_prs" /* SkipFileCoverageOnPrs */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_SKIP_FILE_COVERAGE_ON_PRS", + // For testing, this is not behind a CLI version check yet. However + // before rolling this out externally, we should set a minimum version here + // since current versions of the CodeQL CLI will log if baseline information + // cannot be found when interpreting results. + minimumVersion: void 0 + }, + ["start_proxy_connection_checks" /* StartProxyConnectionChecks */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_START_PROXY_CONNECTION_CHECKS", + minimumVersion: void 0 + }, + ["upload_overlay_db_to_api" /* UploadOverlayDbToApi */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_UPLOAD_OVERLAY_DB_TO_API", + minimumVersion: void 0, + toolsFeature: "bundleSupportsOverlay" /* BundleSupportsOverlay */ + }, + ["use_repository_properties_v2" /* UseRepositoryProperties */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_USE_REPOSITORY_PROPERTIES", + minimumVersion: void 0 + }, + ["validate_db_config" /* ValidateDbConfig */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_VALIDATE_DB_CONFIG", + minimumVersion: void 0 + } +}; + +// src/diff-informed-analysis-utils.ts +function getDiffRangesJsonFilePath() { + return path4.join(getTemporaryDirectory(), "pr-diff-range.json"); +} +function readDiffRangesJsonFile(logger) { + const jsonFilePath = getDiffRangesJsonFilePath(); + if (!fs4.existsSync(jsonFilePath)) { + logger.debug(`Diff ranges JSON file does not exist at ${jsonFilePath}`); + return void 0; + } + const jsonContents = fs4.readFileSync(jsonFilePath, "utf8"); + logger.debug( + `Read pr-diff-range JSON file from ${jsonFilePath}: +${jsonContents}` + ); + return JSON.parse(jsonContents); +} + +// src/fingerprints.ts +var fs5 = __toESM(require("fs")); +var import_path = __toESM(require("path")); + +// node_modules/long/index.js +var wasm = null; +try { + wasm = new WebAssembly.Instance( + new WebAssembly.Module( + new Uint8Array([ + // \0asm + 0, + 97, + 115, + 109, + // version 1 + 1, + 0, + 0, + 0, + // section "type" + 1, + 13, + 2, + // 0, () => i32 + 96, + 0, + 1, + 127, + // 1, (i32, i32, i32, i32) => i32 + 96, + 4, + 127, + 127, + 127, + 127, + 1, + 127, + // section "function" + 3, + 7, + 6, + // 0, type 0 + 0, + // 1, type 1 + 1, + // 2, type 1 + 1, + // 3, type 1 + 1, + // 4, type 1 + 1, + // 5, type 1 + 1, + // section "global" + 6, + 6, + 1, + // 0, "high", mutable i32 + 127, + 1, + 65, + 0, + 11, + // section "export" + 7, + 50, + 6, + // 0, "mul" + 3, + 109, + 117, + 108, + 0, + 1, + // 1, "div_s" + 5, + 100, + 105, + 118, + 95, + 115, + 0, + 2, + // 2, "div_u" + 5, + 100, + 105, + 118, + 95, + 117, + 0, + 3, + // 3, "rem_s" + 5, + 114, + 101, + 109, + 95, + 115, + 0, + 4, + // 4, "rem_u" + 5, + 114, + 101, + 109, + 95, + 117, + 0, + 5, + // 5, "get_high" + 8, + 103, + 101, + 116, + 95, + 104, + 105, + 103, + 104, + 0, + 0, + // section "code" + 10, + 191, + 1, + 6, + // 0, "get_high" + 4, + 0, + 35, + 0, + 11, + // 1, "mul" + 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, + // 2, "div_s" + 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, + // 3, "div_u" + 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, + // 4, "rem_s" + 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, + // 5, "rem_u" + 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 { +} +function Long(low, high, unsigned) { + this.low = low | 0; + this.high = high | 0; + this.unsigned = !!unsigned; +} +Long.prototype.__isLong__; +Object.defineProperty(Long.prototype, "__isLong__", { value: true }); +function isLong(obj) { + return (obj && obj["__isLong__"]) === true; +} +function ctz32(value) { + var c = Math.clz32(value & -value); + return value ? 31 - c : c; +} +Long.isLong = isLong; +var INT_CACHE = {}; +var UINT_CACHE = {}; +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, 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; + } +} +Long.fromInt = fromInt; +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 + ); +} +Long.fromNumber = fromNumber; +function fromBits(lowBits, highBits, unsigned) { + return new Long(lowBits, highBits, unsigned); +} +Long.fromBits = fromBits; +var pow_dbl = Math.pow; +function fromString(str2, unsigned, radix) { + if (str2.length === 0) throw Error("empty string"); + if (typeof unsigned === "number") { + radix = unsigned; + unsigned = false; + } else { + unsigned = !!unsigned; + } + if (str2 === "NaN" || str2 === "Infinity" || str2 === "+Infinity" || str2 === "-Infinity") + return unsigned ? UZERO : ZERO; + radix = radix || 10; + if (radix < 2 || 36 < radix) throw RangeError("radix"); + var p; + if ((p = str2.indexOf("-")) > 0) throw Error("interior hyphen"); + else if (p === 0) { + return fromString(str2.substring(1), unsigned, radix).neg(); + } + var radixToPower = fromNumber(pow_dbl(radix, 8)); + var result = ZERO; + for (var i = 0; i < str2.length; i += 8) { + var size = Math.min(8, str2.length - i), value = parseInt(str2.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; +} +Long.fromString = fromString; +function fromValue(val, unsigned) { + if (typeof val === "number") return fromNumber(val, unsigned); + if (typeof val === "string") return fromString(val, unsigned); + return fromBits( + val.low, + val.high, + typeof unsigned === "boolean" ? unsigned : val.unsigned + ); +} +Long.fromValue = fromValue; +var TWO_PWR_16_DBL = 1 << 16; +var TWO_PWR_24_DBL = 1 << 24; +var TWO_PWR_32_DBL = TWO_PWR_16_DBL * TWO_PWR_16_DBL; +var TWO_PWR_64_DBL = TWO_PWR_32_DBL * TWO_PWR_32_DBL; +var TWO_PWR_63_DBL = TWO_PWR_64_DBL / 2; +var TWO_PWR_24 = fromInt(TWO_PWR_24_DBL); +var ZERO = fromInt(0); +Long.ZERO = ZERO; +var UZERO = fromInt(0, true); +Long.UZERO = UZERO; +var ONE = fromInt(1); +Long.ONE = ONE; +var UONE = fromInt(1, true); +Long.UONE = UONE; +var NEG_ONE = fromInt(-1); +Long.NEG_ONE = NEG_ONE; +var MAX_VALUE = fromBits(4294967295 | 0, 2147483647 | 0, false); +Long.MAX_VALUE = MAX_VALUE; +var MAX_UNSIGNED_VALUE = fromBits(4294967295 | 0, 4294967295 | 0, true); +Long.MAX_UNSIGNED_VALUE = MAX_UNSIGNED_VALUE; +var MIN_VALUE = fromBits(0, 2147483648 | 0, false); +Long.MIN_VALUE = MIN_VALUE; +var LongPrototype = Long.prototype; +LongPrototype.toInt = function toInt() { + return this.unsigned ? this.low >>> 0 : this.low; +}; +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); +}; +LongPrototype.toString = function toString2(radix) { + radix = radix || 10; + if (radix < 2 || 36 < radix) throw RangeError("radix"); + if (this.isZero()) return "0"; + if (this.isNegative()) { + if (this.eq(MIN_VALUE)) { + 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); + } + 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; + } + } +}; +LongPrototype.getHighBits = function getHighBits() { + return this.high; +}; +LongPrototype.getHighBitsUnsigned = function getHighBitsUnsigned() { + return this.high >>> 0; +}; +LongPrototype.getLowBits = function getLowBits() { + return this.low; +}; +LongPrototype.getLowBitsUnsigned = function getLowBitsUnsigned() { + return this.low >>> 0; +}; +LongPrototype.getNumBitsAbs = function getNumBitsAbs() { + if (this.isNegative()) + 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; +}; +LongPrototype.isSafeInteger = function isSafeInteger() { + var top11Bits = this.high >> 21; + if (!top11Bits) return true; + if (this.unsigned) return false; + return top11Bits === -1 && !(this.low === 0 && this.high === -2097152); +}; +LongPrototype.isZero = function isZero() { + return this.high === 0 && this.low === 0; +}; +LongPrototype.eqz = LongPrototype.isZero; +LongPrototype.isNegative = function isNegative() { + return !this.unsigned && this.high < 0; +}; +LongPrototype.isPositive = function isPositive() { + return this.unsigned || this.high >= 0; +}; +LongPrototype.isOdd = function isOdd() { + return (this.low & 1) === 1; +}; +LongPrototype.isEven = function isEven() { + return (this.low & 1) === 0; +}; +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; +}; +LongPrototype.eq = LongPrototype.equals; +LongPrototype.notEquals = function notEquals(other) { + return !this.eq( + /* validates */ + other + ); +}; +LongPrototype.neq = LongPrototype.notEquals; +LongPrototype.ne = LongPrototype.notEquals; +LongPrototype.lessThan = function lessThan(other) { + return this.comp( + /* validates */ + other + ) < 0; +}; +LongPrototype.lt = LongPrototype.lessThan; +LongPrototype.lessThanOrEqual = function lessThanOrEqual(other) { + return this.comp( + /* validates */ + other + ) <= 0; +}; +LongPrototype.lte = LongPrototype.lessThanOrEqual; +LongPrototype.le = LongPrototype.lessThanOrEqual; +LongPrototype.greaterThan = function greaterThan(other) { + return this.comp( + /* validates */ + other + ) > 0; +}; +LongPrototype.gt = LongPrototype.greaterThan; +LongPrototype.greaterThanOrEqual = function greaterThanOrEqual(other) { + return this.comp( + /* validates */ + other + ) >= 0; +}; +LongPrototype.gte = LongPrototype.greaterThanOrEqual; +LongPrototype.ge = LongPrototype.greaterThanOrEqual; +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; + if (!this.unsigned) return this.sub(other).isNegative() ? -1 : 1; + return other.high >>> 0 > this.high >>> 0 || other.high === this.high && other.low >>> 0 > this.low >>> 0 ? -1 : 1; +}; +LongPrototype.comp = LongPrototype.compare; +LongPrototype.negate = function negate() { + if (!this.unsigned && this.eq(MIN_VALUE)) return MIN_VALUE; + return this.not().add(ONE); +}; +LongPrototype.neg = LongPrototype.negate; +LongPrototype.add = function add(addend) { + if (!isLong(addend)) addend = fromValue(addend); + var a48 = this.high >>> 16; + var a32 = this.high & 65535; + var a16 = this.low >>> 16; + var a00 = this.low & 65535; + var b48 = addend.high >>> 16; + var b32 = addend.high & 65535; + var b16 = addend.low >>> 16; + var b00 = addend.low & 65535; + var c48 = 0, c32 = 0, c16 = 0, c00 = 0; + c00 += a00 + b00; + c16 += c00 >>> 16; + c00 &= 65535; + c16 += a16 + b16; + c32 += c16 >>> 16; + c16 &= 65535; + c32 += a32 + b32; + c48 += c32 >>> 16; + c32 &= 65535; + c48 += a48 + b48; + c48 &= 65535; + return fromBits(c16 << 16 | c00, c48 << 16 | c32, this.unsigned); +}; +LongPrototype.subtract = function subtract(subtrahend) { + if (!isLong(subtrahend)) subtrahend = fromValue(subtrahend); + return this.add(subtrahend.neg()); +}; +LongPrototype.sub = LongPrototype.subtract; +LongPrototype.multiply = function multiply(multiplier) { + if (this.isZero()) return this; + if (!isLong(multiplier)) multiplier = fromValue(multiplier); + 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 this.unsigned ? UZERO : 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 (this.lt(TWO_PWR_24) && multiplier.lt(TWO_PWR_24)) + return fromNumber(this.toNumber() * multiplier.toNumber(), this.unsigned); + var a48 = this.high >>> 16; + var a32 = this.high & 65535; + var a16 = this.low >>> 16; + var a00 = this.low & 65535; + var b48 = multiplier.high >>> 16; + var b32 = multiplier.high & 65535; + var b16 = multiplier.low >>> 16; + var b00 = multiplier.low & 65535; + var c48 = 0, c32 = 0, c16 = 0, c00 = 0; + c00 += a00 * b00; + c16 += c00 >>> 16; + c00 &= 65535; + c16 += a16 * b00; + c32 += c16 >>> 16; + c16 &= 65535; + c16 += a00 * b16; + c32 += c16 >>> 16; + c16 &= 65535; + c32 += a32 * b00; + c48 += c32 >>> 16; + c32 &= 65535; + c32 += a16 * b16; + c48 += c32 >>> 16; + c32 &= 65535; + c32 += a00 * b32; + c48 += c32 >>> 16; + c32 &= 65535; + c48 += a48 * b00 + a32 * b16 + a16 * b32 + a00 * b48; + c48 &= 65535; + return fromBits(c16 << 16 | c00, c48 << 16 | c32, this.unsigned); +}; +LongPrototype.mul = LongPrototype.multiply; +LongPrototype.divide = function divide(divisor) { + if (!isLong(divisor)) divisor = fromValue(divisor); + if (divisor.isZero()) throw Error("division by zero"); + if (wasm) { + if (!this.unsigned && this.high === -2147483648 && divisor.low === -1 && divisor.high === -1) { + 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) { + if (this.eq(MIN_VALUE)) { + if (divisor.eq(ONE) || divisor.eq(NEG_ONE)) + return MIN_VALUE; + else if (divisor.eq(MIN_VALUE)) return ONE; + else { + 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 { + if (!divisor.unsigned) divisor = divisor.toUnsigned(); + if (divisor.gt(this)) return UZERO; + if (divisor.gt(this.shru(1))) + return UONE; + res = UZERO; + } + rem = this; + while (rem.gte(divisor)) { + approx = Math.max(1, Math.floor(rem.toNumber() / divisor.toNumber())); + var log2 = Math.ceil(Math.log(approx) / Math.LN2), delta = log2 <= 48 ? 1 : pow_dbl(2, log2 - 48), approxRes = fromNumber(approx), approxRem = approxRes.mul(divisor); + while (approxRem.isNegative() || approxRem.gt(rem)) { + approx -= delta; + approxRes = fromNumber(approx, this.unsigned); + approxRem = approxRes.mul(divisor); + } + if (approxRes.isZero()) approxRes = ONE; + res = res.add(approxRes); + rem = rem.sub(approxRem); + } + return res; +}; +LongPrototype.div = LongPrototype.divide; +LongPrototype.modulo = function modulo(divisor) { + if (!isLong(divisor)) divisor = fromValue(divisor); + 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)); +}; +LongPrototype.mod = LongPrototype.modulo; +LongPrototype.rem = LongPrototype.modulo; +LongPrototype.not = function not() { + return fromBits(~this.low, ~this.high, this.unsigned); +}; +LongPrototype.countLeadingZeros = function countLeadingZeros() { + return this.high ? Math.clz32(this.high) : Math.clz32(this.low) + 32; +}; +LongPrototype.clz = LongPrototype.countLeadingZeros; +LongPrototype.countTrailingZeros = function countTrailingZeros() { + return this.low ? ctz32(this.low) : ctz32(this.high) + 32; +}; +LongPrototype.ctz = LongPrototype.countTrailingZeros; +LongPrototype.and = function and(other) { + if (!isLong(other)) other = fromValue(other); + return fromBits(this.low & other.low, this.high & other.high, this.unsigned); +}; +LongPrototype.or = function or(other) { + if (!isLong(other)) other = fromValue(other); + return fromBits(this.low | other.low, this.high | other.high, this.unsigned); +}; +LongPrototype.xor = function xor(other) { + if (!isLong(other)) other = fromValue(other); + return fromBits(this.low ^ other.low, this.high ^ other.high, this.unsigned); +}; +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); +}; +LongPrototype.shl = LongPrototype.shiftLeft; +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 + ); +}; +LongPrototype.shr = LongPrototype.shiftRight; +LongPrototype.shiftRightUnsigned = function shiftRightUnsigned(numBits) { + if (isLong(numBits)) numBits = numBits.toInt(); + if ((numBits &= 63) === 0) return this; + if (numBits < 32) + return fromBits( + this.low >>> numBits | this.high << 32 - numBits, + this.high >>> numBits, + this.unsigned + ); + if (numBits === 32) return fromBits(this.high, 0, this.unsigned); + return fromBits(this.high >>> numBits - 32, 0, this.unsigned); +}; +LongPrototype.shru = LongPrototype.shiftRightUnsigned; +LongPrototype.shr_u = LongPrototype.shiftRightUnsigned; +LongPrototype.rotateLeft = function rotateLeft(numBits) { + var b; + if (isLong(numBits)) numBits = numBits.toInt(); + if ((numBits &= 63) === 0) return this; + if (numBits === 32) return fromBits(this.high, this.low, this.unsigned); + if (numBits < 32) { + b = 32 - numBits; + return fromBits( + this.low << numBits | this.high >>> b, + this.high << numBits | this.low >>> b, + this.unsigned + ); + } + numBits -= 32; + b = 32 - numBits; + return fromBits( + this.high << numBits | this.low >>> b, + this.low << numBits | this.high >>> b, + this.unsigned + ); +}; +LongPrototype.rotl = LongPrototype.rotateLeft; +LongPrototype.rotateRight = function rotateRight(numBits) { + var b; + if (isLong(numBits)) numBits = numBits.toInt(); + if ((numBits &= 63) === 0) return this; + if (numBits === 32) return fromBits(this.high, this.low, this.unsigned); + if (numBits < 32) { + b = 32 - numBits; + return fromBits( + this.high << b | this.low >>> numBits, + this.low << b | this.high >>> numBits, + this.unsigned + ); + } + numBits -= 32; + b = 32 - numBits; + return fromBits( + this.low << b | this.high >>> numBits, + this.high << b | this.low >>> numBits, + this.unsigned + ); +}; +LongPrototype.rotr = LongPrototype.rotateRight; +LongPrototype.toSigned = function toSigned() { + if (!this.unsigned) return this; + return fromBits(this.low, this.high, false); +}; +LongPrototype.toUnsigned = function toUnsigned() { + if (this.unsigned) return this; + return fromBits(this.low, this.high, true); +}; +LongPrototype.toBytes = function toBytes(le) { + return le ? this.toBytesLE() : this.toBytesBE(); +}; +LongPrototype.toBytesLE = function toBytesLE() { + var hi = this.high, lo = this.low; + return [ + lo & 255, + lo >>> 8 & 255, + lo >>> 16 & 255, + lo >>> 24, + hi & 255, + hi >>> 8 & 255, + hi >>> 16 & 255, + hi >>> 24 + ]; +}; +LongPrototype.toBytesBE = function toBytesBE() { + var hi = this.high, lo = this.low; + return [ + hi >>> 24, + hi >>> 16 & 255, + hi >>> 8 & 255, + hi & 255, + lo >>> 24, + lo >>> 16 & 255, + lo >>> 8 & 255, + lo & 255 + ]; +}; +Long.fromBytes = function fromBytes(bytes, unsigned, le) { + return le ? Long.fromBytesLE(bytes, unsigned) : Long.fromBytesBE(bytes, unsigned); +}; +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 + ); +}; +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 + ); +}; +if (typeof BigInt === "function") { + Long.fromBigInt = function fromBigInt(value, unsigned) { + var lowBits = Number(BigInt.asIntN(32, value)); + var highBits = Number(BigInt.asIntN(32, value >> BigInt(32))); + return fromBits(lowBits, highBits, unsigned); + }; + Long.fromValue = function fromValueWithBigInt(value, unsigned) { + if (typeof value === "bigint") return Long.fromBigInt(value, unsigned); + return fromValue(value, unsigned); + }; + LongPrototype.toBigInt = function toBigInt() { + var lowBigInt = BigInt(this.low >>> 0); + var highBigInt = BigInt(this.unsigned ? this.high >>> 0 : this.high); + return highBigInt << BigInt(32) | lowBigInt; + }; +} +var long_default = Long; + +// src/fingerprints.ts +var tab = " ".charCodeAt(0); +var space = " ".charCodeAt(0); +var lf = "\n".charCodeAt(0); +var cr = "\r".charCodeAt(0); +var EOF = 65535; +var BLOCK_SIZE = 100; +var MOD = long_default.fromInt(37); +function computeFirstMod() { + let firstMod = long_default.ONE; + for (let i = 0; i < BLOCK_SIZE; i++) { + firstMod = firstMod.multiply(MOD); + } + return firstMod; +} +async function hash(callback, filepath) { + const window2 = Array(BLOCK_SIZE).fill(0); + const lineNumbers = Array(BLOCK_SIZE).fill(-1); + let hashRaw = long_default.ZERO; + const firstMod = computeFirstMod(); + let index = 0; + let lineNumber = 0; + let lineStart = true; + let prevCR = false; + const hashCounts = {}; + const outputHash = function() { + const hashValue = hashRaw.toUnsigned().toString(16); + if (!hashCounts[hashValue]) { + hashCounts[hashValue] = 0; + } + hashCounts[hashValue]++; + callback(lineNumbers[index], `${hashValue}:${hashCounts[hashValue]}`); + lineNumbers[index] = -1; + }; + const updateHash = function(current) { + const begin = window2[index]; + window2[index] = current; + hashRaw = MOD.multiply(hashRaw).add(long_default.fromInt(current)).subtract(firstMod.multiply(long_default.fromInt(begin))); + index = (index + 1) % BLOCK_SIZE; + }; + const processCharacter = function(current) { + if (current === space || current === tab || prevCR && current === lf) { + prevCR = false; + return; + } + 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); + }; + const readStream = fs5.createReadStream(filepath, "utf8"); + for await (const data of readStream) { + for (let i = 0; i < data.length; ++i) { + processCharacter(data.charCodeAt(i)); + } + } + processCharacter(EOF); + for (let i = 0; i < BLOCK_SIZE; i++) { + if (lineNumbers[index] !== -1) { + outputHash(); + } + updateHash(0); + } +} +function locationUpdateCallback(result, location, logger) { + let locationStartLine = location.physicalLocation?.region?.startLine; + if (locationStartLine === void 0) { + locationStartLine = 1; + } + return function(lineNumber, hashValue) { + if (locationStartLine !== lineNumber) { + return; + } + if (!result.partialFingerprints) { + result.partialFingerprints = {}; + } + const existingFingerprint = result.partialFingerprints.primaryLocationLineHash; + if (!existingFingerprint) { + result.partialFingerprints.primaryLocationLineHash = hashValue; + } else if (existingFingerprint !== hashValue) { + logger.warning( + `Calculated fingerprint of ${hashValue} for file ${location.physicalLocation.artifactLocation.uri} line ${lineNumber}, but found existing inconsistent fingerprint value ${existingFingerprint}` + ); + } + }; +} +function resolveUriToFile(location, artifacts, sourceRoot, logger) { + if (!location.uri && location.index !== void 0) { + if (typeof location.index !== "number" || location.index < 0 || location.index >= artifacts.length || typeof artifacts[location.index].location !== "object") { + logger.debug(`Ignoring location as index "${location.index}" is invalid`); + return void 0; + } + location = artifacts[location.index].location; + } + if (typeof location.uri !== "string") { + logger.debug(`Ignoring location as URI "${location.uri}" is invalid`); + return void 0; + } + let uri; + try { + uri = decodeURIComponent(location.uri); + } catch { + logger.debug(`Ignoring location as URI "${location.uri}" is invalid`); + return void 0; + } + 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 void 0; + } + const srcRootPrefix = `${sourceRoot}/`; + if (uri.startsWith("/") && !uri.startsWith(srcRootPrefix)) { + logger.debug( + `Ignoring location URI "${uri}" as it is outside of the src root` + ); + return void 0; + } + if (!import_path.default.isAbsolute(uri)) { + uri = srcRootPrefix + uri; + } + if (!fs5.existsSync(uri)) { + logger.debug(`Unable to compute fingerprint for non-existent file: ${uri}`); + return void 0; + } + if (fs5.statSync(uri).isDirectory()) { + logger.debug(`Unable to compute fingerprint for directory: ${uri}`); + return void 0; + } + return uri; +} +async function addFingerprints(sarif, sourceRoot, logger) { + logger.info( + `Adding fingerprints to SARIF file. See ${"https://docs.github.com/en/enterprise-cloud@latest/code-security/code-scanning/integrating-with-code-scanning/sarif-support-for-code-scanning#providing-data-to-track-code-scanning-alerts-across-runs" /* TRACK_CODE_SCANNING_ALERTS_ACROSS_RUNS */} for more information.` + ); + const callbacksByFile = {}; + for (const run of sarif.runs || []) { + const artifacts = run.artifacts || []; + for (const result of run.results || []) { + const primaryLocation = (result.locations || [])[0]; + if (!primaryLocation?.physicalLocation?.artifactLocation) { + logger.debug( + `Unable to compute fingerprint for invalid location: ${JSON.stringify( + primaryLocation + )}` + ); + continue; + } + if (primaryLocation?.physicalLocation?.region?.startLine === void 0) { + continue; + } + const filepath = resolveUriToFile( + primaryLocation.physicalLocation.artifactLocation, + artifacts, + sourceRoot, + logger + ); + if (!filepath) { + continue; + } + if (!callbacksByFile[filepath]) { + callbacksByFile[filepath] = []; + } + callbacksByFile[filepath].push( + locationUpdateCallback(result, primaryLocation, logger) + ); + } + } + for (const [filepath, callbacks] of Object.entries(callbacksByFile)) { + const teeCallback = function(lineNumber, hashValue) { + for (const c of Object.values(callbacks)) { + c(lineNumber, hashValue); + } + }; + await hash(teeCallback, filepath); + } + return sarif; +} + +// src/init.ts +var toolrunner4 = __toESM(require_toolrunner()); +var io5 = __toESM(require_io()); + // src/codeql.ts var fs9 = __toESM(require("fs")); var path9 = __toESM(require("path")); @@ -106707,16 +108389,9 @@ function wrapCliConfigurationError(cliError) { return new ConfigurationError(errorMessageBuilder); } -// src/config-utils.ts -var fs5 = __toESM(require("fs")); -var path6 = __toESM(require("path")); - -// src/caching-utils.ts -var core6 = __toESM(require_core()); - // src/config/db-config.ts var jsonschema = __toESM(require_lib2()); -var semver2 = __toESM(require_semver2()); +var semver5 = __toESM(require_semver2()); var PACK_IDENTIFIER_PATTERN = (function() { const alphaNumeric = "[a-z0-9]"; const alphaNumericDash = "[a-z0-9-]"; @@ -106726,34 +108401,7 @@ var PACK_IDENTIFIER_PATTERN = (function() { // src/diagnostics.ts var import_fs = require("fs"); -var import_path = __toESM(require("path")); - -// src/logging.ts -var core7 = __toESM(require_core()); -function getActionsLogger() { - return { - debug: core7.debug, - info: core7.info, - warning: core7.warning, - error: core7.error, - isDebug: core7.isDebug, - startGroup: core7.startGroup, - endGroup: core7.endGroup - }; -} -function formatDuration(durationMs) { - if (durationMs < 1e3) { - return `${durationMs}ms`; - } - if (durationMs < 60 * 1e3) { - return `${(durationMs / 1e3).toFixed(1)}s`; - } - const minutes = Math.floor(durationMs / (60 * 1e3)); - const seconds = Math.floor(durationMs % (60 * 1e3) / 1e3); - return `${minutes}m${seconds}s`; -} - -// src/diagnostics.ts +var import_path2 = __toESM(require("path")); var unwrittenDiagnostics = []; var unwrittenDefaultLanguageDiagnostics = []; function makeDiagnostic(id, name, data = void 0) { @@ -106791,14 +108439,14 @@ function addNoLanguageDiagnostic(config, diagnostic) { function writeDiagnostic(config, language, diagnostic) { const logger = getActionsLogger(); const databasePath = language ? getCodeQLDatabasePath(config, language) : config.dbLocation; - const diagnosticsPath = import_path.default.resolve( + const diagnosticsPath = import_path2.default.resolve( databasePath, "diagnostic", "codeql-action" ); try { (0, import_fs.mkdirSync)(diagnosticsPath, { recursive: true }); - const jsonPath = import_path.default.resolve( + const jsonPath = import_path2.default.resolve( diagnosticsPath, // Remove colons from the timestamp as these are not allowed in Windows filenames. `codeql-action-${diagnostic.timestamp.replaceAll(":", "")}.json` @@ -106810,534 +108458,6 @@ function writeDiagnostic(config, language, diagnostic) { } } -// src/diff-informed-analysis-utils.ts -var fs4 = __toESM(require("fs")); -var path5 = __toESM(require("path")); - -// src/feature-flags.ts -var semver5 = __toESM(require_semver2()); - -// src/defaults.json -var bundleVersion = "codeql-bundle-v2.24.2"; -var cliVersion = "2.24.2"; - -// src/overlay-database-utils.ts -var fs3 = __toESM(require("fs")); -var path4 = __toESM(require("path")); -var actionsCache = __toESM(require_cache5()); - -// src/git-utils.ts -var core8 = __toESM(require_core()); -var toolrunner2 = __toESM(require_toolrunner()); -var io3 = __toESM(require_io()); -var semver3 = __toESM(require_semver2()); -var runGitCommand = async function(workingDirectory, args, customErrorMessage, options) { - let stdout = ""; - let stderr = ""; - core8.debug(`Running git command: git ${args.join(" ")}`); - try { - await new toolrunner2.ToolRunner(await io3.which("git", true), args, { - silent: true, - listeners: { - stdout: (data) => { - stdout += data.toString(); - }, - stderr: (data) => { - stderr += data.toString(); - } - }, - cwd: workingDirectory, - ...options - }).exec(); - return stdout; - } catch (error3) { - let reason = stderr; - if (stderr.includes("not a git repository")) { - reason = "The checkout path provided to the action does not appear to be a git repository."; - } - core8.info(`git call failed. ${customErrorMessage} Error: ${reason}`); - throw error3; - } -}; -var getCommitOid = async function(checkoutPath, ref = "HEAD") { - try { - const stdout = await runGitCommand( - checkoutPath, - ["rev-parse", ref], - "Continuing with commit SHA from user input or environment." - ); - return stdout.trim(); - } catch { - return getOptionalInput("sha") || getRequiredEnvParam("GITHUB_SHA"); - } -}; -var determineBaseBranchHeadCommitOid = async function(checkoutPathOverride) { - if (getWorkflowEventName() !== "pull_request") { - return void 0; - } - const mergeSha = getRequiredEnvParam("GITHUB_SHA"); - const checkoutPath = checkoutPathOverride ?? getOptionalInput("checkout_path"); - try { - let commitOid = ""; - let baseOid = ""; - let headOid = ""; - const stdout = await runGitCommand( - checkoutPath, - ["show", "-s", "--format=raw", mergeSha], - "Will calculate the base branch SHA on the server." - ); - for (const data of stdout.split("\n")) { - if (data.startsWith("commit ") && commitOid === "") { - commitOid = data.substring(7); - } else if (data.startsWith("parent ")) { - if (baseOid === "") { - baseOid = data.substring(7); - } else if (headOid === "") { - headOid = data.substring(7); - } - } - } - if (commitOid === mergeSha && headOid.length === 40 && baseOid.length === 40) { - return baseOid; - } - return void 0; - } catch { - return void 0; - } -}; -var decodeGitFilePath = function(filePath) { - if (filePath.startsWith('"') && filePath.endsWith('"')) { - filePath = filePath.substring(1, filePath.length - 1); - return filePath.replace( - /\\([abfnrtv\\"]|[0-7]{1,3})/g, - (_match, seq2) => { - switch (seq2[0]) { - case "a": - return "\x07"; - case "b": - return "\b"; - case "f": - return "\f"; - case "n": - return "\n"; - case "r": - return "\r"; - case "t": - return " "; - case "v": - return "\v"; - case "\\": - return "\\"; - case '"': - return '"'; - default: - return String.fromCharCode(parseInt(seq2, 8)); - } - } - ); - } - return filePath; -}; -var getFileOidsUnderPath = async function(basePath) { - const stdout = await runGitCommand( - basePath, - ["ls-files", "--recurse-submodules", "--format=%(objectname)_%(path)"], - "Cannot list Git OIDs of tracked files." - ); - const fileOidMap = {}; - const regex = /^([0-9a-f]{40})_(.+)$/; - for (const line of stdout.split("\n")) { - if (line) { - const match = line.match(regex); - if (match) { - const oid = match[1]; - const path12 = decodeGitFilePath(match[2]); - fileOidMap[path12] = oid; - } else { - throw new Error(`Unexpected "git ls-files" output: ${line}`); - } - } - } - return fileOidMap; -}; -function getRefFromEnv() { - let refEnv; - try { - refEnv = getRequiredEnvParam("GITHUB_REF"); - } catch (e) { - const maybeRef = process.env["CODE_SCANNING_REF"]; - if (maybeRef === void 0 || maybeRef.length === 0) { - throw e; - } - refEnv = maybeRef; - } - return refEnv; -} -async function getRef() { - const refInput = getOptionalInput("ref"); - const shaInput = getOptionalInput("sha"); - const checkoutPath = getOptionalInput("checkout_path") || getOptionalInput("source-root") || getRequiredEnvParam("GITHUB_WORKSPACE"); - const hasRefInput = !!refInput; - const hasShaInput = !!shaInput; - if ((hasRefInput || hasShaInput) && !(hasRefInput && hasShaInput)) { - throw new ConfigurationError( - "Both 'ref' and 'sha' are required if one of them is provided." - ); - } - const ref = refInput || getRefFromEnv(); - const sha = shaInput || getRequiredEnvParam("GITHUB_SHA"); - if (refInput) { - return refInput; - } - const pull_ref_regex = /refs\/pull\/(\d+)\/merge/; - if (!pull_ref_regex.test(ref)) { - return ref; - } - const head = await getCommitOid(checkoutPath, "HEAD"); - const hasChangedRef = sha !== head && await getCommitOid( - checkoutPath, - ref.replace(/^refs\/pull\//, "refs/remotes/pull/") - ) !== head; - if (hasChangedRef) { - const newRef = ref.replace(pull_ref_regex, "refs/pull/$1/head"); - core8.debug( - `No longer on merge commit, rewriting ref from ${ref} to ${newRef}.` - ); - return newRef; - } else { - return ref; - } -} -function removeRefsHeadsPrefix(ref) { - return ref.startsWith("refs/heads/") ? ref.slice("refs/heads/".length) : ref; -} -async function isAnalyzingDefaultBranch() { - if (process.env.CODE_SCANNING_IS_ANALYZING_DEFAULT_BRANCH === "true") { - return true; - } - let currentRef = await getRef(); - currentRef = removeRefsHeadsPrefix(currentRef); - const event = getWorkflowEvent(); - let defaultBranch = event?.repository?.default_branch; - if (getWorkflowEventName() === "schedule") { - defaultBranch = removeRefsHeadsPrefix(getRefFromEnv()); - } - return currentRef === defaultBranch; -} - -// src/overlay-database-utils.ts -var CODEQL_OVERLAY_MINIMUM_VERSION = "2.23.8"; -var OVERLAY_BASE_DATABASE_MAX_UPLOAD_SIZE_MB = 7500; -var OVERLAY_BASE_DATABASE_MAX_UPLOAD_SIZE_BYTES = OVERLAY_BASE_DATABASE_MAX_UPLOAD_SIZE_MB * 1e6; -async function writeBaseDatabaseOidsFile(config, sourceRoot) { - const gitFileOids = await getFileOidsUnderPath(sourceRoot); - const gitFileOidsJson = JSON.stringify(gitFileOids); - const baseDatabaseOidsFilePath = getBaseDatabaseOidsFilePath(config); - await fs3.promises.writeFile(baseDatabaseOidsFilePath, gitFileOidsJson); -} -async function readBaseDatabaseOidsFile(config, logger) { - const baseDatabaseOidsFilePath = getBaseDatabaseOidsFilePath(config); - try { - const contents = await fs3.promises.readFile( - baseDatabaseOidsFilePath, - "utf-8" - ); - return JSON.parse(contents); - } catch (e) { - logger.error( - `Failed to read overlay-base file OIDs from ${baseDatabaseOidsFilePath}: ${e.message || e}` - ); - throw e; - } -} -async function writeOverlayChangesFile(config, sourceRoot, logger) { - const baseFileOids = await readBaseDatabaseOidsFile(config, logger); - const overlayFileOids = await getFileOidsUnderPath(sourceRoot); - const changedFiles = computeChangedFiles(baseFileOids, overlayFileOids); - logger.info( - `Found ${changedFiles.length} changed file(s) under ${sourceRoot}.` - ); - const changedFilesJson = JSON.stringify({ changes: changedFiles }); - const overlayChangesFile = path4.join( - getTemporaryDirectory(), - "overlay-changes.json" - ); - logger.debug( - `Writing overlay changed files to ${overlayChangesFile}: ${changedFilesJson}` - ); - await fs3.promises.writeFile(overlayChangesFile, changedFilesJson); - return overlayChangesFile; -} -function computeChangedFiles(baseFileOids, overlayFileOids) { - const changes = []; - for (const [file, oid] of Object.entries(overlayFileOids)) { - if (!(file in baseFileOids) || baseFileOids[file] !== oid) { - changes.push(file); - } - } - for (const file of Object.keys(baseFileOids)) { - if (!(file in overlayFileOids)) { - changes.push(file); - } - } - return changes; -} - -// src/tools-features.ts -var semver4 = __toESM(require_semver2()); -function isSupportedToolsFeature(versionInfo, feature) { - return !!versionInfo.features && versionInfo.features[feature]; -} - -// src/feature-flags.ts -var CODEQL_VERSION_ZSTD_BUNDLE = "2.19.0"; -var featureConfig = { - ["allow_toolcache_input" /* AllowToolcacheInput */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_ALLOW_TOOLCACHE_INPUT", - minimumVersion: void 0 - }, - ["cleanup_trap_caches" /* CleanupTrapCaches */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_CLEANUP_TRAP_CACHES", - minimumVersion: void 0 - }, - ["cpp_dependency_installation_enabled" /* CppDependencyInstallation */]: { - defaultValue: false, - envVar: "CODEQL_EXTRACTOR_CPP_AUTOINSTALL_DEPENDENCIES", - legacyApi: true, - minimumVersion: "2.15.0" - }, - ["csharp_cache_bmn" /* CsharpCacheBuildModeNone */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_CSHARP_CACHE_BMN", - minimumVersion: void 0 - }, - ["csharp_new_cache_key" /* CsharpNewCacheKey */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_CSHARP_NEW_CACHE_KEY", - minimumVersion: void 0 - }, - ["diff_informed_queries" /* DiffInformedQueries */]: { - defaultValue: true, - envVar: "CODEQL_ACTION_DIFF_INFORMED_QUERIES", - minimumVersion: "2.21.0" - }, - ["disable_csharp_buildless" /* DisableCsharpBuildless */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_DISABLE_CSHARP_BUILDLESS", - minimumVersion: void 0 - }, - ["disable_java_buildless_enabled" /* DisableJavaBuildlessEnabled */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_DISABLE_JAVA_BUILDLESS", - legacyApi: true, - minimumVersion: void 0 - }, - ["disable_kotlin_analysis_enabled" /* DisableKotlinAnalysisEnabled */]: { - defaultValue: false, - envVar: "CODEQL_DISABLE_KOTLIN_ANALYSIS", - legacyApi: true, - minimumVersion: void 0 - }, - ["export_diagnostics_enabled" /* ExportDiagnosticsEnabled */]: { - defaultValue: true, - envVar: "CODEQL_ACTION_EXPORT_DIAGNOSTICS", - legacyApi: true, - minimumVersion: void 0 - }, - ["force_nightly" /* ForceNightly */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_FORCE_NIGHTLY", - minimumVersion: void 0 - }, - ["ignore_generated_files" /* IgnoreGeneratedFiles */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_IGNORE_GENERATED_FILES", - minimumVersion: void 0 - }, - ["improved_proxy_certificates" /* ImprovedProxyCertificates */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_IMPROVED_PROXY_CERTIFICATES", - minimumVersion: void 0 - }, - ["java_network_debugging" /* JavaNetworkDebugging */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_JAVA_NETWORK_DEBUGGING", - minimumVersion: void 0 - }, - ["overlay_analysis" /* OverlayAnalysis */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS", - minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION - }, - ["overlay_analysis_actions" /* OverlayAnalysisActions */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_ACTIONS", - minimumVersion: void 0 - }, - ["overlay_analysis_code_scanning_actions" /* OverlayAnalysisCodeScanningActions */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_ACTIONS", - minimumVersion: void 0 - }, - ["overlay_analysis_code_scanning_cpp" /* OverlayAnalysisCodeScanningCpp */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_CPP", - minimumVersion: void 0 - }, - ["overlay_analysis_code_scanning_csharp" /* OverlayAnalysisCodeScanningCsharp */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_CSHARP", - minimumVersion: void 0 - }, - ["overlay_analysis_code_scanning_go" /* OverlayAnalysisCodeScanningGo */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_GO", - minimumVersion: void 0 - }, - ["overlay_analysis_code_scanning_java" /* OverlayAnalysisCodeScanningJava */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_JAVA", - minimumVersion: void 0 - }, - ["overlay_analysis_code_scanning_javascript" /* OverlayAnalysisCodeScanningJavascript */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_JAVASCRIPT", - minimumVersion: void 0 - }, - ["overlay_analysis_code_scanning_python" /* OverlayAnalysisCodeScanningPython */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_PYTHON", - minimumVersion: void 0 - }, - ["overlay_analysis_code_scanning_ruby" /* OverlayAnalysisCodeScanningRuby */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_RUBY", - minimumVersion: void 0 - }, - ["overlay_analysis_code_scanning_rust" /* OverlayAnalysisCodeScanningRust */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_RUST", - minimumVersion: void 0 - }, - ["overlay_analysis_code_scanning_swift" /* OverlayAnalysisCodeScanningSwift */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_SWIFT", - minimumVersion: void 0 - }, - ["overlay_analysis_cpp" /* OverlayAnalysisCpp */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CPP", - minimumVersion: void 0 - }, - ["overlay_analysis_csharp" /* OverlayAnalysisCsharp */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CSHARP", - minimumVersion: void 0 - }, - ["overlay_analysis_go" /* OverlayAnalysisGo */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_GO", - minimumVersion: void 0 - }, - ["overlay_analysis_java" /* OverlayAnalysisJava */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_JAVA", - minimumVersion: void 0 - }, - ["overlay_analysis_javascript" /* OverlayAnalysisJavascript */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_JAVASCRIPT", - minimumVersion: void 0 - }, - ["overlay_analysis_python" /* OverlayAnalysisPython */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_PYTHON", - minimumVersion: void 0 - }, - ["overlay_analysis_ruby" /* OverlayAnalysisRuby */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_RUBY", - minimumVersion: void 0 - }, - ["overlay_analysis_rust" /* OverlayAnalysisRust */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_RUST", - minimumVersion: void 0 - }, - ["overlay_analysis_skip_resource_checks" /* OverlayAnalysisSkipResourceChecks */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_SKIP_RESOURCE_CHECKS", - minimumVersion: void 0 - }, - ["overlay_analysis_swift" /* OverlayAnalysisSwift */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_SWIFT", - minimumVersion: void 0 - }, - ["python_default_is_to_not_extract_stdlib" /* PythonDefaultIsToNotExtractStdlib */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_DISABLE_PYTHON_STANDARD_LIBRARY_EXTRACTION", - minimumVersion: void 0, - toolsFeature: "pythonDefaultIsToNotExtractStdlib" /* PythonDefaultIsToNotExtractStdlib */ - }, - ["qa_telemetry_enabled" /* QaTelemetryEnabled */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_QA_TELEMETRY", - legacyApi: true, - minimumVersion: void 0 - }, - ["skip_file_coverage_on_prs" /* SkipFileCoverageOnPrs */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_SKIP_FILE_COVERAGE_ON_PRS", - // For testing, this is not behind a CLI version check yet. However - // before rolling this out externally, we should set a minimum version here - // since current versions of the CodeQL CLI will log if baseline information - // cannot be found when interpreting results. - minimumVersion: void 0 - }, - ["start_proxy_connection_checks" /* StartProxyConnectionChecks */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_START_PROXY_CONNECTION_CHECKS", - minimumVersion: void 0 - }, - ["upload_overlay_db_to_api" /* UploadOverlayDbToApi */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_UPLOAD_OVERLAY_DB_TO_API", - minimumVersion: void 0, - toolsFeature: "bundleSupportsOverlay" /* BundleSupportsOverlay */ - }, - ["use_repository_properties_v2" /* UseRepositoryProperties */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_USE_REPOSITORY_PROPERTIES", - minimumVersion: void 0 - }, - ["validate_db_config" /* ValidateDbConfig */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_VALIDATE_DB_CONFIG", - minimumVersion: void 0 - } -}; - -// src/diff-informed-analysis-utils.ts -function getDiffRangesJsonFilePath() { - return path5.join(getTemporaryDirectory(), "pr-diff-range.json"); -} -function readDiffRangesJsonFile(logger) { - const jsonFilePath = getDiffRangesJsonFilePath(); - if (!fs4.existsSync(jsonFilePath)) { - logger.debug(`Diff ranges JSON file does not exist at ${jsonFilePath}`); - return void 0; - } - const jsonContents = fs4.readFileSync(jsonFilePath, "utf8"); - logger.debug( - `Read pr-diff-range JSON file from ${jsonFilePath}: -${jsonContents}` - ); - return JSON.parse(jsonContents); -} - // src/trap-caching.ts var actionsCache2 = __toESM(require_cache5()); @@ -107369,30 +108489,6 @@ var OVERLAY_ANALYSIS_CODE_SCANNING_FEATURES = { rust: "overlay_analysis_code_scanning_rust" /* OverlayAnalysisCodeScanningRust */, swift: "overlay_analysis_code_scanning_swift" /* OverlayAnalysisCodeScanningSwift */ }; -function getPathToParsedConfigFile(tempDir) { - return path6.join(tempDir, "config"); -} -async function getConfig(tempDir, logger) { - const configFile = getPathToParsedConfigFile(tempDir); - if (!fs5.existsSync(configFile)) { - return void 0; - } - const configString = fs5.readFileSync(configFile, "utf8"); - logger.debug("Loaded config:"); - logger.debug(configString); - const config = JSON.parse(configString); - if (config.version === void 0) { - throw new ConfigurationError( - `Loaded configuration file, but it does not contain the expected 'version' field.` - ); - } - if (config.version !== getActionVersion()) { - throw new ConfigurationError( - `Loaded a configuration file for version '${config.version}', but running version '${getActionVersion()}'` - ); - } - return config; -} function appendExtraQueryExclusions(extraQueryExclusions, cliConfig) { const augmentedConfig = cloneObject(cliConfig); if (extraQueryExclusions.length === 0) { @@ -107576,7 +108672,7 @@ async function extractTarZst(tar, dest, tarVersion, logger) { args.push("-f", tar instanceof stream.Readable ? "-" : tar, "-C", dest); process.stdout.write(`[command]tar ${args.join(" ")} `); - await new Promise((resolve6, reject) => { + await new Promise((resolve5, reject) => { const tarProcess = (0, import_child_process.spawn)("tar", args, { stdio: "pipe" }); let stdout = ""; tarProcess.stdout?.on("data", (data) => { @@ -107610,7 +108706,7 @@ async function extractTarZst(tar, dest, tarVersion, logger) { ) ); } - resolve6(); + resolve5(); }); }); } catch (e) { @@ -107747,7 +108843,7 @@ async function downloadAndExtractZstdWithStreaming(codeqlURL, dest, authorizatio headers ); const response = await new Promise( - (resolve6) => import_follow_redirects.https.get( + (resolve5) => import_follow_redirects.https.get( codeqlURL, { headers, @@ -107756,7 +108852,7 @@ async function downloadAndExtractZstdWithStreaming(codeqlURL, dest, authorizatio // Use the agent to respect proxy settings. agent }, - (r) => resolve6(r) + (r) => resolve5(r) ) ); if (response.statusCode !== 200) { @@ -108424,12 +109520,6 @@ Details: ${e.stack}` : ""}` ); } } -async function getCodeQL(cmd) { - if (cachedCodeQL === void 0) { - cachedCodeQL = await getCodeQLForCmd(cmd, true); - } - return cachedCodeQL; -} async function getCodeQLForCmd(cmd, checkVersion) { const codeql = { getPath() { @@ -108984,1131 +110074,7 @@ async function getJobRunUuidSarifOptions(codeql) { ) ? [`--sarif-run-property=jobRunUuid=${jobRunUuid}`] : []; } -// src/fingerprints.ts -var fs10 = __toESM(require("fs")); -var import_path2 = __toESM(require("path")); - -// node_modules/long/index.js -var wasm = null; -try { - wasm = new WebAssembly.Instance( - new WebAssembly.Module( - new Uint8Array([ - // \0asm - 0, - 97, - 115, - 109, - // version 1 - 1, - 0, - 0, - 0, - // section "type" - 1, - 13, - 2, - // 0, () => i32 - 96, - 0, - 1, - 127, - // 1, (i32, i32, i32, i32) => i32 - 96, - 4, - 127, - 127, - 127, - 127, - 1, - 127, - // section "function" - 3, - 7, - 6, - // 0, type 0 - 0, - // 1, type 1 - 1, - // 2, type 1 - 1, - // 3, type 1 - 1, - // 4, type 1 - 1, - // 5, type 1 - 1, - // section "global" - 6, - 6, - 1, - // 0, "high", mutable i32 - 127, - 1, - 65, - 0, - 11, - // section "export" - 7, - 50, - 6, - // 0, "mul" - 3, - 109, - 117, - 108, - 0, - 1, - // 1, "div_s" - 5, - 100, - 105, - 118, - 95, - 115, - 0, - 2, - // 2, "div_u" - 5, - 100, - 105, - 118, - 95, - 117, - 0, - 3, - // 3, "rem_s" - 5, - 114, - 101, - 109, - 95, - 115, - 0, - 4, - // 4, "rem_u" - 5, - 114, - 101, - 109, - 95, - 117, - 0, - 5, - // 5, "get_high" - 8, - 103, - 101, - 116, - 95, - 104, - 105, - 103, - 104, - 0, - 0, - // section "code" - 10, - 191, - 1, - 6, - // 0, "get_high" - 4, - 0, - 35, - 0, - 11, - // 1, "mul" - 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, - // 2, "div_s" - 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, - // 3, "div_u" - 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, - // 4, "rem_s" - 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, - // 5, "rem_u" - 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 { -} -function Long(low, high, unsigned) { - this.low = low | 0; - this.high = high | 0; - this.unsigned = !!unsigned; -} -Long.prototype.__isLong__; -Object.defineProperty(Long.prototype, "__isLong__", { value: true }); -function isLong(obj) { - return (obj && obj["__isLong__"]) === true; -} -function ctz32(value) { - var c = Math.clz32(value & -value); - return value ? 31 - c : c; -} -Long.isLong = isLong; -var INT_CACHE = {}; -var UINT_CACHE = {}; -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, 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; - } -} -Long.fromInt = fromInt; -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 - ); -} -Long.fromNumber = fromNumber; -function fromBits(lowBits, highBits, unsigned) { - return new Long(lowBits, highBits, unsigned); -} -Long.fromBits = fromBits; -var pow_dbl = Math.pow; -function fromString(str2, unsigned, radix) { - if (str2.length === 0) throw Error("empty string"); - if (typeof unsigned === "number") { - radix = unsigned; - unsigned = false; - } else { - unsigned = !!unsigned; - } - if (str2 === "NaN" || str2 === "Infinity" || str2 === "+Infinity" || str2 === "-Infinity") - return unsigned ? UZERO : ZERO; - radix = radix || 10; - if (radix < 2 || 36 < radix) throw RangeError("radix"); - var p; - if ((p = str2.indexOf("-")) > 0) throw Error("interior hyphen"); - else if (p === 0) { - return fromString(str2.substring(1), unsigned, radix).neg(); - } - var radixToPower = fromNumber(pow_dbl(radix, 8)); - var result = ZERO; - for (var i = 0; i < str2.length; i += 8) { - var size = Math.min(8, str2.length - i), value = parseInt(str2.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; -} -Long.fromString = fromString; -function fromValue(val, unsigned) { - if (typeof val === "number") return fromNumber(val, unsigned); - if (typeof val === "string") return fromString(val, unsigned); - return fromBits( - val.low, - val.high, - typeof unsigned === "boolean" ? unsigned : val.unsigned - ); -} -Long.fromValue = fromValue; -var TWO_PWR_16_DBL = 1 << 16; -var TWO_PWR_24_DBL = 1 << 24; -var TWO_PWR_32_DBL = TWO_PWR_16_DBL * TWO_PWR_16_DBL; -var TWO_PWR_64_DBL = TWO_PWR_32_DBL * TWO_PWR_32_DBL; -var TWO_PWR_63_DBL = TWO_PWR_64_DBL / 2; -var TWO_PWR_24 = fromInt(TWO_PWR_24_DBL); -var ZERO = fromInt(0); -Long.ZERO = ZERO; -var UZERO = fromInt(0, true); -Long.UZERO = UZERO; -var ONE = fromInt(1); -Long.ONE = ONE; -var UONE = fromInt(1, true); -Long.UONE = UONE; -var NEG_ONE = fromInt(-1); -Long.NEG_ONE = NEG_ONE; -var MAX_VALUE = fromBits(4294967295 | 0, 2147483647 | 0, false); -Long.MAX_VALUE = MAX_VALUE; -var MAX_UNSIGNED_VALUE = fromBits(4294967295 | 0, 4294967295 | 0, true); -Long.MAX_UNSIGNED_VALUE = MAX_UNSIGNED_VALUE; -var MIN_VALUE = fromBits(0, 2147483648 | 0, false); -Long.MIN_VALUE = MIN_VALUE; -var LongPrototype = Long.prototype; -LongPrototype.toInt = function toInt() { - return this.unsigned ? this.low >>> 0 : this.low; -}; -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); -}; -LongPrototype.toString = function toString2(radix) { - radix = radix || 10; - if (radix < 2 || 36 < radix) throw RangeError("radix"); - if (this.isZero()) return "0"; - if (this.isNegative()) { - if (this.eq(MIN_VALUE)) { - 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); - } - 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; - } - } -}; -LongPrototype.getHighBits = function getHighBits() { - return this.high; -}; -LongPrototype.getHighBitsUnsigned = function getHighBitsUnsigned() { - return this.high >>> 0; -}; -LongPrototype.getLowBits = function getLowBits() { - return this.low; -}; -LongPrototype.getLowBitsUnsigned = function getLowBitsUnsigned() { - return this.low >>> 0; -}; -LongPrototype.getNumBitsAbs = function getNumBitsAbs() { - if (this.isNegative()) - 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; -}; -LongPrototype.isSafeInteger = function isSafeInteger() { - var top11Bits = this.high >> 21; - if (!top11Bits) return true; - if (this.unsigned) return false; - return top11Bits === -1 && !(this.low === 0 && this.high === -2097152); -}; -LongPrototype.isZero = function isZero() { - return this.high === 0 && this.low === 0; -}; -LongPrototype.eqz = LongPrototype.isZero; -LongPrototype.isNegative = function isNegative() { - return !this.unsigned && this.high < 0; -}; -LongPrototype.isPositive = function isPositive() { - return this.unsigned || this.high >= 0; -}; -LongPrototype.isOdd = function isOdd() { - return (this.low & 1) === 1; -}; -LongPrototype.isEven = function isEven() { - return (this.low & 1) === 0; -}; -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; -}; -LongPrototype.eq = LongPrototype.equals; -LongPrototype.notEquals = function notEquals(other) { - return !this.eq( - /* validates */ - other - ); -}; -LongPrototype.neq = LongPrototype.notEquals; -LongPrototype.ne = LongPrototype.notEquals; -LongPrototype.lessThan = function lessThan(other) { - return this.comp( - /* validates */ - other - ) < 0; -}; -LongPrototype.lt = LongPrototype.lessThan; -LongPrototype.lessThanOrEqual = function lessThanOrEqual(other) { - return this.comp( - /* validates */ - other - ) <= 0; -}; -LongPrototype.lte = LongPrototype.lessThanOrEqual; -LongPrototype.le = LongPrototype.lessThanOrEqual; -LongPrototype.greaterThan = function greaterThan(other) { - return this.comp( - /* validates */ - other - ) > 0; -}; -LongPrototype.gt = LongPrototype.greaterThan; -LongPrototype.greaterThanOrEqual = function greaterThanOrEqual(other) { - return this.comp( - /* validates */ - other - ) >= 0; -}; -LongPrototype.gte = LongPrototype.greaterThanOrEqual; -LongPrototype.ge = LongPrototype.greaterThanOrEqual; -LongPrototype.compare = function compare2(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; - if (!this.unsigned) return this.sub(other).isNegative() ? -1 : 1; - return other.high >>> 0 > this.high >>> 0 || other.high === this.high && other.low >>> 0 > this.low >>> 0 ? -1 : 1; -}; -LongPrototype.comp = LongPrototype.compare; -LongPrototype.negate = function negate() { - if (!this.unsigned && this.eq(MIN_VALUE)) return MIN_VALUE; - return this.not().add(ONE); -}; -LongPrototype.neg = LongPrototype.negate; -LongPrototype.add = function add(addend) { - if (!isLong(addend)) addend = fromValue(addend); - var a48 = this.high >>> 16; - var a32 = this.high & 65535; - var a16 = this.low >>> 16; - var a00 = this.low & 65535; - var b48 = addend.high >>> 16; - var b32 = addend.high & 65535; - var b16 = addend.low >>> 16; - var b00 = addend.low & 65535; - var c48 = 0, c32 = 0, c16 = 0, c00 = 0; - c00 += a00 + b00; - c16 += c00 >>> 16; - c00 &= 65535; - c16 += a16 + b16; - c32 += c16 >>> 16; - c16 &= 65535; - c32 += a32 + b32; - c48 += c32 >>> 16; - c32 &= 65535; - c48 += a48 + b48; - c48 &= 65535; - return fromBits(c16 << 16 | c00, c48 << 16 | c32, this.unsigned); -}; -LongPrototype.subtract = function subtract(subtrahend) { - if (!isLong(subtrahend)) subtrahend = fromValue(subtrahend); - return this.add(subtrahend.neg()); -}; -LongPrototype.sub = LongPrototype.subtract; -LongPrototype.multiply = function multiply(multiplier) { - if (this.isZero()) return this; - if (!isLong(multiplier)) multiplier = fromValue(multiplier); - 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 this.unsigned ? UZERO : 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 (this.lt(TWO_PWR_24) && multiplier.lt(TWO_PWR_24)) - return fromNumber(this.toNumber() * multiplier.toNumber(), this.unsigned); - var a48 = this.high >>> 16; - var a32 = this.high & 65535; - var a16 = this.low >>> 16; - var a00 = this.low & 65535; - var b48 = multiplier.high >>> 16; - var b32 = multiplier.high & 65535; - var b16 = multiplier.low >>> 16; - var b00 = multiplier.low & 65535; - var c48 = 0, c32 = 0, c16 = 0, c00 = 0; - c00 += a00 * b00; - c16 += c00 >>> 16; - c00 &= 65535; - c16 += a16 * b00; - c32 += c16 >>> 16; - c16 &= 65535; - c16 += a00 * b16; - c32 += c16 >>> 16; - c16 &= 65535; - c32 += a32 * b00; - c48 += c32 >>> 16; - c32 &= 65535; - c32 += a16 * b16; - c48 += c32 >>> 16; - c32 &= 65535; - c32 += a00 * b32; - c48 += c32 >>> 16; - c32 &= 65535; - c48 += a48 * b00 + a32 * b16 + a16 * b32 + a00 * b48; - c48 &= 65535; - return fromBits(c16 << 16 | c00, c48 << 16 | c32, this.unsigned); -}; -LongPrototype.mul = LongPrototype.multiply; -LongPrototype.divide = function divide(divisor) { - if (!isLong(divisor)) divisor = fromValue(divisor); - if (divisor.isZero()) throw Error("division by zero"); - if (wasm) { - if (!this.unsigned && this.high === -2147483648 && divisor.low === -1 && divisor.high === -1) { - 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) { - if (this.eq(MIN_VALUE)) { - if (divisor.eq(ONE) || divisor.eq(NEG_ONE)) - return MIN_VALUE; - else if (divisor.eq(MIN_VALUE)) return ONE; - else { - 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 { - if (!divisor.unsigned) divisor = divisor.toUnsigned(); - if (divisor.gt(this)) return UZERO; - if (divisor.gt(this.shru(1))) - return UONE; - res = UZERO; - } - rem = this; - while (rem.gte(divisor)) { - approx = Math.max(1, Math.floor(rem.toNumber() / divisor.toNumber())); - var log2 = Math.ceil(Math.log(approx) / Math.LN2), delta = log2 <= 48 ? 1 : pow_dbl(2, log2 - 48), approxRes = fromNumber(approx), approxRem = approxRes.mul(divisor); - while (approxRem.isNegative() || approxRem.gt(rem)) { - approx -= delta; - approxRes = fromNumber(approx, this.unsigned); - approxRem = approxRes.mul(divisor); - } - if (approxRes.isZero()) approxRes = ONE; - res = res.add(approxRes); - rem = rem.sub(approxRem); - } - return res; -}; -LongPrototype.div = LongPrototype.divide; -LongPrototype.modulo = function modulo(divisor) { - if (!isLong(divisor)) divisor = fromValue(divisor); - 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)); -}; -LongPrototype.mod = LongPrototype.modulo; -LongPrototype.rem = LongPrototype.modulo; -LongPrototype.not = function not() { - return fromBits(~this.low, ~this.high, this.unsigned); -}; -LongPrototype.countLeadingZeros = function countLeadingZeros() { - return this.high ? Math.clz32(this.high) : Math.clz32(this.low) + 32; -}; -LongPrototype.clz = LongPrototype.countLeadingZeros; -LongPrototype.countTrailingZeros = function countTrailingZeros() { - return this.low ? ctz32(this.low) : ctz32(this.high) + 32; -}; -LongPrototype.ctz = LongPrototype.countTrailingZeros; -LongPrototype.and = function and(other) { - if (!isLong(other)) other = fromValue(other); - return fromBits(this.low & other.low, this.high & other.high, this.unsigned); -}; -LongPrototype.or = function or(other) { - if (!isLong(other)) other = fromValue(other); - return fromBits(this.low | other.low, this.high | other.high, this.unsigned); -}; -LongPrototype.xor = function xor(other) { - if (!isLong(other)) other = fromValue(other); - return fromBits(this.low ^ other.low, this.high ^ other.high, this.unsigned); -}; -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); -}; -LongPrototype.shl = LongPrototype.shiftLeft; -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 - ); -}; -LongPrototype.shr = LongPrototype.shiftRight; -LongPrototype.shiftRightUnsigned = function shiftRightUnsigned(numBits) { - if (isLong(numBits)) numBits = numBits.toInt(); - if ((numBits &= 63) === 0) return this; - if (numBits < 32) - return fromBits( - this.low >>> numBits | this.high << 32 - numBits, - this.high >>> numBits, - this.unsigned - ); - if (numBits === 32) return fromBits(this.high, 0, this.unsigned); - return fromBits(this.high >>> numBits - 32, 0, this.unsigned); -}; -LongPrototype.shru = LongPrototype.shiftRightUnsigned; -LongPrototype.shr_u = LongPrototype.shiftRightUnsigned; -LongPrototype.rotateLeft = function rotateLeft(numBits) { - var b; - if (isLong(numBits)) numBits = numBits.toInt(); - if ((numBits &= 63) === 0) return this; - if (numBits === 32) return fromBits(this.high, this.low, this.unsigned); - if (numBits < 32) { - b = 32 - numBits; - return fromBits( - this.low << numBits | this.high >>> b, - this.high << numBits | this.low >>> b, - this.unsigned - ); - } - numBits -= 32; - b = 32 - numBits; - return fromBits( - this.high << numBits | this.low >>> b, - this.low << numBits | this.high >>> b, - this.unsigned - ); -}; -LongPrototype.rotl = LongPrototype.rotateLeft; -LongPrototype.rotateRight = function rotateRight(numBits) { - var b; - if (isLong(numBits)) numBits = numBits.toInt(); - if ((numBits &= 63) === 0) return this; - if (numBits === 32) return fromBits(this.high, this.low, this.unsigned); - if (numBits < 32) { - b = 32 - numBits; - return fromBits( - this.high << b | this.low >>> numBits, - this.low << b | this.high >>> numBits, - this.unsigned - ); - } - numBits -= 32; - b = 32 - numBits; - return fromBits( - this.low << b | this.high >>> numBits, - this.high << b | this.low >>> numBits, - this.unsigned - ); -}; -LongPrototype.rotr = LongPrototype.rotateRight; -LongPrototype.toSigned = function toSigned() { - if (!this.unsigned) return this; - return fromBits(this.low, this.high, false); -}; -LongPrototype.toUnsigned = function toUnsigned() { - if (this.unsigned) return this; - return fromBits(this.low, this.high, true); -}; -LongPrototype.toBytes = function toBytes(le) { - return le ? this.toBytesLE() : this.toBytesBE(); -}; -LongPrototype.toBytesLE = function toBytesLE() { - var hi = this.high, lo = this.low; - return [ - lo & 255, - lo >>> 8 & 255, - lo >>> 16 & 255, - lo >>> 24, - hi & 255, - hi >>> 8 & 255, - hi >>> 16 & 255, - hi >>> 24 - ]; -}; -LongPrototype.toBytesBE = function toBytesBE() { - var hi = this.high, lo = this.low; - return [ - hi >>> 24, - hi >>> 16 & 255, - hi >>> 8 & 255, - hi & 255, - lo >>> 24, - lo >>> 16 & 255, - lo >>> 8 & 255, - lo & 255 - ]; -}; -Long.fromBytes = function fromBytes(bytes, unsigned, le) { - return le ? Long.fromBytesLE(bytes, unsigned) : Long.fromBytesBE(bytes, unsigned); -}; -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 - ); -}; -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 - ); -}; -if (typeof BigInt === "function") { - Long.fromBigInt = function fromBigInt(value, unsigned) { - var lowBits = Number(BigInt.asIntN(32, value)); - var highBits = Number(BigInt.asIntN(32, value >> BigInt(32))); - return fromBits(lowBits, highBits, unsigned); - }; - Long.fromValue = function fromValueWithBigInt(value, unsigned) { - if (typeof value === "bigint") return Long.fromBigInt(value, unsigned); - return fromValue(value, unsigned); - }; - LongPrototype.toBigInt = function toBigInt() { - var lowBigInt = BigInt(this.low >>> 0); - var highBigInt = BigInt(this.unsigned ? this.high >>> 0 : this.high); - return highBigInt << BigInt(32) | lowBigInt; - }; -} -var long_default = Long; - -// src/fingerprints.ts -var tab = " ".charCodeAt(0); -var space = " ".charCodeAt(0); -var lf = "\n".charCodeAt(0); -var cr = "\r".charCodeAt(0); -var EOF = 65535; -var BLOCK_SIZE = 100; -var MOD = long_default.fromInt(37); -function computeFirstMod() { - let firstMod = long_default.ONE; - for (let i = 0; i < BLOCK_SIZE; i++) { - firstMod = firstMod.multiply(MOD); - } - return firstMod; -} -async function hash(callback, filepath) { - const window2 = Array(BLOCK_SIZE).fill(0); - const lineNumbers = Array(BLOCK_SIZE).fill(-1); - let hashRaw = long_default.ZERO; - const firstMod = computeFirstMod(); - let index = 0; - let lineNumber = 0; - let lineStart = true; - let prevCR = false; - const hashCounts = {}; - const outputHash = function() { - const hashValue = hashRaw.toUnsigned().toString(16); - if (!hashCounts[hashValue]) { - hashCounts[hashValue] = 0; - } - hashCounts[hashValue]++; - callback(lineNumbers[index], `${hashValue}:${hashCounts[hashValue]}`); - lineNumbers[index] = -1; - }; - const updateHash = function(current) { - const begin = window2[index]; - window2[index] = current; - hashRaw = MOD.multiply(hashRaw).add(long_default.fromInt(current)).subtract(firstMod.multiply(long_default.fromInt(begin))); - index = (index + 1) % BLOCK_SIZE; - }; - const processCharacter = function(current) { - if (current === space || current === tab || prevCR && current === lf) { - prevCR = false; - return; - } - 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); - }; - const readStream = fs10.createReadStream(filepath, "utf8"); - for await (const data of readStream) { - for (let i = 0; i < data.length; ++i) { - processCharacter(data.charCodeAt(i)); - } - } - processCharacter(EOF); - for (let i = 0; i < BLOCK_SIZE; i++) { - if (lineNumbers[index] !== -1) { - outputHash(); - } - updateHash(0); - } -} -function locationUpdateCallback(result, location, logger) { - let locationStartLine = location.physicalLocation?.region?.startLine; - if (locationStartLine === void 0) { - locationStartLine = 1; - } - return function(lineNumber, hashValue) { - if (locationStartLine !== lineNumber) { - return; - } - if (!result.partialFingerprints) { - result.partialFingerprints = {}; - } - const existingFingerprint = result.partialFingerprints.primaryLocationLineHash; - if (!existingFingerprint) { - result.partialFingerprints.primaryLocationLineHash = hashValue; - } else if (existingFingerprint !== hashValue) { - logger.warning( - `Calculated fingerprint of ${hashValue} for file ${location.physicalLocation.artifactLocation.uri} line ${lineNumber}, but found existing inconsistent fingerprint value ${existingFingerprint}` - ); - } - }; -} -function resolveUriToFile(location, artifacts, sourceRoot, logger) { - if (!location.uri && location.index !== void 0) { - if (typeof location.index !== "number" || location.index < 0 || location.index >= artifacts.length || typeof artifacts[location.index].location !== "object") { - logger.debug(`Ignoring location as index "${location.index}" is invalid`); - return void 0; - } - location = artifacts[location.index].location; - } - if (typeof location.uri !== "string") { - logger.debug(`Ignoring location as URI "${location.uri}" is invalid`); - return void 0; - } - let uri; - try { - uri = decodeURIComponent(location.uri); - } catch { - logger.debug(`Ignoring location as URI "${location.uri}" is invalid`); - return void 0; - } - 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 void 0; - } - const srcRootPrefix = `${sourceRoot}/`; - if (uri.startsWith("/") && !uri.startsWith(srcRootPrefix)) { - logger.debug( - `Ignoring location URI "${uri}" as it is outside of the src root` - ); - return void 0; - } - if (!import_path2.default.isAbsolute(uri)) { - uri = srcRootPrefix + uri; - } - if (!fs10.existsSync(uri)) { - logger.debug(`Unable to compute fingerprint for non-existent file: ${uri}`); - return void 0; - } - if (fs10.statSync(uri).isDirectory()) { - logger.debug(`Unable to compute fingerprint for directory: ${uri}`); - return void 0; - } - return uri; -} -async function addFingerprints(sarif, sourceRoot, logger) { - logger.info( - `Adding fingerprints to SARIF file. See ${"https://docs.github.com/en/enterprise-cloud@latest/code-security/code-scanning/integrating-with-code-scanning/sarif-support-for-code-scanning#providing-data-to-track-code-scanning-alerts-across-runs" /* TRACK_CODE_SCANNING_ALERTS_ACROSS_RUNS */} for more information.` - ); - const callbacksByFile = {}; - for (const run of sarif.runs || []) { - const artifacts = run.artifacts || []; - for (const result of run.results || []) { - const primaryLocation = (result.locations || [])[0]; - if (!primaryLocation?.physicalLocation?.artifactLocation) { - logger.debug( - `Unable to compute fingerprint for invalid location: ${JSON.stringify( - primaryLocation - )}` - ); - continue; - } - if (primaryLocation?.physicalLocation?.region?.startLine === void 0) { - continue; - } - const filepath = resolveUriToFile( - primaryLocation.physicalLocation.artifactLocation, - artifacts, - sourceRoot, - logger - ); - if (!filepath) { - continue; - } - if (!callbacksByFile[filepath]) { - callbacksByFile[filepath] = []; - } - callbacksByFile[filepath].push( - locationUpdateCallback(result, primaryLocation, logger) - ); - } - } - for (const [filepath, callbacks] of Object.entries(callbacksByFile)) { - const teeCallback = function(lineNumber, hashValue) { - for (const c of Object.values(callbacks)) { - c(lineNumber, hashValue); - } - }; - await hash(teeCallback, filepath); - } - return sarif; -} - // src/init.ts -var toolrunner4 = __toESM(require_toolrunner()); -var io5 = __toESM(require_io()); async function initCodeQL(toolsInput, apiDetails, tempDir, variant, defaultCliVersion, features, logger) { logger.startGroup("Setup CodeQL tools"); const { @@ -110150,7 +110116,7 @@ function combineSarifFiles(sarifFiles, logger) { for (const sarifFile of sarifFiles) { logger.debug(`Loading SARIF file: ${sarifFile}`); const sarifObject = JSON.parse( - fs11.readFileSync(sarifFile, "utf8") + fs10.readFileSync(sarifFile, "utf8") ); if (combinedSarif.version === null) { combinedSarif.version = sarifObject.version; @@ -110244,10 +110210,10 @@ async function minimalInitCodeQL(logger, gitHubVersion, features) { ); return initCodeQLResult.codeql; } -async function combineSarifFilesUsingCLI(sarifFiles, gitHubVersion, features, logger) { +async function combineSarifFilesUsingCLI(sarifFiles, gitHubVersion, _features, logger, getCodeQL, tempDir) { logger.info("Combining SARIF files using the CodeQL CLI"); const sarifObjects = sarifFiles.map((sarifFile) => { - return JSON.parse(fs11.readFileSync(sarifFile, "utf8")); + return JSON.parse(fs10.readFileSync(sarifFile, "utf8")); }); const deprecationWarningMessage = gitHubVersion.type === "GitHub Enterprise Server" /* GHES */ ? "and will be removed in GitHub Enterprise Server 3.18" : "and will be removed in July 2025"; const deprecationMoreInformationMessage = "For more information, see https://github.blog/changelog/2024-05-06-code-scanning-will-stop-combining-runs-from-a-single-upload"; @@ -110267,23 +110233,15 @@ async function combineSarifFilesUsingCLI(sarifFiles, gitHubVersion, features, lo } return combineSarifFiles(sarifFiles, logger); } - let codeQL; - let tempDir = getTemporaryDirectory(); - const config = await getConfig(tempDir, logger); - if (config !== void 0) { - codeQL = await getCodeQL(config.codeQLCmd); - tempDir = config.tempDir; - } else { - codeQL = await minimalInitCodeQL(logger, gitHubVersion, features); - } - const baseTempDir = path11.resolve(tempDir, "combined-sarif"); - fs11.mkdirSync(baseTempDir, { recursive: true }); - const outputDirectory = fs11.mkdtempSync(path11.resolve(baseTempDir, "output-")); - const outputFile = path11.resolve(outputDirectory, "combined-sarif.sarif"); + const codeQL = await getCodeQL(); + const baseTempDir = path10.resolve(tempDir, "combined-sarif"); + fs10.mkdirSync(baseTempDir, { recursive: true }); + const outputDirectory = fs10.mkdtempSync(path10.resolve(baseTempDir, "output-")); + const outputFile = path10.resolve(outputDirectory, "combined-sarif.sarif"); await codeQL.mergeResults(sarifFiles, outputFile, { mergeRunsFromEqualCategory: true }); - return JSON.parse(fs11.readFileSync(outputFile, "utf8")); + return JSON.parse(fs10.readFileSync(outputFile, "utf8")); } function populateRunAutomationDetails(sarif, category, analysis_key, environment) { const automationID = getAutomationID2(category, analysis_key, environment); @@ -110312,7 +110270,7 @@ function getAutomationID2(category, analysis_key, environment) { async function uploadPayload(payload, repositoryNwo, logger, analysis) { logger.info("Uploading results"); if (shouldSkipSarifUpload()) { - const payloadSaveFile = path11.join( + const payloadSaveFile = path10.join( getTemporaryDirectory(), `payload-${analysis.kind}.json` ); @@ -110320,7 +110278,7 @@ async function uploadPayload(payload, repositoryNwo, logger, analysis) { `SARIF upload disabled by an environment variable. Saving to ${payloadSaveFile}` ); logger.info(`Payload: ${JSON.stringify(payload, null, 2)}`); - fs11.writeFileSync(payloadSaveFile, JSON.stringify(payload, null, 2)); + fs10.writeFileSync(payloadSaveFile, JSON.stringify(payload, null, 2)); return "dummy-sarif-id"; } const client = getApiClient(); @@ -110354,12 +110312,12 @@ async function uploadPayload(payload, repositoryNwo, logger, analysis) { function findSarifFilesInDir(sarifPath, isSarif) { const sarifFiles = []; const walkSarifFiles = (dir) => { - const entries = fs11.readdirSync(dir, { withFileTypes: true }); + const entries = fs10.readdirSync(dir, { withFileTypes: true }); for (const entry of entries) { if (entry.isFile() && isSarif(entry.name)) { - sarifFiles.push(path11.resolve(dir, entry.name)); + sarifFiles.push(path10.resolve(dir, entry.name)); } else if (entry.isDirectory()) { - walkSarifFiles(path11.resolve(dir, entry.name)); + walkSarifFiles(path10.resolve(dir, entry.name)); } } }; @@ -110367,11 +110325,11 @@ function findSarifFilesInDir(sarifPath, isSarif) { return sarifFiles; } function getSarifFilePaths(sarifPath, isSarif) { - if (!fs11.existsSync(sarifPath)) { + if (!fs10.existsSync(sarifPath)) { throw new ConfigurationError(`Path does not exist: ${sarifPath}`); } let sarifFiles; - if (fs11.lstatSync(sarifPath).isDirectory()) { + if (fs10.lstatSync(sarifPath).isDirectory()) { sarifFiles = findSarifFilesInDir(sarifPath, isSarif); if (sarifFiles.length === 0) { throw new ConfigurationError( @@ -110384,7 +110342,7 @@ function getSarifFilePaths(sarifPath, isSarif) { return sarifFiles; } async function getGroupedSarifFilePaths(logger, sarifPath) { - const stats = fs11.statSync(sarifPath, { throwIfNoEntry: false }); + const stats = fs10.statSync(sarifPath, { throwIfNoEntry: false }); if (stats === void 0) { throw new ConfigurationError(`Path does not exist: ${sarifPath}`); } @@ -110392,7 +110350,7 @@ async function getGroupedSarifFilePaths(logger, sarifPath) { if (stats.isDirectory()) { let unassignedSarifFiles = findSarifFilesInDir( sarifPath, - (name) => path11.extname(name) === ".sarif" + (name) => path10.extname(name) === ".sarif" ); logger.debug( `Found the following .sarif files in ${sarifPath}: ${unassignedSarifFiles.join(", ")}` @@ -110449,7 +110407,7 @@ function countResultsInSarif(sarif) { } function readSarifFile(sarifFilePath) { try { - return JSON.parse(fs11.readFileSync(sarifFilePath, "utf8")); + return JSON.parse(fs10.readFileSync(sarifFilePath, "utf8")); } catch (e) { throw new InvalidSarifUploadError( `Invalid SARIF. JSON syntax error: ${getErrorMessage(e)}` @@ -110518,7 +110476,7 @@ function buildPayload(commitOid, ref, analysisKey, analysisName, zippedSarif, wo payloadObj.base_sha = mergeBaseCommitOid; } else if (process.env.GITHUB_EVENT_PATH) { const githubEvent = JSON.parse( - fs11.readFileSync(process.env.GITHUB_EVENT_PATH, "utf8") + fs10.readFileSync(process.env.GITHUB_EVENT_PATH, "utf8") ); payloadObj.base_ref = `refs/heads/${githubEvent.pull_request.base.ref}`; payloadObj.base_sha = githubEvent.pull_request.base.sha; @@ -110526,7 +110484,7 @@ function buildPayload(commitOid, ref, analysisKey, analysisName, zippedSarif, wo } return payloadObj; } -async function postProcessSarifFiles(logger, features, checkoutPath, sarifPaths, category, analysis) { +async function postProcessSarifFiles(logger, features, getCodeQL, tempPath, checkoutPath, sarifPaths, category, analysis) { logger.info(`Post-processing sarif files: ${JSON.stringify(sarifPaths)}`); const gitHubVersion = await getGitHubVersion(); let sarif; @@ -110540,7 +110498,9 @@ async function postProcessSarifFiles(logger, features, checkoutPath, sarifPaths, sarifPaths, gitHubVersion, features, - logger + logger, + getCodeQL, + tempPath ); } else { const sarifPath = sarifPaths[0]; @@ -110573,12 +110533,14 @@ async function writePostProcessedFiles(logger, pathInput, uploadTarget, postProc logger.debug(`Not writing post-processed SARIF files.`); } } -async function uploadFiles(inputSarifPath, checkoutPath, category, features, logger, uploadTarget) { +async function uploadFiles(tempDir, codeql, inputSarifPath, checkoutPath, category, features, logger, uploadTarget) { const sarifPaths = getSarifFilePaths( inputSarifPath, uploadTarget.sarifPredicate ); return uploadSpecifiedFiles( + tempDir, + codeql, sarifPaths, checkoutPath, category, @@ -110587,10 +110549,12 @@ async function uploadFiles(inputSarifPath, checkoutPath, category, features, log uploadTarget ); } -async function uploadSpecifiedFiles(sarifPaths, checkoutPath, category, features, logger, uploadTarget) { +async function uploadSpecifiedFiles(tempDir, codeql, sarifPaths, checkoutPath, category, features, logger, uploadTarget) { const processingResults = await postProcessSarifFiles( logger, features, + async () => codeql, + tempDir, checkoutPath, sarifPaths, category, @@ -110652,19 +110616,19 @@ async function uploadPostProcessedFiles(logger, checkoutPath, uploadTarget, post }; } function dumpSarifFile(sarifPayload, outputDir, logger, uploadTarget) { - if (!fs11.existsSync(outputDir)) { - fs11.mkdirSync(outputDir, { recursive: true }); - } else if (!fs11.lstatSync(outputDir).isDirectory()) { + if (!fs10.existsSync(outputDir)) { + fs10.mkdirSync(outputDir, { recursive: true }); + } else if (!fs10.lstatSync(outputDir).isDirectory()) { throw new ConfigurationError( `The path that processed SARIF files should be written to exists, but is not a directory: ${outputDir}` ); } - const outputFile = path11.resolve( + const outputFile = path10.resolve( outputDir, `upload${uploadTarget.sarifExtension}` ); logger.info(`Writing processed SARIF file to ${outputFile}`); - fs11.writeFileSync(outputFile, sarifPayload); + fs10.writeFileSync(outputFile, sarifPayload); } var STATUS_CHECK_FREQUENCY_MILLISECONDS = 5 * 1e3; var STATUS_CHECK_TIMEOUT_MILLISECONDS = 2 * 60 * 1e3; @@ -110807,7 +110771,7 @@ function filterAlertsByDiffRange(logger, sarif) { if (!locationUri || locationStartLine === void 0) { return false; } - const locationPath = path11.join(checkoutPath, locationUri).replaceAll(path11.sep, "/"); + const locationPath = path10.join(checkoutPath, locationUri).replaceAll(path10.sep, "/"); return diffRanges.some( (range) => range.path === locationPath && (range.startLine <= locationStartLine && range.endLine >= locationStartLine || range.startLine === 0 && range.endLine === 0) ); diff --git a/lib/upload-sarif-action.js b/lib/upload-sarif-action.js index f4635e27d..2190120dc 100644 --- a/lib/upload-sarif-action.js +++ b/lib/upload-sarif-action.js @@ -47409,6 +47409,1303 @@ var require_light = __commonJS({ } }); +// node_modules/jsonschema/lib/helpers.js +var require_helpers = __commonJS({ + "node_modules/jsonschema/lib/helpers.js"(exports2, module2) { + "use strict"; + var uri = require("url"); + var ValidationError = exports2.ValidationError = function ValidationError2(message, instance, schema2, path13, name, argument) { + if (Array.isArray(path13)) { + this.path = path13; + this.property = path13.reduce(function(sum, item) { + return sum + makeSuffix(item); + }, "instance"); + } else if (path13 !== void 0) { + this.property = path13; + } + if (message) { + this.message = message; + } + if (schema2) { + var id = schema2.$id || schema2.id; + this.schema = id || schema2; + } + if (instance !== void 0) { + this.instance = instance; + } + this.name = name; + this.argument = argument; + this.stack = this.toString(); + }; + ValidationError.prototype.toString = function toString3() { + return this.property + " " + this.message; + }; + var ValidatorResult = exports2.ValidatorResult = function ValidatorResult2(instance, schema2, options, ctx) { + this.instance = instance; + this.schema = schema2; + this.options = options; + this.path = ctx.path; + this.propertyPath = ctx.propertyPath; + this.errors = []; + this.throwError = options && options.throwError; + this.throwFirst = options && options.throwFirst; + this.throwAll = options && options.throwAll; + 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.path); + } 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.path, detail.name, detail.argument); + } + this.errors.push(err); + if (this.throwFirst) { + throw new ValidatorResultError(this); + } else if (this.throwError) { + throw err; + } + return err; + }; + ValidatorResult.prototype.importErrors = function importErrors(res) { + if (typeof res == "string" || res && res.validatorType) { + this.addError(res); + } else if (res && res.errors) { + this.errors = this.errors.concat(res.errors); + } + }; + function stringizer(v, i) { + return i + ": " + v.toString() + "\n"; + } + ValidatorResult.prototype.toString = function toString3(res) { + return this.errors.map(stringizer).join(""); + }; + Object.defineProperty(ValidatorResult.prototype, "valid", { get: function() { + return !this.errors.length; + } }); + module2.exports.ValidatorResultError = ValidatorResultError; + function ValidatorResultError(result) { + if (Error.captureStackTrace) { + Error.captureStackTrace(this, ValidatorResultError); + } + this.instance = result.instance; + this.schema = result.schema; + this.options = result.options; + this.errors = result.errors; + } + ValidatorResultError.prototype = new Error(); + ValidatorResultError.prototype.constructor = ValidatorResultError; + ValidatorResultError.prototype.name = "Validation Error"; + var SchemaError = exports2.SchemaError = function SchemaError2(msg, schema2) { + this.message = msg; + this.schema = schema2; + Error.call(this, msg); + Error.captureStackTrace(this, SchemaError2); + }; + SchemaError.prototype = Object.create( + Error.prototype, + { + constructor: { value: SchemaError, enumerable: false }, + name: { value: "SchemaError", enumerable: false } + } + ); + var SchemaContext = exports2.SchemaContext = function SchemaContext2(schema2, options, path13, base, schemas) { + this.schema = schema2; + this.options = options; + if (Array.isArray(path13)) { + this.path = path13; + this.propertyPath = path13.reduce(function(sum, item) { + return sum + makeSuffix(item); + }, "instance"); + } else { + this.propertyPath = path13; + } + this.base = base; + this.schemas = schemas; + }; + SchemaContext.prototype.resolve = function resolve6(target) { + return uri.resolve(this.base, target); + }; + SchemaContext.prototype.makeChild = function makeChild(schema2, propertyName) { + var path13 = propertyName === void 0 ? this.path : this.path.concat([propertyName]); + var id = schema2.$id || schema2.id; + var base = uri.resolve(this.base, id || ""); + var ctx = new SchemaContext(schema2, this.options, path13, base, Object.create(this.schemas)); + if (id && !ctx.schemas[base]) { + ctx.schemas[base] = schema2; + } + return ctx; + }; + var FORMAT_REGEXPS = exports2.FORMAT_REGEXPS = { + // 7.3.1. Dates, Times, and Duration + "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])$/, + "duration": /P(T\d+(H(\d+M(\d+S)?)?|M(\d+S)?|S)|\d+(D|M(\d+D)?|Y(\d+M(\d+D)?)?)(T\d+(H(\d+M(\d+S)?)?|M(\d+S)?|S))?|\d+W)/i, + // 7.3.2. Email Addresses + // TODO: fix the email production + "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])\]))$/, + "idn-email": /^("(?:[!#-\[\]-\u{10FFFF}]|\\[\t -\u{10FFFF}])*"|[!#-'*+\-/-9=?A-Z\^-\u{10FFFF}](?:\.?[!#-'*+\-/-9=?A-Z\^-\u{10FFFF}])*)@([!#-'*+\-/-9=?A-Z\^-\u{10FFFF}](?:\.?[!#-'*+\-/-9=?A-Z\^-\u{10FFFF}])*|\[[!-Z\^-\u{10FFFF}]*\])$/u, + // 7.3.3. Hostnames + // 7.3.4. IP Addresses + "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]?)$/, + // FIXME whitespace is invalid + "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*$/, + // 7.3.5. Resource Identifiers + // TODO: A more accurate regular expression for "uri" goes: + // [A-Za-z][+\-.0-9A-Za-z]*:((/(/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?)?)?#(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|(/(/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?[/?]|[!$&-.0-;=?-Z_a-z~])|/?%[0-9A-Fa-f]{2}|[!$&-.0-;=?-Z_a-z~])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*(#(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*)?|/(/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+(:\d*)?|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?:\d*|\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)?)? + "uri": /^[a-zA-Z][a-zA-Z0-9+.-]*:[^\s]*$/, + "uri-reference": /^(((([A-Za-z][+\-.0-9A-Za-z]*(:%[0-9A-Fa-f]{2}|:[!$&-.0-;=?-Z_a-z~]|[/?])|\?)(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|([A-Za-z][+\-.0-9A-Za-z]*:?)?)|([A-Za-z][+\-.0-9A-Za-z]*:)?\/((%[0-9A-Fa-f]{2}|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?[/?]|[!$&-.0-;=?-Z_a-z~])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|(\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?)?))#(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|(([A-Za-z][+\-.0-9A-Za-z]*)?%[0-9A-Fa-f]{2}|[!$&-.0-9;=@_~]|[A-Za-z][+\-.0-9A-Za-z]*[!$&-*,;=@_~])(%[0-9A-Fa-f]{2}|[!$&-.0-9;=@-Z_a-z~])*((([/?](%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*)?#|[/?])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*)?|([A-Za-z][+\-.0-9A-Za-z]*(:%[0-9A-Fa-f]{2}|:[!$&-.0-;=?-Z_a-z~]|[/?])|\?)(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|([A-Za-z][+\-.0-9A-Za-z]*:)?\/((%[0-9A-Fa-f]{2}|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?[/?]|[!$&-.0-;=?-Z_a-z~])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+(:\d*)?|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?:\d*|\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)?|[A-Za-z][+\-.0-9A-Za-z]*:?)?$/, + "iri": /^[a-zA-Z][a-zA-Z0-9+.-]*:[^\s]*$/, + "iri-reference": /^(((([A-Za-z][+\-.0-9A-Za-z]*(:%[0-9A-Fa-f]{2}|:[!$&-.0-;=?-Z_a-z~-\u{10FFFF}]|[/?])|\?)(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|([A-Za-z][+\-.0-9A-Za-z]*:?)?)|([A-Za-z][+\-.0-9A-Za-z]*:)?\/((%[0-9A-Fa-f]{2}|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~-\u{10FFFF}])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?[/?]|[!$&-.0-;=?-Z_a-z~-\u{10FFFF}])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|(\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~-\u{10FFFF}])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?)?))#(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|(([A-Za-z][+\-.0-9A-Za-z]*)?%[0-9A-Fa-f]{2}|[!$&-.0-9;=@_~-\u{10FFFF}]|[A-Za-z][+\-.0-9A-Za-z]*[!$&-*,;=@_~-\u{10FFFF}])(%[0-9A-Fa-f]{2}|[!$&-.0-9;=@-Z_a-z~-\u{10FFFF}])*((([/?](%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*)?#|[/?])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*)?|([A-Za-z][+\-.0-9A-Za-z]*(:%[0-9A-Fa-f]{2}|:[!$&-.0-;=?-Z_a-z~-\u{10FFFF}]|[/?])|\?)(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|([A-Za-z][+\-.0-9A-Za-z]*:)?\/((%[0-9A-Fa-f]{2}|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~-\u{10FFFF}])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?[/?]|[!$&-.0-;=?-Z_a-z~-\u{10FFFF}])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~-\u{10FFFF}])+(:\d*)?|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?:\d*|\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?)?|[A-Za-z][+\-.0-9A-Za-z]*:?)?$/u, + "uuid": /^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$/i, + // 7.3.6. uri-template + "uri-template": /(%[0-9a-f]{2}|[!#$&(-;=?@\[\]_a-z~]|\{[!#&+,./;=?@|]?(%[0-9a-f]{2}|[0-9_a-z])(\.?(%[0-9a-f]{2}|[0-9_a-z]))*(:[1-9]\d{0,3}|\*)?(,(%[0-9a-f]{2}|[0-9_a-z])(\.?(%[0-9a-f]{2}|[0-9_a-z]))*(:[1-9]\d{0,3}|\*)?)*\})*/iu, + // 7.3.7. JSON Pointers + "json-pointer": /^(\/([\x00-\x2e0-@\[-}\x7f]|~[01])*)*$/iu, + "relative-json-pointer": /^\d+(#|(\/([\x00-\x2e0-@\[-}\x7f]|~[01])*)*)$/iu, + // 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])?)*\.?$/, + "utc-millisec": function(input) { + return typeof input === "string" && parseFloat(input) === parseInt(input, 10) && !isNaN(input); + }, + // 7.3.8. regex + "regex": function(input) { + var result = true; + try { + new RegExp(input); + } catch (e) { + result = false; + } + return result; + }, + // Other definitions + // "style" was removed from JSON Schema in draft-4 and is deprecated + "style": /[\r\n\t ]*[^\r\n\t ][^:]*:[\r\n\t ]*[^\r\n\t ;]*[\r\n\t ]*;?/, + // "color" was removed from JSON Schema in draft-4 and is deprecated + "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*\)))$/, + "phone": /^\+(?:[0-9] ?){6,14}[0-9]$/, + "alpha": /^[a-zA-Z]+$/, + "alphanumeric": /^[a-zA-Z0-9]+$/ + }; + FORMAT_REGEXPS.regexp = FORMAT_REGEXPS.regex; + FORMAT_REGEXPS.pattern = FORMAT_REGEXPS.regex; + FORMAT_REGEXPS.ipv4 = FORMAT_REGEXPS["ip-address"]; + exports2.isFormat = function isFormat(input, format, validator) { + if (typeof input === "string" && FORMAT_REGEXPS[format] !== void 0) { + 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 = exports2.makeSuffix = function makeSuffix2(key) { + key = key.toString(); + if (!key.match(/[.\s\[\]]/) && !key.match(/^[\d]/)) { + return "." + key; + } + if (key.match(/^\d+$/)) { + return "[" + key + "]"; + } + return "[" + JSON.stringify(key) + "]"; + }; + exports2.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; + } + module2.exports.deepMerge = deepMerge; + exports2.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"); + } + exports2.encodePath = function encodePointer(a) { + return a.map(pathEncoder).join(""); + }; + exports2.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; + }; + exports2.isSchema = function isSchema(val) { + return typeof val === "object" && val || typeof val === "boolean"; + }; + } +}); + +// node_modules/jsonschema/lib/attribute.js +var require_attribute = __commonJS({ + "node_modules/jsonschema/lib/attribute.js"(exports2, module2) { + "use strict"; + var helpers = require_helpers(); + var ValidatorResult = helpers.ValidatorResult; + var SchemaError = helpers.SchemaError; + var attribute = {}; + attribute.ignoreProperties = { + // informative properties + "id": true, + "default": true, + "description": true, + "title": true, + // arguments to other properties + "additionalItems": true, + "then": true, + "else": true, + // special-handled properties + "$schema": true, + "$ref": true, + "extends": true + }; + var validators = attribute.validators = {}; + validators.type = function validateType(instance, schema2, options, ctx) { + if (instance === void 0) { + return null; + } + var result = new ValidatorResult(instance, schema2, options, ctx); + var types = Array.isArray(schema2.type) ? schema2.type : [schema2.type]; + if (!types.some(this.testType.bind(this, instance, schema2, options, ctx))) { + var list = types.map(function(v) { + if (!v) return; + var id = v.$id || v.id; + return id ? "<" + id + ">" : v + ""; + }); + result.addError({ + name: "type", + argument: list, + message: "is not of a type(s) " + list + }); + } + return result; + }; + function testSchemaNoThrow(instance, options, ctx, callback, schema2) { + var throwError2 = options.throwError; + var throwAll = options.throwAll; + options.throwError = false; + options.throwAll = false; + var res = this.validateSchema(instance, schema2, options, ctx); + options.throwError = throwError2; + options.throwAll = throwAll; + if (!res.valid && callback instanceof Function) { + callback(res); + } + return res.valid; + } + validators.anyOf = function validateAnyOf(instance, schema2, options, ctx) { + if (instance === void 0) { + return null; + } + var result = new ValidatorResult(instance, schema2, options, ctx); + var inner = new ValidatorResult(instance, schema2, options, ctx); + if (!Array.isArray(schema2.anyOf)) { + throw new SchemaError("anyOf must be an array"); + } + if (!schema2.anyOf.some( + testSchemaNoThrow.bind( + this, + instance, + options, + ctx, + function(res) { + inner.importErrors(res); + } + ) + )) { + var list = schema2.anyOf.map(function(v, i) { + var id = v.$id || v.id; + if (id) return "<" + id + ">"; + return 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; + }; + validators.allOf = function validateAllOf(instance, schema2, options, ctx) { + if (instance === void 0) { + return null; + } + if (!Array.isArray(schema2.allOf)) { + throw new SchemaError("allOf must be an array"); + } + var result = new ValidatorResult(instance, schema2, options, ctx); + var self2 = this; + schema2.allOf.forEach(function(v, i) { + var valid3 = self2.validateSchema(instance, v, options, ctx); + if (!valid3.valid) { + var id = v.$id || v.id; + var msg = id || v.title && JSON.stringify(v.title) || v["$ref"] && "<" + v["$ref"] + ">" || "[subschema " + i + "]"; + result.addError({ + name: "allOf", + argument: { id: msg, length: valid3.errors.length, valid: valid3 }, + message: "does not match allOf schema " + msg + " with " + valid3.errors.length + " error[s]:" + }); + result.importErrors(valid3); + } + }); + return result; + }; + validators.oneOf = function validateOneOf(instance, schema2, options, ctx) { + if (instance === void 0) { + return null; + } + if (!Array.isArray(schema2.oneOf)) { + throw new SchemaError("oneOf must be an array"); + } + var result = new ValidatorResult(instance, schema2, options, ctx); + var inner = new ValidatorResult(instance, schema2, options, ctx); + var count = schema2.oneOf.filter( + testSchemaNoThrow.bind( + this, + instance, + options, + ctx, + function(res) { + inner.importErrors(res); + } + ) + ).length; + var list = schema2.oneOf.map(function(v, i) { + var id = v.$id || v.id; + return 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; + }; + validators.if = function validateIf(instance, schema2, options, ctx) { + if (instance === void 0) return null; + if (!helpers.isSchema(schema2.if)) throw new Error('Expected "if" keyword to be a schema'); + var ifValid = testSchemaNoThrow.call(this, instance, options, ctx, null, schema2.if); + var result = new ValidatorResult(instance, schema2, options, ctx); + var res; + if (ifValid) { + if (schema2.then === void 0) return; + if (!helpers.isSchema(schema2.then)) throw new Error('Expected "then" keyword to be a schema'); + res = this.validateSchema(instance, schema2.then, options, ctx.makeChild(schema2.then)); + result.importErrors(res); + } else { + if (schema2.else === void 0) return; + if (!helpers.isSchema(schema2.else)) throw new Error('Expected "else" keyword to be a schema'); + res = this.validateSchema(instance, schema2.else, options, ctx.makeChild(schema2.else)); + result.importErrors(res); + } + return result; + }; + function getEnumerableProperty(object, key) { + if (Object.hasOwnProperty.call(object, key)) return object[key]; + if (!(key in object)) return; + while (object = Object.getPrototypeOf(object)) { + if (Object.propertyIsEnumerable.call(object, key)) return object[key]; + } + } + validators.propertyNames = function validatePropertyNames(instance, schema2, options, ctx) { + if (!this.types.object(instance)) return; + var result = new ValidatorResult(instance, schema2, options, ctx); + var subschema = schema2.propertyNames !== void 0 ? schema2.propertyNames : {}; + if (!helpers.isSchema(subschema)) throw new SchemaError('Expected "propertyNames" to be a schema (object or boolean)'); + for (var property in instance) { + if (getEnumerableProperty(instance, property) !== void 0) { + var res = this.validateSchema(property, subschema, options, ctx.makeChild(subschema)); + result.importErrors(res); + } + } + return result; + }; + validators.properties = function validateProperties(instance, schema2, options, ctx) { + if (!this.types.object(instance)) return; + var result = new ValidatorResult(instance, schema2, options, ctx); + var properties = schema2.properties || {}; + for (var property in properties) { + var subschema = properties[property]; + if (subschema === void 0) { + continue; + } else if (subschema === null) { + throw new SchemaError('Unexpected null, expected schema in "properties"'); + } + if (typeof options.preValidateProperty == "function") { + options.preValidateProperty(instance, property, subschema, options, ctx); + } + var prop = getEnumerableProperty(instance, property); + var res = this.validateSchema(prop, subschema, options, ctx.makeChild(subschema, property)); + if (res.instance !== result.instance[property]) result.instance[property] = res.instance; + result.importErrors(res); + } + return result; + }; + function testAdditionalProperty(instance, schema2, options, ctx, property, result) { + if (!this.types.object(instance)) return; + if (schema2.properties && schema2.properties[property] !== void 0) { + return; + } + if (schema2.additionalProperties === false) { + result.addError({ + name: "additionalProperties", + argument: property, + message: "is not allowed to have the additional property " + JSON.stringify(property) + }); + } else { + var additionalProperties = schema2.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); + } + } + validators.patternProperties = function validatePatternProperties(instance, schema2, options, ctx) { + if (!this.types.object(instance)) return; + var result = new ValidatorResult(instance, schema2, options, ctx); + var patternProperties = schema2.patternProperties || {}; + for (var property in instance) { + var test = true; + for (var pattern in patternProperties) { + var subschema = patternProperties[pattern]; + if (subschema === void 0) { + continue; + } else if (subschema === null) { + throw new SchemaError('Unexpected null, expected schema in "patternProperties"'); + } + try { + var regexp = new RegExp(pattern, "u"); + } catch (_e) { + regexp = new RegExp(pattern); + } + if (!regexp.test(property)) { + continue; + } + test = false; + if (typeof options.preValidateProperty == "function") { + options.preValidateProperty(instance, property, subschema, options, ctx); + } + var res = this.validateSchema(instance[property], subschema, options, ctx.makeChild(subschema, property)); + if (res.instance !== result.instance[property]) result.instance[property] = res.instance; + result.importErrors(res); + } + if (test) { + testAdditionalProperty.call(this, instance, schema2, options, ctx, property, result); + } + } + return result; + }; + validators.additionalProperties = function validateAdditionalProperties(instance, schema2, options, ctx) { + if (!this.types.object(instance)) return; + if (schema2.patternProperties) { + return null; + } + var result = new ValidatorResult(instance, schema2, options, ctx); + for (var property in instance) { + testAdditionalProperty.call(this, instance, schema2, options, ctx, property, result); + } + return result; + }; + validators.minProperties = function validateMinProperties(instance, schema2, options, ctx) { + if (!this.types.object(instance)) return; + var result = new ValidatorResult(instance, schema2, options, ctx); + var keys = Object.keys(instance); + if (!(keys.length >= schema2.minProperties)) { + result.addError({ + name: "minProperties", + argument: schema2.minProperties, + message: "does not meet minimum property length of " + schema2.minProperties + }); + } + return result; + }; + validators.maxProperties = function validateMaxProperties(instance, schema2, options, ctx) { + if (!this.types.object(instance)) return; + var result = new ValidatorResult(instance, schema2, options, ctx); + var keys = Object.keys(instance); + if (!(keys.length <= schema2.maxProperties)) { + result.addError({ + name: "maxProperties", + argument: schema2.maxProperties, + message: "does not meet maximum property length of " + schema2.maxProperties + }); + } + return result; + }; + validators.items = function validateItems(instance, schema2, options, ctx) { + var self2 = this; + if (!this.types.array(instance)) return; + if (schema2.items === void 0) return; + var result = new ValidatorResult(instance, schema2, options, ctx); + instance.every(function(value, i) { + if (Array.isArray(schema2.items)) { + var items = schema2.items[i] === void 0 ? schema2.additionalItems : schema2.items[i]; + } else { + var items = schema2.items; + } + if (items === void 0) { + return true; + } + if (items === false) { + result.addError({ + name: "items", + message: "additionalItems not permitted" + }); + return false; + } + var res = self2.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; + }; + validators.contains = function validateContains(instance, schema2, options, ctx) { + var self2 = this; + if (!this.types.array(instance)) return; + if (schema2.contains === void 0) return; + if (!helpers.isSchema(schema2.contains)) throw new Error('Expected "contains" keyword to be a schema'); + var result = new ValidatorResult(instance, schema2, options, ctx); + var count = instance.some(function(value, i) { + var res = self2.validateSchema(value, schema2.contains, options, ctx.makeChild(schema2.contains, i)); + return res.errors.length === 0; + }); + if (count === false) { + result.addError({ + name: "contains", + argument: schema2.contains, + message: "must contain an item matching given schema" + }); + } + return result; + }; + validators.minimum = function validateMinimum(instance, schema2, options, ctx) { + if (!this.types.number(instance)) return; + var result = new ValidatorResult(instance, schema2, options, ctx); + if (schema2.exclusiveMinimum && schema2.exclusiveMinimum === true) { + if (!(instance > schema2.minimum)) { + result.addError({ + name: "minimum", + argument: schema2.minimum, + message: "must be greater than " + schema2.minimum + }); + } + } else { + if (!(instance >= schema2.minimum)) { + result.addError({ + name: "minimum", + argument: schema2.minimum, + message: "must be greater than or equal to " + schema2.minimum + }); + } + } + return result; + }; + validators.maximum = function validateMaximum(instance, schema2, options, ctx) { + if (!this.types.number(instance)) return; + var result = new ValidatorResult(instance, schema2, options, ctx); + if (schema2.exclusiveMaximum && schema2.exclusiveMaximum === true) { + if (!(instance < schema2.maximum)) { + result.addError({ + name: "maximum", + argument: schema2.maximum, + message: "must be less than " + schema2.maximum + }); + } + } else { + if (!(instance <= schema2.maximum)) { + result.addError({ + name: "maximum", + argument: schema2.maximum, + message: "must be less than or equal to " + schema2.maximum + }); + } + } + return result; + }; + validators.exclusiveMinimum = function validateExclusiveMinimum(instance, schema2, options, ctx) { + if (typeof schema2.exclusiveMinimum === "boolean") return; + if (!this.types.number(instance)) return; + var result = new ValidatorResult(instance, schema2, options, ctx); + var valid3 = instance > schema2.exclusiveMinimum; + if (!valid3) { + result.addError({ + name: "exclusiveMinimum", + argument: schema2.exclusiveMinimum, + message: "must be strictly greater than " + schema2.exclusiveMinimum + }); + } + return result; + }; + validators.exclusiveMaximum = function validateExclusiveMaximum(instance, schema2, options, ctx) { + if (typeof schema2.exclusiveMaximum === "boolean") return; + if (!this.types.number(instance)) return; + var result = new ValidatorResult(instance, schema2, options, ctx); + var valid3 = instance < schema2.exclusiveMaximum; + if (!valid3) { + result.addError({ + name: "exclusiveMaximum", + argument: schema2.exclusiveMaximum, + message: "must be strictly less than " + schema2.exclusiveMaximum + }); + } + return result; + }; + var validateMultipleOfOrDivisbleBy = function validateMultipleOfOrDivisbleBy2(instance, schema2, options, ctx, validationType, errorMessage) { + if (!this.types.number(instance)) return; + var validationArgument = schema2[validationType]; + if (validationArgument == 0) { + throw new SchemaError(validationType + " cannot be zero"); + } + var result = new ValidatorResult(instance, schema2, 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; + }; + validators.multipleOf = function validateMultipleOf(instance, schema2, options, ctx) { + return validateMultipleOfOrDivisbleBy.call(this, instance, schema2, options, ctx, "multipleOf", "is not a multiple of (divisible by) "); + }; + validators.divisibleBy = function validateDivisibleBy(instance, schema2, options, ctx) { + return validateMultipleOfOrDivisbleBy.call(this, instance, schema2, options, ctx, "divisibleBy", "is not divisible by (multiple of) "); + }; + validators.required = function validateRequired(instance, schema2, options, ctx) { + var result = new ValidatorResult(instance, schema2, options, ctx); + if (instance === void 0 && schema2.required === true) { + result.addError({ + name: "required", + message: "is required" + }); + } else if (this.types.object(instance) && Array.isArray(schema2.required)) { + schema2.required.forEach(function(n) { + if (getEnumerableProperty(instance, n) === void 0) { + result.addError({ + name: "required", + argument: n, + message: "requires property " + JSON.stringify(n) + }); + } + }); + } + return result; + }; + validators.pattern = function validatePattern(instance, schema2, options, ctx) { + if (!this.types.string(instance)) return; + var result = new ValidatorResult(instance, schema2, options, ctx); + var pattern = schema2.pattern; + try { + var regexp = new RegExp(pattern, "u"); + } catch (_e) { + regexp = new RegExp(pattern); + } + if (!instance.match(regexp)) { + result.addError({ + name: "pattern", + argument: schema2.pattern, + message: "does not match pattern " + JSON.stringify(schema2.pattern.toString()) + }); + } + return result; + }; + validators.format = function validateFormat(instance, schema2, options, ctx) { + if (instance === void 0) return; + var result = new ValidatorResult(instance, schema2, options, ctx); + if (!result.disableFormat && !helpers.isFormat(instance, schema2.format, this)) { + result.addError({ + name: "format", + argument: schema2.format, + message: "does not conform to the " + JSON.stringify(schema2.format) + " format" + }); + } + return result; + }; + validators.minLength = function validateMinLength(instance, schema2, options, ctx) { + if (!this.types.string(instance)) return; + var result = new ValidatorResult(instance, schema2, options, ctx); + var hsp = instance.match(/[\uDC00-\uDFFF]/g); + var length = instance.length - (hsp ? hsp.length : 0); + if (!(length >= schema2.minLength)) { + result.addError({ + name: "minLength", + argument: schema2.minLength, + message: "does not meet minimum length of " + schema2.minLength + }); + } + return result; + }; + validators.maxLength = function validateMaxLength(instance, schema2, options, ctx) { + if (!this.types.string(instance)) return; + var result = new ValidatorResult(instance, schema2, options, ctx); + var hsp = instance.match(/[\uDC00-\uDFFF]/g); + var length = instance.length - (hsp ? hsp.length : 0); + if (!(length <= schema2.maxLength)) { + result.addError({ + name: "maxLength", + argument: schema2.maxLength, + message: "does not meet maximum length of " + schema2.maxLength + }); + } + return result; + }; + validators.minItems = function validateMinItems(instance, schema2, options, ctx) { + if (!this.types.array(instance)) return; + var result = new ValidatorResult(instance, schema2, options, ctx); + if (!(instance.length >= schema2.minItems)) { + result.addError({ + name: "minItems", + argument: schema2.minItems, + message: "does not meet minimum length of " + schema2.minItems + }); + } + return result; + }; + validators.maxItems = function validateMaxItems(instance, schema2, options, ctx) { + if (!this.types.array(instance)) return; + var result = new ValidatorResult(instance, schema2, options, ctx); + if (!(instance.length <= schema2.maxItems)) { + result.addError({ + name: "maxItems", + argument: schema2.maxItems, + message: "does not meet maximum length of " + schema2.maxItems + }); + } + return result; + }; + 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; + } + validators.uniqueItems = function validateUniqueItems(instance, schema2, options, ctx) { + if (schema2.uniqueItems !== true) return; + if (!this.types.array(instance)) return; + var result = new ValidatorResult(instance, schema2, options, ctx); + if (!instance.every(testArrays)) { + result.addError({ + name: "uniqueItems", + message: "contains duplicate item" + }); + } + return result; + }; + validators.dependencies = function validateDependencies(instance, schema2, options, ctx) { + if (!this.types.object(instance)) return; + var result = new ValidatorResult(instance, schema2, options, ctx); + for (var property in schema2.dependencies) { + if (instance[property] === void 0) { + continue; + } + var dep = schema2.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] === void 0) { + 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; + }; + validators["enum"] = function validateEnum(instance, schema2, options, ctx) { + if (instance === void 0) { + return null; + } + if (!Array.isArray(schema2["enum"])) { + throw new SchemaError("enum expects an array", schema2); + } + var result = new ValidatorResult(instance, schema2, options, ctx); + if (!schema2["enum"].some(helpers.deepCompareStrict.bind(null, instance))) { + result.addError({ + name: "enum", + argument: schema2["enum"], + message: "is not one of enum values: " + schema2["enum"].map(String).join(",") + }); + } + return result; + }; + validators["const"] = function validateEnum(instance, schema2, options, ctx) { + if (instance === void 0) { + return null; + } + var result = new ValidatorResult(instance, schema2, options, ctx); + if (!helpers.deepCompareStrict(schema2["const"], instance)) { + result.addError({ + name: "const", + argument: schema2["const"], + message: "does not exactly match expected constant: " + schema2["const"] + }); + } + return result; + }; + validators.not = validators.disallow = function validateNot(instance, schema2, options, ctx) { + var self2 = this; + if (instance === void 0) return null; + var result = new ValidatorResult(instance, schema2, options, ctx); + var notTypes = schema2.not || schema2.disallow; + if (!notTypes) return null; + if (!Array.isArray(notTypes)) notTypes = [notTypes]; + notTypes.forEach(function(type2) { + if (self2.testType(instance, schema2, options, ctx, type2)) { + var id = type2 && (type2.$id || type2.id); + var schemaId = id || type2; + result.addError({ + name: "not", + argument: schemaId, + message: "is of prohibited type " + schemaId + }); + } + }); + return result; + }; + module2.exports = attribute; + } +}); + +// node_modules/jsonschema/lib/scan.js +var require_scan = __commonJS({ + "node_modules/jsonschema/lib/scan.js"(exports2, module2) { + "use strict"; + var urilib = require("url"); + var helpers = require_helpers(); + module2.exports.SchemaScanResult = SchemaScanResult; + function SchemaScanResult(found, ref) { + this.id = found; + this.ref = ref; + } + module2.exports.scan = function scan(base, schema2) { + function scanSchema(baseuri, schema3) { + if (!schema3 || typeof schema3 != "object") return; + if (schema3.$ref) { + var resolvedUri = urilib.resolve(baseuri, schema3.$ref); + ref[resolvedUri] = ref[resolvedUri] ? ref[resolvedUri] + 1 : 0; + return; + } + var id = schema3.$id || schema3.id; + var ourBase = id ? urilib.resolve(baseuri, id) : baseuri; + if (ourBase) { + if (ourBase.indexOf("#") < 0) ourBase += "#"; + if (found[ourBase]) { + if (!helpers.deepCompareStrict(found[ourBase], schema3)) { + throw new Error("Schema <" + ourBase + "> already exists with different definition"); + } + return found[ourBase]; + } + found[ourBase] = schema3; + if (ourBase[ourBase.length - 1] == "#") { + found[ourBase.substring(0, ourBase.length - 1)] = schema3; + } + } + scanArray(ourBase + "/items", Array.isArray(schema3.items) ? schema3.items : [schema3.items]); + scanArray(ourBase + "/extends", Array.isArray(schema3.extends) ? schema3.extends : [schema3.extends]); + scanSchema(ourBase + "/additionalItems", schema3.additionalItems); + scanObject(ourBase + "/properties", schema3.properties); + scanSchema(ourBase + "/additionalProperties", schema3.additionalProperties); + scanObject(ourBase + "/definitions", schema3.definitions); + scanObject(ourBase + "/patternProperties", schema3.patternProperties); + scanObject(ourBase + "/dependencies", schema3.dependencies); + scanArray(ourBase + "/disallow", schema3.disallow); + scanArray(ourBase + "/allOf", schema3.allOf); + scanArray(ourBase + "/anyOf", schema3.anyOf); + scanArray(ourBase + "/oneOf", schema3.oneOf); + scanSchema(ourBase + "/not", schema3.not); + } + function scanArray(baseuri, schemas) { + if (!Array.isArray(schemas)) return; + for (var i = 0; i < schemas.length; i++) { + scanSchema(baseuri + "/" + i, schemas[i]); + } + } + function scanObject(baseuri, schemas) { + if (!schemas || typeof schemas != "object") return; + for (var p in schemas) { + scanSchema(baseuri + "/" + p, schemas[p]); + } + } + var found = {}; + var ref = {}; + scanSchema(base, schema2); + return new SchemaScanResult(found, ref); + }; + } +}); + +// node_modules/jsonschema/lib/validator.js +var require_validator = __commonJS({ + "node_modules/jsonschema/lib/validator.js"(exports2, module2) { + "use strict"; + var urilib = require("url"); + var attribute = require_attribute(); + var helpers = require_helpers(); + var scanSchema = require_scan().scan; + var ValidatorResult = helpers.ValidatorResult; + var ValidatorResultError = helpers.ValidatorResultError; + var SchemaError = helpers.SchemaError; + var SchemaContext = helpers.SchemaContext; + var anonymousBase = "/"; + var Validator3 = function Validator4() { + this.customFormats = Object.create(Validator4.prototype.customFormats); + this.schemas = {}; + this.unresolvedRefs = []; + this.types = Object.create(types); + this.attributes = Object.create(attribute.validators); + }; + Validator3.prototype.customFormats = {}; + Validator3.prototype.schemas = null; + Validator3.prototype.types = null; + Validator3.prototype.attributes = null; + Validator3.prototype.unresolvedRefs = null; + Validator3.prototype.addSchema = function addSchema(schema2, base) { + var self2 = this; + if (!schema2) { + return null; + } + var scan = scanSchema(base || anonymousBase, schema2); + var ourUri = base || schema2.$id || schema2.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(uri2) { + return typeof self2.schemas[uri2] === "undefined"; + }); + return this.schemas[ourUri]; + }; + Validator3.prototype.addSubSchemaArray = function addSubSchemaArray(baseuri, schemas) { + if (!Array.isArray(schemas)) return; + for (var i = 0; i < schemas.length; i++) { + this.addSubSchema(baseuri, schemas[i]); + } + }; + Validator3.prototype.addSubSchemaObject = function addSubSchemaArray(baseuri, schemas) { + if (!schemas || typeof schemas != "object") return; + for (var p in schemas) { + this.addSubSchema(baseuri, schemas[p]); + } + }; + Validator3.prototype.setSchemas = function setSchemas(schemas) { + this.schemas = schemas; + }; + Validator3.prototype.getSchema = function getSchema(urn) { + return this.schemas[urn]; + }; + Validator3.prototype.validate = function validate(instance, schema2, options, ctx) { + if (typeof schema2 !== "boolean" && typeof schema2 !== "object" || schema2 === null) { + throw new SchemaError("Expected `schema` to be an object or boolean"); + } + if (!options) { + options = {}; + } + var id = schema2.$id || schema2.id; + var base = urilib.resolve(options.base || anonymousBase, id || ""); + if (!ctx) { + ctx = new SchemaContext(schema2, options, [], base, Object.create(this.schemas)); + if (!ctx.schemas[base]) { + ctx.schemas[base] = schema2; + } + var found = scanSchema(base, schema2); + for (var n in found.id) { + var sch = found.id[n]; + ctx.schemas[n] = sch; + } + } + if (options.required && instance === void 0) { + var result = new ValidatorResult(instance, schema2, options, ctx); + result.addError("is required, but is undefined"); + return result; + } + var result = this.validateSchema(instance, schema2, options, ctx); + if (!result) { + throw new Error("Result undefined"); + } else if (options.throwAll && result.errors.length) { + throw new ValidatorResultError(result); + } + return result; + }; + function shouldResolve(schema2) { + var ref = typeof schema2 === "string" ? schema2 : schema2.$ref; + if (typeof ref == "string") return ref; + return false; + } + Validator3.prototype.validateSchema = function validateSchema(instance, schema2, options, ctx) { + var result = new ValidatorResult(instance, schema2, options, ctx); + if (typeof schema2 === "boolean") { + if (schema2 === true) { + schema2 = {}; + } else if (schema2 === false) { + schema2 = { type: [] }; + } + } else if (!schema2) { + throw new Error("schema is undefined"); + } + if (schema2["extends"]) { + if (Array.isArray(schema2["extends"])) { + var schemaobj = { schema: schema2, ctx }; + schema2["extends"].forEach(this.schemaTraverser.bind(this, schemaobj)); + schema2 = schemaobj.schema; + schemaobj.schema = null; + schemaobj.ctx = null; + schemaobj = null; + } else { + schema2 = helpers.deepMerge(schema2, this.superResolve(schema2["extends"], ctx)); + } + } + var switchSchema = shouldResolve(schema2); + if (switchSchema) { + var resolved = this.resolve(schema2, switchSchema, ctx); + var subctx = new SchemaContext(resolved.subschema, options, ctx.path, resolved.switchSchema, ctx.schemas); + return this.validateSchema(instance, resolved.subschema, options, subctx); + } + var skipAttributes = options && options.skipAttributes || []; + for (var key in schema2) { + if (!attribute.ignoreProperties[key] && skipAttributes.indexOf(key) < 0) { + var validatorErr = null; + var validator = this.attributes[key]; + if (validator) { + validatorErr = validator.call(this, instance, schema2, options, ctx); + } else if (options.allowUnknownAttributes === false) { + throw new SchemaError("Unsupported attribute: " + key, schema2); + } + if (validatorErr) { + result.importErrors(validatorErr); + } + } + } + if (typeof options.rewrite == "function") { + var value = options.rewrite.call(this, instance, schema2, options, ctx); + result.instance = value; + } + return result; + }; + Validator3.prototype.schemaTraverser = function schemaTraverser(schemaobj, s) { + schemaobj.schema = helpers.deepMerge(schemaobj.schema, this.superResolve(s, schemaobj.ctx)); + }; + Validator3.prototype.superResolve = function superResolve(schema2, ctx) { + var ref = shouldResolve(schema2); + if (ref) { + return this.resolve(schema2, ref, ctx).subschema; + } + return schema2; + }; + Validator3.prototype.resolve = function resolve6(schema2, switchSchema, ctx) { + switchSchema = ctx.resolve(switchSchema); + if (ctx.schemas[switchSchema]) { + return { subschema: ctx.schemas[switchSchema], switchSchema }; + } + var parsed = urilib.parse(switchSchema); + var fragment = parsed && parsed.hash; + var document2 = fragment && fragment.length && switchSchema.substr(0, switchSchema.length - fragment.length); + if (!document2 || !ctx.schemas[document2]) { + throw new SchemaError("no such schema <" + switchSchema + ">", schema2); + } + var subschema = helpers.objectGetPath(ctx.schemas[document2], fragment.substr(1)); + if (subschema === void 0) { + throw new SchemaError("no such schema " + fragment + " located in <" + document2 + ">", schema2); + } + return { subschema, switchSchema }; + }; + Validator3.prototype.testType = function validateType(instance, schema2, options, ctx, type2) { + if (type2 === void 0) { + return; + } else if (type2 === null) { + throw new SchemaError('Unexpected null in "type" keyword'); + } + if (typeof this.types[type2] == "function") { + return this.types[type2].call(this, instance); + } + if (type2 && typeof type2 == "object") { + var res = this.validateSchema(instance, type2, options, ctx); + return res === void 0 || !(res && res.errors.length); + } + return true; + }; + var types = Validator3.prototype.types = {}; + types.string = function testString(instance) { + return typeof instance == "string"; + }; + types.number = function testNumber(instance) { + 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) { + return instance && typeof instance === "object" && !Array.isArray(instance) && !(instance instanceof Date); + }; + module2.exports = Validator3; + } +}); + +// node_modules/jsonschema/lib/index.js +var require_lib2 = __commonJS({ + "node_modules/jsonschema/lib/index.js"(exports2, module2) { + "use strict"; + var Validator3 = module2.exports.Validator = require_validator(); + module2.exports.ValidatorResult = require_helpers().ValidatorResult; + module2.exports.ValidatorResultError = require_helpers().ValidatorResultError; + module2.exports.ValidationError = require_helpers().ValidationError; + module2.exports.SchemaError = require_helpers().SchemaError; + module2.exports.SchemaScanResult = require_scan().SchemaScanResult; + module2.exports.scan = require_scan().scan; + module2.exports.validate = function(instance, schema2, options) { + var v = new Validator3(); + return v.validate(instance, schema2, options); + }; + } +}); + // node_modules/@actions/glob/lib/internal-glob-options-helper.js var require_internal_glob_options_helper = __commonJS({ "node_modules/@actions/glob/lib/internal-glob-options-helper.js"(exports2) { @@ -52834,7 +54131,7 @@ var require_delay = __commonJS({ }); // node_modules/@typespec/ts-http-runtime/dist/commonjs/util/helpers.js -var require_helpers = __commonJS({ +var require_helpers2 = __commonJS({ "node_modules/@typespec/ts-http-runtime/dist/commonjs/util/helpers.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); @@ -52892,7 +54189,7 @@ var require_throttlingRetryStrategy = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.isThrottlingRetryResponse = isThrottlingRetryResponse; exports2.throttlingRetryStrategy = throttlingRetryStrategy; - var helpers_js_1 = require_helpers(); + var helpers_js_1 = require_helpers2(); var RetryAfterHeader = "Retry-After"; var AllRetryAfterHeaders = ["retry-after-ms", "x-ms-retry-after-ms", RetryAfterHeader]; function getRetryAfterInMs(response) { @@ -52990,7 +54287,7 @@ var require_retryPolicy = __commonJS({ "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.retryPolicy = retryPolicy; - var helpers_js_1 = require_helpers(); + var helpers_js_1 = require_helpers2(); var AbortError_js_1 = require_AbortError(); var logger_js_1 = require_logger(); var constants_js_1 = require_constants13(); @@ -53970,7 +55267,7 @@ var require_src = __commonJS({ }); // node_modules/agent-base/dist/helpers.js -var require_helpers2 = __commonJS({ +var require_helpers3 = __commonJS({ "node_modules/agent-base/dist/helpers.js"(exports2) { "use strict"; var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { @@ -54078,7 +55375,7 @@ var require_dist = __commonJS({ var net = __importStar2(require("net")); var http = __importStar2(require("http")); var https_1 = require("https"); - __exportStar2(require_helpers2(), exports2); + __exportStar2(require_helpers3(), exports2); var INTERNAL = /* @__PURE__ */ Symbol("AgentBaseInternalState"); var Agent = class extends http.Agent { constructor(opts) { @@ -97541,1303 +98838,6 @@ var require_cache5 = __commonJS({ } }); -// node_modules/jsonschema/lib/helpers.js -var require_helpers3 = __commonJS({ - "node_modules/jsonschema/lib/helpers.js"(exports2, module2) { - "use strict"; - var uri = require("url"); - var ValidationError = exports2.ValidationError = function ValidationError2(message, instance, schema2, path13, name, argument) { - if (Array.isArray(path13)) { - this.path = path13; - this.property = path13.reduce(function(sum, item) { - return sum + makeSuffix(item); - }, "instance"); - } else if (path13 !== void 0) { - this.property = path13; - } - if (message) { - this.message = message; - } - if (schema2) { - var id = schema2.$id || schema2.id; - this.schema = id || schema2; - } - if (instance !== void 0) { - this.instance = instance; - } - this.name = name; - this.argument = argument; - this.stack = this.toString(); - }; - ValidationError.prototype.toString = function toString3() { - return this.property + " " + this.message; - }; - var ValidatorResult = exports2.ValidatorResult = function ValidatorResult2(instance, schema2, options, ctx) { - this.instance = instance; - this.schema = schema2; - this.options = options; - this.path = ctx.path; - this.propertyPath = ctx.propertyPath; - this.errors = []; - this.throwError = options && options.throwError; - this.throwFirst = options && options.throwFirst; - this.throwAll = options && options.throwAll; - 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.path); - } 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.path, detail.name, detail.argument); - } - this.errors.push(err); - if (this.throwFirst) { - throw new ValidatorResultError(this); - } else if (this.throwError) { - throw err; - } - return err; - }; - ValidatorResult.prototype.importErrors = function importErrors(res) { - if (typeof res == "string" || res && res.validatorType) { - this.addError(res); - } else if (res && res.errors) { - this.errors = this.errors.concat(res.errors); - } - }; - function stringizer(v, i) { - return i + ": " + v.toString() + "\n"; - } - ValidatorResult.prototype.toString = function toString3(res) { - return this.errors.map(stringizer).join(""); - }; - Object.defineProperty(ValidatorResult.prototype, "valid", { get: function() { - return !this.errors.length; - } }); - module2.exports.ValidatorResultError = ValidatorResultError; - function ValidatorResultError(result) { - if (Error.captureStackTrace) { - Error.captureStackTrace(this, ValidatorResultError); - } - this.instance = result.instance; - this.schema = result.schema; - this.options = result.options; - this.errors = result.errors; - } - ValidatorResultError.prototype = new Error(); - ValidatorResultError.prototype.constructor = ValidatorResultError; - ValidatorResultError.prototype.name = "Validation Error"; - var SchemaError = exports2.SchemaError = function SchemaError2(msg, schema2) { - this.message = msg; - this.schema = schema2; - Error.call(this, msg); - Error.captureStackTrace(this, SchemaError2); - }; - SchemaError.prototype = Object.create( - Error.prototype, - { - constructor: { value: SchemaError, enumerable: false }, - name: { value: "SchemaError", enumerable: false } - } - ); - var SchemaContext = exports2.SchemaContext = function SchemaContext2(schema2, options, path13, base, schemas) { - this.schema = schema2; - this.options = options; - if (Array.isArray(path13)) { - this.path = path13; - this.propertyPath = path13.reduce(function(sum, item) { - return sum + makeSuffix(item); - }, "instance"); - } else { - this.propertyPath = path13; - } - this.base = base; - this.schemas = schemas; - }; - SchemaContext.prototype.resolve = function resolve6(target) { - return uri.resolve(this.base, target); - }; - SchemaContext.prototype.makeChild = function makeChild(schema2, propertyName) { - var path13 = propertyName === void 0 ? this.path : this.path.concat([propertyName]); - var id = schema2.$id || schema2.id; - var base = uri.resolve(this.base, id || ""); - var ctx = new SchemaContext(schema2, this.options, path13, base, Object.create(this.schemas)); - if (id && !ctx.schemas[base]) { - ctx.schemas[base] = schema2; - } - return ctx; - }; - var FORMAT_REGEXPS = exports2.FORMAT_REGEXPS = { - // 7.3.1. Dates, Times, and Duration - "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])$/, - "duration": /P(T\d+(H(\d+M(\d+S)?)?|M(\d+S)?|S)|\d+(D|M(\d+D)?|Y(\d+M(\d+D)?)?)(T\d+(H(\d+M(\d+S)?)?|M(\d+S)?|S))?|\d+W)/i, - // 7.3.2. Email Addresses - // TODO: fix the email production - "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])\]))$/, - "idn-email": /^("(?:[!#-\[\]-\u{10FFFF}]|\\[\t -\u{10FFFF}])*"|[!#-'*+\-/-9=?A-Z\^-\u{10FFFF}](?:\.?[!#-'*+\-/-9=?A-Z\^-\u{10FFFF}])*)@([!#-'*+\-/-9=?A-Z\^-\u{10FFFF}](?:\.?[!#-'*+\-/-9=?A-Z\^-\u{10FFFF}])*|\[[!-Z\^-\u{10FFFF}]*\])$/u, - // 7.3.3. Hostnames - // 7.3.4. IP Addresses - "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]?)$/, - // FIXME whitespace is invalid - "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*$/, - // 7.3.5. Resource Identifiers - // TODO: A more accurate regular expression for "uri" goes: - // [A-Za-z][+\-.0-9A-Za-z]*:((/(/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?)?)?#(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|(/(/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?[/?]|[!$&-.0-;=?-Z_a-z~])|/?%[0-9A-Fa-f]{2}|[!$&-.0-;=?-Z_a-z~])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*(#(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*)?|/(/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+(:\d*)?|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?:\d*|\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)?)? - "uri": /^[a-zA-Z][a-zA-Z0-9+.-]*:[^\s]*$/, - "uri-reference": /^(((([A-Za-z][+\-.0-9A-Za-z]*(:%[0-9A-Fa-f]{2}|:[!$&-.0-;=?-Z_a-z~]|[/?])|\?)(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|([A-Za-z][+\-.0-9A-Za-z]*:?)?)|([A-Za-z][+\-.0-9A-Za-z]*:)?\/((%[0-9A-Fa-f]{2}|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?[/?]|[!$&-.0-;=?-Z_a-z~])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|(\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?)?))#(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|(([A-Za-z][+\-.0-9A-Za-z]*)?%[0-9A-Fa-f]{2}|[!$&-.0-9;=@_~]|[A-Za-z][+\-.0-9A-Za-z]*[!$&-*,;=@_~])(%[0-9A-Fa-f]{2}|[!$&-.0-9;=@-Z_a-z~])*((([/?](%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*)?#|[/?])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*)?|([A-Za-z][+\-.0-9A-Za-z]*(:%[0-9A-Fa-f]{2}|:[!$&-.0-;=?-Z_a-z~]|[/?])|\?)(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|([A-Za-z][+\-.0-9A-Za-z]*:)?\/((%[0-9A-Fa-f]{2}|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?[/?]|[!$&-.0-;=?-Z_a-z~])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+(:\d*)?|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?:\d*|\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)?|[A-Za-z][+\-.0-9A-Za-z]*:?)?$/, - "iri": /^[a-zA-Z][a-zA-Z0-9+.-]*:[^\s]*$/, - "iri-reference": /^(((([A-Za-z][+\-.0-9A-Za-z]*(:%[0-9A-Fa-f]{2}|:[!$&-.0-;=?-Z_a-z~-\u{10FFFF}]|[/?])|\?)(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|([A-Za-z][+\-.0-9A-Za-z]*:?)?)|([A-Za-z][+\-.0-9A-Za-z]*:)?\/((%[0-9A-Fa-f]{2}|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~-\u{10FFFF}])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?[/?]|[!$&-.0-;=?-Z_a-z~-\u{10FFFF}])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|(\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~-\u{10FFFF}])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?)?))#(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|(([A-Za-z][+\-.0-9A-Za-z]*)?%[0-9A-Fa-f]{2}|[!$&-.0-9;=@_~-\u{10FFFF}]|[A-Za-z][+\-.0-9A-Za-z]*[!$&-*,;=@_~-\u{10FFFF}])(%[0-9A-Fa-f]{2}|[!$&-.0-9;=@-Z_a-z~-\u{10FFFF}])*((([/?](%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*)?#|[/?])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*)?|([A-Za-z][+\-.0-9A-Za-z]*(:%[0-9A-Fa-f]{2}|:[!$&-.0-;=?-Z_a-z~-\u{10FFFF}]|[/?])|\?)(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|([A-Za-z][+\-.0-9A-Za-z]*:)?\/((%[0-9A-Fa-f]{2}|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~-\u{10FFFF}])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?[/?]|[!$&-.0-;=?-Z_a-z~-\u{10FFFF}])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~-\u{10FFFF}])+(:\d*)?|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?:\d*|\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?)?|[A-Za-z][+\-.0-9A-Za-z]*:?)?$/u, - "uuid": /^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$/i, - // 7.3.6. uri-template - "uri-template": /(%[0-9a-f]{2}|[!#$&(-;=?@\[\]_a-z~]|\{[!#&+,./;=?@|]?(%[0-9a-f]{2}|[0-9_a-z])(\.?(%[0-9a-f]{2}|[0-9_a-z]))*(:[1-9]\d{0,3}|\*)?(,(%[0-9a-f]{2}|[0-9_a-z])(\.?(%[0-9a-f]{2}|[0-9_a-z]))*(:[1-9]\d{0,3}|\*)?)*\})*/iu, - // 7.3.7. JSON Pointers - "json-pointer": /^(\/([\x00-\x2e0-@\[-}\x7f]|~[01])*)*$/iu, - "relative-json-pointer": /^\d+(#|(\/([\x00-\x2e0-@\[-}\x7f]|~[01])*)*)$/iu, - // 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])?)*\.?$/, - "utc-millisec": function(input) { - return typeof input === "string" && parseFloat(input) === parseInt(input, 10) && !isNaN(input); - }, - // 7.3.8. regex - "regex": function(input) { - var result = true; - try { - new RegExp(input); - } catch (e) { - result = false; - } - return result; - }, - // Other definitions - // "style" was removed from JSON Schema in draft-4 and is deprecated - "style": /[\r\n\t ]*[^\r\n\t ][^:]*:[\r\n\t ]*[^\r\n\t ;]*[\r\n\t ]*;?/, - // "color" was removed from JSON Schema in draft-4 and is deprecated - "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*\)))$/, - "phone": /^\+(?:[0-9] ?){6,14}[0-9]$/, - "alpha": /^[a-zA-Z]+$/, - "alphanumeric": /^[a-zA-Z0-9]+$/ - }; - FORMAT_REGEXPS.regexp = FORMAT_REGEXPS.regex; - FORMAT_REGEXPS.pattern = FORMAT_REGEXPS.regex; - FORMAT_REGEXPS.ipv4 = FORMAT_REGEXPS["ip-address"]; - exports2.isFormat = function isFormat(input, format, validator) { - if (typeof input === "string" && FORMAT_REGEXPS[format] !== void 0) { - 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 = exports2.makeSuffix = function makeSuffix2(key) { - key = key.toString(); - if (!key.match(/[.\s\[\]]/) && !key.match(/^[\d]/)) { - return "." + key; - } - if (key.match(/^\d+$/)) { - return "[" + key + "]"; - } - return "[" + JSON.stringify(key) + "]"; - }; - exports2.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; - } - module2.exports.deepMerge = deepMerge; - exports2.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"); - } - exports2.encodePath = function encodePointer(a) { - return a.map(pathEncoder).join(""); - }; - exports2.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; - }; - exports2.isSchema = function isSchema(val) { - return typeof val === "object" && val || typeof val === "boolean"; - }; - } -}); - -// node_modules/jsonschema/lib/attribute.js -var require_attribute = __commonJS({ - "node_modules/jsonschema/lib/attribute.js"(exports2, module2) { - "use strict"; - var helpers = require_helpers3(); - var ValidatorResult = helpers.ValidatorResult; - var SchemaError = helpers.SchemaError; - var attribute = {}; - attribute.ignoreProperties = { - // informative properties - "id": true, - "default": true, - "description": true, - "title": true, - // arguments to other properties - "additionalItems": true, - "then": true, - "else": true, - // special-handled properties - "$schema": true, - "$ref": true, - "extends": true - }; - var validators = attribute.validators = {}; - validators.type = function validateType(instance, schema2, options, ctx) { - if (instance === void 0) { - return null; - } - var result = new ValidatorResult(instance, schema2, options, ctx); - var types = Array.isArray(schema2.type) ? schema2.type : [schema2.type]; - if (!types.some(this.testType.bind(this, instance, schema2, options, ctx))) { - var list = types.map(function(v) { - if (!v) return; - var id = v.$id || v.id; - return id ? "<" + id + ">" : v + ""; - }); - result.addError({ - name: "type", - argument: list, - message: "is not of a type(s) " + list - }); - } - return result; - }; - function testSchemaNoThrow(instance, options, ctx, callback, schema2) { - var throwError2 = options.throwError; - var throwAll = options.throwAll; - options.throwError = false; - options.throwAll = false; - var res = this.validateSchema(instance, schema2, options, ctx); - options.throwError = throwError2; - options.throwAll = throwAll; - if (!res.valid && callback instanceof Function) { - callback(res); - } - return res.valid; - } - validators.anyOf = function validateAnyOf(instance, schema2, options, ctx) { - if (instance === void 0) { - return null; - } - var result = new ValidatorResult(instance, schema2, options, ctx); - var inner = new ValidatorResult(instance, schema2, options, ctx); - if (!Array.isArray(schema2.anyOf)) { - throw new SchemaError("anyOf must be an array"); - } - if (!schema2.anyOf.some( - testSchemaNoThrow.bind( - this, - instance, - options, - ctx, - function(res) { - inner.importErrors(res); - } - ) - )) { - var list = schema2.anyOf.map(function(v, i) { - var id = v.$id || v.id; - if (id) return "<" + id + ">"; - return 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; - }; - validators.allOf = function validateAllOf(instance, schema2, options, ctx) { - if (instance === void 0) { - return null; - } - if (!Array.isArray(schema2.allOf)) { - throw new SchemaError("allOf must be an array"); - } - var result = new ValidatorResult(instance, schema2, options, ctx); - var self2 = this; - schema2.allOf.forEach(function(v, i) { - var valid3 = self2.validateSchema(instance, v, options, ctx); - if (!valid3.valid) { - var id = v.$id || v.id; - var msg = id || v.title && JSON.stringify(v.title) || v["$ref"] && "<" + v["$ref"] + ">" || "[subschema " + i + "]"; - result.addError({ - name: "allOf", - argument: { id: msg, length: valid3.errors.length, valid: valid3 }, - message: "does not match allOf schema " + msg + " with " + valid3.errors.length + " error[s]:" - }); - result.importErrors(valid3); - } - }); - return result; - }; - validators.oneOf = function validateOneOf(instance, schema2, options, ctx) { - if (instance === void 0) { - return null; - } - if (!Array.isArray(schema2.oneOf)) { - throw new SchemaError("oneOf must be an array"); - } - var result = new ValidatorResult(instance, schema2, options, ctx); - var inner = new ValidatorResult(instance, schema2, options, ctx); - var count = schema2.oneOf.filter( - testSchemaNoThrow.bind( - this, - instance, - options, - ctx, - function(res) { - inner.importErrors(res); - } - ) - ).length; - var list = schema2.oneOf.map(function(v, i) { - var id = v.$id || v.id; - return 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; - }; - validators.if = function validateIf(instance, schema2, options, ctx) { - if (instance === void 0) return null; - if (!helpers.isSchema(schema2.if)) throw new Error('Expected "if" keyword to be a schema'); - var ifValid = testSchemaNoThrow.call(this, instance, options, ctx, null, schema2.if); - var result = new ValidatorResult(instance, schema2, options, ctx); - var res; - if (ifValid) { - if (schema2.then === void 0) return; - if (!helpers.isSchema(schema2.then)) throw new Error('Expected "then" keyword to be a schema'); - res = this.validateSchema(instance, schema2.then, options, ctx.makeChild(schema2.then)); - result.importErrors(res); - } else { - if (schema2.else === void 0) return; - if (!helpers.isSchema(schema2.else)) throw new Error('Expected "else" keyword to be a schema'); - res = this.validateSchema(instance, schema2.else, options, ctx.makeChild(schema2.else)); - result.importErrors(res); - } - return result; - }; - function getEnumerableProperty(object, key) { - if (Object.hasOwnProperty.call(object, key)) return object[key]; - if (!(key in object)) return; - while (object = Object.getPrototypeOf(object)) { - if (Object.propertyIsEnumerable.call(object, key)) return object[key]; - } - } - validators.propertyNames = function validatePropertyNames(instance, schema2, options, ctx) { - if (!this.types.object(instance)) return; - var result = new ValidatorResult(instance, schema2, options, ctx); - var subschema = schema2.propertyNames !== void 0 ? schema2.propertyNames : {}; - if (!helpers.isSchema(subschema)) throw new SchemaError('Expected "propertyNames" to be a schema (object or boolean)'); - for (var property in instance) { - if (getEnumerableProperty(instance, property) !== void 0) { - var res = this.validateSchema(property, subschema, options, ctx.makeChild(subschema)); - result.importErrors(res); - } - } - return result; - }; - validators.properties = function validateProperties(instance, schema2, options, ctx) { - if (!this.types.object(instance)) return; - var result = new ValidatorResult(instance, schema2, options, ctx); - var properties = schema2.properties || {}; - for (var property in properties) { - var subschema = properties[property]; - if (subschema === void 0) { - continue; - } else if (subschema === null) { - throw new SchemaError('Unexpected null, expected schema in "properties"'); - } - if (typeof options.preValidateProperty == "function") { - options.preValidateProperty(instance, property, subschema, options, ctx); - } - var prop = getEnumerableProperty(instance, property); - var res = this.validateSchema(prop, subschema, options, ctx.makeChild(subschema, property)); - if (res.instance !== result.instance[property]) result.instance[property] = res.instance; - result.importErrors(res); - } - return result; - }; - function testAdditionalProperty(instance, schema2, options, ctx, property, result) { - if (!this.types.object(instance)) return; - if (schema2.properties && schema2.properties[property] !== void 0) { - return; - } - if (schema2.additionalProperties === false) { - result.addError({ - name: "additionalProperties", - argument: property, - message: "is not allowed to have the additional property " + JSON.stringify(property) - }); - } else { - var additionalProperties = schema2.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); - } - } - validators.patternProperties = function validatePatternProperties(instance, schema2, options, ctx) { - if (!this.types.object(instance)) return; - var result = new ValidatorResult(instance, schema2, options, ctx); - var patternProperties = schema2.patternProperties || {}; - for (var property in instance) { - var test = true; - for (var pattern in patternProperties) { - var subschema = patternProperties[pattern]; - if (subschema === void 0) { - continue; - } else if (subschema === null) { - throw new SchemaError('Unexpected null, expected schema in "patternProperties"'); - } - try { - var regexp = new RegExp(pattern, "u"); - } catch (_e) { - regexp = new RegExp(pattern); - } - if (!regexp.test(property)) { - continue; - } - test = false; - if (typeof options.preValidateProperty == "function") { - options.preValidateProperty(instance, property, subschema, options, ctx); - } - var res = this.validateSchema(instance[property], subschema, options, ctx.makeChild(subschema, property)); - if (res.instance !== result.instance[property]) result.instance[property] = res.instance; - result.importErrors(res); - } - if (test) { - testAdditionalProperty.call(this, instance, schema2, options, ctx, property, result); - } - } - return result; - }; - validators.additionalProperties = function validateAdditionalProperties(instance, schema2, options, ctx) { - if (!this.types.object(instance)) return; - if (schema2.patternProperties) { - return null; - } - var result = new ValidatorResult(instance, schema2, options, ctx); - for (var property in instance) { - testAdditionalProperty.call(this, instance, schema2, options, ctx, property, result); - } - return result; - }; - validators.minProperties = function validateMinProperties(instance, schema2, options, ctx) { - if (!this.types.object(instance)) return; - var result = new ValidatorResult(instance, schema2, options, ctx); - var keys = Object.keys(instance); - if (!(keys.length >= schema2.minProperties)) { - result.addError({ - name: "minProperties", - argument: schema2.minProperties, - message: "does not meet minimum property length of " + schema2.minProperties - }); - } - return result; - }; - validators.maxProperties = function validateMaxProperties(instance, schema2, options, ctx) { - if (!this.types.object(instance)) return; - var result = new ValidatorResult(instance, schema2, options, ctx); - var keys = Object.keys(instance); - if (!(keys.length <= schema2.maxProperties)) { - result.addError({ - name: "maxProperties", - argument: schema2.maxProperties, - message: "does not meet maximum property length of " + schema2.maxProperties - }); - } - return result; - }; - validators.items = function validateItems(instance, schema2, options, ctx) { - var self2 = this; - if (!this.types.array(instance)) return; - if (schema2.items === void 0) return; - var result = new ValidatorResult(instance, schema2, options, ctx); - instance.every(function(value, i) { - if (Array.isArray(schema2.items)) { - var items = schema2.items[i] === void 0 ? schema2.additionalItems : schema2.items[i]; - } else { - var items = schema2.items; - } - if (items === void 0) { - return true; - } - if (items === false) { - result.addError({ - name: "items", - message: "additionalItems not permitted" - }); - return false; - } - var res = self2.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; - }; - validators.contains = function validateContains(instance, schema2, options, ctx) { - var self2 = this; - if (!this.types.array(instance)) return; - if (schema2.contains === void 0) return; - if (!helpers.isSchema(schema2.contains)) throw new Error('Expected "contains" keyword to be a schema'); - var result = new ValidatorResult(instance, schema2, options, ctx); - var count = instance.some(function(value, i) { - var res = self2.validateSchema(value, schema2.contains, options, ctx.makeChild(schema2.contains, i)); - return res.errors.length === 0; - }); - if (count === false) { - result.addError({ - name: "contains", - argument: schema2.contains, - message: "must contain an item matching given schema" - }); - } - return result; - }; - validators.minimum = function validateMinimum(instance, schema2, options, ctx) { - if (!this.types.number(instance)) return; - var result = new ValidatorResult(instance, schema2, options, ctx); - if (schema2.exclusiveMinimum && schema2.exclusiveMinimum === true) { - if (!(instance > schema2.minimum)) { - result.addError({ - name: "minimum", - argument: schema2.minimum, - message: "must be greater than " + schema2.minimum - }); - } - } else { - if (!(instance >= schema2.minimum)) { - result.addError({ - name: "minimum", - argument: schema2.minimum, - message: "must be greater than or equal to " + schema2.minimum - }); - } - } - return result; - }; - validators.maximum = function validateMaximum(instance, schema2, options, ctx) { - if (!this.types.number(instance)) return; - var result = new ValidatorResult(instance, schema2, options, ctx); - if (schema2.exclusiveMaximum && schema2.exclusiveMaximum === true) { - if (!(instance < schema2.maximum)) { - result.addError({ - name: "maximum", - argument: schema2.maximum, - message: "must be less than " + schema2.maximum - }); - } - } else { - if (!(instance <= schema2.maximum)) { - result.addError({ - name: "maximum", - argument: schema2.maximum, - message: "must be less than or equal to " + schema2.maximum - }); - } - } - return result; - }; - validators.exclusiveMinimum = function validateExclusiveMinimum(instance, schema2, options, ctx) { - if (typeof schema2.exclusiveMinimum === "boolean") return; - if (!this.types.number(instance)) return; - var result = new ValidatorResult(instance, schema2, options, ctx); - var valid3 = instance > schema2.exclusiveMinimum; - if (!valid3) { - result.addError({ - name: "exclusiveMinimum", - argument: schema2.exclusiveMinimum, - message: "must be strictly greater than " + schema2.exclusiveMinimum - }); - } - return result; - }; - validators.exclusiveMaximum = function validateExclusiveMaximum(instance, schema2, options, ctx) { - if (typeof schema2.exclusiveMaximum === "boolean") return; - if (!this.types.number(instance)) return; - var result = new ValidatorResult(instance, schema2, options, ctx); - var valid3 = instance < schema2.exclusiveMaximum; - if (!valid3) { - result.addError({ - name: "exclusiveMaximum", - argument: schema2.exclusiveMaximum, - message: "must be strictly less than " + schema2.exclusiveMaximum - }); - } - return result; - }; - var validateMultipleOfOrDivisbleBy = function validateMultipleOfOrDivisbleBy2(instance, schema2, options, ctx, validationType, errorMessage) { - if (!this.types.number(instance)) return; - var validationArgument = schema2[validationType]; - if (validationArgument == 0) { - throw new SchemaError(validationType + " cannot be zero"); - } - var result = new ValidatorResult(instance, schema2, 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; - }; - validators.multipleOf = function validateMultipleOf(instance, schema2, options, ctx) { - return validateMultipleOfOrDivisbleBy.call(this, instance, schema2, options, ctx, "multipleOf", "is not a multiple of (divisible by) "); - }; - validators.divisibleBy = function validateDivisibleBy(instance, schema2, options, ctx) { - return validateMultipleOfOrDivisbleBy.call(this, instance, schema2, options, ctx, "divisibleBy", "is not divisible by (multiple of) "); - }; - validators.required = function validateRequired(instance, schema2, options, ctx) { - var result = new ValidatorResult(instance, schema2, options, ctx); - if (instance === void 0 && schema2.required === true) { - result.addError({ - name: "required", - message: "is required" - }); - } else if (this.types.object(instance) && Array.isArray(schema2.required)) { - schema2.required.forEach(function(n) { - if (getEnumerableProperty(instance, n) === void 0) { - result.addError({ - name: "required", - argument: n, - message: "requires property " + JSON.stringify(n) - }); - } - }); - } - return result; - }; - validators.pattern = function validatePattern(instance, schema2, options, ctx) { - if (!this.types.string(instance)) return; - var result = new ValidatorResult(instance, schema2, options, ctx); - var pattern = schema2.pattern; - try { - var regexp = new RegExp(pattern, "u"); - } catch (_e) { - regexp = new RegExp(pattern); - } - if (!instance.match(regexp)) { - result.addError({ - name: "pattern", - argument: schema2.pattern, - message: "does not match pattern " + JSON.stringify(schema2.pattern.toString()) - }); - } - return result; - }; - validators.format = function validateFormat(instance, schema2, options, ctx) { - if (instance === void 0) return; - var result = new ValidatorResult(instance, schema2, options, ctx); - if (!result.disableFormat && !helpers.isFormat(instance, schema2.format, this)) { - result.addError({ - name: "format", - argument: schema2.format, - message: "does not conform to the " + JSON.stringify(schema2.format) + " format" - }); - } - return result; - }; - validators.minLength = function validateMinLength(instance, schema2, options, ctx) { - if (!this.types.string(instance)) return; - var result = new ValidatorResult(instance, schema2, options, ctx); - var hsp = instance.match(/[\uDC00-\uDFFF]/g); - var length = instance.length - (hsp ? hsp.length : 0); - if (!(length >= schema2.minLength)) { - result.addError({ - name: "minLength", - argument: schema2.minLength, - message: "does not meet minimum length of " + schema2.minLength - }); - } - return result; - }; - validators.maxLength = function validateMaxLength(instance, schema2, options, ctx) { - if (!this.types.string(instance)) return; - var result = new ValidatorResult(instance, schema2, options, ctx); - var hsp = instance.match(/[\uDC00-\uDFFF]/g); - var length = instance.length - (hsp ? hsp.length : 0); - if (!(length <= schema2.maxLength)) { - result.addError({ - name: "maxLength", - argument: schema2.maxLength, - message: "does not meet maximum length of " + schema2.maxLength - }); - } - return result; - }; - validators.minItems = function validateMinItems(instance, schema2, options, ctx) { - if (!this.types.array(instance)) return; - var result = new ValidatorResult(instance, schema2, options, ctx); - if (!(instance.length >= schema2.minItems)) { - result.addError({ - name: "minItems", - argument: schema2.minItems, - message: "does not meet minimum length of " + schema2.minItems - }); - } - return result; - }; - validators.maxItems = function validateMaxItems(instance, schema2, options, ctx) { - if (!this.types.array(instance)) return; - var result = new ValidatorResult(instance, schema2, options, ctx); - if (!(instance.length <= schema2.maxItems)) { - result.addError({ - name: "maxItems", - argument: schema2.maxItems, - message: "does not meet maximum length of " + schema2.maxItems - }); - } - return result; - }; - 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; - } - validators.uniqueItems = function validateUniqueItems(instance, schema2, options, ctx) { - if (schema2.uniqueItems !== true) return; - if (!this.types.array(instance)) return; - var result = new ValidatorResult(instance, schema2, options, ctx); - if (!instance.every(testArrays)) { - result.addError({ - name: "uniqueItems", - message: "contains duplicate item" - }); - } - return result; - }; - validators.dependencies = function validateDependencies(instance, schema2, options, ctx) { - if (!this.types.object(instance)) return; - var result = new ValidatorResult(instance, schema2, options, ctx); - for (var property in schema2.dependencies) { - if (instance[property] === void 0) { - continue; - } - var dep = schema2.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] === void 0) { - 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; - }; - validators["enum"] = function validateEnum(instance, schema2, options, ctx) { - if (instance === void 0) { - return null; - } - if (!Array.isArray(schema2["enum"])) { - throw new SchemaError("enum expects an array", schema2); - } - var result = new ValidatorResult(instance, schema2, options, ctx); - if (!schema2["enum"].some(helpers.deepCompareStrict.bind(null, instance))) { - result.addError({ - name: "enum", - argument: schema2["enum"], - message: "is not one of enum values: " + schema2["enum"].map(String).join(",") - }); - } - return result; - }; - validators["const"] = function validateEnum(instance, schema2, options, ctx) { - if (instance === void 0) { - return null; - } - var result = new ValidatorResult(instance, schema2, options, ctx); - if (!helpers.deepCompareStrict(schema2["const"], instance)) { - result.addError({ - name: "const", - argument: schema2["const"], - message: "does not exactly match expected constant: " + schema2["const"] - }); - } - return result; - }; - validators.not = validators.disallow = function validateNot(instance, schema2, options, ctx) { - var self2 = this; - if (instance === void 0) return null; - var result = new ValidatorResult(instance, schema2, options, ctx); - var notTypes = schema2.not || schema2.disallow; - if (!notTypes) return null; - if (!Array.isArray(notTypes)) notTypes = [notTypes]; - notTypes.forEach(function(type2) { - if (self2.testType(instance, schema2, options, ctx, type2)) { - var id = type2 && (type2.$id || type2.id); - var schemaId = id || type2; - result.addError({ - name: "not", - argument: schemaId, - message: "is of prohibited type " + schemaId - }); - } - }); - return result; - }; - module2.exports = attribute; - } -}); - -// node_modules/jsonschema/lib/scan.js -var require_scan = __commonJS({ - "node_modules/jsonschema/lib/scan.js"(exports2, module2) { - "use strict"; - var urilib = require("url"); - var helpers = require_helpers3(); - module2.exports.SchemaScanResult = SchemaScanResult; - function SchemaScanResult(found, ref) { - this.id = found; - this.ref = ref; - } - module2.exports.scan = function scan(base, schema2) { - function scanSchema(baseuri, schema3) { - if (!schema3 || typeof schema3 != "object") return; - if (schema3.$ref) { - var resolvedUri = urilib.resolve(baseuri, schema3.$ref); - ref[resolvedUri] = ref[resolvedUri] ? ref[resolvedUri] + 1 : 0; - return; - } - var id = schema3.$id || schema3.id; - var ourBase = id ? urilib.resolve(baseuri, id) : baseuri; - if (ourBase) { - if (ourBase.indexOf("#") < 0) ourBase += "#"; - if (found[ourBase]) { - if (!helpers.deepCompareStrict(found[ourBase], schema3)) { - throw new Error("Schema <" + ourBase + "> already exists with different definition"); - } - return found[ourBase]; - } - found[ourBase] = schema3; - if (ourBase[ourBase.length - 1] == "#") { - found[ourBase.substring(0, ourBase.length - 1)] = schema3; - } - } - scanArray(ourBase + "/items", Array.isArray(schema3.items) ? schema3.items : [schema3.items]); - scanArray(ourBase + "/extends", Array.isArray(schema3.extends) ? schema3.extends : [schema3.extends]); - scanSchema(ourBase + "/additionalItems", schema3.additionalItems); - scanObject(ourBase + "/properties", schema3.properties); - scanSchema(ourBase + "/additionalProperties", schema3.additionalProperties); - scanObject(ourBase + "/definitions", schema3.definitions); - scanObject(ourBase + "/patternProperties", schema3.patternProperties); - scanObject(ourBase + "/dependencies", schema3.dependencies); - scanArray(ourBase + "/disallow", schema3.disallow); - scanArray(ourBase + "/allOf", schema3.allOf); - scanArray(ourBase + "/anyOf", schema3.anyOf); - scanArray(ourBase + "/oneOf", schema3.oneOf); - scanSchema(ourBase + "/not", schema3.not); - } - function scanArray(baseuri, schemas) { - if (!Array.isArray(schemas)) return; - for (var i = 0; i < schemas.length; i++) { - scanSchema(baseuri + "/" + i, schemas[i]); - } - } - function scanObject(baseuri, schemas) { - if (!schemas || typeof schemas != "object") return; - for (var p in schemas) { - scanSchema(baseuri + "/" + p, schemas[p]); - } - } - var found = {}; - var ref = {}; - scanSchema(base, schema2); - return new SchemaScanResult(found, ref); - }; - } -}); - -// node_modules/jsonschema/lib/validator.js -var require_validator = __commonJS({ - "node_modules/jsonschema/lib/validator.js"(exports2, module2) { - "use strict"; - var urilib = require("url"); - var attribute = require_attribute(); - var helpers = require_helpers3(); - var scanSchema = require_scan().scan; - var ValidatorResult = helpers.ValidatorResult; - var ValidatorResultError = helpers.ValidatorResultError; - var SchemaError = helpers.SchemaError; - var SchemaContext = helpers.SchemaContext; - var anonymousBase = "/"; - var Validator3 = function Validator4() { - this.customFormats = Object.create(Validator4.prototype.customFormats); - this.schemas = {}; - this.unresolvedRefs = []; - this.types = Object.create(types); - this.attributes = Object.create(attribute.validators); - }; - Validator3.prototype.customFormats = {}; - Validator3.prototype.schemas = null; - Validator3.prototype.types = null; - Validator3.prototype.attributes = null; - Validator3.prototype.unresolvedRefs = null; - Validator3.prototype.addSchema = function addSchema(schema2, base) { - var self2 = this; - if (!schema2) { - return null; - } - var scan = scanSchema(base || anonymousBase, schema2); - var ourUri = base || schema2.$id || schema2.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(uri2) { - return typeof self2.schemas[uri2] === "undefined"; - }); - return this.schemas[ourUri]; - }; - Validator3.prototype.addSubSchemaArray = function addSubSchemaArray(baseuri, schemas) { - if (!Array.isArray(schemas)) return; - for (var i = 0; i < schemas.length; i++) { - this.addSubSchema(baseuri, schemas[i]); - } - }; - Validator3.prototype.addSubSchemaObject = function addSubSchemaArray(baseuri, schemas) { - if (!schemas || typeof schemas != "object") return; - for (var p in schemas) { - this.addSubSchema(baseuri, schemas[p]); - } - }; - Validator3.prototype.setSchemas = function setSchemas(schemas) { - this.schemas = schemas; - }; - Validator3.prototype.getSchema = function getSchema(urn) { - return this.schemas[urn]; - }; - Validator3.prototype.validate = function validate(instance, schema2, options, ctx) { - if (typeof schema2 !== "boolean" && typeof schema2 !== "object" || schema2 === null) { - throw new SchemaError("Expected `schema` to be an object or boolean"); - } - if (!options) { - options = {}; - } - var id = schema2.$id || schema2.id; - var base = urilib.resolve(options.base || anonymousBase, id || ""); - if (!ctx) { - ctx = new SchemaContext(schema2, options, [], base, Object.create(this.schemas)); - if (!ctx.schemas[base]) { - ctx.schemas[base] = schema2; - } - var found = scanSchema(base, schema2); - for (var n in found.id) { - var sch = found.id[n]; - ctx.schemas[n] = sch; - } - } - if (options.required && instance === void 0) { - var result = new ValidatorResult(instance, schema2, options, ctx); - result.addError("is required, but is undefined"); - return result; - } - var result = this.validateSchema(instance, schema2, options, ctx); - if (!result) { - throw new Error("Result undefined"); - } else if (options.throwAll && result.errors.length) { - throw new ValidatorResultError(result); - } - return result; - }; - function shouldResolve(schema2) { - var ref = typeof schema2 === "string" ? schema2 : schema2.$ref; - if (typeof ref == "string") return ref; - return false; - } - Validator3.prototype.validateSchema = function validateSchema(instance, schema2, options, ctx) { - var result = new ValidatorResult(instance, schema2, options, ctx); - if (typeof schema2 === "boolean") { - if (schema2 === true) { - schema2 = {}; - } else if (schema2 === false) { - schema2 = { type: [] }; - } - } else if (!schema2) { - throw new Error("schema is undefined"); - } - if (schema2["extends"]) { - if (Array.isArray(schema2["extends"])) { - var schemaobj = { schema: schema2, ctx }; - schema2["extends"].forEach(this.schemaTraverser.bind(this, schemaobj)); - schema2 = schemaobj.schema; - schemaobj.schema = null; - schemaobj.ctx = null; - schemaobj = null; - } else { - schema2 = helpers.deepMerge(schema2, this.superResolve(schema2["extends"], ctx)); - } - } - var switchSchema = shouldResolve(schema2); - if (switchSchema) { - var resolved = this.resolve(schema2, switchSchema, ctx); - var subctx = new SchemaContext(resolved.subschema, options, ctx.path, resolved.switchSchema, ctx.schemas); - return this.validateSchema(instance, resolved.subschema, options, subctx); - } - var skipAttributes = options && options.skipAttributes || []; - for (var key in schema2) { - if (!attribute.ignoreProperties[key] && skipAttributes.indexOf(key) < 0) { - var validatorErr = null; - var validator = this.attributes[key]; - if (validator) { - validatorErr = validator.call(this, instance, schema2, options, ctx); - } else if (options.allowUnknownAttributes === false) { - throw new SchemaError("Unsupported attribute: " + key, schema2); - } - if (validatorErr) { - result.importErrors(validatorErr); - } - } - } - if (typeof options.rewrite == "function") { - var value = options.rewrite.call(this, instance, schema2, options, ctx); - result.instance = value; - } - return result; - }; - Validator3.prototype.schemaTraverser = function schemaTraverser(schemaobj, s) { - schemaobj.schema = helpers.deepMerge(schemaobj.schema, this.superResolve(s, schemaobj.ctx)); - }; - Validator3.prototype.superResolve = function superResolve(schema2, ctx) { - var ref = shouldResolve(schema2); - if (ref) { - return this.resolve(schema2, ref, ctx).subschema; - } - return schema2; - }; - Validator3.prototype.resolve = function resolve6(schema2, switchSchema, ctx) { - switchSchema = ctx.resolve(switchSchema); - if (ctx.schemas[switchSchema]) { - return { subschema: ctx.schemas[switchSchema], switchSchema }; - } - var parsed = urilib.parse(switchSchema); - var fragment = parsed && parsed.hash; - var document2 = fragment && fragment.length && switchSchema.substr(0, switchSchema.length - fragment.length); - if (!document2 || !ctx.schemas[document2]) { - throw new SchemaError("no such schema <" + switchSchema + ">", schema2); - } - var subschema = helpers.objectGetPath(ctx.schemas[document2], fragment.substr(1)); - if (subschema === void 0) { - throw new SchemaError("no such schema " + fragment + " located in <" + document2 + ">", schema2); - } - return { subschema, switchSchema }; - }; - Validator3.prototype.testType = function validateType(instance, schema2, options, ctx, type2) { - if (type2 === void 0) { - return; - } else if (type2 === null) { - throw new SchemaError('Unexpected null in "type" keyword'); - } - if (typeof this.types[type2] == "function") { - return this.types[type2].call(this, instance); - } - if (type2 && typeof type2 == "object") { - var res = this.validateSchema(instance, type2, options, ctx); - return res === void 0 || !(res && res.errors.length); - } - return true; - }; - var types = Validator3.prototype.types = {}; - types.string = function testString(instance) { - return typeof instance == "string"; - }; - types.number = function testNumber(instance) { - 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) { - return instance && typeof instance === "object" && !Array.isArray(instance) && !(instance instanceof Date); - }; - module2.exports = Validator3; - } -}); - -// node_modules/jsonschema/lib/index.js -var require_lib2 = __commonJS({ - "node_modules/jsonschema/lib/index.js"(exports2, module2) { - "use strict"; - var Validator3 = module2.exports.Validator = require_validator(); - module2.exports.ValidatorResult = require_helpers3().ValidatorResult; - module2.exports.ValidatorResultError = require_helpers3().ValidatorResultError; - module2.exports.ValidationError = require_helpers3().ValidationError; - module2.exports.SchemaError = require_helpers3().SchemaError; - module2.exports.SchemaScanResult = require_scan().SchemaScanResult; - module2.exports.scan = require_scan().scan; - module2.exports.validate = function(instance, schema2, options) { - var v = new Validator3(); - return v.validate(instance, schema2, options); - }; - } -}); - // node_modules/@actions/tool-cache/lib/manifest.js var require_manifest = __commonJS({ "node_modules/@actions/tool-cache/lib/manifest.js"(exports2, module2) { @@ -105893,8 +105893,8 @@ function cacheCodeQlVersion(version) { function getCachedCodeQlVersion() { return cachedCodeQlVersion; } -async function codeQlVersionAtLeast(codeql, requiredVersion) { - return semver.gte((await codeql.getVersion()).version, requiredVersion); +async function codeQlVersionAtLeast(codeql2, requiredVersion) { + return semver.gte((await codeql2.getVersion()).version, requiredVersion); } function getBaseDatabaseOidsFilePath(config) { return path.join(config.dbLocation, BASE_DATABASE_OIDS_FILE_NAME); @@ -106506,10 +106506,365 @@ function wrapApiConfigurationError(e) { return e; } +// src/codeql.ts +var fs10 = __toESM(require("fs")); +var path10 = __toESM(require("path")); +var core10 = __toESM(require_core()); +var toolrunner3 = __toESM(require_toolrunner()); + +// src/cli-errors.ts +var SUPPORTED_PLATFORMS = [ + ["linux", "x64"], + ["win32", "x64"], + ["darwin", "x64"], + ["darwin", "arm64"] +]; +var CliError = class extends Error { + exitCode; + stderr; + constructor({ cmd, args, exitCode, stderr }) { + const prettyCommand = prettyPrintInvocation(cmd, args); + const fatalErrors = extractFatalErrors(stderr); + const autobuildErrors = extractAutobuildErrors(stderr); + let message; + if (fatalErrors) { + message = `Encountered a fatal error while running "${prettyCommand}". Exit code was ${exitCode} and error was: ${ensureEndsInPeriod( + fatalErrors.trim() + )} See the logs for more details.`; + } else if (autobuildErrors) { + message = `We were unable to automatically build your code. Please provide manual build steps. See ${"https://docs.github.com/en/code-security/code-scanning/troubleshooting-code-scanning/automatic-build-failed" /* AUTOMATIC_BUILD_FAILED */} for more information. Encountered the following error: ${autobuildErrors}`; + } else { + const lastLine = ensureEndsInPeriod( + stderr.trim().split("\n").pop()?.trim() || "n/a" + ); + message = `Encountered a fatal error while running "${prettyCommand}". Exit code was ${exitCode} and last log line was: ${lastLine} See the logs for more details.`; + } + super(message); + this.exitCode = exitCode; + this.stderr = stderr; + } +}; +function extractFatalErrors(error3) { + const fatalErrorRegex = /.*fatal (internal )?error occurr?ed(. Details)?:/gi; + let fatalErrors = []; + let lastFatalErrorIndex; + let match; + while ((match = fatalErrorRegex.exec(error3)) !== null) { + if (lastFatalErrorIndex !== void 0) { + fatalErrors.push(error3.slice(lastFatalErrorIndex, match.index).trim()); + } + lastFatalErrorIndex = match.index; + } + if (lastFatalErrorIndex !== void 0) { + const lastError = error3.slice(lastFatalErrorIndex).trim(); + if (fatalErrors.length === 0) { + return lastError; + } + const isOneLiner = !fatalErrors.some((e) => e.includes("\n")); + if (isOneLiner) { + fatalErrors = fatalErrors.map(ensureEndsInPeriod); + } + return [ + ensureEndsInPeriod(lastError), + "Context:", + ...fatalErrors.reverse() + ].join(isOneLiner ? " " : "\n"); + } + return void 0; +} +function extractAutobuildErrors(error3) { + const pattern = /.*\[autobuild\] \[ERROR\] (.*)/gi; + let errorLines = [...error3.matchAll(pattern)].map((match) => match[1]); + if (errorLines.length > 10) { + errorLines = errorLines.slice(0, 10); + errorLines.push("(truncated)"); + } + return errorLines.join("\n") || void 0; +} +var cliErrorsConfig = { + ["AutobuildError" /* AutobuildError */]: { + cliErrorMessageCandidates: [ + new RegExp("We were unable to automatically build your code") + ] + }, + ["CouldNotCreateTempDir" /* CouldNotCreateTempDir */]: { + cliErrorMessageCandidates: [new RegExp("Could not create temp directory")] + }, + ["ExternalRepositoryCloneFailed" /* ExternalRepositoryCloneFailed */]: { + cliErrorMessageCandidates: [ + new RegExp("Failed to clone external Git repository") + ] + }, + ["GradleBuildFailed" /* GradleBuildFailed */]: { + cliErrorMessageCandidates: [ + new RegExp("\\[autobuild\\] FAILURE: Build failed with an exception.") + ] + }, + // Version of CodeQL CLI is incompatible with this version of the CodeQL Action + ["IncompatibleWithActionVersion" /* IncompatibleWithActionVersion */]: { + cliErrorMessageCandidates: [ + new RegExp("is not compatible with this CodeQL CLI") + ] + }, + ["InitCalledTwice" /* InitCalledTwice */]: { + cliErrorMessageCandidates: [ + new RegExp( + "Refusing to create databases .* but could not process any of it" + ) + ], + additionalErrorMessageToAppend: `Is the "init" action called twice in the same job?` + }, + ["InvalidConfigFile" /* InvalidConfigFile */]: { + cliErrorMessageCandidates: [ + new RegExp("Config file .* is not valid"), + new RegExp("The supplied config file is empty") + ] + }, + ["InvalidExternalRepoSpecifier" /* InvalidExternalRepoSpecifier */]: { + cliErrorMessageCandidates: [ + new RegExp("Specifier for external repository is invalid") + ] + }, + // Expected source location for database creation does not exist + ["InvalidSourceRoot" /* InvalidSourceRoot */]: { + cliErrorMessageCandidates: [new RegExp("Invalid source root")] + }, + ["MavenBuildFailed" /* MavenBuildFailed */]: { + cliErrorMessageCandidates: [ + new RegExp("\\[autobuild\\] \\[ERROR\\] Failed to execute goal") + ] + }, + ["NoBuildCommandAutodetected" /* NoBuildCommandAutodetected */]: { + cliErrorMessageCandidates: [ + new RegExp("Could not auto-detect a suitable build method") + ] + }, + ["NoBuildMethodAutodetected" /* NoBuildMethodAutodetected */]: { + cliErrorMessageCandidates: [ + new RegExp( + "Could not detect a suitable build command for the source checkout" + ) + ] + }, + // Usually when a manual build script has failed, or if an autodetected language + // was unintended to have CodeQL analysis run on it. + ["NoSourceCodeSeen" /* NoSourceCodeSeen */]: { + exitCode: 32, + cliErrorMessageCandidates: [ + new RegExp( + "CodeQL detected code written in .* but could not process any of it" + ), + new RegExp( + "CodeQL did not detect any code written in languages supported by CodeQL" + ) + ] + }, + ["NoSupportedBuildCommandSucceeded" /* NoSupportedBuildCommandSucceeded */]: { + cliErrorMessageCandidates: [ + new RegExp("No supported build command succeeded") + ] + }, + ["NoSupportedBuildSystemDetected" /* NoSupportedBuildSystemDetected */]: { + cliErrorMessageCandidates: [ + new RegExp("No supported build system detected") + ] + }, + ["OutOfMemoryOrDisk" /* OutOfMemoryOrDisk */]: { + cliErrorMessageCandidates: [ + new RegExp("CodeQL is out of memory."), + new RegExp("out of disk"), + new RegExp("No space left on device") + ], + additionalErrorMessageToAppend: "For more information, see https://gh.io/troubleshooting-code-scanning/out-of-disk-or-memory" + }, + ["PackCannotBeFound" /* PackCannotBeFound */]: { + cliErrorMessageCandidates: [ + new RegExp( + "Query pack .* cannot be found\\. Check the spelling of the pack\\." + ), + new RegExp( + "is not a .ql file, .qls file, a directory, or a query pack specification." + ) + ] + }, + ["PackMissingAuth" /* PackMissingAuth */]: { + cliErrorMessageCandidates: [ + new RegExp("GitHub Container registry .* 403 Forbidden"), + new RegExp( + "Do you need to specify a token to authenticate to the registry?" + ) + ] + }, + ["SwiftBuildFailed" /* SwiftBuildFailed */]: { + cliErrorMessageCandidates: [ + new RegExp( + "\\[autobuilder/build\\] \\[build-command-failed\\] `autobuild` failed to run the build command" + ) + ] + }, + ["UnsupportedBuildMode" /* UnsupportedBuildMode */]: { + cliErrorMessageCandidates: [ + new RegExp( + "does not support the .* build mode. Please try using one of the following build modes instead" + ) + ] + }, + ["NotFoundInRegistry" /* NotFoundInRegistry */]: { + cliErrorMessageCandidates: [ + new RegExp("'.*' not found in the registry '.*'") + ] + } +}; +function getCliConfigCategoryIfExists(cliError) { + for (const [category, configuration] of Object.entries(cliErrorsConfig)) { + if (cliError.exitCode !== void 0 && configuration.exitCode !== void 0 && cliError.exitCode === configuration.exitCode) { + return category; + } + for (const e of configuration.cliErrorMessageCandidates) { + if (cliError.message.match(e) || cliError.stderr.match(e)) { + return category; + } + } + } + return void 0; +} +function isUnsupportedPlatform() { + return !SUPPORTED_PLATFORMS.some( + ([platform, arch2]) => platform === process.platform && arch2 === process.arch + ); +} +function getUnsupportedPlatformError(cliError) { + return new ConfigurationError( + `The CodeQL CLI does not support the platform/architecture combination of ${process.platform}/${process.arch} (see ${"https://codeql.github.com/docs/codeql-overview/system-requirements/" /* SYSTEM_REQUIREMENTS */}). The underlying error was: ${cliError.message}` + ); +} +function wrapCliConfigurationError(cliError) { + if (isUnsupportedPlatform()) { + return getUnsupportedPlatformError(cliError); + } + const cliConfigErrorCategory = getCliConfigCategoryIfExists(cliError); + if (cliConfigErrorCategory === void 0) { + return cliError; + } + let errorMessageBuilder = cliError.message; + const additionalErrorMessageToAppend = cliErrorsConfig[cliConfigErrorCategory].additionalErrorMessageToAppend; + if (additionalErrorMessageToAppend !== void 0) { + errorMessageBuilder = `${errorMessageBuilder} ${additionalErrorMessageToAppend}`; + } + return new ConfigurationError(errorMessageBuilder); +} + +// src/config-utils.ts +var fs6 = __toESM(require("fs")); +var path7 = __toESM(require("path")); + +// src/caching-utils.ts +var core6 = __toESM(require_core()); + +// src/config/db-config.ts +var jsonschema = __toESM(require_lib2()); +var semver2 = __toESM(require_semver2()); +var PACK_IDENTIFIER_PATTERN = (function() { + const alphaNumeric = "[a-z0-9]"; + const alphaNumericDash = "[a-z0-9-]"; + const component = `${alphaNumeric}(${alphaNumericDash}*${alphaNumeric})?`; + return new RegExp(`^${component}/${component}$`); +})(); + +// src/diagnostics.ts +var import_fs = require("fs"); +var import_path = __toESM(require("path")); + +// src/logging.ts +var core7 = __toESM(require_core()); +function getActionsLogger() { + return { + debug: core7.debug, + info: core7.info, + warning: core7.warning, + error: core7.error, + isDebug: core7.isDebug, + startGroup: core7.startGroup, + endGroup: core7.endGroup + }; +} +function formatDuration(durationMs) { + if (durationMs < 1e3) { + return `${durationMs}ms`; + } + if (durationMs < 60 * 1e3) { + return `${(durationMs / 1e3).toFixed(1)}s`; + } + const minutes = Math.floor(durationMs / (60 * 1e3)); + const seconds = Math.floor(durationMs % (60 * 1e3) / 1e3); + return `${minutes}m${seconds}s`; +} + +// src/diagnostics.ts +var unwrittenDiagnostics = []; +var unwrittenDefaultLanguageDiagnostics = []; +function makeDiagnostic(id, name, data = void 0) { + return { + ...data, + timestamp: data?.timestamp ?? (/* @__PURE__ */ new Date()).toISOString(), + source: { ...data?.source, id, name } + }; +} +function addDiagnostic(config, language, diagnostic) { + const logger = getActionsLogger(); + const databasePath = language ? getCodeQLDatabasePath(config, language) : config.dbLocation; + if ((0, import_fs.existsSync)(databasePath)) { + writeDiagnostic(config, language, diagnostic); + } else { + logger.debug( + `Writing a diagnostic for ${language}, but the database at ${databasePath} does not exist yet.` + ); + unwrittenDiagnostics.push({ diagnostic, language }); + } +} +function addNoLanguageDiagnostic(config, diagnostic) { + if (config !== void 0) { + addDiagnostic( + config, + // Arbitrarily choose the first language. We could also choose all languages, but that + // increases the risk of misinterpreting the data. + config.languages[0], + diagnostic + ); + } else { + unwrittenDefaultLanguageDiagnostics.push(diagnostic); + } +} +function writeDiagnostic(config, language, diagnostic) { + const logger = getActionsLogger(); + const databasePath = language ? getCodeQLDatabasePath(config, language) : config.dbLocation; + const diagnosticsPath = import_path.default.resolve( + databasePath, + "diagnostic", + "codeql-action" + ); + try { + (0, import_fs.mkdirSync)(diagnosticsPath, { recursive: true }); + const jsonPath = import_path.default.resolve( + diagnosticsPath, + // Remove colons from the timestamp as these are not allowed in Windows filenames. + `codeql-action-${diagnostic.timestamp.replaceAll(":", "")}.json` + ); + (0, import_fs.writeFileSync)(jsonPath, JSON.stringify(diagnostic)); + } catch (err) { + logger.warning(`Unable to write diagnostic message to database: ${err}`); + logger.debug(JSON.stringify(diagnostic)); + } +} + +// src/diff-informed-analysis-utils.ts +var fs5 = __toESM(require("fs")); +var path6 = __toESM(require("path")); + // src/feature-flags.ts var fs4 = __toESM(require("fs")); -var path4 = __toESM(require("path")); -var semver4 = __toESM(require_semver2()); +var path5 = __toESM(require("path")); +var semver5 = __toESM(require_semver2()); // src/defaults.json var bundleVersion = "codeql-bundle-v2.24.2"; @@ -106517,21 +106872,18 @@ var cliVersion = "2.24.2"; // src/overlay-database-utils.ts var fs3 = __toESM(require("fs")); -var path3 = __toESM(require("path")); +var path4 = __toESM(require("path")); var actionsCache = __toESM(require_cache5()); -// src/caching-utils.ts -var core6 = __toESM(require_core()); - // src/git-utils.ts -var core7 = __toESM(require_core()); +var core8 = __toESM(require_core()); var toolrunner2 = __toESM(require_toolrunner()); var io3 = __toESM(require_io()); -var semver2 = __toESM(require_semver2()); +var semver3 = __toESM(require_semver2()); var runGitCommand = async function(workingDirectory, args, customErrorMessage, options) { let stdout = ""; let stderr = ""; - core7.debug(`Running git command: git ${args.join(" ")}`); + core8.debug(`Running git command: git ${args.join(" ")}`); try { await new toolrunner2.ToolRunner(await io3.which("git", true), args, { silent: true, @@ -106552,7 +106904,7 @@ var runGitCommand = async function(workingDirectory, args, customErrorMessage, o if (stderr.includes("not a git repository")) { reason = "The checkout path provided to the action does not appear to be a git repository."; } - core7.info(`git call failed. ${customErrorMessage} Error: ${reason}`); + core8.info(`git call failed. ${customErrorMessage} Error: ${reason}`); throw error3; } }; @@ -106697,7 +107049,7 @@ async function getRef() { ) !== head; if (hasChangedRef) { const newRef = ref.replace(pull_ref_regex, "refs/pull/$1/head"); - core7.debug( + core8.debug( `No longer on merge commit, rewriting ref from ${ref} to ${newRef}.` ); return newRef; @@ -106722,31 +107074,6 @@ async function isAnalyzingDefaultBranch() { return currentRef === defaultBranch; } -// src/logging.ts -var core8 = __toESM(require_core()); -function getActionsLogger() { - return { - debug: core8.debug, - info: core8.info, - warning: core8.warning, - error: core8.error, - isDebug: core8.isDebug, - startGroup: core8.startGroup, - endGroup: core8.endGroup - }; -} -function formatDuration(durationMs) { - if (durationMs < 1e3) { - return `${durationMs}ms`; - } - if (durationMs < 60 * 1e3) { - return `${(durationMs / 1e3).toFixed(1)}s`; - } - const minutes = Math.floor(durationMs / (60 * 1e3)); - const seconds = Math.floor(durationMs % (60 * 1e3) / 1e3); - return `${minutes}m${seconds}s`; -} - // src/overlay-database-utils.ts var CODEQL_OVERLAY_MINIMUM_VERSION = "2.23.8"; var OVERLAY_BASE_DATABASE_MAX_UPLOAD_SIZE_MB = 7500; @@ -106780,7 +107107,7 @@ async function writeOverlayChangesFile(config, sourceRoot, logger) { `Found ${changedFiles.length} changed file(s) under ${sourceRoot}.` ); const changedFilesJson = JSON.stringify({ changes: changedFiles }); - const overlayChangesFile = path3.join( + const overlayChangesFile = path4.join( getTemporaryDirectory(), "overlay-changes.json" ); @@ -106806,7 +107133,7 @@ function computeChangedFiles(baseFileOids, overlayFileOids) { } // src/tools-features.ts -var semver3 = __toESM(require_semver2()); +var semver4 = __toESM(require_semver2()); function isSupportedToolsFeature(versionInfo, feature) { return !!versionInfo.features && versionInfo.features[feature]; } @@ -107073,8 +107400,8 @@ var OfflineFeatures = class { * * @throws if a `minimumVersion` is specified for the feature, and `codeql` is not provided. */ - async getValue(feature, codeql) { - const offlineValue = await this.getOfflineValue(feature, codeql); + async getValue(feature, codeql2) { + const offlineValue = await this.getOfflineValue(feature, codeql2); if (offlineValue !== void 0) { return offlineValue; } @@ -107083,14 +107410,14 @@ var OfflineFeatures = class { /** * Determines whether `feature` is enabled using the CLI and environment variables. */ - async getOfflineValue(feature, codeql) { + async getOfflineValue(feature, codeql2) { const config = this.getFeatureConfig(feature); - if (!codeql && config.minimumVersion) { + if (!codeql2 && config.minimumVersion) { throw new Error( `Internal error: A minimum version is specified for feature ${feature}, but no instance of CodeQL was provided.` ); } - if (!codeql && config.toolsFeature) { + if (!codeql2 && config.toolsFeature) { throw new Error( `Internal error: A required tools feature is specified for feature ${feature}, but no instance of CodeQL was provided.` ); @@ -107103,28 +107430,28 @@ var OfflineFeatures = class { return false; } const minimumVersion = config.minimumVersion; - if (codeql && minimumVersion) { - if (!await codeQlVersionAtLeast(codeql, minimumVersion)) { + if (codeql2 && minimumVersion) { + if (!await codeQlVersionAtLeast(codeql2, minimumVersion)) { this.logger.debug( `Feature ${feature} is disabled because the CodeQL CLI version is older than the minimum version ${minimumVersion}.` ); return false; } else { this.logger.debug( - `CodeQL CLI version ${(await codeql.getVersion()).version} is newer than the minimum version ${minimumVersion} for feature ${feature}.` + `CodeQL CLI version ${(await codeql2.getVersion()).version} is newer than the minimum version ${minimumVersion} for feature ${feature}.` ); } } const toolsFeature = config.toolsFeature; - if (codeql && toolsFeature) { - if (!await codeql.supportsFeature(toolsFeature)) { + if (codeql2 && toolsFeature) { + if (!await codeql2.supportsFeature(toolsFeature)) { this.logger.debug( `Feature ${feature} is disabled because the CodeQL CLI version does not support the required tools feature ${toolsFeature}.` ); return false; } else { this.logger.debug( - `CodeQL CLI version ${(await codeql.getVersion()).version} supports the required tools feature ${toolsFeature} for feature ${feature}.` + `CodeQL CLI version ${(await codeql2.getVersion()).version} supports the required tools feature ${toolsFeature} for feature ${feature}.` ); } } @@ -107152,7 +107479,7 @@ var Features = class extends OfflineFeatures { super(logger); this.gitHubFeatureFlags = new GitHubFeatureFlags( repositoryNwo, - path4.join(tempDir, FEATURE_FLAGS_FILE_NAME), + path5.join(tempDir, FEATURE_FLAGS_FILE_NAME), logger ); } @@ -107174,8 +107501,8 @@ var Features = class extends OfflineFeatures { * * @throws if a `minimumVersion` is specified for the feature, and `codeql` is not provided. */ - async getValue(feature, codeql) { - const offlineValue = await this.getOfflineValue(feature, codeql); + async getValue(feature, codeql2) { + const offlineValue = await this.getOfflineValue(feature, codeql2); if (offlineValue !== void 0) { return offlineValue; } @@ -107208,7 +107535,7 @@ var GitHubFeatureFlags = class { DEFAULT_VERSION_FEATURE_FLAG_PREFIX.length, f.length - DEFAULT_VERSION_FEATURE_FLAG_SUFFIX.length ).replace(/_/g, "."); - if (!semver4.valid(version)) { + if (!semver5.valid(version)) { this.logger.warning( `Ignoring feature flag ${f} as it does not specify a valid CodeQL version.` ); @@ -107367,86 +107694,7 @@ function initFeatures(gitHubVersion, repositoryNwo, tempDir, logger) { } } -// src/status-report.ts -var os = __toESM(require("os")); -var core9 = __toESM(require_core()); - -// src/config-utils.ts -var fs6 = __toESM(require("fs")); -var path7 = __toESM(require("path")); - -// src/config/db-config.ts -var jsonschema = __toESM(require_lib2()); -var semver5 = __toESM(require_semver2()); -var PACK_IDENTIFIER_PATTERN = (function() { - const alphaNumeric = "[a-z0-9]"; - const alphaNumericDash = "[a-z0-9-]"; - const component = `${alphaNumeric}(${alphaNumericDash}*${alphaNumeric})?`; - return new RegExp(`^${component}/${component}$`); -})(); - -// src/diagnostics.ts -var import_fs = require("fs"); -var import_path = __toESM(require("path")); -var unwrittenDiagnostics = []; -var unwrittenDefaultLanguageDiagnostics = []; -function makeDiagnostic(id, name, data = void 0) { - return { - ...data, - timestamp: data?.timestamp ?? (/* @__PURE__ */ new Date()).toISOString(), - source: { ...data?.source, id, name } - }; -} -function addDiagnostic(config, language, diagnostic) { - const logger = getActionsLogger(); - const databasePath = language ? getCodeQLDatabasePath(config, language) : config.dbLocation; - if ((0, import_fs.existsSync)(databasePath)) { - writeDiagnostic(config, language, diagnostic); - } else { - logger.debug( - `Writing a diagnostic for ${language}, but the database at ${databasePath} does not exist yet.` - ); - unwrittenDiagnostics.push({ diagnostic, language }); - } -} -function addNoLanguageDiagnostic(config, diagnostic) { - if (config !== void 0) { - addDiagnostic( - config, - // Arbitrarily choose the first language. We could also choose all languages, but that - // increases the risk of misinterpreting the data. - config.languages[0], - diagnostic - ); - } else { - unwrittenDefaultLanguageDiagnostics.push(diagnostic); - } -} -function writeDiagnostic(config, language, diagnostic) { - const logger = getActionsLogger(); - const databasePath = language ? getCodeQLDatabasePath(config, language) : config.dbLocation; - const diagnosticsPath = import_path.default.resolve( - databasePath, - "diagnostic", - "codeql-action" - ); - try { - (0, import_fs.mkdirSync)(diagnosticsPath, { recursive: true }); - const jsonPath = import_path.default.resolve( - diagnosticsPath, - // Remove colons from the timestamp as these are not allowed in Windows filenames. - `codeql-action-${diagnostic.timestamp.replaceAll(":", "")}.json` - ); - (0, import_fs.writeFileSync)(jsonPath, JSON.stringify(diagnostic)); - } catch (err) { - logger.warning(`Unable to write diagnostic message to database: ${err}`); - logger.debug(JSON.stringify(diagnostic)); - } -} - // src/diff-informed-analysis-utils.ts -var fs5 = __toESM(require("fs")); -var path6 = __toESM(require("path")); function getDiffRangesJsonFilePath() { return path6.join(getTemporaryDirectory(), "pr-diff-range.json"); } @@ -107538,470 +107786,6 @@ function appendExtraQueryExclusions(extraQueryExclusions, cliConfig) { return augmentedConfig; } -// src/status-report.ts -function isFirstPartyAnalysis(actionName) { - if (actionName !== "upload-sarif" /* UploadSarif */) { - return true; - } - return process.env["CODEQL_ACTION_INIT_HAS_RUN" /* INIT_ACTION_HAS_RUN */] === "true"; -} -function isThirdPartyAnalysis(actionName) { - return !isFirstPartyAnalysis(actionName); -} -function getActionsStatus(error3, otherFailureCause) { - if (error3 || otherFailureCause) { - return error3 instanceof ConfigurationError ? "user-error" : "failure"; - } else { - return "success"; - } -} -function setJobStatusIfUnsuccessful(actionStatus) { - if (actionStatus === "user-error") { - core9.exportVariable( - "CODEQL_ACTION_JOB_STATUS" /* JOB_STATUS */, - process.env["CODEQL_ACTION_JOB_STATUS" /* JOB_STATUS */] ?? "JOB_STATUS_CONFIGURATION_ERROR" /* ConfigErrorStatus */ - ); - } else if (actionStatus === "failure" || actionStatus === "aborted") { - core9.exportVariable( - "CODEQL_ACTION_JOB_STATUS" /* JOB_STATUS */, - process.env["CODEQL_ACTION_JOB_STATUS" /* JOB_STATUS */] ?? "JOB_STATUS_FAILURE" /* FailureStatus */ - ); - } -} -async function createStatusReportBase(actionName, status, actionStartedAt, config, diskInfo, logger, cause, exception2) { - try { - const commitOid = getOptionalInput("sha") || process.env["GITHUB_SHA"] || ""; - const ref = await getRef(); - const jobRunUUID = process.env["JOB_RUN_UUID" /* JOB_RUN_UUID */] || ""; - const workflowRunID = getWorkflowRunID(); - const workflowRunAttempt = getWorkflowRunAttempt(); - const workflowName = process.env["GITHUB_WORKFLOW"] || ""; - const jobName = process.env["GITHUB_JOB"] || ""; - const analysis_key = await getAnalysisKey(); - let workflowStartedAt = process.env["CODEQL_WORKFLOW_STARTED_AT" /* WORKFLOW_STARTED_AT */]; - if (workflowStartedAt === void 0) { - workflowStartedAt = actionStartedAt.toISOString(); - core9.exportVariable("CODEQL_WORKFLOW_STARTED_AT" /* WORKFLOW_STARTED_AT */, workflowStartedAt); - } - const runnerOs = getRequiredEnvParam("RUNNER_OS"); - const codeQlCliVersion = getCachedCodeQlVersion(); - const actionRef = process.env["GITHUB_ACTION_REF"] || ""; - const testingEnvironment = getTestingEnvironment(); - if (testingEnvironment) { - core9.exportVariable("CODEQL_ACTION_TESTING_ENVIRONMENT" /* TESTING_ENVIRONMENT */, testingEnvironment); - } - const isSteadyStateDefaultSetupRun = process.env["CODE_SCANNING_IS_STEADY_STATE_DEFAULT_SETUP"] === "true"; - const statusReport = { - action_name: actionName, - action_oid: "unknown", - // TODO decide if it's possible to fill this in - action_ref: actionRef, - action_started_at: actionStartedAt.toISOString(), - action_version: getActionVersion(), - analysis_kinds: config?.analysisKinds?.join(","), - analysis_key, - build_mode: config?.buildMode, - commit_oid: commitOid, - first_party_analysis: isFirstPartyAnalysis(actionName), - job_name: jobName, - job_run_uuid: jobRunUUID, - ref, - runner_os: runnerOs, - started_at: workflowStartedAt, - status, - steady_state_default_setup: isSteadyStateDefaultSetupRun, - testing_environment: testingEnvironment || "", - workflow_name: workflowName, - workflow_run_attempt: workflowRunAttempt, - workflow_run_id: workflowRunID - }; - try { - statusReport.actions_event_name = getWorkflowEventName(); - } catch (e) { - logger.warning( - `Could not determine the workflow event name: ${getErrorMessage(e)}.` - ); - } - if (config) { - statusReport.languages = config.languages?.join(","); - } - if (diskInfo) { - statusReport.runner_available_disk_space_bytes = diskInfo.numAvailableBytes; - statusReport.runner_total_disk_space_bytes = diskInfo.numTotalBytes; - } - if (cause) { - statusReport.cause = cause; - } - if (exception2) { - statusReport.exception = exception2; - } - if (status === "success" || status === "failure" || status === "aborted" || status === "user-error") { - statusReport.completed_at = (/* @__PURE__ */ new Date()).toISOString(); - } - const matrix = getRequiredInput("matrix"); - if (matrix) { - statusReport.matrix_vars = matrix; - } - if ("RUNNER_ARCH" in process.env) { - statusReport.runner_arch = process.env["RUNNER_ARCH"]; - } - if (!(runnerOs === "Linux" && isSelfHostedRunner())) { - statusReport.runner_os_release = os.release(); - } - if (codeQlCliVersion !== void 0) { - statusReport.codeql_version = codeQlCliVersion.version; - } - const imageVersion = process.env["ImageVersion"]; - if (imageVersion) { - statusReport.runner_image_version = imageVersion; - } - return statusReport; - } catch (e) { - logger.warning( - `Failed to gather information for telemetry: ${getErrorMessage(e)}. Will skip sending status report.` - ); - if (isInTestMode()) { - throw e; - } - return void 0; - } -} -var OUT_OF_DATE_MSG = "CodeQL Action is out-of-date. Please upgrade to the latest version of `codeql-action`."; -var INCOMPATIBLE_MSG = "CodeQL Action version is incompatible with the API endpoint. Please update to a compatible version of `codeql-action`."; -async function sendStatusReport(statusReport) { - setJobStatusIfUnsuccessful(statusReport.status); - const statusReportJSON = JSON.stringify(statusReport); - core9.debug(`Sending status report: ${statusReportJSON}`); - if (isInTestMode()) { - core9.debug("In test mode. Status reports are not uploaded."); - return; - } - const nwo = getRepositoryNwo(); - const client = getApiClient(); - try { - await client.request( - "PUT /repos/:owner/:repo/code-scanning/analysis/status", - { - owner: nwo.owner, - repo: nwo.repo, - data: statusReportJSON - } - ); - } catch (e) { - const httpError = asHTTPError(e); - if (httpError !== void 0) { - switch (httpError.status) { - case 403: - if (getWorkflowEventName() === "push" && process.env["GITHUB_ACTOR"] === "dependabot[bot]") { - core9.warning( - `Workflows triggered by Dependabot on the "push" event run with read-only access. Uploading CodeQL results requires write access. To use CodeQL with Dependabot, please ensure you are using the "pull_request" event for this workflow and avoid triggering on the "push" event for Dependabot branches. See ${"https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning#scanning-on-push" /* SCANNING_ON_PUSH */} for more information on how to configure these events.` - ); - } else { - core9.warning( - `This run of the CodeQL Action does not have permission to access the CodeQL Action API endpoints. This could be because the Action is running on a pull request from a fork. If not, please ensure the workflow has at least the 'security-events: read' permission. Details: ${httpError.message}` - ); - } - return; - case 404: - core9.warning(httpError.message); - return; - case 422: - if (getRequiredEnvParam("GITHUB_SERVER_URL") !== GITHUB_DOTCOM_URL) { - core9.debug(INCOMPATIBLE_MSG); - } else { - core9.debug(OUT_OF_DATE_MSG); - } - return; - } - } - core9.warning( - `An unexpected error occurred when sending a status report: ${getErrorMessage( - e - )}` - ); - } -} -async function sendUnhandledErrorStatusReport(actionName, actionStartedAt, error3, logger) { - try { - const statusReport = await createStatusReportBase( - actionName, - "failure", - actionStartedAt, - void 0, - void 0, - logger, - `Unhandled CodeQL Action error: ${getErrorMessage(error3)}`, - error3 instanceof Error ? error3.stack : void 0 - ); - if (statusReport !== void 0) { - await sendStatusReport(statusReport); - } - } catch (e) { - logger.warning( - `Failed to send the unhandled error status report: ${getErrorMessage(e)}.` - ); - if (isInTestMode()) { - throw e; - } - } -} - -// src/upload-lib.ts -var fs12 = __toESM(require("fs")); -var path12 = __toESM(require("path")); -var url = __toESM(require("url")); -var import_zlib = __toESM(require("zlib")); -var core12 = __toESM(require_core()); -var jsonschema2 = __toESM(require_lib2()); - -// src/codeql.ts -var fs10 = __toESM(require("fs")); -var path10 = __toESM(require("path")); -var core11 = __toESM(require_core()); -var toolrunner3 = __toESM(require_toolrunner()); - -// src/cli-errors.ts -var SUPPORTED_PLATFORMS = [ - ["linux", "x64"], - ["win32", "x64"], - ["darwin", "x64"], - ["darwin", "arm64"] -]; -var CliError = class extends Error { - exitCode; - stderr; - constructor({ cmd, args, exitCode, stderr }) { - const prettyCommand = prettyPrintInvocation(cmd, args); - const fatalErrors = extractFatalErrors(stderr); - const autobuildErrors = extractAutobuildErrors(stderr); - let message; - if (fatalErrors) { - message = `Encountered a fatal error while running "${prettyCommand}". Exit code was ${exitCode} and error was: ${ensureEndsInPeriod( - fatalErrors.trim() - )} See the logs for more details.`; - } else if (autobuildErrors) { - message = `We were unable to automatically build your code. Please provide manual build steps. See ${"https://docs.github.com/en/code-security/code-scanning/troubleshooting-code-scanning/automatic-build-failed" /* AUTOMATIC_BUILD_FAILED */} for more information. Encountered the following error: ${autobuildErrors}`; - } else { - const lastLine = ensureEndsInPeriod( - stderr.trim().split("\n").pop()?.trim() || "n/a" - ); - message = `Encountered a fatal error while running "${prettyCommand}". Exit code was ${exitCode} and last log line was: ${lastLine} See the logs for more details.`; - } - super(message); - this.exitCode = exitCode; - this.stderr = stderr; - } -}; -function extractFatalErrors(error3) { - const fatalErrorRegex = /.*fatal (internal )?error occurr?ed(. Details)?:/gi; - let fatalErrors = []; - let lastFatalErrorIndex; - let match; - while ((match = fatalErrorRegex.exec(error3)) !== null) { - if (lastFatalErrorIndex !== void 0) { - fatalErrors.push(error3.slice(lastFatalErrorIndex, match.index).trim()); - } - lastFatalErrorIndex = match.index; - } - if (lastFatalErrorIndex !== void 0) { - const lastError = error3.slice(lastFatalErrorIndex).trim(); - if (fatalErrors.length === 0) { - return lastError; - } - const isOneLiner = !fatalErrors.some((e) => e.includes("\n")); - if (isOneLiner) { - fatalErrors = fatalErrors.map(ensureEndsInPeriod); - } - return [ - ensureEndsInPeriod(lastError), - "Context:", - ...fatalErrors.reverse() - ].join(isOneLiner ? " " : "\n"); - } - return void 0; -} -function extractAutobuildErrors(error3) { - const pattern = /.*\[autobuild\] \[ERROR\] (.*)/gi; - let errorLines = [...error3.matchAll(pattern)].map((match) => match[1]); - if (errorLines.length > 10) { - errorLines = errorLines.slice(0, 10); - errorLines.push("(truncated)"); - } - return errorLines.join("\n") || void 0; -} -var cliErrorsConfig = { - ["AutobuildError" /* AutobuildError */]: { - cliErrorMessageCandidates: [ - new RegExp("We were unable to automatically build your code") - ] - }, - ["CouldNotCreateTempDir" /* CouldNotCreateTempDir */]: { - cliErrorMessageCandidates: [new RegExp("Could not create temp directory")] - }, - ["ExternalRepositoryCloneFailed" /* ExternalRepositoryCloneFailed */]: { - cliErrorMessageCandidates: [ - new RegExp("Failed to clone external Git repository") - ] - }, - ["GradleBuildFailed" /* GradleBuildFailed */]: { - cliErrorMessageCandidates: [ - new RegExp("\\[autobuild\\] FAILURE: Build failed with an exception.") - ] - }, - // Version of CodeQL CLI is incompatible with this version of the CodeQL Action - ["IncompatibleWithActionVersion" /* IncompatibleWithActionVersion */]: { - cliErrorMessageCandidates: [ - new RegExp("is not compatible with this CodeQL CLI") - ] - }, - ["InitCalledTwice" /* InitCalledTwice */]: { - cliErrorMessageCandidates: [ - new RegExp( - "Refusing to create databases .* but could not process any of it" - ) - ], - additionalErrorMessageToAppend: `Is the "init" action called twice in the same job?` - }, - ["InvalidConfigFile" /* InvalidConfigFile */]: { - cliErrorMessageCandidates: [ - new RegExp("Config file .* is not valid"), - new RegExp("The supplied config file is empty") - ] - }, - ["InvalidExternalRepoSpecifier" /* InvalidExternalRepoSpecifier */]: { - cliErrorMessageCandidates: [ - new RegExp("Specifier for external repository is invalid") - ] - }, - // Expected source location for database creation does not exist - ["InvalidSourceRoot" /* InvalidSourceRoot */]: { - cliErrorMessageCandidates: [new RegExp("Invalid source root")] - }, - ["MavenBuildFailed" /* MavenBuildFailed */]: { - cliErrorMessageCandidates: [ - new RegExp("\\[autobuild\\] \\[ERROR\\] Failed to execute goal") - ] - }, - ["NoBuildCommandAutodetected" /* NoBuildCommandAutodetected */]: { - cliErrorMessageCandidates: [ - new RegExp("Could not auto-detect a suitable build method") - ] - }, - ["NoBuildMethodAutodetected" /* NoBuildMethodAutodetected */]: { - cliErrorMessageCandidates: [ - new RegExp( - "Could not detect a suitable build command for the source checkout" - ) - ] - }, - // Usually when a manual build script has failed, or if an autodetected language - // was unintended to have CodeQL analysis run on it. - ["NoSourceCodeSeen" /* NoSourceCodeSeen */]: { - exitCode: 32, - cliErrorMessageCandidates: [ - new RegExp( - "CodeQL detected code written in .* but could not process any of it" - ), - new RegExp( - "CodeQL did not detect any code written in languages supported by CodeQL" - ) - ] - }, - ["NoSupportedBuildCommandSucceeded" /* NoSupportedBuildCommandSucceeded */]: { - cliErrorMessageCandidates: [ - new RegExp("No supported build command succeeded") - ] - }, - ["NoSupportedBuildSystemDetected" /* NoSupportedBuildSystemDetected */]: { - cliErrorMessageCandidates: [ - new RegExp("No supported build system detected") - ] - }, - ["OutOfMemoryOrDisk" /* OutOfMemoryOrDisk */]: { - cliErrorMessageCandidates: [ - new RegExp("CodeQL is out of memory."), - new RegExp("out of disk"), - new RegExp("No space left on device") - ], - additionalErrorMessageToAppend: "For more information, see https://gh.io/troubleshooting-code-scanning/out-of-disk-or-memory" - }, - ["PackCannotBeFound" /* PackCannotBeFound */]: { - cliErrorMessageCandidates: [ - new RegExp( - "Query pack .* cannot be found\\. Check the spelling of the pack\\." - ), - new RegExp( - "is not a .ql file, .qls file, a directory, or a query pack specification." - ) - ] - }, - ["PackMissingAuth" /* PackMissingAuth */]: { - cliErrorMessageCandidates: [ - new RegExp("GitHub Container registry .* 403 Forbidden"), - new RegExp( - "Do you need to specify a token to authenticate to the registry?" - ) - ] - }, - ["SwiftBuildFailed" /* SwiftBuildFailed */]: { - cliErrorMessageCandidates: [ - new RegExp( - "\\[autobuilder/build\\] \\[build-command-failed\\] `autobuild` failed to run the build command" - ) - ] - }, - ["UnsupportedBuildMode" /* UnsupportedBuildMode */]: { - cliErrorMessageCandidates: [ - new RegExp( - "does not support the .* build mode. Please try using one of the following build modes instead" - ) - ] - }, - ["NotFoundInRegistry" /* NotFoundInRegistry */]: { - cliErrorMessageCandidates: [ - new RegExp("'.*' not found in the registry '.*'") - ] - } -}; -function getCliConfigCategoryIfExists(cliError) { - for (const [category, configuration] of Object.entries(cliErrorsConfig)) { - if (cliError.exitCode !== void 0 && configuration.exitCode !== void 0 && cliError.exitCode === configuration.exitCode) { - return category; - } - for (const e of configuration.cliErrorMessageCandidates) { - if (cliError.message.match(e) || cliError.stderr.match(e)) { - return category; - } - } - } - return void 0; -} -function isUnsupportedPlatform() { - return !SUPPORTED_PLATFORMS.some( - ([platform, arch2]) => platform === process.platform && arch2 === process.arch - ); -} -function getUnsupportedPlatformError(cliError) { - return new ConfigurationError( - `The CodeQL CLI does not support the platform/architecture combination of ${process.platform}/${process.arch} (see ${"https://codeql.github.com/docs/codeql-overview/system-requirements/" /* SYSTEM_REQUIREMENTS */}). The underlying error was: ${cliError.message}` - ); -} -function wrapCliConfigurationError(cliError) { - if (isUnsupportedPlatform()) { - return getUnsupportedPlatformError(cliError); - } - const cliConfigErrorCategory = getCliConfigCategoryIfExists(cliError); - if (cliConfigErrorCategory === void 0) { - return cliError; - } - let errorMessageBuilder = cliError.message; - const additionalErrorMessageToAppend = cliErrorsConfig[cliConfigErrorCategory].additionalErrorMessageToAppend; - if (additionalErrorMessageToAppend !== void 0) { - errorMessageBuilder = `${errorMessageBuilder} ${additionalErrorMessageToAppend}`; - } - return new ConfigurationError(errorMessageBuilder); -} - // src/setup-codeql.ts var fs9 = __toESM(require("fs")); var path9 = __toESM(require("path")); @@ -108223,10 +108007,10 @@ function inferCompressionMethod(tarPath) { // src/tools-download.ts var fs8 = __toESM(require("fs")); -var os2 = __toESM(require("os")); +var os = __toESM(require("os")); var path8 = __toESM(require("path")); var import_perf_hooks = require("perf_hooks"); -var core10 = __toESM(require_core()); +var core9 = __toESM(require_core()); var import_http_client = __toESM(require_lib()); var toolcache2 = __toESM(require_tool_cache()); var import_follow_redirects = __toESM(require_follow_redirects()); @@ -108280,10 +108064,10 @@ async function downloadAndExtract(codeqlURL, compressionMethod, dest, authorizat }; } } catch (e) { - core10.warning( + core9.warning( `Failed to download and extract CodeQL bundle using streaming with error: ${getErrorMessage(e)}` ); - core10.warning(`Falling back to downloading the bundle before extracting.`); + core9.warning(`Falling back to downloading the bundle before extracting.`); await cleanUpPath(dest, "CodeQL bundle", logger); } const toolsDownloadStart = import_perf_hooks.performance.now(); @@ -108361,7 +108145,7 @@ function getToolcacheDirectory(version) { getRequiredEnvParam("RUNNER_TOOL_CACHE"), TOOLCACHE_TOOL_NAME, semver7.clean(version) || version, - os2.arch() || "" + os.arch() || "" ); } function writeToolcacheMarkerFile(extractedPath, logger) { @@ -108948,14 +108732,14 @@ function isReservedToolsValue(tools) { } // src/tracer-config.ts -async function shouldEnableIndirectTracing(codeql, config) { +async function shouldEnableIndirectTracing(codeql2, config) { if (config.buildMode === "none" /* None */) { return false; } if (config.buildMode === "autobuild" /* Autobuild */) { return false; } - return asyncSome(config.languages, (l) => codeql.isTracedLanguage(l)); + return asyncSome(config.languages, (l) => codeql2.isTracedLanguage(l)); } // src/codeql.ts @@ -109021,7 +108805,7 @@ async function getCodeQL(cmd) { return cachedCodeQL; } async function getCodeQLForCmd(cmd, checkVersion) { - const codeql = { + const codeql2 = { getPath() { return cmd; }, @@ -109064,7 +108848,7 @@ async function getCodeQLForCmd(cmd, checkVersion) { const extraArgs = config.languages.map( (language) => `--language=${language}` ); - if (await shouldEnableIndirectTracing(codeql, config)) { + if (await shouldEnableIndirectTracing(codeql2, config)) { extraArgs.push("--begin-tracing"); extraArgs.push(...await getTrapCachingExtractorConfigArgs(config)); extraArgs.push(`--trace-process-name=${processName}`); @@ -109458,20 +109242,20 @@ ${output}` await runCli(cmd, args); } }; - if (checkVersion && !await codeQlVersionAtLeast(codeql, CODEQL_MINIMUM_VERSION)) { + if (checkVersion && !await codeQlVersionAtLeast(codeql2, CODEQL_MINIMUM_VERSION)) { throw new ConfigurationError( - `Expected a CodeQL CLI with version at least ${CODEQL_MINIMUM_VERSION} but got version ${(await codeql.getVersion()).version}` + `Expected a CodeQL CLI with version at least ${CODEQL_MINIMUM_VERSION} but got version ${(await codeql2.getVersion()).version}` ); - } else if (checkVersion && process.env["CODEQL_ACTION_SUPPRESS_DEPRECATED_SOON_WARNING" /* SUPPRESS_DEPRECATED_SOON_WARNING */] !== "true" && !await codeQlVersionAtLeast(codeql, CODEQL_NEXT_MINIMUM_VERSION)) { - const result = await codeql.getVersion(); - core11.warning( + } else if (checkVersion && process.env["CODEQL_ACTION_SUPPRESS_DEPRECATED_SOON_WARNING" /* SUPPRESS_DEPRECATED_SOON_WARNING */] !== "true" && !await codeQlVersionAtLeast(codeql2, CODEQL_NEXT_MINIMUM_VERSION)) { + const result = await codeql2.getVersion(); + core10.warning( `CodeQL CLI version ${result.version} was discontinued on ${GHES_MOST_RECENT_DEPRECATION_DATE} alongside GitHub Enterprise Server ${GHES_VERSION_MOST_RECENTLY_DEPRECATED} and will not be supported by the next minor release of the CodeQL Action. Please update to CodeQL CLI version ${CODEQL_NEXT_MINIMUM_VERSION} or later. For instance, if you have specified a custom version of the CLI using the 'tools' input to the 'init' Action, you can remove this input to use the default version. Alternatively, if you want to continue using CodeQL CLI version ${result.version}, you can replace 'github/codeql-action/*@v${getActionVersion().split(".")[0]}' by 'github/codeql-action/*@v${getActionVersion()}' in your code scanning workflow to continue using this version of the CodeQL Action.` ); - core11.exportVariable("CODEQL_ACTION_SUPPRESS_DEPRECATED_SOON_WARNING" /* SUPPRESS_DEPRECATED_SOON_WARNING */, "true"); + core10.exportVariable("CODEQL_ACTION_SUPPRESS_DEPRECATED_SOON_WARNING" /* SUPPRESS_DEPRECATED_SOON_WARNING */, "true"); } - return codeql; + return codeql2; } function getExtraOptionsFromEnv(paths, { ignoringOptions } = {}) { const options = getExtraOptionsEnvParam(); @@ -109567,13 +109351,231 @@ function applyAutobuildAzurePipelinesTimeoutFix() { "-Dmaven.wagon.http.pool=false" ].join(" "); } -async function getJobRunUuidSarifOptions(codeql) { +async function getJobRunUuidSarifOptions(codeql2) { const jobRunUuid = process.env["JOB_RUN_UUID" /* JOB_RUN_UUID */]; - return jobRunUuid && await codeql.supportsFeature( + return jobRunUuid && await codeql2.supportsFeature( "databaseInterpretResultsSupportsSarifRunProperty" /* DatabaseInterpretResultsSupportsSarifRunProperty */ ) ? [`--sarif-run-property=jobRunUuid=${jobRunUuid}`] : []; } +// src/status-report.ts +var os2 = __toESM(require("os")); +var core11 = __toESM(require_core()); +function isFirstPartyAnalysis(actionName) { + if (actionName !== "upload-sarif" /* UploadSarif */) { + return true; + } + return process.env["CODEQL_ACTION_INIT_HAS_RUN" /* INIT_ACTION_HAS_RUN */] === "true"; +} +function isThirdPartyAnalysis(actionName) { + return !isFirstPartyAnalysis(actionName); +} +function getActionsStatus(error3, otherFailureCause) { + if (error3 || otherFailureCause) { + return error3 instanceof ConfigurationError ? "user-error" : "failure"; + } else { + return "success"; + } +} +function setJobStatusIfUnsuccessful(actionStatus) { + if (actionStatus === "user-error") { + core11.exportVariable( + "CODEQL_ACTION_JOB_STATUS" /* JOB_STATUS */, + process.env["CODEQL_ACTION_JOB_STATUS" /* JOB_STATUS */] ?? "JOB_STATUS_CONFIGURATION_ERROR" /* ConfigErrorStatus */ + ); + } else if (actionStatus === "failure" || actionStatus === "aborted") { + core11.exportVariable( + "CODEQL_ACTION_JOB_STATUS" /* JOB_STATUS */, + process.env["CODEQL_ACTION_JOB_STATUS" /* JOB_STATUS */] ?? "JOB_STATUS_FAILURE" /* FailureStatus */ + ); + } +} +async function createStatusReportBase(actionName, status, actionStartedAt, config, diskInfo, logger, cause, exception2) { + try { + const commitOid = getOptionalInput("sha") || process.env["GITHUB_SHA"] || ""; + const ref = await getRef(); + const jobRunUUID = process.env["JOB_RUN_UUID" /* JOB_RUN_UUID */] || ""; + const workflowRunID = getWorkflowRunID(); + const workflowRunAttempt = getWorkflowRunAttempt(); + const workflowName = process.env["GITHUB_WORKFLOW"] || ""; + const jobName = process.env["GITHUB_JOB"] || ""; + const analysis_key = await getAnalysisKey(); + let workflowStartedAt = process.env["CODEQL_WORKFLOW_STARTED_AT" /* WORKFLOW_STARTED_AT */]; + if (workflowStartedAt === void 0) { + workflowStartedAt = actionStartedAt.toISOString(); + core11.exportVariable("CODEQL_WORKFLOW_STARTED_AT" /* WORKFLOW_STARTED_AT */, workflowStartedAt); + } + const runnerOs = getRequiredEnvParam("RUNNER_OS"); + const codeQlCliVersion = getCachedCodeQlVersion(); + const actionRef = process.env["GITHUB_ACTION_REF"] || ""; + const testingEnvironment = getTestingEnvironment(); + if (testingEnvironment) { + core11.exportVariable("CODEQL_ACTION_TESTING_ENVIRONMENT" /* TESTING_ENVIRONMENT */, testingEnvironment); + } + const isSteadyStateDefaultSetupRun = process.env["CODE_SCANNING_IS_STEADY_STATE_DEFAULT_SETUP"] === "true"; + const statusReport = { + action_name: actionName, + action_oid: "unknown", + // TODO decide if it's possible to fill this in + action_ref: actionRef, + action_started_at: actionStartedAt.toISOString(), + action_version: getActionVersion(), + analysis_kinds: config?.analysisKinds?.join(","), + analysis_key, + build_mode: config?.buildMode, + commit_oid: commitOid, + first_party_analysis: isFirstPartyAnalysis(actionName), + job_name: jobName, + job_run_uuid: jobRunUUID, + ref, + runner_os: runnerOs, + started_at: workflowStartedAt, + status, + steady_state_default_setup: isSteadyStateDefaultSetupRun, + testing_environment: testingEnvironment || "", + workflow_name: workflowName, + workflow_run_attempt: workflowRunAttempt, + workflow_run_id: workflowRunID + }; + try { + statusReport.actions_event_name = getWorkflowEventName(); + } catch (e) { + logger.warning( + `Could not determine the workflow event name: ${getErrorMessage(e)}.` + ); + } + if (config) { + statusReport.languages = config.languages?.join(","); + } + if (diskInfo) { + statusReport.runner_available_disk_space_bytes = diskInfo.numAvailableBytes; + statusReport.runner_total_disk_space_bytes = diskInfo.numTotalBytes; + } + if (cause) { + statusReport.cause = cause; + } + if (exception2) { + statusReport.exception = exception2; + } + if (status === "success" || status === "failure" || status === "aborted" || status === "user-error") { + statusReport.completed_at = (/* @__PURE__ */ new Date()).toISOString(); + } + const matrix = getRequiredInput("matrix"); + if (matrix) { + statusReport.matrix_vars = matrix; + } + if ("RUNNER_ARCH" in process.env) { + statusReport.runner_arch = process.env["RUNNER_ARCH"]; + } + if (!(runnerOs === "Linux" && isSelfHostedRunner())) { + statusReport.runner_os_release = os2.release(); + } + if (codeQlCliVersion !== void 0) { + statusReport.codeql_version = codeQlCliVersion.version; + } + const imageVersion = process.env["ImageVersion"]; + if (imageVersion) { + statusReport.runner_image_version = imageVersion; + } + return statusReport; + } catch (e) { + logger.warning( + `Failed to gather information for telemetry: ${getErrorMessage(e)}. Will skip sending status report.` + ); + if (isInTestMode()) { + throw e; + } + return void 0; + } +} +var OUT_OF_DATE_MSG = "CodeQL Action is out-of-date. Please upgrade to the latest version of `codeql-action`."; +var INCOMPATIBLE_MSG = "CodeQL Action version is incompatible with the API endpoint. Please update to a compatible version of `codeql-action`."; +async function sendStatusReport(statusReport) { + setJobStatusIfUnsuccessful(statusReport.status); + const statusReportJSON = JSON.stringify(statusReport); + core11.debug(`Sending status report: ${statusReportJSON}`); + if (isInTestMode()) { + core11.debug("In test mode. Status reports are not uploaded."); + return; + } + const nwo = getRepositoryNwo(); + const client = getApiClient(); + try { + await client.request( + "PUT /repos/:owner/:repo/code-scanning/analysis/status", + { + owner: nwo.owner, + repo: nwo.repo, + data: statusReportJSON + } + ); + } catch (e) { + const httpError = asHTTPError(e); + if (httpError !== void 0) { + switch (httpError.status) { + case 403: + if (getWorkflowEventName() === "push" && process.env["GITHUB_ACTOR"] === "dependabot[bot]") { + core11.warning( + `Workflows triggered by Dependabot on the "push" event run with read-only access. Uploading CodeQL results requires write access. To use CodeQL with Dependabot, please ensure you are using the "pull_request" event for this workflow and avoid triggering on the "push" event for Dependabot branches. See ${"https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning#scanning-on-push" /* SCANNING_ON_PUSH */} for more information on how to configure these events.` + ); + } else { + core11.warning( + `This run of the CodeQL Action does not have permission to access the CodeQL Action API endpoints. This could be because the Action is running on a pull request from a fork. If not, please ensure the workflow has at least the 'security-events: read' permission. Details: ${httpError.message}` + ); + } + return; + case 404: + core11.warning(httpError.message); + return; + case 422: + if (getRequiredEnvParam("GITHUB_SERVER_URL") !== GITHUB_DOTCOM_URL) { + core11.debug(INCOMPATIBLE_MSG); + } else { + core11.debug(OUT_OF_DATE_MSG); + } + return; + } + } + core11.warning( + `An unexpected error occurred when sending a status report: ${getErrorMessage( + e + )}` + ); + } +} +async function sendUnhandledErrorStatusReport(actionName, actionStartedAt, error3, logger) { + try { + const statusReport = await createStatusReportBase( + actionName, + "failure", + actionStartedAt, + void 0, + void 0, + logger, + `Unhandled CodeQL Action error: ${getErrorMessage(error3)}`, + error3 instanceof Error ? error3.stack : void 0 + ); + if (statusReport !== void 0) { + await sendStatusReport(statusReport); + } + } catch (e) { + logger.warning( + `Failed to send the unhandled error status report: ${getErrorMessage(e)}.` + ); + if (isInTestMode()) { + throw e; + } + } +} + +// src/upload-lib.ts +var fs12 = __toESM(require("fs")); +var path12 = __toESM(require("path")); +var url = __toESM(require("url")); +var import_zlib = __toESM(require("zlib")); +var core12 = __toESM(require_core()); +var jsonschema2 = __toESM(require_lib2()); + // src/fingerprints.ts var fs11 = __toESM(require("fs")); var import_path2 = __toESM(require("path")); @@ -110702,7 +110704,7 @@ var io5 = __toESM(require_io()); async function initCodeQL(toolsInput, apiDetails, tempDir, variant, defaultCliVersion, features, logger) { logger.startGroup("Setup CodeQL tools"); const { - codeql, + codeql: codeql2, toolsDownloadStatusReport, toolsSource, toolsVersion, @@ -110717,10 +110719,10 @@ async function initCodeQL(toolsInput, apiDetails, tempDir, variant, defaultCliVe logger, true ); - await codeql.printVersion(); + await codeql2.printVersion(); logger.endGroup(); return { - codeql, + codeql: codeql2, toolsDownloadStatusReport, toolsSource, toolsVersion, @@ -110834,7 +110836,7 @@ async function minimalInitCodeQL(logger, gitHubVersion, features) { ); return initCodeQLResult.codeql; } -async function combineSarifFilesUsingCLI(sarifFiles, gitHubVersion, features, logger) { +async function combineSarifFilesUsingCLI(sarifFiles, gitHubVersion, _features, logger, getCodeQL2, tempDir) { logger.info("Combining SARIF files using the CodeQL CLI"); const sarifObjects = sarifFiles.map((sarifFile) => { return JSON.parse(fs12.readFileSync(sarifFile, "utf8")); @@ -110857,15 +110859,7 @@ async function combineSarifFilesUsingCLI(sarifFiles, gitHubVersion, features, lo } return combineSarifFiles(sarifFiles, logger); } - let codeQL; - let tempDir = getTemporaryDirectory(); - const config = await getConfig(tempDir, logger); - if (config !== void 0) { - codeQL = await getCodeQL(config.codeQLCmd); - tempDir = config.tempDir; - } else { - codeQL = await minimalInitCodeQL(logger, gitHubVersion, features); - } + const codeQL = await getCodeQL2(); const baseTempDir = path12.resolve(tempDir, "combined-sarif"); fs12.mkdirSync(baseTempDir, { recursive: true }); const outputDirectory = fs12.mkdtempSync(path12.resolve(baseTempDir, "output-")); @@ -111099,7 +111093,7 @@ function buildPayload(commitOid, ref, analysisKey, analysisName, zippedSarif, wo } return payloadObj; } -async function postProcessSarifFiles(logger, features, checkoutPath, sarifPaths, category, analysis) { +async function postProcessSarifFiles(logger, features, getCodeQL2, tempPath, checkoutPath, sarifPaths, category, analysis) { logger.info(`Post-processing sarif files: ${JSON.stringify(sarifPaths)}`); const gitHubVersion = await getGitHubVersion(); let sarif; @@ -111113,7 +111107,9 @@ async function postProcessSarifFiles(logger, features, checkoutPath, sarifPaths, sarifPaths, gitHubVersion, features, - logger + logger, + getCodeQL2, + tempPath ); } else { const sarifPath = sarifPaths[0]; @@ -111362,7 +111358,7 @@ function filterAlertsByDiffRange(logger, sarif) { } // src/upload-sarif.ts -async function postProcessAndUploadSarif(logger, features, uploadKind, checkoutPath, sarifPath, category, postProcessedOutputPath) { +async function postProcessAndUploadSarif(logger, tempPath, features, getCodeQL2, uploadKind, checkoutPath, sarifPath, category, postProcessedOutputPath) { const sarifGroups = await getGroupedSarifFilePaths( logger, sarifPath @@ -111375,6 +111371,8 @@ async function postProcessAndUploadSarif(logger, features, uploadKind, checkoutP const postProcessingResults = await postProcessSarifFiles( logger, features, + getCodeQL2, + tempPath, checkoutPath, sarifFiles, category, @@ -111416,6 +111414,20 @@ async function sendSuccessStatusReport(startedAt, uploadStats, logger) { await sendStatusReport(statusReport); } } +var codeql; +async function getOrInitCodeQL(logger, gitHubVersion, features, config) { + if (codeql !== void 0) return codeql; + if (config !== void 0) { + codeql = await getCodeQL(config.codeQLCmd); + } else { + codeql = await minimalInitCodeQL( + logger, + gitHubVersion, + features + ); + } + return codeql; +} async function run(startedAt) { const logger = getActionsLogger(); try { @@ -111444,9 +111456,16 @@ async function run(startedAt) { const sarifPath = getRequiredInput("sarif_file"); const checkoutPath = getRequiredInput("checkout_path"); const category = getOptionalInput("category"); + let tempDir = getTemporaryDirectory(); + const config = await getConfig(tempDir, logger); + if (config !== void 0) { + tempDir = config.tempDir; + } const uploadResults = await postProcessAndUploadSarif( logger, + tempDir, features, + () => getOrInitCodeQL(logger, gitHubVersion, features, config), "always", checkoutPath, sarifPath, diff --git a/src/analyze-action.ts b/src/analyze-action.ts index 4093e3786..e8267fc0a 100644 --- a/src/analyze-action.ts +++ b/src/analyze-action.ts @@ -363,7 +363,9 @@ async function run(startedAt: Date) { uploadResults = await postProcessAndUploadSarif( logger, + config.tempDir, features, + async () => codeql, uploadKind, checkoutPath, outputDir, diff --git a/src/init-action-post-helper.test.ts b/src/init-action-post-helper.test.ts index b0afb9b8b..da252db19 100644 --- a/src/init-action-post-helper.test.ts +++ b/src/init-action-post-helper.test.ts @@ -424,6 +424,8 @@ async function testFailedSarifUpload( } t.true( uploadFiles.calledOnceWith( + sinon.match.string, + codeqlObject, sinon.match.string, sinon.match.string, category, diff --git a/src/init-action-post-helper.ts b/src/init-action-post-helper.ts index 28637f98c..f3c9e38e7 100644 --- a/src/init-action-post-helper.ts +++ b/src/init-action-post-helper.ts @@ -104,6 +104,8 @@ async function maybeUploadFailedSarif( logger.info(`Uploading failed SARIF file ${sarifFile}`); const uploadResult = await uploadLib.uploadFiles( + config.tempDir, + codeql, sarifFile, checkoutPath, category, diff --git a/src/upload-lib.ts b/src/upload-lib.ts index 2c58beb2b..4c4fd24c9 100644 --- a/src/upload-lib.ts +++ b/src/upload-lib.ts @@ -11,8 +11,7 @@ import * as actionsUtil from "./actions-util"; import * as analyses from "./analyses"; import * as api from "./api-client"; import { getGitHubVersion, wrapApiConfigurationError } from "./api-client"; -import { getCodeQL, type CodeQL } from "./codeql"; -import { getConfig } from "./config-utils"; +import { type CodeQL } from "./codeql"; import { readDiffRangesJsonFile } from "./diff-informed-analysis-utils"; import { EnvVar } from "./environment"; import { FeatureEnablement } from "./feature-flags"; @@ -219,6 +218,8 @@ export async function minimalInitCodeQL( return initCodeQLResult.codeql; } +export type CodeQLGetter = () => Promise; + // Takes a list of paths to sarif files and combines them together using the // CLI `github merge-results` command when all SARIF files are produced by // CodeQL. Otherwise, it will fall back to combining the files in the action. @@ -226,8 +227,10 @@ export async function minimalInitCodeQL( async function combineSarifFilesUsingCLI( sarifFiles: string[], gitHubVersion: GitHubVersion, - features: FeatureEnablement, + _features: FeatureEnablement, logger: Logger, + getCodeQL: CodeQLGetter, + tempDir: string, ): Promise { logger.info("Combining SARIF files using the CodeQL CLI"); @@ -265,18 +268,10 @@ async function combineSarifFilesUsingCLI( return combineSarifFiles(sarifFiles, logger); } - // Initialize CodeQL, either by using the config file from the 'init' step, - // or by initializing it here. - let codeQL: CodeQL; - let tempDir: string = actionsUtil.getTemporaryDirectory(); - - const config = await getConfig(tempDir, logger); - if (config !== undefined) { - codeQL = await getCodeQL(config.codeQLCmd); - tempDir = config.tempDir; - } else { - codeQL = await minimalInitCodeQL(logger, gitHubVersion, features); - } + // Obtain a `CodeQL` instance. For `analyze`, this is typically the instance that was used for running the queries. + // For `upload-sarif`, this either initialises a new instance or returns a previously initialised one if `getCodeQL` + // is called more than once. + const codeQL: CodeQL = await getCodeQL(); const baseTempDir = path.resolve(tempDir, "combined-sarif"); fs.mkdirSync(baseTempDir, { recursive: true }); @@ -682,6 +677,8 @@ export interface PostProcessingResults { * * @param logger The logger to use. * @param features Information about enabled features. + * @param getCodeQL A function to retrieve a `CodeQL` instance. + * @param tempPath A path to a temporary directory. * @param checkoutPath The path where the repo was checked out at. * @param sarifPaths The paths of the SARIF files to post-process. * @param category The analysis category. @@ -693,6 +690,8 @@ export interface PostProcessingResults { export async function postProcessSarifFiles( logger: Logger, features: FeatureEnablement, + getCodeQL: CodeQLGetter, + tempPath: string, checkoutPath: string, sarifPaths: string[], category: string | undefined, @@ -717,6 +716,8 @@ export async function postProcessSarifFiles( gitHubVersion, features, logger, + getCodeQL, + tempPath, ); } else { const sarifPath = sarifPaths[0]; @@ -777,6 +778,8 @@ export async function writePostProcessedFiles( * to. */ export async function uploadFiles( + tempDir: string, + codeql: CodeQL, inputSarifPath: string, checkoutPath: string, category: string | undefined, @@ -790,6 +793,8 @@ export async function uploadFiles( ); return uploadSpecifiedFiles( + tempDir, + codeql, sarifPaths, checkoutPath, category, @@ -803,6 +808,8 @@ export async function uploadFiles( * Uploads the given array of SARIF files. */ async function uploadSpecifiedFiles( + tempDir: string, + codeql: CodeQL, sarifPaths: string[], checkoutPath: string, category: string | undefined, @@ -813,6 +820,8 @@ async function uploadSpecifiedFiles( const processingResults: PostProcessingResults = await postProcessSarifFiles( logger, features, + async () => codeql, + tempDir, checkoutPath, sarifPaths, category, diff --git a/src/upload-sarif-action.ts b/src/upload-sarif-action.ts index cec41b276..3209a2dde 100644 --- a/src/upload-sarif-action.ts +++ b/src/upload-sarif-action.ts @@ -4,7 +4,9 @@ import * as actionsUtil from "./actions-util"; import { getActionVersion, getTemporaryDirectory } from "./actions-util"; import * as analyses from "./analyses"; import { getGitHubVersion } from "./api-client"; -import { initFeatures } from "./feature-flags"; +import { CodeQL, getCodeQL } from "./codeql"; +import { Config, getConfig } from "./config-utils"; +import { FeatureEnablement, initFeatures } from "./feature-flags"; import { Logger, getActionsLogger } from "./logging"; import { getRepositoryNwo } from "./repository"; import { @@ -20,6 +22,7 @@ import * as upload_lib from "./upload-lib"; import { postProcessAndUploadSarif } from "./upload-sarif"; import { ConfigurationError, + GitHubVersion, checkActionVersion, checkDiskUsage, getErrorMessage, @@ -54,6 +57,35 @@ async function sendSuccessStatusReport( } } +/** The cached `CodeQL` instance, if any. */ +let codeql: CodeQL | undefined; + +/** Get or initialise a `CodeQL` instance for use by the `upload-sarif` action. */ +async function getOrInitCodeQL( + logger: Logger, + gitHubVersion: GitHubVersion, + features: FeatureEnablement, + config: Config | undefined, +): Promise { + // Return the cached instance, if we have one. + if (codeql !== undefined) return codeql; + + // If we have been able to load a `Config` from an earlier CodeQL Action step in the job, + // then use the CodeQL executable that we have used previously. Otherwise, initialise the + // CLI specifically for `upload-sarif`. Either way, we cache the instance. + if (config !== undefined) { + codeql = await getCodeQL(config.codeQLCmd); + } else { + codeql = await upload_lib.minimalInitCodeQL( + logger, + gitHubVersion, + features, + ); + } + + return codeql; +} + async function run(startedAt: Date) { // To capture errors appropriately, keep as much code within the try-catch as // possible, and only use safe functions outside. @@ -94,9 +126,20 @@ async function run(startedAt: Date) { const checkoutPath = actionsUtil.getRequiredInput("checkout_path"); const category = actionsUtil.getOptionalInput("category"); + // Determine the temporary directory to use. If we are able to read a `Config` from a previous CodeQL Action + // step in the job, then use the temporary directory configured there. Otherwise, use our default. + let tempDir: string = actionsUtil.getTemporaryDirectory(); + + const config = await getConfig(tempDir, logger); + if (config !== undefined) { + tempDir = config.tempDir; + } + const uploadResults = await postProcessAndUploadSarif( logger, + tempDir, features, + () => getOrInitCodeQL(logger, gitHubVersion, features, config), "always", checkoutPath, sarifPath, diff --git a/src/upload-sarif.test.ts b/src/upload-sarif.test.ts index d32c0c031..601dbfd46 100644 --- a/src/upload-sarif.test.ts +++ b/src/upload-sarif.test.ts @@ -5,6 +5,7 @@ import test, { ExecutionContext } from "ava"; import * as sinon from "sinon"; import { AnalysisKind, getAnalysisConfig } from "./analyses"; +import { getCodeQLForTesting } from "./codeql"; import { getRunnerLogger } from "./logging"; import { createFeatures, setupTests } from "./testing-utils"; import { UploadResult } from "./upload-lib"; @@ -31,6 +32,8 @@ function mockPostProcessSarifFiles() { sinon.match.any, sinon.match.any, sinon.match.any, + sinon.match.any, + sinon.match.any, analysisConfig, ) .resolves({ sarif: { runs: [] }, analysisKey: "", environment: "" }); @@ -73,7 +76,9 @@ const postProcessAndUploadSarifMacro = test.macro({ const actual = await postProcessAndUploadSarif( logger, + tempDir, features, + async () => getCodeQLForTesting(), "always", "", testPath, @@ -90,6 +95,8 @@ const postProcessAndUploadSarifMacro = test.macro({ postProcessSarifFiles.calledWith( logger, features, + sinon.match.func, + tempDir, sinon.match.any, analysisKindResult.expectedFiles?.map(toFullPath) ?? fullSarifPaths, @@ -221,7 +228,9 @@ test("postProcessAndUploadSarif doesn't upload if upload is disabled", async (t) const actual = await postProcessAndUploadSarif( logger, + tempDir, features, + () => getCodeQLForTesting(), "never", "", tempDir, @@ -248,7 +257,9 @@ test("postProcessAndUploadSarif writes post-processed SARIF files if output dire const postProcessedOutPath = path.join(tempDir, "post-processed"); const actual = await postProcessAndUploadSarif( logger, + tempDir, features, + () => getCodeQLForTesting(), "never", "", tempDir, diff --git a/src/upload-sarif.ts b/src/upload-sarif.ts index bc2c88698..372b2d1f4 100644 --- a/src/upload-sarif.ts +++ b/src/upload-sarif.ts @@ -14,7 +14,9 @@ export type UploadSarifResults = Partial< * Finds SARIF files in `sarifPath`, post-processes them, and uploads them to the appropriate services. * * @param logger The logger to use. + * @param tempPath The path to the temporary directory. * @param features Information about enabled features. + * @param getCodeQL A function to retrieve a `CodeQL` instance. * @param uploadKind The kind of upload that is requested. * @param checkoutPath The path where the repository was checked out at. * @param sarifPath The path to the file or directory to upload. @@ -25,7 +27,9 @@ export type UploadSarifResults = Partial< */ export async function postProcessAndUploadSarif( logger: Logger, + tempPath: string, features: FeatureEnablement, + getCodeQL: upload_lib.CodeQLGetter, uploadKind: UploadKind, checkoutPath: string, sarifPath: string, @@ -45,6 +49,8 @@ export async function postProcessAndUploadSarif( const postProcessingResults = await upload_lib.postProcessSarifFiles( logger, features, + getCodeQL, + tempPath, checkoutPath, sarifFiles, category,